1 -- Created on: 1996-12-05
2 -- Created by: Flore Lantheaume/Odile Olivier
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class FixRelation from AIS inherits Relation from AIS
20 ---Purpose: Constructs and manages a constraint by a fixed
21 -- relation between two or more interactive datums. This
22 -- constraint is represented by a wire from a shape -
23 -- point, vertex, or edge - in the first datum and a
24 -- corresponding shape in the second.
25 -- Warning: This relation is not bound with any kind of parametric
26 -- constraint : it represents the "status" of an parametric
30 PresentationManager3d from PrsMgr,
31 Presentation from Prs3d,
32 Selection from SelectMgr,
42 Transformation from Geom,
46 Create (aShape : Shape from TopoDS;
47 aPlane : Plane from Geom;
48 aWire : Wire from TopoDS)
49 ---Purpose: initializes the vertex aShape, the
50 -- plane aPlane and the wire aWire, which connects
51 -- the two vertices in a fixed relation.
52 returns FixRelation from AIS;
54 Create (aShape : Shape from TopoDS;
55 aPlane : Plane from Geom;
56 aWire : Wire from TopoDS;
57 aPosition : Pnt from gp;
58 anArrowSize : Real from Standard = 0.01)
59 ---Purpose: initializes the vertex aShape, the
60 -- plane aPlane and the wire aWire, the position
61 -- aPosition, the arrow size anArrowSize and the
62 -- wire aWire, which connects the two vertices in a fixed relation.
63 returns FixRelation from AIS;
64 Create (aShape : Shape from TopoDS;
65 aPlane : Plane from Geom)
66 ---Purpose: initializes the edge aShape and the plane aPlane.
67 returns FixRelation from AIS;
69 Create (aShape : Shape from TopoDS;
70 aPlane : Plane from Geom;
71 aPosition : Pnt from gp;
72 anArrowSize : Real from Standard = 0.01)
73 ---Purpose: initializes the edge aShape, the
74 -- plane aPlane, the position aPosition and the arrow
77 returns FixRelation from AIS;
79 Wire(me: mutable) returns Wire from TopoDS
81 ---Purpose: Returns the wire which connects vertices in a fixed relation.
83 SetWire(me: mutable;aWire : Wire from TopoDS)
85 --- Purpose: Constructs the wire aWire. This connects vertices
86 -- which are in a fixed relation.
88 IsMovable(me) returns Boolean from Standard
90 ---Purpose: Returns true if the Interactive Objects in the relation
94 -- Methods from PresentableObject
97 aPresentationManager: PresentationManager3d from PrsMgr;
98 aPresentation : Presentation from Prs3d;
99 aMode : Integer from Standard= 0)
100 is redefined static private;
103 aProjector: Projector from Prs3d;
104 aPresentation: Presentation from Prs3d)
105 is redefined static private;
107 Compute(me : mutable;
108 aProjector : Projector from Prs3d;
109 aTrsf : Transformation from Geom;
110 aPresentation : Presentation from Prs3d)
112 ---Purpose: computes the presentation according to a point of view
113 -- given by <aProjector>.
114 -- To be Used when the associated degenerated Presentations
115 -- have been transformed by <aTrsf> which is not a Pure
116 -- Translation. The HLR Prs can't be deducted automatically
117 -- WARNING :<aTrsf> must be applied
118 -- to the object to display before computation !!!
120 -- Methods from SelectableObject
122 ComputeSelection(me : mutable;
123 aSelection : Selection from SelectMgr;
124 aMode : Integer from Standard)
125 is redefined private;
129 -- Computation private methods
132 ComputeVertex(me : mutable;
133 FixVertex : Vertex from TopoDS;
134 curpos : out Pnt from gp)
135 ---Purpose: computes the presentation for <myFixShape> if it's a
141 curv1 : Curve from Geom;
142 curv2 : Curve from Geom;
143 firstp1 : Pnt from gp;
144 lastp1 : Pnt from gp ;
145 firstp2 : Pnt from gp;
146 lastp2 : Pnt from gp)
152 curv : Curve from Geom;
153 firstp : Pnt from gp;
159 ComputeEdge(me : mutable;
160 FixEdge : Edge from TopoDS;
161 curpos : out Pnt from gp)
162 ---Purpose: computes the presentation for <myFixShape> if it's a
167 ComputeLinePosition(me : mutable;
169 pos : out Pnt from gp;
170 pfirst : out Real from Standard;
171 plast : out Real from Standard)
175 ComputeCirclePosition(me : mutable;
176 gcirc : Circ from gp;
177 pos : out Pnt from gp;
178 pfirst : out Real from Standard;
179 plast : out Real from Standard)
182 ConnectedEdges(myclass; aWire : Wire from TopoDS;
183 aVertex : Vertex from TopoDS;
184 Edge1,Edge2 : out Edge from TopoDS)
185 returns Boolean from Standard
191 myWire : Wire from TopoDS;
192 myPntAttach : Pnt from gp;