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 -- GG : GER61351 17/11/1999 Change SetColor() with a compatible Quantity_Color instead
18 -- the restricted NameOfColor.
19 -- Redefines the Color(),Material(),Transparency() methods
20 -- for taking in acount the current facing model.
21 -- GG : BUC60536 The compute methods must be defined "protected"
22 -- and no more "private"
26 class Shape from AIS inherits InteractiveObject from AIS
28 ---Purpose: A framework to manage presentation and selection of shapes.
29 -- AIS_Shape is the interactive object which is used the
30 -- most by applications. There are standard functions
31 -- available which allow you to prepare selection
32 -- operations on the constituent elements of shapes -
33 -- vertices, edges, faces etc - in an open local context.
34 -- The selection modes specific to "Shape" type objects
35 -- are referred to as Standard Activation Mode. These
36 -- modes are only taken into account in open local
37 -- context and only act on Interactive Objects which
38 -- have redefined the virtual method
39 -- AcceptShapeDecomposition so that it returns true.
40 -- Several advanced functions are also available. These
41 -- include functions to manage deviation angle and
42 -- deviation coefficient - both HLR and non-HLR - of
43 -- an inheriting shape class. These services allow you to
44 -- select one type of shape interactive object for higher
45 -- precision drawing. When you do this, the
46 -- AIS_Drawer::IsOwn... functions corresponding to the
47 -- above deviation angle and coefficient functions return
48 -- true indicating that there is a local setting available
49 -- for the specific object.
52 NameOfColor from Quantity,
55 ShapeEnum from TopAbs,
57 NameOfMaterial from Graphic3d ,
58 ---NameOfPhysicalMaterial from Graphic3d ,
59 MaterialAspect from Graphic3d,
60 Presentation from Prs3d,
62 PresentationManager3d from PrsMgr,
63 Selection from SelectMgr,
65 KindOfInteractive from AIS,
66 Transformation from Geom,
71 Create(shap: Shape from TopoDS)
72 returns Shape from AIS;
73 ---Purpose: Initializes construction of the shape shap from wires,
74 -- edges and vertices.
76 Signature(me) returns Integer from Standard is redefined virtual ;
77 ---Purpose: Returns index 0. This value refers to SHAPE from TopAbs_ShapeEnum
79 Type(me) returns KindOfInteractive from AIS is redefined virtual;
80 ---Purpose: Returns Object as the type of Interactive Object.
82 AcceptShapeDecomposition(me) returns Boolean from Standard is redefined virtual;
83 ---Purpose: Returns true if the Interactive Object accepts shape decomposition.
85 Set(me:mutable;ashap : Shape from TopoDS) is static;
86 ---Purpose: Constructs an instance of the shape object ashape.
89 Shape(me) returns Shape from TopoDS ;
90 ---Purpose: Returns this shape object.
95 ---------------------------------------------------------------------
96 SetOwnDeviationCoefficient(me: mutable) returns Boolean from Standard ;
97 ---Purpose: Sets a local value for deviation coefficient for this specific shape.
98 SetOwnHLRDeviationCoefficient(me: mutable) returns Boolean from Standard ;
99 ---Purpose: Sets a local value for HLR deviation coefficient for this specific shape.
100 SetOwnDeviationAngle(me: mutable) returns Boolean from Standard ;
101 ---Purpose: Sets a local value for deviation angle for this specific shape.
103 SetOwnHLRDeviationAngle(me: mutable) returns Boolean from Standard ;
104 ---Purpose: Sets a local value for HLR deviation angle for this specific shape.
107 SetOwnDeviationCoefficient(me: mutable; aCoefficient: Real from Standard) ;
108 ---Purpose: Sets a local value for deviation coefficient for this specific shape.
110 SetOwnHLRDeviationCoefficient(me: mutable; aCoefficient : Real from Standard) ;
111 ---Purpose: sets myOwnHLRDeviationCoefficient field in AIS_Drawer &
112 -- recomputes presentation
114 SetAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
115 ---Purpose: this compute a new angle and Deviation from the value anAngle
116 -- and set the values stored in myDrawer with these that become local to the shape
118 UserAngle(me) returns Real from Standard;
119 ---Purpose: gives back the angle initial value put by the User.
121 SetOwnDeviationAngle(me: mutable; anAngle: Real from Standard) ;
122 ---Purpose: sets myOwnDeviationAngle field in AIS_Drawer & recomputes presentation
125 SetHLRAngleAndDeviation(me: mutable; anAngle: Real from Standard) ;
126 ---Purpose: this compute a new Angle and Deviation from the value anAngle for HLR
127 -- and set the values stored in myDrawer for with these that become local to the shape
129 SetOwnHLRDeviationAngle(me: mutable; anAngle: Real from Standard) ;
130 ---Purpose: sets myOwnHLRDeviationAngle field in AIS_Drawer & recomputes presentation
133 OwnDeviationCoefficient(me; aCoefficient : out Real from Standard ;
134 aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
135 ---Purpose: Returns true and the values of the deviation
136 -- coefficient aCoefficient and the previous deviation
137 -- coefficient aPreviousCoefficient. If these values are
138 -- not already set, false is returned.
140 OwnHLRDeviationCoefficient(me; aCoefficient : out Real from Standard;
141 aPreviousCoefficient : out Real from Standard ) returns Boolean from Standard;
142 ---Purpose: Returns true and the values of the HLR deviation
143 -- coefficient aCoefficient and the previous HLR
144 -- deviation coefficient aPreviousCoefficient. If these
145 -- values are not already set, false is returned.
147 OwnDeviationAngle(me; anAngle: out Real from Standard;
148 aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
149 ---Purpose: Returns true and the values of the deviation angle
150 -- anAngle and the previous deviation angle aPreviousAngle.
151 -- If these values are not already set, false is returned.
154 OwnHLRDeviationAngle(me; anAngle : out Real from Standard ;
155 aPreviousAngle : out Real from Standard ) returns Boolean from Standard;
156 ---Purpose: Returns true and the values of the HLR deviation
157 -- angle anAngle and of the previous HLR deviation
158 -- angle aPreviousAngle. If these values are not
159 -- already set, false is returned.
162 SetTypeOfHLR(me: mutable; theTypeOfHLR: TypeOfHLR from Prs3d);
163 ---Purpose: Sets the type of HLR algorithm used by the shape
166 TypeOfHLR(me) returns TypeOfHLR from Prs3d;
167 ---Purpose: Gets the type of HLR algorithm
171 ---Category: Redefine Compute Methods...
173 Compute(me : mutable;
174 aPresentationManager : PresentationManager3d from PrsMgr;
175 aPresentation : Presentation from Prs3d;
176 aMode : Integer from Standard = 0)
177 is redefined virtual protected;
179 Compute(me : mutable;
180 aProjector : Projector from Prs3d;
181 aPresentation : Presentation from Prs3d)
182 is redefined virtual protected;
184 Compute(me : mutable;
185 aProjector : Projector from Prs3d;
186 aTrsf : Transformation from Geom;
187 aPresentation : Presentation from Prs3d)
188 is redefined virtual protected;
192 ComputeSelection(me : mutable;
193 aSelection : Selection from SelectMgr;
194 aMode : Integer from Standard)
195 is redefined virtual protected;
198 ---Category: The Attributes to be redefined
201 SetColor(me:mutable;aColor:NameOfColor from Quantity)
202 is redefined virtual;
203 ---Purpose: Sets the color aColor in the reconstructed
204 -- compound shape. Acts via the Drawer methods below on the appearance of:
205 -- - free boundaries:
206 -- AIS_Drawer_FreeBoundaryAspect,
207 -- - isos: AIS_Drawer_UIsoAspect,
208 -- AIS_Drawer_VIsoAspect,
209 -- - shared boundaries:
210 -- AIS_Drawer_UnFreeBoundaryAspect,
211 -- - shading: AIS_Drawer_ShadingAspect,
212 -- - visible line color in hidden line mode:
213 -- AIS_Drawer_SeenLineAspect
214 -- - hidden line color in hidden line mode:
215 -- AIS_Drawer_HiddenLineAspect.
217 SetColor(me:mutable;aColor:Color from Quantity)
218 is redefined virtual;
220 UnsetColor(me:mutable) is redefined virtual;
221 ---Purpose: Removes settings for color in the reconstructed compound shape.
223 SetWidth(me:mutable; aValue:Real from Standard) is redefined virtual;
224 ---Purpose: Sets the value aValue for line width in the reconstructed compound shape.
225 UnsetWidth(me:mutable) is redefined virtual;
226 ---Purpose: Removes the setting for line width in the reconstructed compound shape.
228 SetMaterial(me:mutable;aName:NameOfMaterial from Graphic3d) is redefined virtual;
230 SetMaterial(me:mutable;aName:MaterialAspect from Graphic3d) is redefined virtual;
231 ---Purpose: Allows you to provide settings for the material aName
232 -- in the reconstructed compound shape.
234 UnsetMaterial(me:mutable) is redefined virtual;
235 --- Purpose: Removes settings for material in the reconstructed compound shape.
237 SetTransparency(me:mutable;aValue : Real from Standard=0.6) is redefined virtual;
238 ---Purpose: Sets the value aValue for transparency in the reconstructed compound shape.
240 UnsetTransparency(me:mutable) is redefined virtual;
241 ---Purpose: Removes the setting for transparency in the reconstructed compound shape.
243 BoundingBox(me:mutable) returns Box from Bnd is virtual;
244 ---Purpose: Constructs a bounding box with which to reconstruct
245 -- compound topological shapes for presentation.
246 ---C++: return const &
248 Color(me) returns NameOfColor from Quantity is redefined;
249 ---Purpose: Returns the NameOfColor attributes of the shape accordingly to
250 -- the current facing model;
252 Color(me; aColor: out Color from Quantity) is redefined;
253 ---Purpose: Returns the Color attributes of the shape accordingly to
254 -- the current facing model;
256 Material(me) returns NameOfMaterial from Graphic3d is redefined;
257 ---Purpose: Returns the NameOfMaterial attributes of the shape accordingly to
258 -- the current facing model;
260 Transparency(me) returns Real from Standard is redefined;
261 ---Purpose: Returns the transparency attributes of the shape accordingly to
262 -- the current facing model;
268 SelectionType(myclass; aDecompositionMode : Integer from Standard)
269 returns ShapeEnum from TopAbs;
270 ---Purpose: Activates the same TopAbs shape enumerations as
271 -- those used by SelectionMode assigning a type to the mode aDecompositionMode.
273 SelectionMode(myclass; aShapeType : ShapeEnum from TopAbs)
274 returns Integer from Standard;
275 ---Purpose: Establishes an equivalence between a mode and the
276 -- type, aShapeType, of selection. The correspondences are as follows:
284 -- - mode 7 - Compsolid
285 -- - mode 8 - Compound
287 LoadRecomputable(me:mutable;TheMode : Integer from Standard) is static protected;
289 Compute(me : mutable;
290 aProjector : Projector from Prs3d;
291 aPresentation : Presentation from Prs3d;
292 ashape : Shape from TopoDS) is static private;
294 GetDeflection(myclass; aShape : Shape from TopoDS;
295 aDrawer : Drawer from Prs3d)
296 returns Real from Standard;
298 DisplayBox(myclass; aPrs : Presentation from Prs3d;
300 aDrawer : Drawer from Prs3d) is protected;
303 theDrawer : Drawer from AIS;
304 theColor : Color from Quantity)
308 theDrawer : Drawer from AIS;
309 theWidth : Real from Standard)
313 theDrawer : Drawer from AIS;
314 theValue : Real from Standard)
318 myshape : Shape from TopoDS is protected;
319 myBB : Box from Bnd is protected;
320 myCompBB : Boolean from Standard is protected;
321 myInitAng : Real from Standard;