Commit | Line | Data |
---|---|---|
b311480e | 1 | -- Created on: 2010-12-03 |
2 | -- Created by: Artem SHAL | |
973c2be1 | 3 | -- Copyright (c) 2010-2014 OPEN CASCADE SAS |
b311480e | 4 | -- |
973c2be1 | 5 | -- This file is part of Open CASCADE Technology software library. |
b311480e | 6 | -- |
d5f74e42 | 7 | -- This library is free software; you can redistribute it and/or modify it under |
8 | -- the terms of the GNU Lesser General Public License version 2.1 as published | |
973c2be1 | 9 | -- by the Free Software Foundation, with special exception defined in the file |
10 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |
11 | -- distribution for complete text of the license and disclaimer of any warranty. | |
b311480e | 12 | -- |
973c2be1 | 13 | -- Alternatively, this file may be used under the terms of Open CASCADE |
14 | -- commercial license or contractual agreement. | |
92d1589b A |
15 | |
16 | class Sphere from Bnd | |
17 | ||
18 | ---Purpose: This class represents a bounding sphere of a geometric entity | |
19 | -- (triangle, segment of line or whatever else). | |
20 | ||
21 | uses XYZ from gp | |
22 | ||
23 | is | |
24 | ||
25 | Create returns Sphere; | |
26 | ---Purpose: Empty constructor | |
27 | ||
28 | Create (theCntr : XYZ from gp; theRad : Real; theU : Integer; theV : Integer) | |
29 | returns Sphere; | |
30 | ---Purpose: Constructor of a definite sphere | |
31 | ||
32 | U (me) returns Integer; | |
33 | ---C++: inline | |
34 | ---Purpose: Returns the U parameter on shape | |
35 | ||
36 | V (me) returns Integer; | |
37 | ---C++: inline | |
38 | ---Purpose: Returns the V parameter on shape | |
39 | ||
40 | IsValid (me) returns Boolean; | |
41 | ---C++: inline | |
42 | ---Purpose: Returns validity status, indicating that this | |
43 | -- sphere corresponds to a real entity | |
44 | ||
45 | SetValid (me : in out; isValid : Boolean); | |
46 | ---C++: inline | |
47 | ||
48 | Center (me) returns XYZ from gp; | |
49 | ---C++: inline | |
50 | ---C++: return const & | |
51 | ---Purpose: Returns center of sphere object | |
52 | ||
53 | Radius (me) returns Real; | |
54 | ---C++: inline | |
55 | ---Purpose: Returns the radius value | |
56 | ||
57 | Distances (me; theXYZ : XYZ from gp; theMin : in out Real; theMax : in out Real) is static; | |
58 | ---Purpose: Calculate and return minimal and maximal distance to sphere. | |
59 | -- NOTE: This function is tightly optimized; any modifications | |
60 | -- may affect performance! | |
61 | ||
62 | SquareDistances (me; theXYZ : XYZ from gp; theMin : in out Real; theMax : in out Real) is static; | |
63 | ---Purpose: Calculate and return minimal and maximal distance to sphere. | |
64 | -- NOTE: This function is tightly optimized; any modifications | |
65 | -- may affect performance! | |
66 | ||
67 | Project (me; theNode : XYZ from gp; theProjNode : in out XYZ from gp; theDist : in out Real; theInside : in out Boolean) | |
68 | ---Purpose: Projects a point on entity. | |
69 | -- Returns true if success | |
70 | returns Boolean; | |
71 | ||
72 | Distance (me; theNode : XYZ from gp) | |
73 | returns Real; | |
74 | ||
75 | SquareDistance (me; theNode : XYZ from gp) | |
76 | returns Real; | |
77 | ||
78 | Add (me : in out; theOther : Sphere from Bnd); | |
79 | ||
80 | IsOut (me; theOther : Sphere from Bnd) | |
81 | returns Boolean; | |
82 | ||
83 | IsOut (me; thePnt : XYZ from gp; theMaxDist : in out Real) | |
84 | returns Boolean; | |
85 | ||
86 | SquareExtent (me) returns Real; | |
87 | ||
88 | fields | |
89 | ||
90 | myCenter : XYZ from gp; | |
91 | myRadius : Real; | |
92 | myIsValid : Boolean; | |
93 | myU : Integer; | |
94 | myV : Integer; | |
95 | ||
96 | end Sphere; |