b311480e |
1 | -- Created on: 1997-03-03 |
2 | -- Created by: Jean-Pierre COMBE |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class SymmetricRelation from AIS inherits Relation from AIS |
18 | |
19 | ---Purpose: A framework to display constraints of symmetricity |
20 | -- between two or more datum Interactive Objects. |
21 | -- A plane serves as the axis of symmetry between the |
22 | -- shapes of which the datums are parts. |
23 | |
24 | uses Shape from TopoDS, |
25 | Presentation from Prs3d, |
26 | PresentationManager3d from PrsMgr, |
27 | Selection from SelectMgr, |
28 | Dir from gp, |
29 | Pnt from gp, |
30 | Projector from Prs3d, |
128cc8df |
31 | Transformation from Geom, |
7fd59977 |
32 | ExtendedString from TCollection, |
33 | Plane from Geom |
34 | |
35 | is |
36 | Create(aSymmTool : Shape from TopoDS; |
37 | FirstShape : Shape from TopoDS; |
38 | SecondShape : Shape from TopoDS; |
39 | aPlane : Plane from Geom) |
6e33d3ce |
40 | returns SymmetricRelation from AIS; |
7fd59977 |
41 | --- Purpose: Constructs an object to display constraints of symmetricity. |
42 | -- This object is defined by a tool aSymmTool, a first |
43 | -- shape FirstShape, a second shape SecondShape, and a plane aPlane. |
44 | -- aPlane serves as the axis of symmetry. |
45 | -- aSymmTool is the shape composed of FirstShape |
46 | -- SecondShape and aPlane. It may be queried and |
47 | -- edited using the functions GetTool and SetTool. |
48 | -- The two shapes are typically two edges, two vertices or two points. |
49 | |
50 | IsMovable(me) returns Boolean from Standard |
51 | ---Purpose: Returns true if the symmetric constraint display is movable. |
52 | ---C++: inline |
53 | |
54 | is redefined; |
55 | |
56 | SetTool(me:mutable; aSymmetricTool : Shape from TopoDS); |
57 | ---Purpose: Sets the tool aSymmetricTool composed of a first |
58 | -- shape, a second shape, and a plane. |
59 | -- This tool is initially created at construction time. |
60 | ---C++: inline |
61 | |
62 | GetTool(me) |
63 | ---Purpose: Returns the tool composed of a first shape, a second |
64 | -- shape, and a plane. This tool is created at construction time. |
65 | ---C++: inline |
66 | ---C++: return const & |
67 | returns Shape from TopoDS; |
68 | |
69 | -- Methods from PresentableObject |
70 | |
71 | Compute(me : mutable; |
72 | aPresentationManager: PresentationManager3d from PrsMgr; |
6e33d3ce |
73 | aPresentation : Presentation from Prs3d; |
7fd59977 |
74 | aMode : Integer from Standard= 0) |
75 | is redefined static private; |
76 | |
77 | Compute(me:mutable; |
78 | aProjector: Projector from Prs3d; |
6e33d3ce |
79 | aPresentation: Presentation from Prs3d) |
7fd59977 |
80 | is redefined static private; |
81 | |
7fd59977 |
82 | Compute(me : mutable; |
83 | aProjector : Projector from Prs3d; |
84 | aTrsf : Transformation from Geom; |
6e33d3ce |
85 | aPresentation : Presentation from Prs3d) |
7fd59977 |
86 | is redefined; |
87 | ---Purpose: computes the presentation according to a point of view |
88 | -- given by <aProjector>. |
89 | -- To be Used when the associated degenerated Presentations |
90 | -- have been transformed by <aTrsf> which is not a Pure |
91 | -- Translation. The HLR Prs can't be deducted automatically |
92 | -- WARNING :<aTrsf> must be applied |
93 | -- to the object to display before computation !!! |
94 | |
95 | -- SymmetricRelation Methods from SelectableObject |
96 | |
97 | ComputeSelection(me : mutable; |
6e33d3ce |
98 | aSelection : Selection from SelectMgr; |
7fd59977 |
99 | aMode : Integer from Standard)is private; |
100 | |
101 | -- |
102 | -- Computation private methods |
103 | -- |
104 | |
6e33d3ce |
105 | ComputeTwoFacesSymmetric(me: mutable; aprs : Presentation from Prs3d) |
7fd59977 |
106 | is private; |
107 | |
6e33d3ce |
108 | ComputeTwoEdgesSymmetric(me: mutable; aprs : Presentation from Prs3d) |
7fd59977 |
109 | is private; |
110 | |
6e33d3ce |
111 | ComputeTwoVerticesSymmetric(me: mutable; aprs : Presentation from Prs3d) |
7fd59977 |
112 | is private; |
113 | |
114 | |
115 | fields |
116 | |
117 | myTool : Shape from TopoDS; |
118 | myFAttach : Pnt from gp; |
119 | mySAttach : Pnt from gp; |
120 | myFDirAttach : Dir from gp; |
121 | myAxisDirAttach : Dir from gp; |
122 | |
123 | end SymmetricRelation; |