0026885: Visualization - drop redundant aspects from structure level
[occt.git] / src / Graphic3d / Graphic3d_Structure.hxx
index 5cdbfb0..aaf3284 100644 (file)
@@ -38,6 +38,7 @@
 #include <Graphic3d_TypeOfConnection.hxx>
 #include <Graphic3d_MapOfStructure.hxx>
 #include <Graphic3d_TypeOfComposition.hxx>
+#include <Graphic3d_TransformPers.hxx>
 #include <Graphic3d_TransModeFlags.hxx>
 #include <Graphic3d_BndBox4f.hxx>
 #include <Graphic3d_BndBox4d.hxx>
@@ -48,10 +49,6 @@ class Graphic3d_TransformError;
 class Graphic3d_Group;
 class Graphic3d_StructureManager;
 class Quantity_Color;
-class Graphic3d_AspectLine3d;
-class Graphic3d_AspectFillArea3d;
-class Graphic3d_AspectText3d;
-class Graphic3d_AspectMarker3d;
 class Graphic3d_DataStructureManager;
 class Bnd_Box;
 class gp_Pnt;
@@ -77,7 +74,6 @@ public:
   
   //! Creates a graphic object in the manager theManager.
   //! It will appear in all the views of the visualiser.
-  //! Warning: The default values AspectLine, AspectFillArea, AspectText and AspectMarker are NOT applied to the structure.
   //! The structure is not displayed when it is created.
   Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager);
   
@@ -98,11 +94,7 @@ public:
   
   //! Suppresses the structure <me>.
   //! It will be erased at the next screen update.
-  Standard_EXPORT virtual void Destroy();
-~Graphic3d_Structure()
-{
-  Destroy();
-}
+  Standard_EXPORT ~Graphic3d_Structure();
   
   //! Displays the structure <me> in all the views of the visualiser.
   Standard_EXPORT virtual void Display();
@@ -127,8 +119,7 @@ public:
   Standard_EXPORT void Remove();
   
   //! Computes axis-aligned bounding box of a structure.
-  //! Category: Methods to modify the class definition
-  Standard_EXPORT void CalculateBoundBox();
+  Standard_EXPORT virtual void CalculateBoundBox();
   
   //! If <theToSet> is Standard_True then <me> is infinite and
   //! the MinMaxValues method method return :
@@ -176,23 +167,7 @@ public:
   //! Get clip planes slicing the structure on rendering.
   //! @return set of clip planes.
   Standard_EXPORT const Graphic3d_SequenceOfHClipPlane& GetClipPlanes() const;
-  
-  //! Modifies the default attributes for lines
-  //! in the structure <me>.
-  Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
-  
-  //! Modifies the default attributes for faces
-  //! in the structure <me>.
-  Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
-  
-  //! Modifies the default attributes for text
-  //! in the structure <me>.
-  Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
-  
-  //! Modifies the default attributes for markers
-  //! in the structure <me>.
-  Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
-  
+
   //! Modifies the visibility indicator to Standard_True or
   //! Standard_False for the structure <me>.
   //! The default value at the definition of <me> is
@@ -245,10 +220,7 @@ public:
   //! Returns Standard_True if the structure <me> contains
   //! Polygons, Triangles or Quadrangles.
   Standard_EXPORT Standard_Boolean ContainsFacet() const;
-  
-  //! Returns the values of the current default attributes.
-  Standard_EXPORT Handle(Graphic3d_AspectFillArea3d) FillArea3dAspect() const;
-  
+
   //! Returns the groups sequence included in the structure <me> (internal storage).
   Standard_EXPORT const Graphic3d_SequenceOfGroup& Groups() const;
   
@@ -283,24 +255,13 @@ public:
   //! Returns the highlight indicator for the structure <me>.
   Standard_EXPORT virtual Standard_Boolean IsHighlighted() const;
   
