1 -- File: AIS_FixRelation.cdl
2 -- Created: Thu Dec 5 10:08:10 1996
3 -- Author: Flore Lantheaume/Odile Olivier
4 -- <odl@sacadox.paris1.matra-dtv.fr>
5 ---Copyright: Matra Datavision 1996
7 class FixRelation from AIS inherits Relation from AIS
10 ---Purpose: Constructs and manages a constraint by a fixed
11 -- relation between two or more interactive datums. This
12 -- constraint is represented by a wire from a shape -
13 -- point, vertex, or edge - in the first datum and a
14 -- corresponding shape in the second.
15 -- Warning: This relation is not bound with any kind of parametric
16 -- constraint : it represents the "status" of an parametric
20 PresentationManager3d from PrsMgr,
21 Presentation from Prs3d,
22 Selection from SelectMgr,
32 Transformation from Geom,
33 PresentationManager2d from PrsMgr,
34 GraphicObject from Graphic2d,
38 Create (aShape : Shape from TopoDS;
39 aPlane : Plane from Geom;
40 aWire : Wire from TopoDS)
41 ---Purpose: initializes the vertex aShape, the
42 -- plane aPlane and the wire aWire, which connects
43 -- the two vertices in a fixed relation.
44 returns mutable FixRelation from AIS;
46 Create (aShape : Shape from TopoDS;
47 aPlane : Plane from Geom;
48 aWire : Wire from TopoDS;
49 aPosition : Pnt from gp;
50 anArrowSize : Real from Standard = 0.01)
51 ---Purpose: initializes the vertex aShape, the
52 -- plane aPlane and the wire aWire, the position
53 -- aPosition, the arrow size anArrowSize and the
54 -- wire aWire, which connects the two vertices in a fixed relation.
55 returns mutable FixRelation from AIS;
56 Create (aShape : Shape from TopoDS;
57 aPlane : Plane from Geom)
58 ---Purpose: initializes the edge aShape and the plane aPlane.
59 returns mutable FixRelation from AIS;
61 Create (aShape : Shape from TopoDS;
62 aPlane : Plane from Geom;
63 aPosition : Pnt from gp;
64 anArrowSize : Real from Standard = 0.01)
65 ---Purpose: initializes the edge aShape, the
66 -- plane aPlane, the position aPosition and the arrow
69 returns mutable FixRelation from AIS;
71 Wire(me: mutable) returns Wire from TopoDS
73 ---Purpose: Returns the wire which connects vertices in a fixed relation.
75 SetWire(me: mutable;aWire : Wire from TopoDS)
77 --- Purpose: Constructs the wire aWire. This connects vertices
78 -- which are in a fixed relation.
80 IsMovable(me) returns Boolean from Standard
82 ---Purpose: Returns true if the Interactive Objects in the relation
86 -- Methods from PresentableObject
89 aPresentationManager: PresentationManager3d from PrsMgr;
90 aPresentation : mutable Presentation from Prs3d;
91 aMode : Integer from Standard= 0)
92 is redefined static private;
95 aProjector: Projector from Prs3d;
96 aPresentation: mutable Presentation from Prs3d)
97 is redefined static private;
100 aPresentationManager: PresentationManager2d from PrsMgr;
101 aPresentation: mutable GraphicObject from Graphic2d;
102 aMode: Integer from Standard = 0)
103 is redefined static private;
105 Compute(me : mutable;
106 aProjector : Projector from Prs3d;
107 aTrsf : Transformation from Geom;
108 aPresentation : mutable Presentation from Prs3d)
110 ---Purpose: computes the presentation according to a point of view
111 -- given by <aProjector>.
112 -- To be Used when the associated degenerated Presentations
113 -- have been transformed by <aTrsf> which is not a Pure
114 -- Translation. The HLR Prs can't be deducted automatically
115 -- WARNING :<aTrsf> must be applied
116 -- to the object to display before computation !!!
118 -- Methods from SelectableObject
120 ComputeSelection(me : mutable;
121 aSelection : mutable Selection from SelectMgr;
122 aMode : Integer from Standard)
123 is redefined private;
127 -- Computation private methods
130 ComputeVertex(me : mutable;
131 FixVertex : Vertex from TopoDS;
132 curpos : out Pnt from gp)
133 ---Purpose: computes the presentation for <myFixShape> if it's a
139 curv1 : Curve from Geom;
140 curv2 : Curve from Geom;
141 firstp1 : Pnt from gp;
142 lastp1 : Pnt from gp ;
143 firstp2 : Pnt from gp;
144 lastp2 : Pnt from gp)
150 curv : Curve from Geom;
151 firstp : Pnt from gp;
157 ComputeEdge(me : mutable;
158 FixEdge : Edge from TopoDS;
159 curpos : out Pnt from gp)
160 ---Purpose: computes the presentation for <myFixShape> if it's a
165 ComputeLinePosition(me : mutable;
167 pos : out Pnt from gp;
168 pfirst : out Real from Standard;
169 plast : out Real from Standard)
173 ComputeCirclePosition(me : mutable;
174 gcirc : Circ from gp;
175 pos : out Pnt from gp;
176 pfirst : out Real from Standard;
177 plast : out Real from Standard)
180 ConnectedEdges(myclass; aWire : Wire from TopoDS;
181 aVertex : Vertex from TopoDS;
182 Edge1,Edge2 : out Edge from TopoDS)
183 returns Boolean from Standard
189 myWire : Wire from TopoDS;
190 myPntAttach : Pnt from gp;
191 haspos : Boolean from Standard;