1 -- Created on: 1997-03-03
2 -- Created by: Jean-Pierre COMBE
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
23 class IdenticRelation from AIS inherits Relation from AIS
25 ---Purpose: Constructs a constraint by a relation of identity
26 -- between two or more datums figuring in shape
27 -- Interactive Objects.
33 Presentation from Prs3d,
34 PresentationManager3d from PrsMgr,
35 Selection from SelectMgr,
37 Transformation from Geom,
38 PresentationManager2d from PrsMgr,
39 GraphicObject from Graphic2d,
49 Create(FirstShape : Shape from TopoDS;
50 SecondShape : Shape from TopoDS;
51 aPlane : Plane from Geom)
52 returns mutable IdenticRelation from AIS;
54 -- Initializes the relation of identity between the two
55 -- entities, FirstShape and SecondShape. The plane
56 -- aPlane is initialized in case a visual reference is
57 -- needed to show identity.
59 IsMovable(me) returns Boolean from Standard
62 -- Returns true if the interactive object is movable.
65 -- Methods from PresentableObject
68 aPresentationManager: PresentationManager3d from PrsMgr;
69 aPresentation : mutable Presentation from Prs3d;
70 aMode : Integer from Standard= 0)
74 aProjector: Projector from Prs3d;
75 aPresentation: mutable Presentation from Prs3d)
76 is redefined static private;
79 aPresentationManager: PresentationManager2d from PrsMgr;
80 aPresentation: mutable GraphicObject from Graphic2d;
81 aMode: Integer from Standard = 0)
82 is redefined static private;
85 aProjector : Projector from Prs3d;
86 aTrsf : Transformation from Geom;
87 aPresentation : mutable Presentation from Prs3d)
89 ---Purpose: computes the presentation according to a point of view
90 -- given by <aProjector>.
91 -- To be Used when the associated degenerated Presentations
92 -- have been transformed by <aTrsf> which is not a Pure
93 -- Translation. The HLR Prs can't be deducted automatically
94 -- WARNING :<aTrsf> must be applied
95 -- to the object to display before computation !!!
97 -- Methods from SelectableObject
99 ComputeSelection(me : mutable;
100 aSelection : mutable Selection from SelectMgr;
101 aMode : Integer from Standard)
102 is redefined private;
105 -- Computation private methods
108 ComputeOneEdgeOVertexPresentation(me: mutable;
109 aPresentation : mutable Presentation from Prs3d)
112 ComputeTwoEdgesPresentation(me: mutable;
113 aPresentation : mutable Presentation from Prs3d)
116 ComputeTwoLinesPresentation(me: mutable;
117 aPresentation : mutable Presentation from Prs3d;
118 aLin : Line from Geom;
119 Pnt1On1 : in out Pnt from gp;
120 Pnt2On1 : in out Pnt from gp;
121 Pnt1On2 : in out Pnt from gp;
122 Pnt2On2 : in out Pnt from gp;
123 isInf1 : Boolean from Standard;
124 isInf2 : Boolean from Standard)
127 ComputeTwoCirclesPresentation(me: mutable;
128 aPresentation : mutable Presentation from Prs3d;
129 aCircle : Circle from Geom;
130 Pnt1On1 : Pnt from gp;
131 Pnt2On1 : Pnt from gp;
132 Pnt1On2 : Pnt from gp;
133 Pnt2On2 : Pnt from gp)
137 ComputeAutoArcPresentation(me: mutable;
138 aCircle : Circle from Geom;
139 firstp : Pnt from gp;
141 isstatic: Boolean from Standard = Standard_False)
142 ---Purpose: Computes the presentation of the identic constraint
143 -- between 2 arcs in the case of automatic presentation
146 ComputeNotAutoCircPresentation(me: mutable;
147 aCircle : Circle from Geom)
148 ---Purpose: Computes the presentation of the identic constraint
149 -- between 2 circles in the case of non automatic presentation
152 ComputeNotAutoArcPresentation(me: mutable;
153 aCircle : Circle from Geom;
154 pntfirst: Pnt from gp;
155 pntlast : Pnt from gp)
156 ---Purpose: Computes the presentation of the identic constraint
157 -- between 2 arcs in the case of non automatic presentation
159 -- jfa 17/10/2000 end
162 ComputeTwoEllipsesPresentation(me: mutable;
163 aPrs : mutable Presentation from Prs3d;
164 anEll : Ellipse from Geom;
165 Pnt1On1 : Pnt from gp;
166 Pnt2On1 : Pnt from gp;
167 Pnt1On2 : Pnt from gp;
168 Pnt2On2 : Pnt from gp)
170 -- jfa 10/10/2000 end
173 ComputeAutoArcPresentation(me: mutable;
174 theEll : Ellipse from Geom;
175 firstp : Pnt from gp;
177 isstatic: Boolean from Standard = Standard_False)
178 ---Purpose: Computes the presentation of the identic constraint
179 -- between 2 arcs in the case of automatic presentation
182 ComputeNotAutoElipsPresentation(me: mutable;
183 theEll : Ellipse from Geom)
184 ---Purpose: Computes the presentation of the identic constraint
185 -- between 2 ellipses in the case of non automatic presentation
188 ComputeNotAutoArcPresentation(me: mutable;
189 theEll : Ellipse from Geom;
190 pntfirst: Pnt from gp;
191 pntlast : Pnt from gp)
192 ---Purpose: Computes the presentation of the identic constraint
193 -- between 2 arcs in the case of non automatic presentation
195 -- jfa 18/10/2000 end
197 ComputeTwoVerticesPresentation(me: mutable;
198 aPresentation : mutable Presentation from Prs3d)
202 returns Real from Standard
205 ComputeDirection(me; aWire : Wire from TopoDS;
206 aVertex : Vertex from TopoDS;
207 aDir : out Dir from gp)
208 returns Boolean from Standard
211 ComputeLineDirection(me; aLin : Line from Geom;
212 anExtremity : Pnt from gp)
216 ComputeCircleDirection(me; aCirc : Circle from Geom;
217 ConnectedVertex : Vertex from TopoDS)
223 isCircle : Boolean from Standard;
224 myFAttach : Pnt from gp;
225 mySAttach : Pnt from gp;
226 myCenter : Pnt from gp;