-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathSphereObj.py
executable file
·60 lines (44 loc) · 2.4 KB
/
SphereObj.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from __future__ import print_function
import copy
class SphereObj(object):
''' ==================================================================================
FUNCTION __init__: Default constructor
================================================================================= '''
def __init__(self, Radius=0.0, MaxRadius=0.0, Center=[0.0,0.0,0.0]):
self.Radius = Radius
self.MaxRadius = MaxRadius
self.Center = Center
''' ==================================================================================
FUNCTION Set_Center: Sets the center of the sphere
================================================================================= '''
def Set_Center(self, List):
self.Center = list(List)
''' ==================================================================================
FUNCTION Set_Radius: Sets the radius of the sphere
================================================================================= '''
def Set_Radius(self, val):
self.Radius = val
''' ==================================================================================
FUNCTION Set_MaxRadius: Sets the maximum radius of the sphere
================================================================================= '''
def Set_MaxRadius(self, val):
self.MaxRadius = val
''' ==================================================================================
FUNCTION Reset: Reset the sphere
================================================================================= '''
def Reset(self):
self.Radius = 0.0
self.Center = [ 0.0, 0.0, 0.0 ]
''' ==================================================================================
FUNCTION Copy: Copies an instance of a class
================================================================================= '''
def Copy(self):
return copy.deepcopy(self)
''' ==================================================================================
FUNCTION Print: Prints the instance of a class
================================================================================= '''
def Print(self):
print(self)
print("Radius:", self.Radius)
print("MaxRadius:", self.MaxRadius)
print("Center:", self.Center)