1 -- Created on: 1996-12-20
2 -- Created by: Robert COUBLANC
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 Shape from AIS inherits InteractiveObject from AIS
19 ---Purpose: A framework to manage presentation and selection of shapes.
20 -- AIS_Shape is the interactive object which is used the
21 -- most by applications. There are standard functions
22 -- available which allow you to prepare selection
23 -- operations on the constituent elements of shapes -
24 -- vertices, edges, faces etc - in an open local context.
25 -- The selection modes specific to "Shape" type objects
26 -- are referred to as Standard Activation Mode. These
27 -- modes are only taken into account in open local
28 -- context and only act on Interactive Objects which
29 -- have redefined the virtual method
30 -- AcceptShapeDecomposition so that it returns true.
31 -- Several advanced functions are also available. These
32 -- include functions to manage deviation angle and
33 -- deviation coefficient - both HLR and non-HLR - of
34 -- an inheriting shape class. These services allow you to
35 -- select one type of shape interactive object for higher
36 -- precision drawing. When you do this, the
37 -- Prs3d_Drawer::IsOwn... functions corresponding to the
38 -- above deviation angle and coefficient functions return
39 -- true indicating that there is a local setting available
40 -- for the specific object.
43 NameOfColor from Quantity,
46 ShapeEnum from TopAbs,
48 NameOfMaterial from Graphic3d ,
49 ---NameOfPhysicalMaterial from Graphic3d ,
50 MaterialAspect from Graphic3d,
51 Presentation from Prs3d,
53 PresentationManager3d from PrsMgr,
54 Selection from SelectMgr,
55 KindOfInteractive from AIS,
56 Transformation from Geom,
61 Create(shap: Shape from TopoDS)
62 returns Shape from AIS;
63 ---Purpose: Initializes construction of the shape shap from wires,
64 -- edges and vertices.
66 Signature(me) returns Integer from Standard is redefined virtual ;
67 ---Purpose: Returns index 0. This value refers to SHAPE from TopAbs_ShapeEnum
69 Type(me) returns KindOfInteractive from AIS is redefined virtual;
70 ---Purpose: Returns Object as the type of Interactive Object.
72 AcceptShapeDecomposition(me) returns Boolean from Standard is redefined virtual;
73 ---Purpose: Returns true if the Interactive Object accepts shape decomposition.
75 Set(me:mutable;ashap : Shape from TopoDS) is static;
76 ---Purpose: Constructs an instance of the shape object ashape.
79 Shape(me) returns Shape from TopoDS ;
80 ---Purpose: Returns this shape object.
85 ---------------------------------------------------------------------
86 SetOwnDeviationCoefficient(me: mutable) returns Boolean from Standard ;
87 ---Purpose: Sets a local value for deviation coefficient for this specific shape.
88 SetOwnHLRDeviationCoefficient(me: mutable) returns Boolean from Standard ;
89 ---Purpose: Sets a local value for HLR deviation coefficient for this specific shape.
90 SetOwnDeviationAngle(me: mutable) returns Boolean from Standard ;
91 ---Purpose: Sets a local value for deviation angle for this specific shape.
93 SetOwnHLRDeviationAngle(me: mutable) returns Boolean from Standard ;
94 ---Purpose: Sets a local value for HLR deviation angle for this specific shape.
97 SetOwnDeviationCoefficient(me: mutable; aCoefficient: Real from Standard) ;
98 ---Purpose: Sets a local value for deviation coefficient for this specific shape.
100 SetOwnHLRDeviationCoefficient(me: mutable; aCoefficient : Real from Standard) ;
101 ---Purpose: sets myOwnHLRDeviationCoefficient field in Prs3d_Drawer &
102 -- recomputes presentation
104 SetAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
105 ---Purpose: this compute a new angle and Deviation from the value anAngle
106 -- and set the values stored in myDrawer with these that become local to the shape
108 UserAngle(me) returns Real from Standard;
109 ---Purpose: gives back the angle initial value put by the User.
111 SetOwnDeviationAngle(me: mutable; anAngle: Real from Standard) ;
112 ---Purpose: sets myOwnDeviationAngle field in Prs3d_Drawer & recomputes presentation
115 SetHLRAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
116 ---Purpose: this compute a new Angle and Deviation from the value anAngle for HLR
117 -- and set the values stored in myDrawer for with these that become local to the shape
119 SetOwnHLRDeviationAngle(me: mutable; anAngle: Real from Standard) ;
120 ---Purpose: sets myOwnHLRDeviationAngle field in Prs3d_Drawer & recomputes presentation
123 OwnDeviationCoefficient(me; aCoefficient : out Real from Standard ;
124 aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
125 ---Purpose: Returns true and the values of the deviation
126 -- coefficient aCoefficient and the previous deviation
127 -- coefficient aPreviousCoefficient. If these values are
128 -- not already set, false is returned.
130 OwnHLRDeviationCoefficient(me; aCoefficient : out Real from Standard;
131 aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
132 ---Purpose: Returns true and the values of the HLR deviation
133 -- coefficient aCoefficient and the previous HLR
134 -- deviation coefficient aPreviousCoefficient. If these
135 -- values are not already set, false is returned.
137 OwnDeviationAngle(me; anAngle: out Real from Standard;
138 aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
139 ---Purpose: Returns true and the values of the deviation angle
140 -- anAngle and the previous deviation angle aPreviousAngle.
141 -- If these values are not already set, false is returned.
144 OwnHLRDeviationAngle(me; anAngle : out Real from Standard ;
145 aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
146 ---Purpose: Returns true and the values of the HLR deviation
147 -- angle anAngle and of the previous HLR deviation
148 -- angle aPreviousAngle. If these values are not
149 -- already set, false is returned.
152 SetTypeOfHLR(me: mutable; theTypeOfHLR: TypeOfHLR from Prs3d);
153 ---Purpose: Sets the type of HLR algorithm used by the shape
156 TypeOfHLR(me) returns TypeOfHLR from Prs3d;
157 ---Purpose: Gets the type of HLR algorithm
161 ---Category: Redefine Compute Methods...
163 Compute(me : mutable;
164 aPresentationManager : PresentationManager3d from PrsMgr;
165 aPresentation : Presentation from Prs3d;
166 aMode : Integer from Standard = 0)
167 is redefined virtual protected;
169 Compute(me : mutable;
170 aProjector : Projector from Prs3d;
171 aPresentation : Presentation from Prs3d)
172 is redefined virtual protected;
174 Compute(me : mutable;
175 aProjector : Projector from Prs3d;
176 aTrsf : Transformation from Geom;
177 aPresentation : Presentation from Prs3d)
178 is redefined virtual protected;
182 ComputeSelection(me : mutable;
183 aSelection : Selection from SelectMgr;
184 aMode : Integer from Standard)
185 is redefined virtual protected;
188 ---Category: The Attributes to be redefined
191 SetColor(me:mutable;aColor:NameOfColor from Quantity)
192 is redefined virtual;
193 ---Purpose: Sets the color aColor in the reconstructed
194 -- compound shape. Acts via the Drawer methods below on the appearance of:
195 -- - free boundaries:
196 -- Prs3d_Drawer_FreeBoundaryAspect,
197 -- - isos: Prs3d_Drawer_UIsoAspect,
198 -- Prs3dDrawer_VIsoAspect,
199 -- - shared boundaries:
200 -- Prs3d_Drawer_UnFreeBoundaryAspect,
201 -- - shading: Prs3d_Drawer_ShadingAspect,
202 -- - visible line color in hidden line mode:
203 -- Prs3d_Drawer_SeenLineAspect
204 -- - hidden line color in hidden line mode:
205 -- Prs3d_Drawer_HiddenLineAspect.
207 SetColor(me:mutable;aColor:Color from Quantity)
208 is redefined virtual;
210 UnsetColor(me:mutable) is redefined virtual;
211 ---Purpose: Removes settings for color in the reconstructed compound shape.
213 SetWidth(me:mutable; aValue:Real from Standard) is redefined virtual;
214 ---Purpose: Sets the value aValue for line width in the reconstructed compound shape.
215 -- Changes line aspects for lines-only presentation modes like Wireframe and Bounding Box.
216 -- Doesn't change face boundary line aspect.
217 UnsetWidth(me:mutable) is redefined virtual;
218 ---Purpose: Removes the setting for line width in the reconstructed compound shape.
220 SetMaterial(me:mutable;aName:NameOfMaterial from Graphic3d) is redefined virtual;
222 SetMaterial(me:mutable;aName:MaterialAspect from Graphic3d) is redefined virtual;
223 ---Purpose: Allows you to provide settings for the material aName
224 -- in the reconstructed compound shape.
226 UnsetMaterial(me:mutable) is redefined virtual;
227 --- Purpose: Removes settings for material in the reconstructed compound shape.
229 SetTransparency(me:mutable;aValue : Real from Standard=0.6) is redefined virtual;
230 ---Purpose: Sets the value aValue for transparency in the reconstructed compound shape.
232 UnsetTransparency(me:mutable) is redefined virtual;
233 ---Purpose: Removes the setting for transparency in the reconstructed compound shape.
235 BoundingBox(me:mutable) returns Box from Bnd is virtual;
236 ---Purpose: Constructs a bounding box with which to reconstruct
237 -- compound topological shapes for presentation.
238 ---C++: return const &
240 Color(me) returns NameOfColor from Quantity is redefined;
241 ---Purpose: Returns the NameOfColor attributes of the shape accordingly to
242 -- the current facing model;
244 Color(me; aColor: out Color from Quantity) is redefined;
245 ---Purpose: Returns the Color attributes of the shape accordingly to
246 -- the current facing model;
248 Material(me) returns NameOfMaterial from Graphic3d is redefined;
249 ---Purpose: Returns the NameOfMaterial attributes of the shape accordingly to
250 -- the current facing model;
252 Transparency(me) returns Real from Standard is redefined;
253 ---Purpose: Returns the transparency attributes of the shape accordingly to
254 -- the current facing model;
260 SelectionType(myclass; aDecompositionMode : Integer from Standard)
261 returns ShapeEnum from TopAbs;
262 ---Purpose: Activates the same TopAbs shape enumerations as
263 -- those used by SelectionMode assigning a type to the mode aDecompositionMode.
265 SelectionMode(myclass; aShapeType : ShapeEnum from TopAbs)
266 returns Integer from Standard;
267 ---Purpose: Establishes an equivalence between a mode and the
268 -- type, aShapeType, of selection. The correspondences are as follows:
276 -- - mode 7 - Compsolid
277 -- - mode 8 - Compound
279 LoadRecomputable(me:mutable;TheMode : Integer from Standard) is static protected;
281 Compute(me : mutable;
282 aProjector : Projector from Prs3d;
283 aPresentation : Presentation from Prs3d;
284 ashape : Shape from TopoDS) is static private;
287 theDrawer : Drawer from Prs3d;
288 theColor : Color from Quantity)
292 theDrawer : Drawer from Prs3d;
293 theWidth : Real from Standard)
297 theDrawer : Drawer from Prs3d;
298 theValue : Real from Standard)
302 theDrawer : Drawer from Prs3d;
303 theMaterial : MaterialAspect from Graphic3d;
304 theToKeepColor : Boolean from Standard;
305 theToKeepTransp : Boolean from Standard)
309 myshape : Shape from TopoDS is protected;
310 myBB : Box from Bnd is protected;
311 myCompBB : Boolean from Standard is protected;
312 myInitAng : Real from Standard;