2 -- Created: Fri Dec 20 15:18:05 1996
3 -- Author: Robert COUBLANC
4 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
5 -- the restricted NameOfColor.
6 -- Redefines the Color(),Material(),Transparency() methods
7 -- for taking in acount the current facing model.
8 -- GG : BUC60536 The compute methods must be defined "protected"
9 -- and no more "private"
11 ---Copyright: Matra Datavision 1996
14 class Shape from AIS inherits InteractiveObject from AIS
16 ---Purpose: A framework to manage presentation and selection of shapes.
17 -- AIS_Shape is the interactive object which is used the
18 -- most by applications. There are standard functions
19 -- available which allow you to prepare selection
20 -- operations on the constituent elements of shapes -
21 -- vertices, edges, faces etc - in an open local context.
22 -- The selection modes specific to "Shape" type objects
23 -- are referred to as Standard Activation Mode. These
24 -- modes are only taken into account in open local
25 -- context and only act on Interactive Objects which
26 -- have redefined the virtual method
27 -- AcceptShapeDecomposition so that it returns true.
28 -- Several advanced functions are also available. These
29 -- include functions to manage deviation angle and
30 -- deviation coefficient - both HLR and non-HLR - of
31 -- an inheriting shape class. These services allow you to
32 -- select one type of shape interactive object for higher
33 -- precision drawing. When you do this, the
34 -- AIS_Drawer::IsOwn... functions corresponding to the
35 -- above deviation angle and coefficient functions return
36 -- true indicating that there is a local setting available
37 -- for the specific object.
40 NameOfColor from Quantity,
43 ShapeEnum from TopAbs,
45 GraphicObject from Graphic2d,
46 NameOfMaterial from Graphic3d ,
47 ---NameOfPhysicalMaterial from Graphic3d ,
48 MaterialAspect from Graphic3d,
49 Presentation from Prs3d,
51 PresentationManager2d from PrsMgr,
52 PresentationManager3d from PrsMgr,
53 Selection from SelectMgr,
54 KindOfInteractive from AIS,
55 Transformation from Geom,
59 Create(shap: Shape from TopoDS)
60 returns mutable Shape from AIS;
61 ---Purpose: Initializes construction of the shape shap from wires,
62 -- edges and vertices.
64 Signature(me) returns Integer from Standard is redefined virtual ;
65 ---Purpose: Returns index 0. This value refers to SHAPE from TopAbs_ShapeEnum
67 Type(me) returns KindOfInteractive from AIS is redefined virtual;
68 ---Purpose: Returns Object as the type of Interactive Object.
70 AcceptShapeDecomposition(me) returns Boolean from Standard is redefined virtual;
71 ---Purpose: Returns true if the Interactive Object accepts shape decomposition.
73 Set(me:mutable;ashap : Shape from TopoDS) is static;
74 ---Purpose: Constructs an instance of the shape object ashape.
77 Shape(me) returns Shape from TopoDS ;
78 ---Purpose: Returns this shape object.
83 ---------------------------------------------------------------------
84 SetOwnDeviationCoefficient(me: mutable) returns Boolean from Standard ;
85 ---Purpose: Sets a local value for deviation coefficient for this specific shape.
86 SetOwnHLRDeviationCoefficient(me: mutable) returns Boolean from Standard ;
87 ---Purpose: Sets a local value for HLR deviation coefficient for this specific shape.
88 SetOwnDeviationAngle(me: mutable) returns Boolean from Standard ;
89 ---Purpose: Sets a local value for deviation angle for this specific shape.
91 SetOwnHLRDeviationAngle(me: mutable) returns Boolean from Standard ;
92 ---Purpose: Sets a local value for HLR deviation angle for this specific shape.
95 SetOwnDeviationCoefficient(me: mutable; aCoefficient: Real from Standard) ;
96 ---Purpose: Sets a local value for deviation coefficient for this specific shape.
98 SetOwnHLRDeviationCoefficient(me: mutable; aCoefficient : Real from Standard) ;
99 ---Purpose: sets myOwnHLRDeviationCoefficient field in AIS_Drawer &
100 -- recomputes presentation
102 SetAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
103 ---Purpose: this compute a new angle and Deviation from the value anAngle
104 -- and set the values stored in myDrawer with these that become local to the shape
106 UserAngle(me) returns Real from Standard;
107 ---Purpose: gives back the angle initial value put by the User.
109 SetOwnDeviationAngle(me: mutable; anAngle: Real from Standard) ;
110 ---Purpose: sets myOwnDeviationAngle field in AIS_Drawer & recomputes presentation
113 SetHLRAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
114 ---Purpose: this compute a new Angle and Deviation from the value anAngle for HLR
115 -- and set the values stored in myDrawer for with these that become local to the shape
117 SetOwnHLRDeviationAngle(me: mutable; anAngle: Real from Standard) ;
118 ---Purpose: sets myOwnHLRDeviationAngle field in AIS_Drawer & recomputes presentation
121 OwnDeviationCoefficient(me; aCoefficient : out Real from Standard ;
122 aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
123 ---Purpose: Returns true and the values of the deviation
124 -- coefficient aCoefficient and the previous deviation
125 -- coefficient aPreviousCoefficient. If these values are
126 -- not already set, false is returned.
128 OwnHLRDeviationCoefficient(me; aCoefficient : out Real from Standard;
129 aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
130 ---Purpose: Returns true and the values of the HLR deviation
131 -- coefficient aCoefficient and the previous HLR
132 -- deviation coefficient aPreviousCoefficient. If these
133 -- values are not already set, false is returned.
135 OwnDeviationAngle(me; anAngle: out Real from Standard;
136 aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
137 ---Purpose: Returns true and the values of the deviation angle
138 -- anAngle and the previous deviation angle aPreviousAngle.
139 -- If these values are not already set, false is returned.
142 OwnHLRDeviationAngle(me; anAngle : out Real from Standard ;
143 aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
144 ---Purpose: Returns true and the values of the HLR deviation
145 -- angle anAngle and of the previous HLR deviation
146 -- angle aPreviousAngle. If these values are not
147 -- already set, false is returned.
153 ---Category: Redefine Compute Methods...
155 Compute(me : mutable;
156 aPresentationManager : PresentationManager3d from PrsMgr;
157 aPresentation : mutable Presentation from Prs3d;
158 aMode : Integer from Standard = 0)
159 is redefined virtual protected;
161 Compute(me : mutable;
162 aPresentationManager : PresentationManager2d from PrsMgr;
163 aPresentation : mutable GraphicObject from Graphic2d;aMode:Integer from Standard = 0)
164 is redefined virtual protected;
166 Compute(me : mutable;
167 aProjector : Projector from Prs3d;
168 aPresentation : mutable Presentation from Prs3d)
169 is redefined virtual protected;
171 Compute(me : mutable;
172 aProjector : Projector from Prs3d;
173 aTrsf : Transformation from Geom;
174 aPresentation : mutable Presentation from Prs3d)
175 is redefined virtual protected;
179 ComputeSelection(me : mutable;
180 aSelection : mutable Selection from SelectMgr;
181 aMode : Integer from Standard)
182 is redefined virtual protected;
185 ---Category: The Attributes to be redefined
188 SetColor(me:mutable;aColor:NameOfColor from Quantity)
189 is redefined virtual;
190 ---Purpose: Sets the color aColor in the reconstructed
191 -- compound shape. Acts via the Drawer methods below on the appearance of:
192 -- - free boundaries:
193 -- AIS_Drawer_FreeBoundaryAspect,
194 -- - isos: AIS_Drawer_UIsoAspect,
195 -- AIS_Drawer_VIsoAspect,
196 -- - shared boundaries:
197 -- AIS_Drawer_UnFreeBoundaryAspect,
198 -- - shading: AIS_Drawer_ShadingAspect,
199 -- - visible line color in hidden line mode:
200 -- AIS_Drawer_SeenLineAspect
201 -- - hidden line color in hidden line mode:
202 -- AIS_Drawer_HiddenLineAspect.
204 SetColor(me:mutable;aColor:Color from Quantity)
205 is redefined virtual;
207 UnsetColor(me:mutable) is redefined virtual;
208 ---Purpose: Removes settings for color in the reconstructed compound shape.
210 SetWidth(me:mutable; aValue:Real from Standard) is redefined virtual;
211 ---Purpose: Sets the value aValue for line width in the reconstructed compound shape.
212 UnsetWidth(me:mutable) is redefined virtual;
213 ---Purpose: Removes the setting for line width in the reconstructed compound shape.
215 SetMaterial(me:mutable;aName:NameOfMaterial from Graphic3d) is redefined virtual;
217 SetMaterial(me:mutable;aName:MaterialAspect from Graphic3d) is redefined virtual;
218 ---Purpose: Allows you to provide settings for the material aName
219 -- in the reconstructed compound shape.
221 UnsetMaterial(me:mutable) is redefined virtual;
222 --- Purpose: Removes settings for material in the reconstructed compound shape.
224 SetTransparency(me:mutable;aValue : Real from Standard=0.6) is redefined virtual;
225 ---Purpose: Sets the value aValue for transparency in the reconstructed compound shape.
227 UnsetTransparency(me:mutable) is redefined virtual;
228 ---Purpose: Removes the setting for transparency in the reconstructed compound shape.
230 BoundingBox(me:mutable) returns Box from Bnd is virtual;
231 ---Purpose: Constructs a bounding box with which to reconstruct
232 -- compound topological shapes for presentation.
233 ---C++: return const &
235 Color(me) returns NameOfColor from Quantity is redefined;
236 ---Purpose: Returns the NameOfColor attributes of the shape accordingly to
237 -- the current facing model;
239 Color(me; aColor: out Color from Quantity) is redefined;
240 ---Purpose: Returns the Color attributes of the shape accordingly to
241 -- the current facing model;
243 Material(me) returns NameOfMaterial from Graphic3d is redefined;
244 ---Purpose: Returns the NameOfMaterial attributes of the shape accordingly to
245 -- the current facing model;
247 Transparency(me) returns Real from Standard is redefined;
248 ---Purpose: Returns the transparency attributes of the shape accordingly to
249 -- the current facing model;
255 SelectionType(myclass; aDecompositionMode : Integer from Standard)
256 returns ShapeEnum from TopAbs;
257 ---Purpose: Activates the same TopAbs shape enumerations as
258 -- those used by SelectionMode assigning a type to the mode aDecompositionMode.
260 SelectionMode(myclass; aShapeType : ShapeEnum from TopAbs)
261 returns Integer from Standard;
262 ---Purpose: Establishes an equivalence between a mode and the
263 -- type, aShapeType, of selection. The correspondences are as follows:
271 -- - mode 7 - Compsolid
272 -- - mode 8 - Compound
274 LoadRecomputable(me:mutable;TheMode : Integer from Standard) is static protected;
276 Compute(me : mutable;
277 aProjector : Projector from Prs3d;
278 aPresentation : mutable Presentation from Prs3d;
279 ashape : Shape from TopoDS) is static private;
281 GetDeflection(myclass; aShape : Shape from TopoDS;
282 aDrawer : Drawer from Prs3d)
283 returns Real from Standard;
285 DisplayBox(myclass; aPrs : Presentation from Prs3d;
287 aDrawer : Drawer from Prs3d) is protected;
291 myshape : Shape from TopoDS is protected;
292 myBB : Box from Bnd is protected;
293 myCompBB : Boolean from Standard is protected;
294 myInitAng : Real from Standard;