b311480e |
1 | -- Created on: 1996-12-05 |
2 | -- Created by: Flore Lantheaume/Odile Olivier |
3 | -- Copyright (c) 1996-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | class FixRelation from AIS inherits Relation from AIS |
23 | |
24 | |
25 | ---Purpose: Constructs and manages a constraint by a fixed |
26 | -- relation between two or more interactive datums. This |
27 | -- constraint is represented by a wire from a shape - |
28 | -- point, vertex, or edge - in the first datum and a |
29 | -- corresponding shape in the second. |
30 | -- Warning: This relation is not bound with any kind of parametric |
31 | -- constraint : it represents the "status" of an parametric |
32 | -- object. |
33 | uses |
34 | |
35 | PresentationManager3d from PrsMgr, |
36 | Presentation from Prs3d, |
37 | Selection from SelectMgr, |
38 | Shape from TopoDS, |
39 | Vertex from TopoDS, |
40 | Edge from TopoDS, |
41 | Wire from TopoDS, |
42 | Curve from Geom, |
43 | Circ from gp, |
44 | Lin from gp, |
45 | Pnt from gp, |
46 | Projector from Prs3d, |
47 | Transformation from Geom, |
7fd59977 |
48 | Plane from Geom |
49 | |
50 | is |
51 | Create (aShape : Shape from TopoDS; |
52 | aPlane : Plane from Geom; |
53 | aWire : Wire from TopoDS) |
54 | ---Purpose: initializes the vertex aShape, the |
55 | -- plane aPlane and the wire aWire, which connects |
56 | -- the two vertices in a fixed relation. |
57 | returns mutable FixRelation from AIS; |
58 | |
59 | Create (aShape : Shape from TopoDS; |
60 | aPlane : Plane from Geom; |
61 | aWire : Wire from TopoDS; |
62 | aPosition : Pnt from gp; |
63 | anArrowSize : Real from Standard = 0.01) |
64 | ---Purpose: initializes the vertex aShape, the |
65 | -- plane aPlane and the wire aWire, the position |
66 | -- aPosition, the arrow size anArrowSize and the |
67 | -- wire aWire, which connects the two vertices in a fixed relation. |
68 | returns mutable FixRelation from AIS; |
69 | Create (aShape : Shape from TopoDS; |
70 | aPlane : Plane from Geom) |
71 | ---Purpose: initializes the edge aShape and the plane aPlane. |
72 | returns mutable FixRelation from AIS; |
73 | |
74 | Create (aShape : Shape from TopoDS; |
75 | aPlane : Plane from Geom; |
76 | aPosition : Pnt from gp; |
77 | anArrowSize : Real from Standard = 0.01) |
78 | ---Purpose: initializes the edge aShape, the |
79 | -- plane aPlane, the position aPosition and the arrow |
80 | -- size anArrowSize. |
81 | |
82 | returns mutable FixRelation from AIS; |
83 | |
84 | Wire(me: mutable) returns Wire from TopoDS |
85 | is static; |
86 | ---Purpose: Returns the wire which connects vertices in a fixed relation. |
87 | |
88 | SetWire(me: mutable;aWire : Wire from TopoDS) |
89 | is static; |
90 | --- Purpose: Constructs the wire aWire. This connects vertices |
91 | -- which are in a fixed relation. |
92 | |
93 | IsMovable(me) returns Boolean from Standard |
94 | ---C++: inline |
95 | ---Purpose: Returns true if the Interactive Objects in the relation |
96 | -- are movable. |
97 | is redefined; |
98 | |
99 | -- Methods from PresentableObject |
100 | |
101 | Compute(me : mutable; |
102 | aPresentationManager: PresentationManager3d from PrsMgr; |
103 | aPresentation : mutable Presentation from Prs3d; |
104 | aMode : Integer from Standard= 0) |
105 | is redefined static private; |
106 | |
107 | Compute(me:mutable; |
108 | aProjector: Projector from Prs3d; |
109 | aPresentation: mutable Presentation from Prs3d) |
7fd59977 |
110 | is redefined static private; |
128cc8df |
111 | |
7fd59977 |
112 | Compute(me : mutable; |
113 | aProjector : Projector from Prs3d; |
114 | aTrsf : Transformation from Geom; |
115 | aPresentation : mutable Presentation from Prs3d) |
116 | is redefined; |
117 | ---Purpose: computes the presentation according to a point of view |
118 | -- given by <aProjector>. |
119 | -- To be Used when the associated degenerated Presentations |
120 | -- have been transformed by <aTrsf> which is not a Pure |
121 | -- Translation. The HLR Prs can't be deducted automatically |
122 | -- WARNING :<aTrsf> must be applied |
123 | -- to the object to display before computation !!! |
124 | |
125 | -- Methods from SelectableObject |
126 | |
127 | ComputeSelection(me : mutable; |
128 | aSelection : mutable Selection from SelectMgr; |
129 | aMode : Integer from Standard) |
130 | is redefined private; |
131 | |
132 | |
133 | -- |
134 | -- Computation private methods |
135 | -- |
136 | |
137 | ComputeVertex(me : mutable; |
138 | FixVertex : Vertex from TopoDS; |
139 | curpos : out Pnt from gp) |
140 | ---Purpose: computes the presentation for <myFixShape> if it's a |
141 | -- vertex. |
142 | is private; |
143 | |
144 | |
145 | ComputePosition(me; |
146 | curv1 : Curve from Geom; |
147 | curv2 : Curve from Geom; |
148 | firstp1 : Pnt from gp; |
149 | lastp1 : Pnt from gp ; |
150 | firstp2 : Pnt from gp; |
151 | lastp2 : Pnt from gp) |
152 | returns Pnt from gp |
153 | is private; |
154 | |
155 | |
156 | ComputePosition(me; |
157 | curv : Curve from Geom; |
158 | firstp : Pnt from gp; |
159 | lastp : Pnt from gp) |
160 | returns Pnt from gp |
161 | is private; |
162 | |
163 | |
164 | ComputeEdge(me : mutable; |
165 | FixEdge : Edge from TopoDS; |
166 | curpos : out Pnt from gp) |
167 | ---Purpose: computes the presentation for <myFixShape> if it's a |
168 | -- edge. |
169 | is private; |
170 | |
171 | |
172 | ComputeLinePosition(me : mutable; |
173 | glin : Lin from gp; |
174 | pos : out Pnt from gp; |
175 | pfirst : out Real from Standard; |
176 | plast : out Real from Standard) |
177 | is private; |
178 | |
179 | |
180 | ComputeCirclePosition(me : mutable; |
181 | gcirc : Circ from gp; |
182 | pos : out Pnt from gp; |
183 | pfirst : out Real from Standard; |
184 | plast : out Real from Standard) |
185 | is private; |
186 | |
187 | ConnectedEdges(myclass; aWire : Wire from TopoDS; |
188 | aVertex : Vertex from TopoDS; |
189 | Edge1,Edge2 : out Edge from TopoDS) |
190 | returns Boolean from Standard |
191 | is private; |
192 | |
193 | |
194 | fields |
195 | |
196 | myWire : Wire from TopoDS; |
197 | myPntAttach : Pnt from gp; |
198 | haspos : Boolean from Standard; |
199 | |
200 | end FixRelation; |
201 | |