1 -- Created on: 1996-12-20
2 -- Created by: Robert COUBLANC
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
21 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
22 -- the restricted NameOfColor.
23 -- Redefines the Color(),Material(),Transparency() methods
24 -- for taking in acount the current facing model.
25 -- GG : BUC60536 The compute methods must be defined "protected"
26 -- and no more "private"
30 class Shape from AIS inherits InteractiveObject from AIS
32 ---Purpose: A framework to manage presentation and selection of shapes.
33 -- AIS_Shape is the interactive object which is used the
34 -- most by applications. There are standard functions
35 -- available which allow you to prepare selection
36 -- operations on the constituent elements of shapes -
37 -- vertices, edges, faces etc - in an open local context.
38 -- The selection modes specific to "Shape" type objects
39 -- are referred to as Standard Activation Mode. These
40 -- modes are only taken into account in open local
41 -- context and only act on Interactive Objects which
42 -- have redefined the virtual method
43 -- AcceptShapeDecomposition so that it returns true.
44 -- Several advanced functions are also available. These
45 -- include functions to manage deviation angle and
46 -- deviation coefficient - both HLR and non-HLR - of
47 -- an inheriting shape class. These services allow you to
48 -- select one type of shape interactive object for higher
49 -- precision drawing. When you do this, the
50 -- AIS_Drawer::IsOwn... functions corresponding to the
51 -- above deviation angle and coefficient functions return
52 -- true indicating that there is a local setting available
53 -- for the specific object.
56 NameOfColor from Quantity,
59 ShapeEnum from TopAbs,
61 NameOfMaterial from Graphic3d ,
62 ---NameOfPhysicalMaterial from Graphic3d ,
63 MaterialAspect from Graphic3d,
64 Presentation from Prs3d,
66 PresentationManager3d from PrsMgr,
67 Selection from SelectMgr,
68 KindOfInteractive from AIS,
69 Transformation from Geom,
74 Create(shap: Shape from TopoDS)
75 returns mutable Shape from AIS;
76 ---Purpose: Initializes construction of the shape shap from wires,
77 -- edges and vertices.
79 Signature(me) returns Integer from Standard is redefined virtual ;
80 ---Purpose: Returns index 0. This value refers to SHAPE from TopAbs_ShapeEnum
82 Type(me) returns KindOfInteractive from AIS is redefined virtual;
83 ---Purpose: Returns Object as the type of Interactive Object.
85 AcceptShapeDecomposition(me) returns Boolean from Standard is redefined virtual;
86 ---Purpose: Returns true if the Interactive Object accepts shape decomposition.
88 Set(me:mutable;ashap : Shape from TopoDS) is static;
89 ---Purpose: Constructs an instance of the shape object ashape.
92 Shape(me) returns Shape from TopoDS ;
93 ---Purpose: Returns this shape object.
98 ---------------------------------------------------------------------
99 SetOwnDeviationCoefficient(me: mutable) returns Boolean from Standard ;
100 ---Purpose: Sets a local value for deviation coefficient for this specific shape.
101 SetOwnHLRDeviationCoefficient(me: mutable) returns Boolean from Standard ;
102 ---Purpose: Sets a local value for HLR deviation coefficient for this specific shape.
103 SetOwnDeviationAngle(me: mutable) returns Boolean from Standard ;
104 ---Purpose: Sets a local value for deviation angle for this specific shape.
106 SetOwnHLRDeviationAngle(me: mutable) returns Boolean from Standard ;
107 ---Purpose: Sets a local value for HLR deviation angle for this specific shape.
110 SetOwnDeviationCoefficient(me: mutable; aCoefficient: Real from Standard) ;
111 ---Purpose: Sets a local value for deviation coefficient for this specific shape.
113 SetOwnHLRDeviationCoefficient(me: mutable; aCoefficient : Real from Standard) ;
114 ---Purpose: sets myOwnHLRDeviationCoefficient field in AIS_Drawer &
115 -- recomputes presentation
117 SetAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
118 ---Purpose: this compute a new angle and Deviation from the value anAngle
119 -- and set the values stored in myDrawer with these that become local to the shape
121 UserAngle(me) returns Real from Standard;
122 ---Purpose: gives back the angle initial value put by the User.
124 SetOwnDeviationAngle(me: mutable; anAngle: Real from Standard) ;
125 ---Purpose: sets myOwnDeviationAngle field in AIS_Drawer & recomputes presentation
128 SetHLRAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
129 ---Purpose: this compute a new Angle and Deviation from the value anAngle for HLR
130 -- and set the values stored in myDrawer for with these that become local to the shape
132 SetOwnHLRDeviationAngle(me: mutable; anAngle: Real from Standard) ;
133 ---Purpose: sets myOwnHLRDeviationAngle field in AIS_Drawer & recomputes presentation
136 OwnDeviationCoefficient(me; aCoefficient : out Real from Standard ;
137 aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
138 ---Purpose: Returns true and the values of the deviation
139 -- coefficient aCoefficient and the previous deviation
140 -- coefficient aPreviousCoefficient. If these values are
141 -- not already set, false is returned.
143 OwnHLRDeviationCoefficient(me; aCoefficient : out Real from Standard;
144 aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
145 ---Purpose: Returns true and the values of the HLR deviation
146 -- coefficient aCoefficient and the previous HLR
147 -- deviation coefficient aPreviousCoefficient. If these
148 -- values are not already set, false is returned.
150 OwnDeviationAngle(me; anAngle: out Real from Standard;
151 aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
152 ---Purpose: Returns true and the values of the deviation angle
153 -- anAngle and the previous deviation angle aPreviousAngle.
154 -- If these values are not already set, false is returned.
157 OwnHLRDeviationAngle(me; anAngle : out Real from Standard ;
158 aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
159 ---Purpose: Returns true and the values of the HLR deviation
160 -- angle anAngle and of the previous HLR deviation
161 -- angle aPreviousAngle. If these values are not
162 -- already set, false is returned.
165 SetTypeOfHLR(me: mutable; theTypeOfHLR: TypeOfHLR from Prs3d);
166 ---Purpose: Sets the type of HLR algorithm used by the shape
169 TypeOfHLR(me) returns TypeOfHLR from Prs3d;
170 ---Purpose: Gets the type of HLR algorithm
174 ---Category: Redefine Compute Methods...
176 Compute(me : mutable;
177 aPresentationManager : PresentationManager3d from PrsMgr;
178 aPresentation : mutable Presentation from Prs3d;
179 aMode : Integer from Standard = 0)
180 is redefined virtual protected;
182 Compute(me : mutable;
183 aProjector : Projector from Prs3d;
184 aPresentation : mutable Presentation from Prs3d)
185 is redefined virtual protected;
187 Compute(me : mutable;
188 aProjector : Projector from Prs3d;
189 aTrsf : Transformation from Geom;
190 aPresentation : mutable Presentation from Prs3d)
191 is redefined virtual protected;
195 ComputeSelection(me : mutable;
196 aSelection : mutable Selection from SelectMgr;
197 aMode : Integer from Standard)
198 is redefined virtual protected;
201 ---Category: The Attributes to be redefined
204 SetColor(me:mutable;aColor:NameOfColor from Quantity)
205 is redefined virtual;
206 ---Purpose: Sets the color aColor in the reconstructed
207 -- compound shape. Acts via the Drawer methods below on the appearance of:
208 -- - free boundaries:
209 -- AIS_Drawer_FreeBoundaryAspect,
210 -- - isos: AIS_Drawer_UIsoAspect,
211 -- AIS_Drawer_VIsoAspect,
212 -- - shared boundaries:
213 -- AIS_Drawer_UnFreeBoundaryAspect,
214 -- - shading: AIS_Drawer_ShadingAspect,
215 -- - visible line color in hidden line mode:
216 -- AIS_Drawer_SeenLineAspect
217 -- - hidden line color in hidden line mode:
218 -- AIS_Drawer_HiddenLineAspect.
220 SetColor(me:mutable;aColor:Color from Quantity)
221 is redefined virtual;
223 UnsetColor(me:mutable) is redefined virtual;
224 ---Purpose: Removes settings for color in the reconstructed compound shape.
226 SetWidth(me:mutable; aValue:Real from Standard) is redefined virtual;
227 ---Purpose: Sets the value aValue for line width in the reconstructed compound shape.
228 UnsetWidth(me:mutable) is redefined virtual;
229 ---Purpose: Removes the setting for line width in the reconstructed compound shape.
231 SetMaterial(me:mutable;aName:NameOfMaterial from Graphic3d) is redefined virtual;
233 SetMaterial(me:mutable;aName:MaterialAspect from Graphic3d) is redefined virtual;
234 ---Purpose: Allows you to provide settings for the material aName
235 -- in the reconstructed compound shape.
237 UnsetMaterial(me:mutable) is redefined virtual;
238 --- Purpose: Removes settings for material in the reconstructed compound shape.
240 SetTransparency(me:mutable;aValue : Real from Standard=0.6) is redefined virtual;
241 ---Purpose: Sets the value aValue for transparency in the reconstructed compound shape.
243 UnsetTransparency(me:mutable) is redefined virtual;
244 ---Purpose: Removes the setting for transparency in the reconstructed compound shape.
246 BoundingBox(me:mutable) returns Box from Bnd is virtual;
247 ---Purpose: Constructs a bounding box with which to reconstruct
248 -- compound topological shapes for presentation.
249 ---C++: return const &
251 Color(me) returns NameOfColor from Quantity is redefined;
252 ---Purpose: Returns the NameOfColor attributes of the shape accordingly to
253 -- the current facing model;
255 Color(me; aColor: out Color from Quantity) is redefined;
256 ---Purpose: Returns the Color attributes of the shape accordingly to
257 -- the current facing model;
259 Material(me) returns NameOfMaterial from Graphic3d is redefined;
260 ---Purpose: Returns the NameOfMaterial attributes of the shape accordingly to
261 -- the current facing model;
263 Transparency(me) returns Real from Standard is redefined;
264 ---Purpose: Returns the transparency attributes of the shape accordingly to
265 -- the current facing model;
271 SelectionType(myclass; aDecompositionMode : Integer from Standard)
272 returns ShapeEnum from TopAbs;
273 ---Purpose: Activates the same TopAbs shape enumerations as
274 -- those used by SelectionMode assigning a type to the mode aDecompositionMode.
276 SelectionMode(myclass; aShapeType : ShapeEnum from TopAbs)
277 returns Integer from Standard;
278 ---Purpose: Establishes an equivalence between a mode and the
279 -- type, aShapeType, of selection. The correspondences are as follows:
287 -- - mode 7 - Compsolid
288 -- - mode 8 - Compound
290 LoadRecomputable(me:mutable;TheMode : Integer from Standard) is static protected;
292 Compute(me : mutable;
293 aProjector : Projector from Prs3d;
294 aPresentation : mutable Presentation from Prs3d;
295 ashape : Shape from TopoDS) is static private;
297 GetDeflection(myclass; aShape : Shape from TopoDS;
298 aDrawer : Drawer from Prs3d)
299 returns Real from Standard;
301 DisplayBox(myclass; aPrs : Presentation from Prs3d;
303 aDrawer : Drawer from Prs3d) is protected;
307 myshape : Shape from TopoDS is protected;
308 myBB : Box from Bnd is protected;
309 myCompBB : Boolean from Standard is protected;
310 myInitAng : Real from Standard;