0026361: Visualization - move OpenGl_TextFormatter to Font_TextFormatter
[occt.git] / src / Graphic3d / Graphic3d_Structure.hxx
CommitLineData
42cf5bc1 1// Created on: 1991-06-12
2// Created by: NW,JPB,CAL
3// Copyright (c) 1991-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _Graphic3d_Structure_HeaderFile
18#define _Graphic3d_Structure_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Graphic3d_CStructure.hxx>
24#include <Graphic3d_IndexedMapOfAddress.hxx>
25#include <Quantity_Color.hxx>
26#include <Aspect_TypeOfHighlightMethod.hxx>
27#include <Graphic3d_StructureManagerPtr.hxx>
28#include <Standard_Address.hxx>
29#include <Graphic3d_TypeOfStructure.hxx>
30#include <MMgt_TShared.hxx>
31#include <Standard_Boolean.hxx>
32#include <Standard_Integer.hxx>
33#include <Graphic3d_ZLayerId.hxx>
34#include <Graphic3d_SequenceOfHClipPlane.hxx>
35#include <Standard_Real.hxx>
36#include <TColStd_Array2OfReal.hxx>
37#include <Graphic3d_SequenceOfGroup.hxx>
38#include <Graphic3d_TypeOfConnection.hxx>
39#include <Graphic3d_MapOfStructure.hxx>
40#include <Graphic3d_TypeOfComposition.hxx>
41#include <Graphic3d_TransModeFlags.hxx>
42#include <Graphic3d_BndBox4f.hxx>
43#include <Graphic3d_BndBox4d.hxx>
44#include <Graphic3d_Vertex.hxx>
45class Graphic3d_PriorityDefinitionError;
46class Graphic3d_StructureDefinitionError;
47class Graphic3d_TransformError;
48class Graphic3d_Group;
49class Graphic3d_StructureManager;
50class Quantity_Color;
51class Graphic3d_AspectLine3d;
52class Graphic3d_AspectFillArea3d;
53class Graphic3d_AspectText3d;
54class Graphic3d_AspectMarker3d;
55class Graphic3d_DataStructureManager;
56class Bnd_Box;
57class gp_Pnt;
58class Graphic3d_Vector;
59
60
61class Graphic3d_Structure;
62DEFINE_STANDARD_HANDLE(Graphic3d_Structure, MMgt_TShared)
63
64//! This class allows the definition a graphic object.
65//! This graphic structure can be displayed,
66//! erased, or highlighted.
67//! This graphic structure can be connected with
68//! another graphic structure.
69//! Keywords: Structure, StructureManager, Display, Erase, Highlight,
70//! UnHighlight, Visible, Priority, Selectable, Visible,
71//! Visual, Connection, Ancestors, Descendants, Transformation
72class Graphic3d_Structure : public MMgt_TShared
73{
74
75public:
76
77
78 //! Creates a graphic object in the manager theManager.
79 //! It will appear in all the views of the visualiser.
80 //! Warning: The default values AspectLine, AspectFillArea, AspectText and AspectMarker are NOT applied to the structure.
81 //! The structure is not displayed when it is created.
82 Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager);
83
84 //! Creates a shadow link to existing graphic object.
85 Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager, const Handle(Graphic3d_Structure)& thePrs);
86
87 //! if WithDestruction == Standard_True then
88 //! suppress all the groups of primitives in the structure.
89 //! and it is mandatory to create a new group in <me>.
90 //! if WithDestruction == Standard_False then
91 //! clears all the groups of primitives in the structure.
92 //! and all the groups are conserved and empty.
93 //! They will be erased at the next screen update.
94 //! The structure itself is conserved.
95 //! The transformation and the attributes of <me> are conserved.
96 //! The childs of <me> are conserved.
97 Standard_EXPORT virtual void Clear (const Standard_Boolean WithDestruction = Standard_True);
98
99 //! Suppresses the structure <me>.
100 //! It will be erased at the next screen update.
101 Standard_EXPORT virtual void Destroy();
102~Graphic3d_Structure()
103{
104 Destroy();
105}
106
107 //! Displays the structure <me> in all the views of the visualiser.
108 Standard_EXPORT virtual void Display();
109
110 //! Returns the current display priority for the
111 //! structure <me>.
112 Standard_EXPORT Standard_Integer DisplayPriority() const;
113
114 //! Erases the structure <me> in all the views
115 //! of the visualiser.
116 Standard_EXPORT virtual void Erase();
117
118 //! Highlights the structure <me> in all the views of the visualiser, using the following methods:
119 //! TOHM_COLOR = drawn in the highlight color
120 //! TOHM_BOUNDBOX = enclosed by the boundary box
121 Standard_EXPORT void Highlight (const Aspect_TypeOfHighlightMethod theMethod, const Quantity_Color& theColor, const Standard_Boolean theToUpdateMgr = Standard_True);
122
123 //! Suppress the structure <me>.
124 //! It will be erased at the next screen update.
125 //! Warning: No more graphic operations in <me> after this call.
126 //! Category: Methods to modify the class definition
127 Standard_EXPORT void Remove();
128
129 //! Computes axis-aligned bounding box of a structure.
130 //! Category: Methods to modify the class definition
131 Standard_EXPORT void CalculateBoundBox();
132
133 //! If <theToSet> is Standard_True then <me> is infinite and
134 //! the MinMaxValues method method return :
135 //! theXMin = theYMin = theZMin = RealFirst().
136 //! theXMax = theYMax = theZMax = RealLast().
137 //! By default, <me> is not infinite but empty.
138 Standard_EXPORT void SetInfiniteState (const Standard_Boolean theToSet);
139
140 //! Modifies the order of displaying the structure.
141 //! Values are between 0 and 10.
142 //! Structures are drawn according to their display priorities
143 //! in ascending order.
144 //! A structure of priority 10 is displayed the last and appears over the others.
145 //! The default value is 5.
146 //! Category: Methods to modify the class definition
147 //! Warning: If <me> is displayed then the SetDisplayPriority
148 //! method erase <me> and display <me> with the
149 //! new priority.
150 //! Raises PriorityDefinitionError if <Priority> is
151 //! greater than 10 or a negative value.
152 Standard_EXPORT void SetDisplayPriority (const Standard_Integer Priority);
153
154 //! Reset the current priority of the structure to the
155 //! previous priority.
156 //! Category: Methods to modify the class definition
157 //! Warning: If <me> is displayed then the SetDisplayPriority
158 //! method erase <me> and display <me> with the
159 //! previous priority.
160 Standard_EXPORT void ResetDisplayPriority();
161
162 //! Set Z layer ID for the structure. The Z layer mechanism
163 //! allows to display structures presented in higher layers in overlay
164 //! of structures in lower layers by switching off z buffer depth
165 //! test between layers
166 Standard_EXPORT void SetZLayer (const Graphic3d_ZLayerId theLayerId);
167
168 //! Get Z layer ID of displayed structure. The method
169 //! returns -1 if the structure has no ID (deleted from graphic driver).
170 Standard_EXPORT Graphic3d_ZLayerId GetZLayer() const;
171
172 //! Changes a sequence of clip planes slicing the structure on rendering.
173 //! @param thePlanes [in] the set of clip planes.
174 Standard_EXPORT void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes);
175
176 //! Get clip planes slicing the structure on rendering.
177 //! @return set of clip planes.
178 Standard_EXPORT const Graphic3d_SequenceOfHClipPlane& GetClipPlanes() const;
179
180 //! Modifies the default attributes for lines
181 //! in the structure <me>.
182 Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
183
184 //! Modifies the default attributes for faces
185 //! in the structure <me>.
186 Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
187
188 //! Modifies the default attributes for text
189 //! in the structure <me>.
190 Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
191
192 //! Modifies the default attributes for markers
193 //! in the structure <me>.
194 Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
195
196 //! Modifies the visibility indicator to Standard_True or
197 //! Standard_False for the structure <me>.
198 //! The default value at the definition of <me> is
199 //! Standard_True.
200 Standard_EXPORT void SetVisible (const Standard_Boolean AValue);
201
202 //! Modifies the visualisation mode for the structure <me>.
203 Standard_EXPORT virtual void SetVisual (const Graphic3d_TypeOfStructure AVisual);
204
205 //! Modifies the minimum and maximum zoom coefficients
206 //! for the structure <me>.
207 //! The default value at the definition of <me> is unlimited.
208 //! Category: Methods to modify the class definition
209 //! Warning: Raises StructureDefinitionError if <LimitInf> is
210 //! greater than <LimitSup> or if <LimitInf> or
211 //! <LimitSup> is a negative value.
212 Standard_EXPORT void SetZoomLimit (const Standard_Real LimitInf, const Standard_Real LimitSup);
213
214 //! marks the structure <me> representing wired structure needed for
215 //! highlight only so it won't be added to BVH tree.
216 //! Category: Methods to modify the class definition
217 Standard_EXPORT void SetIsForHighlight (const Standard_Boolean isForHighlight);
218
219 //! Suppresses the highlight for the structure <me>
220 //! in all the views of the visualiser.
221 Standard_EXPORT void UnHighlight();
222
223 Standard_EXPORT virtual void Compute();
224
225 //! Returns the new Structure defined for the new visualization
226 Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector);
227
228 //! Returns the new Structure defined for the new visualization
229 Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, const TColStd_Array2OfReal& AMatrix);
230
231 //! Returns the new Structure defined for the new visualization
232 Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, Handle(Graphic3d_Structure)& aStructure);
233
234 //! Returns the new Structure defined for the new visualization
235 Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, const TColStd_Array2OfReal& AMatrix, Handle(Graphic3d_Structure)& aStructure);
236
237 //! Forces a new construction of the structure <me>
238 //! if <me> is displayed and TOS_COMPUTED.
239 Standard_EXPORT void ReCompute();
240
241 //! Forces a new construction of the structure <me>
242 //! if <me> is displayed in <aProjetor> and TOS_COMPUTED.
243 Standard_EXPORT void ReCompute (const Handle(Graphic3d_DataStructureManager)& aProjector);
244
245 //! Returns Standard_True if the structure <me> contains
246 //! Polygons, Triangles or Quadrangles.
247 Standard_EXPORT Standard_Boolean ContainsFacet() const;
248
249 //! Returns the values of the current default attributes.
250 Standard_EXPORT Handle(Graphic3d_AspectFillArea3d) FillArea3dAspect() const;
251
252 //! Returns the groups sequence included in the structure <me> (internal storage).
253 Standard_EXPORT const Graphic3d_SequenceOfGroup& Groups() const;
254
255 //! Returns the current number of groups in the
256 //! structure <me>.
257 Standard_EXPORT Standard_Integer NumberOfGroups() const;
258
259 //! Append new group to this structure.
260 Standard_EXPORT Handle(Graphic3d_Group) NewGroup();
261
262 //! Returns the highlight color for the Highlight method
263 //! with the highlight method TOHM_COLOR or TOHM_BOUNDBOX.
264 Standard_EXPORT const Quantity_Color& HighlightColor() const;
265
266 //! Returns Standard_True if the structure <me> is deleted.
267 //! <me> is deleted after the call Remove (me).
268 Standard_EXPORT Standard_Boolean IsDeleted() const;
269
270 //! Returns the display indicator for the structure <me>.
271 Standard_EXPORT virtual Standard_Boolean IsDisplayed() const;
272
273 //! Returns Standard_True if the structure <me> is empty.
274 //! Warning: A structure is empty if :
275 //! it do not have group or all the groups are empties
276 //! and it do not have descendant or all the descendants
277 //! are empties.
278 Standard_EXPORT Standard_Boolean IsEmpty() const;
279
280 //! Returns Standard_True if the structure <me> is infinite.
281 Standard_EXPORT Standard_Boolean IsInfinite() const;
282
283 //! Returns the highlight indicator for the structure <me>.
284 Standard_EXPORT virtual Standard_Boolean IsHighlighted() const;
285
286 //! Returns Standard_True if the structure <me> is rotated.
287 //! <=> The transformation != Identity, != Scale, != Translation.
288 Standard_EXPORT Standard_Boolean IsRotated() const;
289
290 //! Returns Standard_True if the structure <me> is transformed.
291 //! <=> The transformation != Identity.
292 Standard_EXPORT Standard_Boolean IsTransformed() const;
293
294 //! Returns the visibility indicator for the structure <me>.
295 Standard_EXPORT Standard_Boolean IsVisible() const;
296
297 //! Returns the values of the current default attributes.
298 Standard_EXPORT Handle(Graphic3d_AspectLine3d) Line3dAspect() const;
299
300 //! Returns the current group of graphic attributes used
301 //! for 3d marker primitives.
302 Standard_EXPORT Handle(Graphic3d_AspectMarker3d) Marker3dAspect() const;
303
304 //! Returns the coordinates of the boundary box of the structure <me>.
305 //! If <theToIgnoreInfiniteFlag> is TRUE, the method returns actual graphical
306 //! boundaries of the Graphic3d_Group components. Otherwise, the
307 //! method returns boundaries taking into account infinite state
308 //! of the structure. This approach generally used for application
309 //! specific fit operation (e.g. fitting the model into screen,
310 //! not taking into accout infinite helper elements).
311 //! Warning: If the structure <me> is empty then the empty box is returned,
312 //! If the structure <me> is infinite then the whole box is returned.
313 Standard_EXPORT Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
314
315 //! Returns the current values of the default attributes.
316 Standard_EXPORT void PrimitivesAspect (Handle(Graphic3d_AspectLine3d)& CTXL, Handle(Graphic3d_AspectText3d)& CTXT, Handle(Graphic3d_AspectMarker3d)& CTXM, Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
317
318 //! Returns the values of the current default attributes.
319 Standard_EXPORT Handle(Graphic3d_AspectText3d) Text3dAspect() const;
320
321 //! Returns the visualisation mode for the structure <me>.
322 Standard_EXPORT Graphic3d_TypeOfStructure Visual() const;
323
324 //! Returns Standard_True if the connection is possible between
325 //! <AStructure1> and <AStructure2> without a creation
326 //! of a cycle.
327 //!
328 //! It's not possible to call the method
329 //! AStructure1->Connect (AStructure2, TypeOfConnection)
330 //! if
331 //! - the set of all ancestors of <AStructure1> contains
332 //! <AStructure1> and if the
333 //! TypeOfConnection == TOC_DESCENDANT
334 //! - the set of all descendants of <AStructure1> contains
335 //! <AStructure2> and if the
336 //! TypeOfConnection == TOC_ANCESTOR
337 Standard_EXPORT static Standard_Boolean AcceptConnection (const Handle(Graphic3d_Structure)& AStructure1, const Handle(Graphic3d_Structure)& AStructure2, const Graphic3d_TypeOfConnection AType);
338
339 //! Returns the group of structures to which <me> is connected.
340 Standard_EXPORT void Ancestors (Graphic3d_MapOfStructure& SG) const;
341
342 //! If Atype is TOC_DESCENDANT then add <AStructure>
343 //! as a child structure of <me>.
344 //! If Atype is TOC_ANCESTOR then add <AStructure>
345 //! as a parent structure of <me>.
346 //! The connection propagates Display, Highlight, Erase,
347 //! Remove, and stacks the transformations.
348 //! No connection if the graph of the structures
349 //! contains a cycle and <WithCheck> is Standard_True;
350 Standard_EXPORT void Connect (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType, const Standard_Boolean WithCheck = Standard_False);
351
352 //! Returns the group of structures connected to <me>.
353 Standard_EXPORT void Descendants (Graphic3d_MapOfStructure& SG) const;
354
355 //! Suppress the connection between <AStructure> and <me>.
356 Standard_EXPORT void Disconnect (const Handle(Graphic3d_Structure)& AStructure);
357
358 //! If Atype is TOC_DESCENDANT then suppress all
359 //! the connections with the child structures of <me>.
360 //! If Atype is TOC_ANCESTOR then suppress all
361 //! the connections with the parent structures of <me>.
362 Standard_EXPORT void DisconnectAll (const Graphic3d_TypeOfConnection AType);
363
364 //! Returns <ASet> the group of structures :
365 //! - directly or indirectly connected to <AStructure> if the
366 //! TypeOfConnection == TOC_DESCENDANT
367 //! - to which <AStructure> is directly or indirectly connected
368 //! if the TypeOfConnection == TOC_ANCESTOR
369 Standard_EXPORT static void Network (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType, Graphic3d_MapOfStructure& ASet);
370
371 Standard_EXPORT void SetOwner (const Standard_Address Owner);
372
373 Standard_EXPORT Standard_Address Owner() const;
374
375 Standard_EXPORT void SetHLRValidation (const Standard_Boolean AFlag);
376
377 Standard_EXPORT Standard_Boolean HLRValidation() const;
378
379 //! Returns the type of composition applied to matrices
380 //! of transformation of <me>.
381 Standard_EXPORT Graphic3d_TypeOfComposition Composition() const;
382
383 //! Modifies the current local modelling transformation
384 //! in the structure <me>.
385 //!
386 //! It is defined as a 4*4 real matrix.
387 //!
388 //! -------------------
389 //! | a11 a12 a13 t1 |
390 //! | a21 a22 a23 t2 |
391 //! | a31 a32 a33 t3 |
392 //! | 0 0 0 1 |
393 //! -------------------
394 //!
395 //! TypeOfComposition : TOC_REPLACE
396 //! TOC_POSTCONCATENATE
397 //!
398 //! Then the modified Local Modelling Transformation is composed
399 //! with the current Global Modelling Transformation to create a
400 //! new Composite Modelling Transformation.
401 //!
402 //! The compose type specifies the role of the current local
403 //! modelling transformation (L) in composing the new value for
404 //! the current local modelling transformation (L'), which is
405 //! then combined with the current global modelling transforma-
406 //! tion (G) to calculate the new composite modelling transfor-
407 //! mation (C).
408 //!
409 //! TOC_REPLACE
410 //! The transformation matrix (T) replaces the value of
411 //! current local modelling transformation (L).
412 //!
413 //! L' <- T
414 //! C <- G x L'
415 //!
416 //! TOC_POSTCONCATENATE
417 //! The current local modelling transformation (L) is multiplied
418 //! by the transformation matrix (T):
419 //!
420 //! L' <- T x L
421 //! C <- G x L'
422 //!
423 //! Category: Methods to manage the structure transformation
424 //! Warning: Raises TransformError if the matrix is not a 4x4 matrix.
425 Standard_EXPORT void SetTransform (const TColStd_Array2OfReal& AMatrix, const Graphic3d_TypeOfComposition AType);
426
427 //! Returns the transformation associated with
428 //! the structure <me>.
429 Standard_EXPORT void Transform (TColStd_Array2OfReal& AMatrix) const;
430
431 //! Modifies the current modelling transform persistence (pan, zoom or rotate)
432 Standard_EXPORT void SetTransformPersistence (const Graphic3d_TransModeFlags& AFlag, const gp_Pnt& APoint);
433
434 Standard_EXPORT void SetTransformPersistence (const Graphic3d_TransModeFlags& AFlag);
435
436 //! Get the current modelling transform persistence (pan, zoom or rotate)
437 Standard_EXPORT Graphic3d_TransModeFlags TransformPersistenceMode() const;
438
439 //! Get the current point of relative modelling transform persistence
440 Standard_EXPORT gp_Pnt TransformPersistencePoint() const;
441
442 //! Sets if the structure location has mutable nature (content or location will be changed regularly).
443 Standard_EXPORT void SetMutable (const Standard_Boolean theIsMutable);
444
445 //! Returns true if structure has mutable nature (content or location are be changed regularly).
446 //! Mutable structure will be managed in different way than static onces.
447 Standard_EXPORT Standard_Boolean IsMutable() const;
448
449 Standard_EXPORT Graphic3d_TypeOfStructure ComputeVisual() const;
450
451 //! Clears the structure <me>.
452 Standard_EXPORT void GraphicClear (const Standard_Boolean WithDestruction);
453
454 Standard_EXPORT void GraphicConnect (const Handle(Graphic3d_Structure)& ADaughter);
455
456 Standard_EXPORT void GraphicDisconnect (const Handle(Graphic3d_Structure)& ADaughter);
457
458 //! Highlights the structure <me>.
459 Standard_EXPORT void GraphicHighlight (const Aspect_TypeOfHighlightMethod Method);
460
461 Standard_EXPORT void GraphicTransform (const TColStd_Array2OfReal& AMatrix);
462
463 //! Suppress the highlight for the structure <me>.
464 Standard_EXPORT void GraphicUnHighlight();
465
466 //! Returns the identification number of the structure <me>.
467 Standard_EXPORT Standard_Integer Identification() const;
468
469 //! Prints informations about the network associated
470 //! with the structure <AStructure>.
471 Standard_EXPORT static void PrintNetwork (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType);
472
473 //! Suppress the adress <APtr> in the list
474 //! of descendants or in the list of ancestors.
475 Standard_EXPORT void Remove (const Standard_Address APtr, const Graphic3d_TypeOfConnection AType);
476
477 Standard_EXPORT void SetComputeVisual (const Graphic3d_TypeOfStructure AVisual);
478
479 //! Transforms <X>, <Y>, <Z> with the transformation <ATrsf>.
480 Standard_EXPORT static void Transforms (const TColStd_Array2OfReal& ATrsf, const Standard_Real X, const Standard_Real Y, const Standard_Real Z, Standard_Real& NewX, Standard_Real& NewY, Standard_Real& NewZ);
481
482 //! Transforms <Coord> with the transformation <ATrsf>.
483 Standard_EXPORT static Graphic3d_Vector Transforms (const TColStd_Array2OfReal& ATrsf, const Graphic3d_Vector& Coord);
484
485 //! Transforms <Coord> with the transformation <ATrsf>.
486 Standard_EXPORT static Graphic3d_Vertex Transforms (const TColStd_Array2OfReal& ATrsf, const Graphic3d_Vertex& Coord);
487
488 //! Returns the low-level structure
489 const Handle(Graphic3d_CStructure)& CStructure() const;
490
491friend class Graphic3d_Group;
492
493
494 DEFINE_STANDARD_RTTI(Graphic3d_Structure,MMgt_TShared)
495
496protected:
497
498
499 //! Transforms boundaries with <theTrsf> transformation.
500 Standard_EXPORT static void TransformBoundaries (const TColStd_Array2OfReal& theTrsf, Standard_Real& theXMin, Standard_Real& theYMin, Standard_Real& theZMin, Standard_Real& theXMax, Standard_Real& theYMax, Standard_Real& theZMax);
501
502 //! Appends new descendant structure.
503 Standard_EXPORT Standard_Boolean AppendDescendant (const Standard_Address theDescendant);
504
505 //! Removes the given descendant structure.
506 Standard_EXPORT Standard_Boolean RemoveDescendant (const Standard_Address theDescendant);
507
508 //! Appends new ancestor structure.
509 Standard_EXPORT Standard_Boolean AppendAncestor (const Standard_Address theAncestor);
510
511 //! Removes the given ancestor structure.
512 Standard_EXPORT Standard_Boolean RemoveAncestor (const Standard_Address theAncestor);
513
514 Graphic3d_StructureManagerPtr myStructureManager;
515 Graphic3d_StructureManagerPtr myFirstStructureManager;
516 Graphic3d_TypeOfStructure myComputeVisual;
517
518
519private:
520
521
522 //! Suppress in the structure <me>, the group theGroup.
523 //! It will be erased at the next screen update.
524 Standard_EXPORT void Remove (const Handle(Graphic3d_Group)& theGroup);
525
526 //! Manages the number of groups in the structure <me>
527 //! which contains facet.
528 //! Polygons, Triangles or Quadrangles.
529 //! <ADelta> = +1 or -1
530 Standard_EXPORT void GroupsWithFacet (const Standard_Integer ADelta);
531
532 //! Returns the extreme coordinates found in the structure <me> without transformation applied.
533 Standard_EXPORT Graphic3d_BndBox4f minMaxCoord() const;
534
535 //! Gets untransformed bounding box from structure.
536 Standard_EXPORT void getBox (Graphic3d_BndBox4d& theBox, const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
537
538 //! Adds transformed (with myCStructure->Transformation) bounding box of structure to theBox.
539 Standard_EXPORT void addTransformed (Graphic3d_BndBox4d& theBox, const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
540
541 //! Returns the manager to which <me> is associated.
542 Standard_EXPORT Handle(Graphic3d_StructureManager) StructureManager() const;
543
544 //! Calls the Update method of the StructureManager which
545 //! contains the Structure <me>.
546 Standard_EXPORT void Update() const;
547
548 //! Updates the c structure associated to <me>.
549 Standard_EXPORT void UpdateStructure (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF);
550
551 Handle(Graphic3d_CStructure) myCStructure;
552 Graphic3d_IndexedMapOfAddress myAncestors;
553 Graphic3d_IndexedMapOfAddress myDescendants;
554 Quantity_Color myHighlightColor;
555 Aspect_TypeOfHighlightMethod myHighlightMethod;
556 Standard_Address myOwner;
557 Graphic3d_TypeOfStructure myVisual;
558
559
560};
561
562
563#include <Graphic3d_Structure.lxx>
564
565
566
567
568
569#endif // _Graphic3d_Structure_HeaderFile