-  //! Returns Standard_True if the structure <me> is rotated.
-  //! <=> The transformation != Identity, != Scale, != Translation.
-  Standard_EXPORT Standard_Boolean IsRotated() const;
-  
   //! Returns Standard_True if the structure <me> is transformed.
   //! <=> The transformation != Identity.
   Standard_EXPORT Standard_Boolean IsTransformed() const;
   
   //! Returns the visibility indicator for the structure <me>.
   Standard_EXPORT Standard_Boolean IsVisible() const;
-  
-  //! Returns the values of the current default attributes.
-  Standard_EXPORT Handle(Graphic3d_AspectLine3d) Line3dAspect() const;
-  
-  //! Returns the current group of graphic attributes used
-  //! for 3d marker primitives.
-  Standard_EXPORT Handle(Graphic3d_AspectMarker3d) Marker3dAspect() const;
-  
+
   //! Returns the coordinates of the boundary box of the structure <me>.
   //! If <theToIgnoreInfiniteFlag> is TRUE, the method returns actual graphical
   //! boundaries of the Graphic3d_Group components. Otherwise, the
@@ -311,13 +272,7 @@ public:
   //! Warning: If the structure <me> is empty then the empty box is returned,
   //! If the structure <me> is infinite then the whole box is returned.
   Standard_EXPORT Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
-  
-  //! Returns the current values of the default attributes.
-  Standard_EXPORT void PrimitivesAspect (Handle(Graphic3d_AspectLine3d)& CTXL, Handle(Graphic3d_AspectText3d)& CTXT, Handle(Graphic3d_AspectMarker3d)& CTXM, Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
-  
-  //! Returns the values of the current default attributes.
-  Standard_EXPORT Handle(Graphic3d_AspectText3d) Text3dAspect() const;
-  
+
   //! Returns the visualisation mode for the structure <me>.
   Standard_EXPORT Graphic3d_TypeOfStructure Visual() const;
   
@@ -375,11 +330,7 @@ public:
   Standard_EXPORT void SetHLRValidation (const Standard_Boolean AFlag);
   
   Standard_EXPORT Standard_Boolean HLRValidation() const;
-  
-  //! Returns the type of composition applied to matrices
-  //! of transformation of <me>.
-  Standard_EXPORT Graphic3d_TypeOfComposition Composition() const;
-  
+
   //! Modifies the current local modelling transformation
   //! in the structure <me>.
   //!
@@ -438,7 +389,10 @@ public:
   
   //! Get the current point of relative modelling transform persistence
   Standard_EXPORT gp_Pnt TransformPersistencePoint() const;
-  
+
+  //! @return transform persistence of the presentable object.
+  const Graphic3d_TransformPers& TransformPersistence() const;
+
   //! Sets if the structure location has mutable nature (content or location will be changed regularly).
   Standard_EXPORT void SetMutable (const Standard_Boolean theIsMutable);
   
@@ -491,7 +445,7 @@ public:
 friend class Graphic3d_Group;
 
 
-  DEFINE_STANDARD_RTTI(Graphic3d_Structure,MMgt_TShared)
+  DEFINE_STANDARD_RTTIEXT(Graphic3d_Structure,MMgt_TShared)
 
 protected:
 
@@ -541,12 +495,11 @@ private:
   //! Returns the manager to which <me> is associated.
   Standard_EXPORT Handle(Graphic3d_StructureManager) StructureManager() const;
   
-  //! Calls the Update method of the StructureManager which
-  //! contains the Structure <me>.
-  Standard_EXPORT void Update() const;
-  
-  //! Updates the c structure associated to <me>.
-  Standard_EXPORT void UpdateStructure (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF);
+  //! Calls the Update method of the StructureManager which contains the Structure <me>.
+  //! If theUpdateLayer is true then invalidates bounding box of ZLayer.
+  Standard_EXPORT void Update (const bool theUpdateLayer = false) const;
+
+protected:
 
   Handle(Graphic3d_CStructure) myCStructure;
   Graphic3d_IndexedMapOfAddress myAncestors;