]> OCCT Git - occt-copy.git/commitdiff
0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
authorkgv <kgv@opencascade.com>
Wed, 24 Apr 2019 16:53:17 +0000 (19:53 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 6 May 2019 12:57:56 +0000 (15:57 +0300)
Removed redundant proxy class Prs3d_Presentation - Graphic3d_Structure now should be used directly.
Removed auxiliary class PrsMgr_ModedPresentation holding Structure and Display Mode index (field has been moved to Structure itself),
so that PrsMgr_Presentations (AIS_InteractiveObject::Presentations()) now holds Structures directly.
PrsMgr_Prs proxy class has been removed, and PrsMgr_Presentation now inherits Graphic3d_Structure.

Graphic3d_Structure, maps declarations have been corrected to use class instead of void*, which allowed to avoid redundant casts.
Several methods have been also modified to avoid creating Handle from this pointer.
AIS package headers have been cleaned up from forward declaration of Prs3d_Presentation class.

Fixed dereference of destroyed presentations within connected and HLR computed objects:
- AIS_InteractiveContext::Disconnect() now erases connected presentation.
- Graphic3d_CView::Clear() now removes destructed structures from Computed list.

- fix inaccessibility of PrsMgr_Presentation methods

105 files changed:
dox/dev_guides/upgrade/upgrade.md
src/AIS/AIS.cxx
src/AIS/AIS.hxx
src/AIS/AIS_Chamf2dDimension.hxx
src/AIS/AIS_Chamf3dDimension.hxx
src/AIS/AIS_ConcentricRelation.hxx
src/AIS/AIS_ConnectedInteractive.cxx
src/AIS/AIS_EqualDistanceRelation.hxx
src/AIS/AIS_EqualRadiusRelation.hxx
src/AIS/AIS_FixRelation.hxx
src/AIS/AIS_InteractiveContext.cxx
src/AIS/AIS_InteractiveContext_2.cxx
src/AIS/AIS_InteractiveObject.cxx
src/AIS/AIS_InteractiveObject.hxx
src/AIS/AIS_LengthDimension.hxx
src/AIS/AIS_MaxRadiusDimension.hxx
src/AIS/AIS_MidPointRelation.hxx
src/AIS/AIS_MinRadiusDimension.hxx
src/AIS/AIS_MultipleConnectedInteractive.cxx
src/AIS/AIS_OffsetDimension.hxx
src/AIS/AIS_ParallelRelation.hxx
src/AIS/AIS_PerpendicularRelation.hxx
src/AIS/AIS_PointCloud.cxx
src/AIS/AIS_Relation.hxx
src/AIS/AIS_Shape.cxx
src/AIS/AIS_SymmetricRelation.hxx
src/AIS/AIS_TangentRelation.hxx
src/AIS/AIS_TexturedShape.cxx
src/AIS/AIS_Triangulation.cxx
src/AIS/AIS_Triangulation.hxx
src/DsgPrs/DsgPrs.cxx
src/DsgPrs/DsgPrs.hxx
src/DsgPrs/DsgPrs_AnglePresentation.hxx
src/DsgPrs/DsgPrs_Chamf2dPresentation.hxx
src/DsgPrs/DsgPrs_ConcentricPresentation.hxx
src/DsgPrs/DsgPrs_DiameterPresentation.hxx
src/DsgPrs/DsgPrs_EllipseRadiusPresentation.hxx
src/DsgPrs/DsgPrs_EqualDistancePresentation.hxx
src/DsgPrs/DsgPrs_EqualRadiusPresentation.hxx
src/DsgPrs/DsgPrs_FilletRadiusPresentation.hxx
src/DsgPrs/DsgPrs_FixPresentation.hxx
src/DsgPrs/DsgPrs_IdenticPresentation.hxx
src/DsgPrs/DsgPrs_LengthPresentation.hxx
src/DsgPrs/DsgPrs_MidPointPresentation.hxx
src/DsgPrs/DsgPrs_OffsetPresentation.hxx
src/DsgPrs/DsgPrs_ParalPresentation.hxx
src/DsgPrs/DsgPrs_PerpenPresentation.hxx
src/DsgPrs/DsgPrs_RadiusPresentation.hxx
src/DsgPrs/DsgPrs_ShadedPlanePresentation.hxx
src/DsgPrs/DsgPrs_ShapeDirPresentation.hxx
src/DsgPrs/DsgPrs_SymbPresentation.hxx
src/DsgPrs/DsgPrs_SymmetricPresentation.hxx
src/DsgPrs/DsgPrs_TangentPresentation.hxx
src/DsgPrs/DsgPrs_XYZAxisPresentation.hxx
src/DsgPrs/DsgPrs_XYZPlanePresentation.hxx
src/Graphic3d/FILES
src/Graphic3d/Graphic3d_CView.cxx
src/Graphic3d/Graphic3d_CView.hxx
src/Graphic3d/Graphic3d_IndexedMapOfAddress.hxx [deleted file]
src/Graphic3d/Graphic3d_Structure.cxx
src/Graphic3d/Graphic3d_Structure.hxx
src/Graphic3d/Graphic3d_StructureManager.cxx
src/Graphic3d/Graphic3d_StructureManager.hxx
src/MeshVS/MeshVS_ElementalColorPrsBuilder.hxx
src/MeshVS/MeshVS_Mesh.cxx
src/MeshVS/MeshVS_Mesh.hxx
src/MeshVS/MeshVS_MeshPrsBuilder.hxx
src/MeshVS/MeshVS_NodalColorPrsBuilder.hxx
src/MeshVS/MeshVS_PrsBuilder.hxx
src/MeshVS/MeshVS_TextPrsBuilder.hxx
src/MeshVS/MeshVS_VectorPrsBuilder.hxx
src/Prs3d/FILES
src/Prs3d/Prs3d.hxx
src/Prs3d/Prs3d_Presentation.cxx [deleted file]
src/Prs3d/Prs3d_Presentation.hxx
src/Prs3d/Prs3d_PresentationShadow.cxx
src/Prs3d/Prs3d_PresentationShadow.hxx
src/PrsMgr/FILES
src/PrsMgr/PrsMgr_ModedPresentation.cxx [deleted file]
src/PrsMgr/PrsMgr_ModedPresentation.hxx [deleted file]
src/PrsMgr/PrsMgr_PresentableObject.cxx
src/PrsMgr/PrsMgr_PresentableObject.hxx
src/PrsMgr/PrsMgr_Presentation.cxx
src/PrsMgr/PrsMgr_Presentation.hxx
src/PrsMgr/PrsMgr_PresentationManager.cxx
src/PrsMgr/PrsMgr_PresentationManager.hxx
src/PrsMgr/PrsMgr_Presentations.hxx
src/PrsMgr/PrsMgr_Prs.cxx [deleted file]
src/PrsMgr/PrsMgr_Prs.hxx [deleted file]
src/QABugs/QABugs_PresentableObject.hxx
src/SelectMgr/SelectMgr_SelectableObject.hxx
src/StdPrs/StdPrs_Curve.hxx
src/StdPrs/StdPrs_DeflectionCurve.hxx
src/StdPrs/StdPrs_HLRPolyShape.hxx
src/StdPrs/StdPrs_Plane.hxx
src/StdPrs/StdPrs_PoleCurve.hxx
src/StdPrs/StdPrs_ShadedShape.hxx
src/StdPrs/StdPrs_ShadedSurface.hxx
src/StdPrs/StdPrs_WFDeflectionRestrictedFace.hxx
src/StdPrs/StdPrs_WFDeflectionSurface.hxx
src/StdPrs/StdPrs_WFPoleSurface.hxx
src/StdPrs/StdPrs_WFSurface.hxx
src/StdSelect/StdSelect_Shape.hxx
src/ViewerTest/ViewerTest.cxx
src/XCAFPrs/XCAFPrs_AISObject.cxx

index 1846d04bc9fe488346482bec4ca727d7de6db65b..a01664d375112c60a6f97db0449e21c5c31cfb47 100644 (file)
@@ -1738,6 +1738,12 @@ or updating presentation without recomputation (see *AIS_InteractiveObject::Sync
 * *Aspect_IS_HIDDENLINE* does not implicitly enables drawing mesh edges anymore.
   Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_HIDDENLINE) to get previous behavior of Aspect_IS_HIDDENLINE style.
 
+@subsection upgrade_740_modedprs PrsMgr_ModedPresentation removal
+
+Proxy classes *Prs3d_Presentation*, *PrsMgr_ModedPresentation* and *PrsMgr_Prs* have been removed.
+Code iterating through the list of low-level structures AIS_InteractiveObject::Presentations() should be updated to access PrsMgr_Presentation directly.
+Forward declarations of *Prs3d_Presentation* should be corrected, since it is now a typedef to *Graphic3d_Structure*.
+
 @subsection upgrade_740_geproj Custom defines within env.bat
 
 *env.bat* produced by Visual Studio project generator *genproj.bat* has been modified so that *%CSF_DEFINES%* variable is reset to initial state.
index 60b6067de3c015025205a8e0f8c733c52ec466a7..fa84613c2fdeee59fc2bf0c0f2d76681d26b84d9 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#include <AIS.hxx>
 
 #include <Adaptor3d_HCurve.hxx>
 #include <Adaptor3d_HSurface.hxx>
-#include <AIS.hxx>
 #include <Bnd_Box.hxx>
 #include <BRep_Tool.hxx>
 #include <BRepAdaptor_Curve.hxx>
index 27559d4ec042e93d7719da8d4bdac9bbecbbb300..70cc8ce6a3276222e69e8570fc97e776998f74a8 100644 (file)
 #ifndef _AIS_HeaderFile
 #define _AIS_HeaderFile
 
+#include <AIS_KindOfSurface.hxx>
+#include <Aspect_TypeOfLine.hxx>
+#include <Aspect_TypeOfMarker.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Pnt.hxx>
+#include <Quantity_NameOfColor.hxx>
+#include <Prs3d_Drawer.hxx>
+#include <Prs3d_Presentation.hxx>
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
 
-#include <Standard_Boolean.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Real.hxx>
-#include <AIS_KindOfSurface.hxx>
-#include <Prs3d_Drawer.hxx>
-#include <Quantity_NameOfColor.hxx>
-#include <Aspect_TypeOfLine.hxx>
-#include <Aspect_TypeOfMarker.hxx>
-class gp_Pnt;
-class TopoDS_Shape;
-class gp_Lin;
+class Bnd_Box;
 class Geom_Curve;
-class TopoDS_Edge;
 class Geom_Plane;
-class TopoDS_Vertex;
-class TopoDS_Face;
-class gp_Pln;
 class Geom_Surface;
-class gp_Dir;
-class Bnd_Box;
-class gp_Elips;
-class Prs3d_Presentation;
-class AIS_Triangulation;
-class AIS_InteractiveContext;
-class AIS_GraphicTool;
-class AIS_GlobalStatus;
-class AIS_InteractiveObject;
-class AIS_Point;
-class AIS_Axis;
-class AIS_Trihedron;
-class AIS_PlaneTrihedron;
-class AIS_Line;
-class AIS_Circle;
-class AIS_Plane;
-class AIS_Shape;
-class AIS_ConnectedInteractive;
-class AIS_MultipleConnectedInteractive;
-class AIS_DimensionOwner;
-class AIS_Relation;
-class AIS_EllipseRadiusDimension;
-class AIS_MaxRadiusDimension;
-class AIS_MinRadiusDimension;
-class AIS_Chamf2dDimension;
-class AIS_Chamf3dDimension;
-class AIS_OffsetDimension;
-class AIS_FixRelation;
-class AIS_PerpendicularRelation;
-class AIS_ParallelRelation;
-class AIS_TangentRelation;
-class AIS_ConcentricRelation;
-class AIS_IdenticRelation;
-class AIS_SymmetricRelation;
-class AIS_MidPointRelation;
-class AIS_EqualRadiusRelation;
-class AIS_EqualDistanceRelation;
-class AIS_TypeFilter;
-class AIS_SignatureFilter;
-class AIS_ExclusionFilter;
-class AIS_AttributeFilter;
-class AIS_C0RegularityFilter;
-class AIS_BadEdgeFilter;
-class AIS_Selection;
-
+class TopoDS_Edge;
+class TopoDS_Face;
+class TopoDS_Shape;
+class TopoDS_Vertex;
 
 //! Application Interactive Services provide the means to create links between an application GUI viewer and
 //! the packages which are used to manage selection and presentation.
index d7adc215db000206b3ef7953f9e050fc91dfce5b..278e80c4a4eec59e78dc8a63fd39c1acfa84225e 100644 (file)
 #ifndef _AIS_Chamf2dDimension_HeaderFile
 #define _AIS_Chamf2dDimension_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
-#include <gp_Dir.hxx>
+#include <AIS_KindOfDimension.hxx>
 #include <AIS_Relation.hxx>
-#include <Standard_Real.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-#include <AIS_KindOfDimension.hxx>
-#include <Standard_Boolean.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Shape;
-class Geom_Plane;
-class TCollection_ExtendedString;
-class gp_Pnt;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
+#include <gp_Dir.hxx>
 
+class Geom_Plane;
 
-class AIS_Chamf2dDimension;
 DEFINE_STANDARD_HANDLE(AIS_Chamf2dDimension, AIS_Relation)
 
 //! A framework to define display of 2D chamfers.
@@ -48,10 +32,9 @@ DEFINE_STANDARD_HANDLE(AIS_Chamf2dDimension, AIS_Relation)
 //! chamfer, or the angle if it is not.
 class AIS_Chamf2dDimension : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_Chamf2dDimension, AIS_Relation)
 public:
 
-  
   //! Constructs the display object for 2D chamfers.
   //! This object is defined by the face aFShape, the
   //! dimension aVal, the plane aPlane and the text aText.
@@ -79,18 +62,7 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_Chamf2dDimension,AIS_Relation)
-
-protected:
-
-
-
-
 private:
-
   
   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
@@ -101,14 +73,8 @@ private:
   gp_Pnt myPntAttach;
   gp_Dir myDir;
 
-
 };
 
-
 #include <AIS_Chamf2dDimension.lxx>
 
-
-
-
-
 #endif // _AIS_Chamf2dDimension_HeaderFile
index 50d4ebf70e989f77bc2fbdb38adbaabbc082a02b..1e8c6db2fe63b5d9e40d83e5c2244c1c5e6a19ab 100644 (file)
 #ifndef _AIS_Chamf3dDimension_HeaderFile
 #define _AIS_Chamf3dDimension_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
-#include <gp_Dir.hxx>
+#include <AIS_KindOfDimension.hxx>
 #include <AIS_Relation.hxx>
-#include <Standard_Real.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-#include <AIS_KindOfDimension.hxx>
-#include <Standard_Boolean.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Shape;
-class TCollection_ExtendedString;
-class gp_Pnt;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-
+#include <gp_Dir.hxx>
 
-class AIS_Chamf3dDimension;
 DEFINE_STANDARD_HANDLE(AIS_Chamf3dDimension, AIS_Relation)
 
 //! A framework to define display of 3D chamfers.
@@ -47,10 +30,9 @@ DEFINE_STANDARD_HANDLE(AIS_Chamf3dDimension, AIS_Relation)
 //! chamfer, or the angle if it is not.
 class AIS_Chamf3dDimension : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_Chamf3dDimension, AIS_Relation)
 public:
 
-  
   //! Constructs a display object for 3D chamfers.
   //! This object is defined by the shape aFShape, the
   //! dimension aVal and the text aText.
@@ -78,19 +60,8 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_Chamf3dDimension,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -100,14 +71,8 @@ private:
   gp_Pnt myPntAttach;
   gp_Dir myDir;
 
-
 };
 
-
 #include <AIS_Chamf3dDimension.lxx>
 
-
-
-
-
 #endif // _AIS_Chamf3dDimension_HeaderFile
index 620381a40f24d1b9e8ef2194cf8c8e23c350afff..af88f42ae8fec6dc76dc71824ef926027a6e8e62 100644 (file)
 #ifndef _AIS_ConcentricRelation_HeaderFile
 #define _AIS_ConcentricRelation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
-#include <Standard_Real.hxx>
-#include <gp_Dir.hxx>
 #include <AIS_Relation.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Shape;
-class Geom_Plane;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
+#include <gp_Dir.hxx>
 
+class Geom_Plane;
 
-class AIS_ConcentricRelation;
 DEFINE_STANDARD_HANDLE(AIS_ConcentricRelation, AIS_Relation)
 
 //! A framework to define a constraint by a relation of
@@ -44,10 +31,9 @@ DEFINE_STANDARD_HANDLE(AIS_ConcentricRelation, AIS_Relation)
 //! relation of concentricity can be extended.
 class AIS_ConcentricRelation : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_ConcentricRelation, AIS_Relation)
 public:
 
-  
   //! Constructs the display object for concentric relations
   //! between shapes.
   //! This object is defined by the two shapes, aFShape
@@ -65,19 +51,8 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_ConcentricRelation,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -95,13 +70,6 @@ private:
   gp_Dir myDir;
   gp_Pnt myPnt;
 
-
 };
 
-
-
-
-
-
-
 #endif // _AIS_ConcentricRelation_HeaderFile
index 6a655f6defbd89bbd8f1575285da35f4297ea802..cd58808f1478f8bc5201b863066ea91efd56d0c7 100644 (file)
@@ -23,7 +23,6 @@
 #include <Precision.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_Projector.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <Select3D_SensitiveEntity.hxx>
 #include <SelectMgr_EntityOwner.hxx>
 #include <SelectMgr_Selection.hxx>
@@ -92,12 +91,12 @@ void AIS_ConnectedInteractive::connect (const Handle(AIS_InteractiveObject)& the
 
 void AIS_ConnectedInteractive::Disconnect()
 {
-  for(Standard_Integer aPrsIter = 1; aPrsIter <= myPresentations.Length(); ++aPrsIter)
+  for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const Handle(PrsMgr_Presentation)& aPrs = myPresentations (aPrsIter).Presentation();
+    const Handle(PrsMgr_Presentation)& aPrs = aPrsIter.Value();
     if (!aPrs.IsNull())
     {
-      aPrs->Presentation()->DisconnectAll (Graphic3d_TOC_DESCENDANT);
+      aPrs->DisconnectAll (Graphic3d_TOC_DESCENDANT);
     }
   }
 }
@@ -112,7 +111,7 @@ void AIS_ConnectedInteractive::Compute (const Handle(PrsMgr_PresentationManager3
   if (HasConnection())
   {
     thePrs->Clear (Standard_False);
-    thePrs->RemoveAll();
+    thePrs->DisconnectAll (Graphic3d_TOC_DESCENDANT);
 
     if (!myReference->HasInteractiveContext())
     {
index ab214575013d1155b6b8526c87156f1a4065e0c1..b119072c56e3e50363cd0ba25fec4006e87a2f88 100644 (file)
 #ifndef _AIS_EqualDistanceRelation_HeaderFile
 #define _AIS_EqualDistanceRelation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <TopoDS_Shape.hxx>
-#include <gp_Pnt.hxx>
 #include <AIS_Relation.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-#include <Prs3d_Drawer.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Boolean.hxx>
-#include <DsgPrs_ArrowSide.hxx>
 #include <AIS_TypeOfDist.hxx>
-class TopoDS_Shape;
-class Geom_Plane;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-class TopoDS_Edge;
-class Bnd_Box;
-class gp_Pnt;
-class TopoDS_Vertex;
+#include <DsgPrs_ArrowSide.hxx>
 
+class Geom_Plane;
 
-class AIS_EqualDistanceRelation;
 DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation)
 
 //! A framework to display equivalent distances between
@@ -52,10 +32,9 @@ DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation)
 //! These distances are used to compare shapes by this vector alone.
 class AIS_EqualDistanceRelation : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation)
 public:
 
-  
   //! Constructs a framework to display equivalent
   //! distances between the shapes aShape1, aShape2,
   //! aShape3, aShape4 and the plane aPlane.
@@ -105,19 +84,8 @@ public:
   //! a line or a circle.
   Standard_EXPORT static void ComputeOneEdgeOneVertexLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -135,14 +103,8 @@ private:
   gp_Pnt myPoint3;
   gp_Pnt myPoint4;
 
-
 };
 
-
 #include <AIS_EqualDistanceRelation.lxx>
 
-
-
-
-
 #endif // _AIS_EqualDistanceRelation_HeaderFile
index ae22ff8482e85e26d4ec8b392368dfa37d1921f8..0680585ba270079ab9d3d1c33421296709a067e0 100644 (file)
 #ifndef _AIS_EqualRadiusRelation_HeaderFile
 #define _AIS_EqualRadiusRelation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
 #include <AIS_Relation.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Edge;
-class Geom_Plane;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
 
+class Geom_Plane;
 
-class AIS_EqualRadiusRelation;
 DEFINE_STANDARD_HANDLE(AIS_EqualRadiusRelation, AIS_Relation)
 
-
 class AIS_EqualRadiusRelation : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_EqualRadiusRelation, AIS_Relation)
 public:
 
-  
   //! Creates equal relation of two arc's radiuses.
   //! If one of edges is not in the given plane,
   //! the presentation method projects it onto the plane.
@@ -56,19 +42,8 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_EqualRadiusRelation,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -82,13 +57,6 @@ private:
   gp_Pnt myFirstPoint;
   gp_Pnt mySecondPoint;
 
-
 };
 
-
-
-
-
-
-
 #endif // _AIS_EqualRadiusRelation_HeaderFile
index 39e118381ee35314ed37e8c4a0fcf8c29c4674b4..4ee25eb67b6758771eaf9703f18cd05ac9f2cc2a 100644 (file)
 #ifndef _AIS_FixRelation_HeaderFile
 #define _AIS_FixRelation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <TopoDS_Wire.hxx>
-#include <gp_Pnt.hxx>
 #include <AIS_Relation.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Boolean.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Shape;
-class Geom_Plane;
-class TopoDS_Wire;
-class gp_Pnt;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-class TopoDS_Vertex;
-class Geom_Curve;
-class TopoDS_Edge;
-class gp_Lin;
-class gp_Circ;
 
+class Geom_Plane;
 
-class AIS_FixRelation;
 DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation)
 
 //! Constructs and manages a constraint by a fixed
@@ -55,9 +34,8 @@ DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation)
 //! object.
 class AIS_FixRelation : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_FixRelation, AIS_Relation)
 public:
-
   
   //! initializes the vertex aShape, the
   //! plane aPlane and the wire aWire, which connects
@@ -98,16 +76,6 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_FixRelation,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
   
@@ -141,11 +109,6 @@ private:
 
 };
 
-
 #include <AIS_FixRelation.lxx>
 
-
-
-
-
 #endif // _AIS_FixRelation_HeaderFile
index 737d03ba9617e074841f8396337d589127aa1a63..5e658480e20b6e5212b7f48aa7ac41c7b65cd43f 100644 (file)
@@ -37,7 +37,6 @@
 #include <Prs3d_PlaneAspect.hxx>
 #include <Prs3d_PointAspect.hxx>
 #include <Prs3d_ShadingAspect.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <PrsMgr_PresentableObject.hxx>
 #include <Quantity_Color.hxx>
 #include <SelectMgr_EntityOwner.hxx>
@@ -2447,6 +2446,13 @@ void AIS_InteractiveContext::Disconnect (const Handle(AIS_InteractiveObject)& th
   {
     Handle(AIS_MultipleConnectedInteractive) theObj (Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly));
     theObj->Disconnect (theObjToDisconnect);
+    if (!myObjects.IsBound (theObjToDisconnect))
+    {
+      // connected presentation might contain displayed presentations
+      myMainPM->Erase (theObjToDisconnect, -1);
+      theObjToDisconnect->ErasePresentations (true);
+    }
+
     const Handle(SelectMgr_SelectableObject)& anObj = theObjToDisconnect; // to avoid ambiguity
     mgrSelector->Remove (anObj);
   }
index 1d2f2da9c3cd6e1ad8158ee9e2fa3fb4f4f1ad3d..9ce6fa886fc6bbbc90d1ead31e8b6853e17a6524 100644 (file)
@@ -419,7 +419,7 @@ Standard_Boolean AIS_InteractiveContext::ImmediateAdd (const Handle(AIS_Interact
     return Standard_False;
   }
 
-  myMainPM->AddToImmediateList (myMainPM->Presentation (theObj, theMode)->Presentation());
+  myMainPM->AddToImmediateList (myMainPM->Presentation (theObj, theMode));
   return Standard_True;
 }
 
index cb01b222cc578cc4ca661e38222b718f60bbc212..ccca7490ea2b9602484510194d4f730c0640035a 100644 (file)
@@ -29,7 +29,6 @@
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 #include <Prs3d_TextAspect.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <PrsMgr_PresentationManager.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(AIS_InteractiveObject,SelectMgr_SelectableObject)
@@ -106,9 +105,7 @@ Handle(Prs3d_Presentation) AIS_InteractiveObject::Presentation() const
   }
 
   Handle(PrsMgr_Presentation) aPrs = myCTXPtr->MainPrsMgr()->Presentation (this, myDrawer->DisplayMode(), false);
-  return !aPrs.IsNull()
-       ? aPrs->Presentation()
-       : Handle(Prs3d_Presentation)();
+  return aPrs;
 }
 
 //=======================================================================
index 5330fd6704e82914bbb0bf9e3eb25942c88a303c..4ca80616ed1f2f7178c7cc9392d3f25424bc6b62 100644 (file)
@@ -22,7 +22,6 @@
 
 class AIS_InteractiveContext;
 class Graphic3d_MaterialAspect;
-class Prs3d_Presentation;
 class Prs3d_BasicAspect;
 class Bnd_Box;
 
index 867fe7257e3074f3a33278ee4187d4aaec42220a..90a87201c05881b1e35238e2291158c3543bba66 100755 (executable)
 #include <AIS_Dimension.hxx>
 #include <AIS_KindOfDimension.hxx>
 #include <Geom_Plane.hxx>
-#include <Geom_Transformation.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Dir.hxx>
 #include <Prs3d_DimensionAspect.hxx>
 #include <Prs3d_Drawer.hxx>
-#include <Prs3d_Presentation.hxx>
 #include <Prs3d_Projector.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <SelectMgr_Selection.hxx>
-#include <Standard.hxx>
-#include <Standard_Macro.hxx>
-#include <Standard_Type.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Vertex.hxx>
-#include <TCollection_ExtendedString.hxx>
-
-class TopoDS_Face;
-class TCollection_ExtendedString;
-class gp_Pnt;
-class TopoDS_Edge;
-class TopoDS_Shape;
-class Geom_Plane;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-class SelectMgr_Selection;
-class Bnd_Box;
-class gp_Dir;
-class TopoDS_Vertex;
-class Standard_Transient;
-class AIS_LengthDimension;
 
 DEFINE_STANDARD_HANDLE (AIS_LengthDimension, AIS_Dimension)
 
index 435e58b4246d81a3703b7946f8e9280395c22d02..cdb5976cb960671a46b48c87bc3e46dfd9f94eaa 100644 (file)
 #ifndef _AIS_MaxRadiusDimension_HeaderFile
 #define _AIS_MaxRadiusDimension_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
 #include <AIS_EllipseRadiusDimension.hxx>
-#include <Standard_Real.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class Standard_ConstructionError;
-class TopoDS_Shape;
-class TCollection_ExtendedString;
-class gp_Pnt;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-
 
-class AIS_MaxRadiusDimension;
 DEFINE_STANDARD_HANDLE(AIS_MaxRadiusDimension, AIS_EllipseRadiusDimension)
 
-
 //! Ellipse  Max  radius  dimension  of  a  Shape  which  can  be  Edge
 //! or  Face  (planar  or  cylindrical(surface  of  extrusion  or
 //! surface  of  offset))
 class AIS_MaxRadiusDimension : public AIS_EllipseRadiusDimension
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_MaxRadiusDimension, AIS_EllipseRadiusDimension)
 public:
 
-  
   //! Max  Ellipse  radius dimension
   //! Shape  can  be  edge  ,  planar  face  or  cylindrical  face
   Standard_EXPORT AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
@@ -66,19 +47,8 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_MaxRadiusDimension,AIS_EllipseRadiusDimension)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -93,13 +63,6 @@ private:
   gp_Pnt myApexN;
   gp_Pnt myEndOfArrow;
 
-
 };
 
-
-
-
-
-
-
 #endif // _AIS_MaxRadiusDimension_HeaderFile
index e2f814f287c26afb355bd39ed16a4d13991b3325..cbe4b9901c7edcc79dee17c7ccd6dbc2663d9516 100644 (file)
 #ifndef _AIS_MidPointRelation_HeaderFile
 #define _AIS_MidPointRelation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <TopoDS_Shape.hxx>
-#include <gp_Pnt.hxx>
 #include <AIS_Relation.hxx>
-#include <Standard_Boolean.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Shape;
+
 class Geom_Plane;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
 class gp_Lin;
 class gp_Pnt;
 class gp_Circ;
 class gp_Elips;
 
-
-class AIS_MidPointRelation;
 DEFINE_STANDARD_HANDLE(AIS_MidPointRelation, AIS_Relation)
 
 //! presentation of equal distance to point myMidPoint
 class AIS_MidPointRelation : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_MidPointRelation, AIS_Relation)
 public:
 
-  
   Standard_EXPORT AIS_MidPointRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
   
     virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
@@ -64,19 +49,8 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_MidPointRelation,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -118,14 +92,8 @@ private:
   gp_Pnt mySecondPnt1;
   gp_Pnt mySecondPnt2;
 
-
 };
 
-
 #include <AIS_MidPointRelation.lxx>
 
-
-
-
-
 #endif // _AIS_MidPointRelation_HeaderFile
index dafc902942f2e1943cc5934b205da072c809baa9..edfb4bf5fecf21cef972385f7ca54948eedd1314 100644 (file)
 #ifndef _AIS_MinRadiusDimension_HeaderFile
 #define _AIS_MinRadiusDimension_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
 #include <AIS_EllipseRadiusDimension.hxx>
-#include <Standard_Real.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class Standard_ConstructionError;
-class TopoDS_Shape;
-class TCollection_ExtendedString;
-class gp_Pnt;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-
 
-class AIS_MinRadiusDimension;
 DEFINE_STANDARD_HANDLE(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension)
 
 //! --  Ellipse  Min  radius  dimension  of  a  Shape  which
@@ -44,10 +27,9 @@ DEFINE_STANDARD_HANDLE(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension)
 //! extrusion  or  surface  of  offset))
 class AIS_MinRadiusDimension : public AIS_EllipseRadiusDimension
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension)
 public:
 
-  
   //! Max  Ellipse  radius dimension
   //! Shape  can  be  edge  ,  planar  face  or  cylindrical  face
   Standard_EXPORT AIS_MinRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
@@ -65,18 +47,7 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_MinRadiusDimension,AIS_EllipseRadiusDimension)
-
-protected:
-
-
-
-
 private:
-
   
   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
@@ -92,13 +63,6 @@ private:
   gp_Pnt myApexN;
   gp_Pnt myEndOfArrow;
 
-
 };
 
-
-
-
-
-
-
 #endif // _AIS_MinRadiusDimension_HeaderFile
index bd749ce522552be1650fc046a7d48b6e42436f12..0776e7d3f70b754c29d5590d4e000ea9edc01168 100644 (file)
@@ -20,7 +20,6 @@
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_InteractiveObject.hxx>
 #include <Prs3d_Projector.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <Select3D_SensitiveEntity.hxx>
 #include <SelectMgr_EntityOwner.hxx>
 #include <Standard_NotImplemented.hxx>
index 5230255a2f57c1c74ea7dfa86001b19591bff77d..5c769ec477d2a2306188b5578d51825d8791e8e3 100644 (file)
 #ifndef _AIS_OffsetDimension_HeaderFile
 #define _AIS_OffsetDimension_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Trsf.hxx>
 #include <AIS_Relation.hxx>
-#include <Standard_Real.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
 #include <AIS_KindOfDimension.hxx>
-#include <Standard_Boolean.hxx>
-class TopoDS_Shape;
-class TCollection_ExtendedString;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-class gp_Trsf;
-
 
-class AIS_OffsetDimension;
 DEFINE_STANDARD_HANDLE(AIS_OffsetDimension, AIS_Relation)
 
 //! A framework to display dimensions of offsets.
@@ -48,10 +29,9 @@ DEFINE_STANDARD_HANDLE(AIS_OffsetDimension, AIS_Relation)
 //! and the basis shape.
 class AIS_OffsetDimension : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_OffsetDimension, AIS_Relation)
 public:
 
-  
   //! Constructs the offset display object defined by the
   //! first shape aFShape, the second shape aSShape, the
   //! dimension aVal, and the text aText.
@@ -77,19 +57,8 @@ public:
   //! selection to a relative position.
     void SetRelativePos (const gp_Trsf& aTrsf);
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_OffsetDimension,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -108,14 +77,8 @@ private:
   gp_Dir myDirAttach2;
   gp_Trsf myRelativePos;
 
-
 };
 
-
 #include <AIS_OffsetDimension.lxx>
 
-
-
-
-
 #endif // _AIS_OffsetDimension_HeaderFile
index 0f821bbf7df57319a66725671b225cce2e553900..2dcc2d1aa20b0556b71736d028e4dde87e757d1f 100644 (file)
 #ifndef _AIS_ParallelRelation_HeaderFile
 #define _AIS_ParallelRelation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
-#include <gp_Dir.hxx>
 #include <AIS_Relation.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Boolean.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Shape;
-class Geom_Plane;
-class gp_Pnt;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-
 
-class AIS_ParallelRelation;
 DEFINE_STANDARD_HANDLE(AIS_ParallelRelation, AIS_Relation)
 
 //! A framework to display constraints of parallelism
@@ -45,7 +27,7 @@ DEFINE_STANDARD_HANDLE(AIS_ParallelRelation, AIS_Relation)
 //! entities can be faces or edges.
 class AIS_ParallelRelation : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_ParallelRelation, AIS_Relation)
 public:
 
   
@@ -73,19 +55,8 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_ParallelRelation,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -100,14 +71,8 @@ private:
   gp_Pnt mySAttach;
   gp_Dir myDirAttach;
 
-
 };
 
-
 #include <AIS_ParallelRelation.lxx>
 
-
-
-
-
 #endif // _AIS_ParallelRelation_HeaderFile
index 83de38c925cf64326a070ee7f27a31ef0afdd391..574091886a8760213b82bca0caeb622966564068 100644 (file)
 #ifndef _AIS_PerpendicularRelation_HeaderFile
 #define _AIS_PerpendicularRelation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
 #include <AIS_Relation.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Shape;
-class Geom_Plane;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-
 
-class AIS_PerpendicularRelation;
 DEFINE_STANDARD_HANDLE(AIS_PerpendicularRelation, AIS_Relation)
 
 //! A framework to display constraints of perpendicularity
@@ -40,10 +26,9 @@ DEFINE_STANDARD_HANDLE(AIS_PerpendicularRelation, AIS_Relation)
 //! datums can be edges or faces.
 class AIS_PerpendicularRelation : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_PerpendicularRelation, AIS_Relation)
 public:
 
-  
   //! Constructs an object to display constraints of
   //! perpendicularity on shapes.
   //! This object is defined by a first shape aFShape, a
@@ -68,16 +53,6 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_PerpendicularRelation,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
   
@@ -94,13 +69,6 @@ private:
   gp_Pnt myFAttach;
   gp_Pnt mySAttach;
 
-
 };
 
-
-
-
-
-
-
 #endif // _AIS_PerpendicularRelation_HeaderFile
index ffce06c13bad2f65bd41c70d2b7e6ec041f3b087..a395b0de4e34d0b5f929fc21882146d3a0f008ba 100644 (file)
@@ -24,7 +24,6 @@
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_ShadingAspect.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <PrsMgr_Presentations.hxx>
 #include <Select3D_SensitiveBox.hxx>
 #include <Select3D_SensitivePrimitiveArray.hxx>
index 2ccd6db16e01da093c3fff8072f41b72c5ce8c99..4246abf45482cbb1d7e2738de698d0e1c52337e0 100644 (file)
@@ -27,7 +27,6 @@
 #include <DsgPrs_ArrowSide.hxx>
 #include <gp_Pln.hxx>
 #include <gp_Pnt.hxx>
-#include <PrsMgr_TypeOfPresentation3d.hxx>
 #include <TCollection_ExtendedString.hxx>
 #include <TopoDS_Shape.hxx>
 
index e6f75cb1edebbb52c91618b7b7d7f709d392ccf4..35202da2d970a25b6d877c27a1906e4103b5652e 100644 (file)
@@ -48,7 +48,6 @@
 #include <Prs3d_ShadingAspect.hxx>
 #include <StdPrs_BndBox.hxx>
 #include <StdPrs_ToolTriangulatedShape.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <Quantity_Color.hxx>
 #include <Select3D_SensitiveBox.hxx>
 #include <Select3D_SensitiveEntity.hxx>
index e0487ba28a040804fb16743fec6202a2218b3d62..dcbc2cdd9f1518b534aaf61ad6874db2205b302a 100644 (file)
 #ifndef _AIS_SymmetricRelation_HeaderFile
 #define _AIS_SymmetricRelation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <TopoDS_Shape.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Dir.hxx>
 #include <AIS_Relation.hxx>
-#include <Standard_Boolean.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Shape;
-class Geom_Plane;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-
 
-class AIS_SymmetricRelation;
 DEFINE_STANDARD_HANDLE(AIS_SymmetricRelation, AIS_Relation)
 
 //! A framework to display constraints of symmetricity
@@ -44,10 +30,9 @@ DEFINE_STANDARD_HANDLE(AIS_SymmetricRelation, AIS_Relation)
 //! shapes of which the datums are parts.
 class AIS_SymmetricRelation : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_SymmetricRelation, AIS_Relation)
 public:
 
-  
   //! Constructs an object to display constraints of symmetricity.
   //! This object is defined by a tool aSymmTool, a first
   //! shape FirstShape, a second shape SecondShape, and a plane aPlane.
@@ -79,19 +64,8 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_SymmetricRelation,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -110,14 +84,8 @@ private:
   gp_Dir myFDirAttach;
   gp_Dir myAxisDirAttach;
 
-
 };
 
-
 #include <AIS_SymmetricRelation.lxx>
 
-
-
-
-
 #endif // _AIS_SymmetricRelation_HeaderFile
index 032d5ede81050fef07031fb335782fd3105075ff..e19703551ea5f2d1715b20a6dc1d62f15dd5773b 100644 (file)
 #ifndef _AIS_TangentRelation_HeaderFile
 #define _AIS_TangentRelation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
-#include <gp_Dir.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Integer.hxx>
 #include <AIS_Relation.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <SelectMgr_Selection.hxx>
-class TopoDS_Shape;
-class Geom_Plane;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
-
 
-class AIS_TangentRelation;
 DEFINE_STANDARD_HANDLE(AIS_TangentRelation, AIS_Relation)
 
 //! A framework to display tangency constraints between
@@ -42,10 +26,9 @@ DEFINE_STANDARD_HANDLE(AIS_TangentRelation, AIS_Relation)
 //! The datums are normally faces or edges.
 class AIS_TangentRelation : public AIS_Relation
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_TangentRelation, AIS_Relation)
 public:
 
-  
   //! TwoFacesTangent or TwoEdgesTangent relation
   //! Constructs an object to display tangency constraints.
   //! This object is defined by the first shape aFShape, the
@@ -79,19 +62,8 @@ public:
   //! to the object to display before computation  !!!
   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(AIS_TangentRelation,AIS_Relation)
-
-protected:
-
-
-
-
 private:
 
-  
   Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
   
   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -107,13 +79,6 @@ private:
   Standard_Real myLength;
   Standard_Integer myExternRef;
 
-
 };
 
-
-
-
-
-
-
 #endif // _AIS_TangentRelation_HeaderFile
index 1baa8418c00ebb07abf2f6fad635d3e83b2dbeb6..00b1c226955cf39ff5cd5814a151f45f646e7e9f 100644 (file)
@@ -28,7 +28,6 @@
 #include <Precision.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_Presentation.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <Prs3d_ShadingAspect.hxx>
@@ -199,14 +198,12 @@ void AIS_TexturedShape::SetColor (const Quantity_Color& theColor)
 {
   AIS_Shape::SetColor (theColor);
 
-  for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
+  for (PrsMgr_Presentations::Iterator aPrsIter (Presentations()); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
-
-    if (aPrsModed.Mode() != 3)
-      continue;
-
-    updateAttributes (aPrsModed.Presentation()->Presentation());
+    if (aPrsIter.Value()->Mode() == 3)
+    {
+      updateAttributes (aPrsIter.Value());
+    }
   }
 }
 
@@ -228,15 +225,12 @@ void AIS_TexturedShape::UnsetColor()
 void AIS_TexturedShape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
 {
   AIS_Shape::SetMaterial (theMat);
-
-  for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
+  for (PrsMgr_Presentations::Iterator aPrsIter (Presentations()); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
-    
-    if (aPrsModed.Mode() != 3)
-      continue;
-    
-    updateAttributes (aPrsModed.Presentation()->Presentation());
+    if (aPrsIter.Value()->Mode() == 3)
+    {
+      updateAttributes (aPrsIter.Value());
+    }
   }
 }
 
@@ -247,15 +241,12 @@ void AIS_TexturedShape::SetMaterial (const Graphic3d_MaterialAspect& theMat)
 void AIS_TexturedShape::UnsetMaterial()
 {
   AIS_Shape::UnsetMaterial();
-
-  for (Standard_Integer aPrsIt = 1; aPrsIt <= Presentations().Length(); ++aPrsIt)
+  for (PrsMgr_Presentations::Iterator aPrsIter (Presentations()); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aPrsModed = Presentations().Value (aPrsIt);
-
-    if (aPrsModed.Mode() != 3)
-      continue;
-
-    updateAttributes (aPrsModed.Presentation()->Presentation());
+    if (aPrsIter.Value()->Mode() == 3)
+    {
+      updateAttributes (aPrsIter.Value());
+    }
   }
 }
 
index 0ff986f3b65ef58f72d3ae590e07ea1ec87e26f7..20e39471e6e5e78595e123c18631c59821bbd97c 100644 (file)
@@ -95,16 +95,14 @@ void AIS_Triangulation::updatePresentation()
     // modify shading presentation without re-computation
     const PrsMgr_Presentations&        aPrsList  = Presentations();
     Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->ShadingAspect()->Aspect();
-    for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
+    for (PrsMgr_Presentations::Iterator aPrsIter (aPrsList); aPrsIter.More(); aPrsIter.Next())
     {
-      const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
-      if (aPrsModed.Mode() != AIS_WireFrame)
+      if (aPrsIter.Value()->Mode() != AIS_WireFrame)
       {
         continue;
       }
 
-      const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-
+      const Handle(Prs3d_Presentation)& aPrs = aPrsIter.Value();
       for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
       {
         const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
index d602e924806ae9a4486cce199bf95d2497a17237..9961a21582ef89f829f37f02ae06eb63dd01b963 100644 (file)
 #ifndef _AIS_Triangulation_HeaderFile
 #define _AIS_Triangulation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <TColStd_HArray1OfInteger.hxx>
-#include <Standard_Integer.hxx>
 #include <AIS_InteractiveObject.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <SelectMgr_Selection.hxx>
-#include <Standard_Real.hxx>
-class Poly_Triangulation;
-class Prs3d_Presentation;
 
+class Poly_Triangulation;
 
-class AIS_Triangulation;
 DEFINE_STANDARD_HANDLE(AIS_Triangulation, AIS_InteractiveObject)
 
 //! Interactive object that draws data from  Poly_Triangulation, optionally with colors associated
@@ -38,10 +29,9 @@ DEFINE_STANDARD_HANDLE(AIS_Triangulation, AIS_InteractiveObject)
 //! Interactive selection of triangles and vertices is not yet implemented.
 class AIS_Triangulation : public AIS_InteractiveObject
 {
-
+  DEFINE_STANDARD_RTTIEXT(AIS_Triangulation, AIS_InteractiveObject)
 public:
 
-  
   //! Constructs the Triangulation display object
   Standard_EXPORT AIS_Triangulation(const Handle(Poly_Triangulation)& aTriangulation);
   
@@ -73,8 +63,6 @@ public:
   //! Removes the setting for transparency in the reconstructed compound shape.
   Standard_EXPORT virtual void UnsetTransparency() Standard_OVERRIDE;
 
-  DEFINE_STANDARD_RTTIEXT(AIS_Triangulation,AIS_InteractiveObject)
-
 protected:
 
   Standard_EXPORT void updatePresentation();
@@ -101,13 +89,6 @@ private:
   Standard_Integer myNbNodes;
   Standard_Integer myNbTriangles;
 
-
 };
 
-
-
-
-
-
-
 #endif // _AIS_Triangulation_HeaderFile
index 5fd2844f830bae0d8e13c3c961ce6672d1e66fbe..38aece8c4369481f816b56275b03bcd8a6b8e344 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+#include <DsgPrs.hxx>
+
 #include <Aspect_TypeOfLine.hxx>
 #include <Aspect_TypeOfMarker.hxx>
-#include <DsgPrs.hxx>
 #include <ElCLib.hxx>
 #include <gce_MakeLin.hxx>
 #include <Geom_Circle.hxx>
index 94cd890db39939ba71ca85f5e7a05d60f0e4ca8b..06cc1f2034a43330b1310bd7ef2201cd022fd98b 100644 (file)
 #ifndef _DsgPrs_HeaderFile
 #define _DsgPrs_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <DsgPrs_ArrowSide.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Real.hxx>
-class Prs3d_Presentation;
-class Prs3d_DimensionAspect;
-class gp_Pnt;
-class gp_Dir;
-class gp_Pln;
-class Geom_Surface;
-class Geom_Curve;
-class gp_Ax1;
-class gp_Circ;
-class gp_Elips;
-class DsgPrs_EllipseRadiusPresentation;
-class DsgPrs_LengthPresentation;
-class DsgPrs_RadiusPresentation;
-class DsgPrs_DiameterPresentation;
-class DsgPrs_FilletRadiusPresentation;
-class DsgPrs_AnglePresentation;
-class DsgPrs_Chamf2dPresentation;
-class DsgPrs_ParalPresentation;
-class DsgPrs_PerpenPresentation;
-class DsgPrs_SymmetricPresentation;
-class DsgPrs_MidPointPresentation;
-class DsgPrs_TangentPresentation;
-class DsgPrs_ConcentricPresentation;
-class DsgPrs_FixPresentation;
-class DsgPrs_IdenticPresentation;
-class DsgPrs_EqualRadiusPresentation;
-class DsgPrs_EqualDistancePresentation;
-class DsgPrs_SymbPresentation;
-class DsgPrs_ShapeDirPresentation;
-class DsgPrs_OffsetPresentation;
-class DsgPrs_XYZAxisPresentation;
-class DsgPrs_XYZPlanePresentation;
-class DsgPrs_ShadedPlanePresentation;
+#include <gp_Dir.hxx>
+#include <gp_Pnt.hxx>
+#include <Prs3d_Presentation.hxx>
 
+class Geom_Curve;
+class Geom_Surface;
+class Prs3d_DimensionAspect;
 
 //! Describes Standard Presentations for DsgIHM objects
 class DsgPrs 
@@ -66,7 +33,6 @@ public:
 
   DEFINE_STANDARD_ALLOC
 
-  
   //! draws symbols ((one or two) arrows,(one or two)points
   //! at thebeginning and at the end of the dimension
   Standard_EXPORT static void ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_DimensionAspect)& anAspect, const gp_Pnt& pt1, const gp_Pnt& pt2, const gp_Dir& dir1, const gp_Dir& dir2, const DsgPrs_ArrowSide ArrowSide, const Standard_Boolean drawFromCenter = Standard_True);
@@ -88,50 +54,6 @@ public:
   //! computes  length  of  ellipse  arc  in  parametric  units
   Standard_EXPORT static Standard_Real DistanceFromApex (const gp_Elips& elips, const gp_Pnt& Apex, const Standard_Real par);
 
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
-
-friend class DsgPrs_EllipseRadiusPresentation;
-friend class DsgPrs_LengthPresentation;
-friend class DsgPrs_RadiusPresentation;
-friend class DsgPrs_DiameterPresentation;
-friend class DsgPrs_FilletRadiusPresentation;
-friend class DsgPrs_AnglePresentation;
-friend class DsgPrs_Chamf2dPresentation;
-friend class DsgPrs_ParalPresentation;
-friend class DsgPrs_PerpenPresentation;
-friend class DsgPrs_SymmetricPresentation;
-friend class DsgPrs_MidPointPresentation;
-friend class DsgPrs_TangentPresentation;
-friend class DsgPrs_ConcentricPresentation;
-friend class DsgPrs_FixPresentation;
-friend class DsgPrs_IdenticPresentation;
-friend class DsgPrs_EqualRadiusPresentation;
-friend class DsgPrs_EqualDistancePresentation;
-friend class DsgPrs_SymbPresentation;
-friend class DsgPrs_ShapeDirPresentation;
-friend class DsgPrs_OffsetPresentation;
-friend class DsgPrs_XYZAxisPresentation;
-friend class DsgPrs_XYZPlanePresentation;
-friend class DsgPrs_ShadedPlanePresentation;
-
 };
 
-
-
-
-
-
-
 #endif // _DsgPrs_HeaderFile
index 4f4f6b7d8742c52dddaa7f9f3240f39914c4d84c..aeb4d2c5d1e440652272d6d55421b799e0d9c185 100644 (file)
@@ -25,7 +25,8 @@
 #include <Standard_Real.hxx>
 #include <DsgPrs_ArrowSide.hxx>
 #include <Standard_Boolean.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Circ;
 class gp_Pnt;
index 0b8e3efd66cde1ea6ea15316b255fd3eb66b5cb1..2f438293917de05504fef49a516bb5a31d8b7e32 100644 (file)
 
 #include <Prs3d_Drawer.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class gp_Pnt;
 class TCollection_ExtendedString;
 
-
 //! Framework for display of 2D chamfers.
 class DsgPrs_Chamf2dPresentation 
 {
index 99b411a6f968649743b141607adf3d0b81c6ce13..893a56852fd2c80dc248b97a4f3c6abf976357ef 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Real.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class gp_Pnt;
 class gp_Dir;
 
-
 //! A framework to define display of relations of concentricity.
 class DsgPrs_ConcentricPresentation 
 {
index f957b6b2ad04ba54792291d43689b2ab728b9b0b..5cd24f3400828ba9b644332263f0097ff49b68f3 100644 (file)
@@ -23,9 +23,8 @@
 
 #include <Prs3d_Drawer.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Real.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Pnt;
 class gp_Circ;
index 29682dc32f3484b803c7f73b81a3b5a96a760884..bcd3cb15ce5a08e4457717d435164e709643c73f 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Boolean.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Pnt;
 class gp_Elips;
 class Geom_OffsetCurve;
 
-
-
 class DsgPrs_EllipseRadiusPresentation 
 {
 public:
index 01956302aee33bad5dc59f85d6f4d984c3830b8a..42108c8985b9800c60b8b2f75e2fc520d83f884b 100644 (file)
 
 #include <Prs3d_Drawer.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class gp_Pnt;
 class Geom_Plane;
 class gp_Dir;
 class gp_Circ;
 
-
 //! A framework to display equal distances between shapes and a given plane.
 //! The distance is the length of a projection from the shape to the plane.
 //! These distances are used to compare two shapes by this vector alone.
index dfcc6463f5d1d53b853e0ce02b0c064689e47632..802409b7975378264d9df24f6a071ea382af4a7b 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class gp_Pnt;
 class Geom_Plane;
 
-
 //! A framework to define display of equality in radii.
 class DsgPrs_EqualRadiusPresentation 
 {
index 674e6ad1977af6696e7f9ad3edcf62dcc69e62c3..e7ed0b645638ff3b4291edc4843d9028a005407a 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Real.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-#include <Standard_Boolean.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Pnt;
 class gp_Dir;
 class Geom_TrimmedCurve;
 
-
 //! A framework for displaying radii of fillets.
 class DsgPrs_FilletRadiusPresentation 
 {
index e9feff8530f523ed04b808fcea9b12a801b6f998..840a9664a690c3458639a30c29ad5ca53e1f562f 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Real.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class gp_Pnt;
 class gp_Dir;
 
-
 //! class which draws the presentation of Fixed objects
 class DsgPrs_FixPresentation 
 {
index 436353bc0f30c453909d4f1cbdcbaf452f19c61d..b40774496063519175fde7da8d787cfc49265a58 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Pnt;
 class gp_Ax2;
 class gp_Elips;
 
-
-
 class DsgPrs_IdenticPresentation 
 {
 public:
index e7f797d49d91b214183b07dfbdf2e2a2484db096..0af13a36e86dcecfbc4399858e1c04d391aaf09c 100644 (file)
 
 #include <Prs3d_Drawer.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Pnt;
 class gp_Dir;
 class gp_Pln;
 class Geom_Surface;
 
-
 //! Framework for displaying lengths.
 //! The length displayed is indicated by line segments
 //! and text alone or by a combination of line segment,
index bd16c1a449772aa0fd83a3d9dced75e39ff332f1..c12af42d88c48b18c8c2067ce645e1cd14c3b6ae 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Boolean.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class gp_Ax2;
 class gp_Pnt;
 class gp_Circ;
 class gp_Elips;
 
-
-
 class DsgPrs_MidPointPresentation 
 {
 public:
index 364cba37e1e9fc8ac6a277f435bdfabc5df7ebe2..e141da92943a09ea66970eb2aa74bb464e99499c 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Pnt;
 class gp_Dir;
 
-
 //! A framework to define display of offsets.
 class DsgPrs_OffsetPresentation 
 {
index d781f225b2037024fe7b0550f43035f597fb3169..bfbf9efc77908d4dfc203c1966352b729a489d9d 100644 (file)
 #ifndef _DsgPrs_ParalPresentation_HeaderFile
 #define _DsgPrs_ParalPresentation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Drawer.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Pnt;
 class gp_Dir;
 
-
 //! A framework to define display of relations of parallelism between shapes.
 class DsgPrs_ParalPresentation 
 {
index 5f94a74b87b3c8feadef04868bc4c4b50edc5353..799363c437c89b89b2a31dc195d07068fb9aec39 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Boolean.hxx>
-class Prs3d_Presentation;
-class gp_Pnt;
+#include <Prs3d_Presentation.hxx>
 
+class gp_Pnt;
 
 //! A framework to define display of perpendicular
 //! constraints between shapes.
index 911708943454d26f0b6e4332154d53053ee50412..15afa61f59422aa949f234c1962e107e7608361a 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Boolean.hxx>
 #include <DsgPrs_ArrowSide.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Pnt;
 class gp_Circ;
index b335a4c39c13f96fd45cca83994cfca04c1de8bd..1e94db7a553c8e9eb36a085eb59944f79075b161 100644 (file)
@@ -22,9 +22,9 @@
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
-class gp_Pnt;
+#include <Prs3d_Presentation.hxx>
 
+class gp_Pnt;
 
 //! A framework to define display of shaded planes.
 class DsgPrs_ShadedPlanePresentation 
index 83bb3fbc477c4bf8902c04058220586fe9402e0f..5b781683c4564519812e24aaf2fc7e84dcadf427 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Integer.hxx>
-class Prs3d_Presentation;
-class TopoDS_Shape;
+#include <Prs3d_Presentation.hxx>
 
+class TopoDS_Shape;
 
 //! A framework to define display of the normal to the
 //! surface of a shape.
index 2e4988b50c71d044bbdc6b87c53fe825dd90dbc2..34a3d2475af903502989a7f9e22d0a9c5014f9d3 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class TCollection_ExtendedString;
 class gp_Pnt;
 
-
 //! A framework to define display of symbols.
 class DsgPrs_SymbPresentation 
 {
index 67cb6d9bcc8b55249746984f1e80c7a33ab94728..854ec893723c35ff7baa069deded6123af3e89fc 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class gp_Pnt;
 class gp_Dir;
 class gp_Lin;
 class gp_Circ;
 
-
 //! A framework to define display of symmetry between shapes.
 class DsgPrs_SymmetricPresentation 
 {
index 4e8ad8488188080054d0a216ebdb388b251efb48..99067d3361141107ca4f18fcfd549dcfa3e12451 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Real.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class gp_Pnt;
 class gp_Dir;
 
-
 //! A framework to define display of tangents.
 class DsgPrs_TangentPresentation 
 {
index 441161d4a71f880799c30d213f3058b6d35e5a28..b1f3b580c68000a45291ce2df9e4f2e79c01cdd0 100644 (file)
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
 
-#include <Standard_Real.hxx>
 #include <Standard_CString.hxx>
-class Prs3d_Presentation;
+#include <Prs3d_Presentation.hxx>
+
 class Prs3d_LineAspect;
 class gp_Dir;
 class gp_Pnt;
 class Prs3d_ArrowAspect;
 class Prs3d_TextAspect;
 
-
 //! A framework for displaying the axes of an XYZ trihedron.
 class DsgPrs_XYZAxisPresentation 
 {
index 645082d52916a1d9fea246bb6e409309df04f012..8becdd159c73298a5fcc3b8af7063701f6c850a7 100644 (file)
@@ -22,9 +22,9 @@
 #include <Standard_Handle.hxx>
 
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
-class gp_Pnt;
+#include <Prs3d_Presentation.hxx>
 
+class gp_Pnt;
 
 //! A framework for displaying the planes of an XYZ trihedron.
 class DsgPrs_XYZPlanePresentation 
index 711dbe8a0f9a28b05f3e7cfa68d495a25a99fae1..f3e0acb83f87ed18677f4ebc14c643ad2d495189 100755 (executable)
@@ -76,7 +76,6 @@ Graphic3d_PresentationAttributes.cxx
 Graphic3d_HorizontalTextAlignment.hxx
 Graphic3d_IndexBuffer.hxx
 Graphic3d_MutableIndexBuffer.hxx
-Graphic3d_IndexedMapOfAddress.hxx
 Graphic3d_LevelOfTextureAnisotropy.hxx
 Graphic3d_LightSet.cxx
 Graphic3d_LightSet.hxx
index d5dac3a0e0968db96e421500e5858cdf4ff05eef..7b7f9e3f6d998d44907b06b12b1df49843333227 100644 (file)
@@ -620,7 +620,7 @@ void Graphic3d_CView::Compute()
 // function : Clear
 // purpose  :
 // =======================================================================
-void Graphic3d_CView::Clear (const Handle(Graphic3d_Structure)& theStructure,
+void Graphic3d_CView::Clear (Graphic3d_Structure* theStructure,
                              const Standard_Boolean theWithDestruction)
 {
   const Standard_Integer anIndex = IsComputed (theStructure);
@@ -636,8 +636,8 @@ void Graphic3d_CView::Clear (const Handle(Graphic3d_Structure)& theStructure,
 // function : Connect
 // purpose  :
 // =======================================================================
-void Graphic3d_CView::Connect (const Handle(Graphic3d_Structure)& theMother,
-                               const Handle(Graphic3d_Structure)& theDaughter)
+void Graphic3d_CView::Connect (const Graphic3d_Structure* theMother,
+                               const Graphic3d_Structure* theDaughter)
 {
   Standard_Integer anIndexM = IsComputed (theMother);
   Standard_Integer anIndexD = IsComputed (theDaughter);
@@ -654,8 +654,8 @@ void Graphic3d_CView::Connect (const Handle(Graphic3d_Structure)& theMother,
 // function : Disconnect
 // purpose  :
 // =======================================================================
-void Graphic3d_CView::Disconnect (const Handle(Graphic3d_Structure)& theMother,
-                                  const Handle(Graphic3d_Structure)& theDaughter)
+void Graphic3d_CView::Disconnect (const Graphic3d_Structure* theMother,
+                                  const Graphic3d_Structure* theDaughter)
 {
   Standard_Integer anIndexM = IsComputed (theMother);
   Standard_Integer anIndexD = IsComputed (theDaughter);
@@ -850,25 +850,25 @@ void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure)
     return;
   }
 
-  Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (theStructure->Visual());
-  if (!ComputedMode())
-  {
-    anAnswer = Graphic3d_TOA_YES;
-  }
-
+  const Graphic3d_TypeOfAnswer anAnswer = myIsInComputedMode ? acceptDisplay (theStructure->Visual()) : Graphic3d_TOA_YES;
   if (anAnswer != Graphic3d_TOA_COMPUTE)
   {
     eraseStructure (theStructure->CStructure());
   }
-  else if (anAnswer == Graphic3d_TOA_COMPUTE && myIsInComputedMode)
+
+  const Standard_Integer anIndex = !myStructsToCompute.IsEmpty() ? IsComputed (theStructure) : 0;
+  if (anIndex != 0)
   {
-    const Standard_Integer anIndex = IsComputed (theStructure);
-    if (anIndex != 0)
+    if (anAnswer == Graphic3d_TOA_COMPUTE
+     && myIsInComputedMode)
     {
       const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex);
       eraseStructure (aCompStruct->CStructure());
     }
+    myStructsComputed .Remove (anIndex);
+    myStructsToCompute.Remove (anIndex);
   }
+
   myStructsDisplayed.Remove (theStructure);
   Update (theStructure->GetZLayer());
 }
@@ -966,16 +966,16 @@ Standard_Boolean Graphic3d_CView::IsComputed (const Standard_Integer theStructId
 // function : IsComputed
 // purpose  :
 // =======================================================================
-Standard_Integer Graphic3d_CView::IsComputed (const Handle(Graphic3d_Structure)& theStructure) const
+Standard_Integer Graphic3d_CView::IsComputed (const Graphic3d_Structure* theStructure) const
 {
   const Standard_Integer aStructId  = theStructure->Identification();
-  const Standard_Integer aNbStructs = myStructsToCompute.Length();
-  for (Standard_Integer aStructIter = 1; aStructIter <= aNbStructs; ++aStructIter)
+  Standard_Integer aStructIndex = 1;
+  for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructsToCompute); aStructIter.More(); aStructIter.Next(), ++aStructIndex)
   {
-    const Handle(Graphic3d_Structure)& aStruct = myStructsToCompute.Value (aStructIter);
+    const Handle(Graphic3d_Structure)& aStruct = aStructIter.Value();
     if (aStruct->Identification() == aStructId)
     {
-      return aStructIter;
+      return aStructIndex;
     }
   }
   return 0;
index e409c5e5bf4d77400d7908ca9dbfa0996ac38d95..56919128794828e92ec8bceba2236e0cc26d792a 100644 (file)
@@ -169,15 +169,16 @@ private:
   Standard_EXPORT Graphic3d_TypeOfAnswer acceptDisplay (const Graphic3d_TypeOfStructure theStructType) const;
 
   //! Clears the structure in this view.
-  Standard_EXPORT void Clear (const Handle(Graphic3d_Structure)& theStructure, const Standard_Boolean theWithDestruction);
+  Standard_EXPORT void Clear (Graphic3d_Structure* theStructure,
+                              const Standard_Boolean theWithDestruction);
 
   //! Connects the structures.
-  Standard_EXPORT void Connect (const Handle(Graphic3d_Structure)& theMother,
-                                const Handle(Graphic3d_Structure)& theDaughter);
+  Standard_EXPORT void Connect (const Graphic3d_Structure* theMother,
+                                const Graphic3d_Structure* theDaughter);
 
   //! Disconnects the structures.
-  Standard_EXPORT void Disconnect (const Handle(Graphic3d_Structure)& theMother,
-                                   const Handle(Graphic3d_Structure)& theDaughter);
+  Standard_EXPORT void Disconnect (const Graphic3d_Structure* theMother,
+                                   const Graphic3d_Structure* theDaughter);
 
   //! Displays the structure in the view.
   Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& theStructure);
@@ -197,7 +198,9 @@ private:
   Standard_EXPORT void UnHighlight (const Handle(Graphic3d_Structure)& theStructure);
 
   //! Returns an index != 0 if the structure have another structure computed for the view <me>.
-  Standard_EXPORT Standard_Integer IsComputed (const Handle(Graphic3d_Structure)& theStructure) const;
+  Standard_EXPORT Standard_Integer IsComputed (const Graphic3d_Structure* theStructure) const;
+
+  Standard_Integer IsComputed (const Handle(Graphic3d_Structure)& theStructure) const { return IsComputed (theStructure.get()); }
 
   //! Returns true if the structure is displayed in the view.
   Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(Graphic3d_Structure)& theStructure) const;
diff --git a/src/Graphic3d/Graphic3d_IndexedMapOfAddress.hxx b/src/Graphic3d/Graphic3d_IndexedMapOfAddress.hxx
deleted file mode 100644 (file)
index 80be9de..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Created on: 2015-04-2015
-// Created by: Denis BOGOLEPOV
-// Copyright (c) 2015 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _Graphic3d_IndexedMapOfAddress
-#define _Graphic3d_IndexedMapOfAddress
-
-#include <NCollection_IndexedMap.hxx>
-
-typedef NCollection_IndexedMap<const Standard_Address> Graphic3d_IndexedMapOfAddress;
-
-#endif // _Graphic3d_IndexedMapOfAddress
index 1384a676de2dfb0db9dc667c3499d1b804956a11..e8a48295f3f89d34afd59b09453eb08a5f5de5d3 100644 (file)
 
 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Structure,Standard_Transient)
 
-//=============================================================================
-//function : Graphic3d_Structure
-//purpose  :
-//=============================================================================
-Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManager)& theManager)
-: myStructureManager(theManager.operator->()),
-  myComputeVisual   (Graphic3d_TOS_ALL),
-  myOwner           (NULL),
-  myVisual          (Graphic3d_TOS_ALL)
-{
-  myCStructure = theManager->GraphicDriver()->CreateStructure (theManager);
-}
-
 //=============================================================================
 //function : Graphic3d_Structure
 //purpose  :
 //=============================================================================
 Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManager)& theManager,
-                                          const Handle(Graphic3d_Structure)&        thePrs)
-: myStructureManager(theManager.operator->()),
-  myComputeVisual   (thePrs->myComputeVisual),
-  myOwner           (thePrs->myOwner),
-  myVisual          (thePrs->myVisual)
+                                          const Handle(Graphic3d_Structure)&        theLinkPrs)
+: myStructureManager(theManager.get()),
+  myOwner           (NULL),
+  myVisual          (Graphic3d_TOS_ALL),
+  myComputeVisual   (Graphic3d_TOS_ALL)
 {
-  myCStructure = thePrs->myCStructure->ShadowLink (theManager);
+  if (!theLinkPrs.IsNull())
+  {
+    myOwner         = theLinkPrs->myOwner;
+    myVisual        = theLinkPrs->myVisual;
+    myComputeVisual = theLinkPrs->myComputeVisual;
+    myCStructure = theLinkPrs->myCStructure->ShadowLink (theManager);
+  }
+  else
+  {
+    myCStructure = theManager->GraphicDriver()->CreateStructure (theManager);
+  }
 }
 
 //=============================================================================
@@ -119,20 +116,16 @@ void Graphic3d_Structure::Remove()
     aGroupIter.ChangeValue()->Clear (Standard_False);
   }
 
-  Standard_Address APtr = (void *) this;
-  // It is necessary to remove the eventual pointer on the structure
-  // that can be destroyed, in the list of descendants
-  // of ancestors of this structure and in the list of ancestors
-  // of descendants of the same structure.
-
+  // It is necessary to remove the eventual pointer on the structure that can be destroyed, in the list of descendants
+  // of ancestors of this structure and in the list of ancestors of descendants of the same structure.
   for (Standard_Integer aStructIdx = 1, aNbDesc = myDescendants.Size(); aStructIdx <= aNbDesc; ++aStructIdx)
   {
-    ((Graphic3d_Structure *)myDescendants.FindKey (aStructIdx))->Remove (APtr, Graphic3d_TOC_ANCESTOR);
+    myDescendants.FindKey (aStructIdx)->Remove (this, Graphic3d_TOC_ANCESTOR);
   }
 
   for (Standard_Integer aStructIdx = 1, aNbAnces = myAncestors.Size(); aStructIdx <= aNbAnces; ++aStructIdx)
   {
-    ((Graphic3d_Structure *)myAncestors.FindKey (aStructIdx))->Remove (APtr, Graphic3d_TOC_DESCENDANT);
+    myAncestors.FindKey (aStructIdx)->Remove (this, Graphic3d_TOC_DESCENDANT);
   }
 
   // Destruction of me in the graphic library
@@ -163,15 +156,6 @@ void Graphic3d_Structure::Display()
   }
 }
 
-//=============================================================================
-//function : SetIsForHighlight
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::SetIsForHighlight (const Standard_Boolean isForHighlight)
-{
-  myCStructure->IsForHighlight = isForHighlight;
-}
-
 //=============================================================================
 //function : SetDisplayPriority
 //purpose  :
@@ -219,15 +203,6 @@ void Graphic3d_Structure::ResetDisplayPriority()
   }
 }
 
-//=============================================================================
-//function : DisplayPriority
-//purpose  :
-//=============================================================================
-Standard_Integer Graphic3d_Structure::DisplayPriority() const
-{
-  return myCStructure->Priority;
-}
-
 //=============================================================================
 //function : Erase
 //purpose  :
@@ -314,61 +289,6 @@ void Graphic3d_Structure::UnHighlight()
   }
 }
 
-//=============================================================================
-//function : HighlightStyle
-//purpose  :
-//=============================================================================
-const Handle(Graphic3d_PresentationAttributes)& Graphic3d_Structure::HighlightStyle() const
-{
-  return myCStructure->HighlightStyle();
-}
-
-//=============================================================================
-//function : IsDisplayed
-//purpose  :
-//=============================================================================
-Standard_Boolean Graphic3d_Structure::IsDisplayed() const
-{
-  return myCStructure->stick ? Standard_True : Standard_False;
-}
-
-//=============================================================================
-//function : IsDeleted
-//purpose  :
-//=============================================================================
-Standard_Boolean Graphic3d_Structure::IsDeleted() const
-{
-  return myCStructure.IsNull();
-}
-
-//=============================================================================
-//function : IsHighlighted
-//purpose  :
-//=============================================================================
-Standard_Boolean Graphic3d_Structure::IsHighlighted() const
-{
-  return myCStructure->highlight ? Standard_True : Standard_False;
-}
-
-//=============================================================================
-//function : IsVisible
-//purpose  :
-//=============================================================================
-Standard_Boolean Graphic3d_Structure::IsVisible() const
-{
-  return myCStructure->visible ? Standard_True : Standard_False;
-}
-
-//=============================================================================
-//function : IsTransformed
-//purpose  :
-//=============================================================================
-Standard_Boolean Graphic3d_Structure::IsTransformed() const
-{
-  return !myCStructure->Transformation().IsNull()
-       && myCStructure->Transformation()->Form() != gp_Identity;
-}
-
 //=============================================================================
 //function : ContainsFacet
 //purpose  :
@@ -386,9 +306,9 @@ Standard_Boolean Graphic3d_Structure::ContainsFacet() const
   }
 
   // stop at the first descendant containing at least one facet
-  for (Graphic3d_IndexedMapOfAddress::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
+  for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
   {
-    if (((const Graphic3d_Structure *)anIter.Value())->ContainsFacet())
+    if (anIter.Value()->ContainsFacet())
     {
       return Standard_True;
     }
@@ -420,9 +340,9 @@ Standard_Boolean Graphic3d_Structure::IsEmpty() const
   }
 
   // stop at the first non-empty descendant
-  for (Graphic3d_IndexedMapOfAddress::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
+  for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
   {
-    if (!((const Graphic3d_Structure* )anIter.Value())->IsEmpty())
+    if (!anIter.Value()->IsEmpty())
     {
       return Standard_False;
     }
@@ -443,57 +363,6 @@ void Graphic3d_Structure::GroupsWithFacet (const Standard_Integer theDelta)
   }
 }
 
-//=============================================================================
-//function : Compute
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::Compute()
-{
-  // Implemented by Presentation
-}
-
-//=============================================================================
-//function : Compute
-//purpose  :
-//=============================================================================
-Handle(Graphic3d_Structure) Graphic3d_Structure::Compute (const Handle(Graphic3d_DataStructureManager)& )
-{
-  // Implemented by Presentation
-  return this;
-}
-
-//=============================================================================
-//function : Compute
-//purpose  :
-//=============================================================================
-Handle(Graphic3d_Structure) Graphic3d_Structure::Compute (const Handle(Graphic3d_DataStructureManager)& ,
-                                                          const Handle(Geom_Transformation)& )
-{
-  // Implemented by Presentation
-  return this;
-}
-
-//=============================================================================
-//function : Compute
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::Compute (const Handle(Graphic3d_DataStructureManager)& ,
-                                   Handle(Graphic3d_Structure)& )
-{
-  // Implemented by Presentation
-}
-
-//=============================================================================
-//function : Compute
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::Compute (const Handle(Graphic3d_DataStructureManager)& ,
-                                   const Handle(Geom_Transformation)& ,
-                                   Handle(Graphic3d_Structure)& )
-{
-  // Implemented by Presentation
-}
-
 //=============================================================================
 //function : ReCompute
 //purpose  :
@@ -512,25 +381,6 @@ void Graphic3d_Structure::ReCompute (const Handle(Graphic3d_DataStructureManager
   myStructureManager->ReCompute (this, theProjector);
 }
 
-//=============================================================================
-//function : SetInfiniteState
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::SetInfiniteState (const Standard_Boolean theToSet)
-{
-  myCStructure->IsInfinite = theToSet ? 1 : 0;
-}
-
-//=============================================================================
-//function : IsInfinite
-//purpose  :
-//=============================================================================
-Standard_Boolean Graphic3d_Structure::IsInfinite() const
-{
-  return IsDeleted()
-       || myCStructure->IsInfinite;
-}
-
 //=============================================================================
 //function : GraphicClear
 //purpose  :
@@ -560,42 +410,6 @@ void Graphic3d_Structure::GraphicClear (const Standard_Boolean theWithDestructio
   myCStructure->Clear();
 }
 
-//=============================================================================
-//function : GraphicConnect
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::GraphicConnect (const Handle(Graphic3d_Structure)& theDaughter)
-{
-  myCStructure->Connect (*theDaughter->myCStructure);
-}
-
-//=============================================================================
-//function : GraphicDisconnect
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::GraphicDisconnect (const Handle(Graphic3d_Structure)& theDaughter)
-{
-  myCStructure->Disconnect (*theDaughter->myCStructure);
-}
-
-//=============================================================================
-//function : Groups
-//purpose  :
-//=============================================================================
-const Graphic3d_SequenceOfGroup& Graphic3d_Structure::Groups() const
-{
-  return myCStructure->Groups();
-}
-
-//=============================================================================
-//function : NumberOfGroups
-//purpose  :
-//=============================================================================
-Standard_Integer Graphic3d_Structure::NumberOfGroups() const
-{
-  return myCStructure->Groups().Length();
-}
-
 //=============================================================================
 //function : SetVisual
 //purpose  :
@@ -639,25 +453,16 @@ void Graphic3d_Structure::SetZoomLimit (const Standard_Real theLimitInf,
                                                "ZoomLimit sup < ZoomLimit inf");
 }
 
-//=============================================================================
-//function : Visual
-//purpose  :
-//=============================================================================
-Graphic3d_TypeOfStructure Graphic3d_Structure::Visual() const
-{
-  return myVisual;
-}
-
 //=============================================================================
 //function : AcceptConnection
 //purpose  :
 //=============================================================================
-Standard_Boolean Graphic3d_Structure::AcceptConnection (const Handle(Graphic3d_Structure)& theStructure1,
-                                                        const Handle(Graphic3d_Structure)& theStructure2,
-                                                        const Graphic3d_TypeOfConnection   theType)
+Standard_Boolean Graphic3d_Structure::AcceptConnection (Graphic3d_Structure* theStructure1,
+                                                        Graphic3d_Structure* theStructure2,
+                                                        Graphic3d_TypeOfConnection theType)
 {
   // cycle detection
-  Graphic3d_MapOfStructure aSet;
+  NCollection_Map<Graphic3d_Structure*> aSet;
   Graphic3d_Structure::Network (theStructure2, theType, aSet);
   return !aSet.Contains (theStructure1);
 }
@@ -668,39 +473,21 @@ Standard_Boolean Graphic3d_Structure::AcceptConnection (const Handle(Graphic3d_S
 //=============================================================================
 void Graphic3d_Structure::Ancestors (Graphic3d_MapOfStructure& theSet) const
 {
-  for (Graphic3d_IndexedMapOfAddress::Iterator anIter (myAncestors); anIter.More(); anIter.Next())
+  for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myAncestors); anIter.More(); anIter.Next())
   {
-    theSet.Add ((Graphic3d_Structure* )anIter.Value());
+    theSet.Add (anIter.Value());
   }
 }
 
-//=============================================================================
-//function : SetOwner
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::SetOwner (const Standard_Address theOwner)
-{
-  myOwner = theOwner;
-}
-
-//=============================================================================
-//function : Owner
-//purpose  :
-//=============================================================================
-Standard_Address Graphic3d_Structure::Owner() const
-{
-  return myOwner;
-}
-
 //=============================================================================
 //function : Descendants
 //purpose  :
 //=============================================================================
 void Graphic3d_Structure::Descendants (Graphic3d_MapOfStructure& theSet) const
 {
-  for (Graphic3d_IndexedMapOfAddress::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
+  for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
   {
-    theSet.Add ((Graphic3d_Structure* )anIter.Value());
+    theSet.Add (anIter.Value());
   }
 }
 
@@ -708,7 +495,7 @@ void Graphic3d_Structure::Descendants (Graphic3d_MapOfStructure& theSet) const
 //function : AppendAncestor
 //purpose  :
 //=============================================================================
-Standard_Boolean Graphic3d_Structure::AppendAncestor (const Standard_Address theAncestor)
+Standard_Boolean Graphic3d_Structure::AppendAncestor (Graphic3d_Structure* theAncestor)
 {
   const Standard_Integer aSize = myAncestors.Size();
 
@@ -719,7 +506,7 @@ Standard_Boolean Graphic3d_Structure::AppendAncestor (const Standard_Address the
 //function : AppendDescendant
 //purpose  :
 //=============================================================================
-Standard_Boolean Graphic3d_Structure::AppendDescendant (const Standard_Address theDescendant)
+Standard_Boolean Graphic3d_Structure::AppendDescendant (Graphic3d_Structure* theDescendant)
 {
   const Standard_Integer aSize = myDescendants.Size();
 
@@ -730,7 +517,7 @@ Standard_Boolean Graphic3d_Structure::AppendDescendant (const Standard_Address t
 //function : RemoveAncestor
 //purpose  :
 //=============================================================================
-Standard_Boolean Graphic3d_Structure::RemoveAncestor (const Standard_Address theAncestor)
+Standard_Boolean Graphic3d_Structure::RemoveAncestor (Graphic3d_Structure* theAncestor)
 {
   const Standard_Integer anIndex = myAncestors.FindIndex (theAncestor);
 
@@ -747,7 +534,7 @@ Standard_Boolean Graphic3d_Structure::RemoveAncestor (const Standard_Address the
 //function : RemoveDescendant
 //purpose  :
 //=============================================================================
-Standard_Boolean Graphic3d_Structure::RemoveDescendant (const Standard_Address theDescendant)
+Standard_Boolean Graphic3d_Structure::RemoveDescendant (Graphic3d_Structure* theDescendant)
 {
   const Standard_Integer anIndex = myDescendants.FindIndex (theDescendant);
 
@@ -764,9 +551,9 @@ Standard_Boolean Graphic3d_Structure::RemoveDescendant (const Standard_Address t
 //function : Connect
 //purpose  :
 //=============================================================================
-void Graphic3d_Structure::Connect (const Handle(Graphic3d_Structure)& theStructure,
-                                   const Graphic3d_TypeOfConnection   theType,
-                                   const Standard_Boolean             theWithCheck)
+void Graphic3d_Structure::Connect (Graphic3d_Structure* theStructure,
+                                   Graphic3d_TypeOfConnection theType,
+                                   Standard_Boolean theWithCheck)
 {
   if (IsDeleted())
   {
@@ -780,11 +567,9 @@ void Graphic3d_Structure::Connect (const Handle(Graphic3d_Structure)& theStructu
     return;
   }
 
-  const Standard_Address aStructure = theStructure.operator->();
-
   if (theType == Graphic3d_TOC_DESCENDANT)
   {
-    if (!AppendDescendant (aStructure))
+    if (!AppendDescendant (theStructure))
     {
       return;
     }
@@ -799,7 +584,7 @@ void Graphic3d_Structure::Connect (const Handle(Graphic3d_Structure)& theStructu
   }
   else // Graphic3d_TOC_ANCESTOR
   {
-    if (!AppendAncestor (aStructure))
+    if (!AppendAncestor (theStructure))
     {
       return;
     }
@@ -815,16 +600,14 @@ void Graphic3d_Structure::Connect (const Handle(Graphic3d_Structure)& theStructu
 //function : Disconnect
 //purpose  :
 //=============================================================================
-void Graphic3d_Structure::Disconnect (const Handle(Graphic3d_Structure)& theStructure)
+void Graphic3d_Structure::Disconnect (Graphic3d_Structure* theStructure)
 {
   if (IsDeleted())
   {
     return;
   }
 
-  const Standard_Address aStructure = theStructure.operator->();
-
-  if (RemoveDescendant (aStructure))
+  if (RemoveDescendant (theStructure))
   {
     theStructure->Disconnect (this);
 
@@ -834,7 +617,7 @@ void Graphic3d_Structure::Disconnect (const Handle(Graphic3d_Structure)& theStru
     CalculateBoundBox();
     Update (true);
   }
-  else if (RemoveAncestor (aStructure))
+  else if (RemoveAncestor (theStructure))
   {
     theStructure->Disconnect (this);
     CalculateBoundBox();
@@ -861,7 +644,7 @@ void Graphic3d_Structure::DisconnectAll (const Graphic3d_TypeOfConnection theTyp
         // is modified by :
         // Graphic3d_Structure::Disconnect (AStructure)
         // that takes AStructure from myDescendants
-        ((Graphic3d_Structure* )(myDescendants.FindKey (1)))->Disconnect (this);
+        myDescendants.FindKey (1)->Disconnect (this);
       }
       break;
     }
@@ -873,7 +656,7 @@ void Graphic3d_Structure::DisconnectAll (const Graphic3d_TypeOfConnection theTyp
         // is modified by :
         // Graphic3d_Structure::Disconnect (AStructure)
         // that takes AStructure from myAncestors
-        ((Graphic3d_Structure* )(myAncestors.FindKey (1)))->Disconnect (this);
+        myAncestors.FindKey (1)->Disconnect (this);
       }
       break;
     }
@@ -941,15 +724,6 @@ Bnd_Box Graphic3d_Structure::MinMaxValues (const Standard_Boolean theToIgnoreInf
   return aResult;
 }
 
-//=============================================================================
-//function : Identification
-//purpose  :
-//=============================================================================
-Standard_Integer Graphic3d_Structure::Identification() const
-{
-  return myCStructure->Id;
-}
-
 //=============================================================================
 //function : SetTransformPersistence
 //purpose  :
@@ -968,7 +742,7 @@ void Graphic3d_Structure::SetTransformPersistence (const Handle(Graphic3d_Transf
 //function : Remove
 //purpose  :
 //=============================================================================
-void Graphic3d_Structure::Remove (const Standard_Address           thePtr,
+void Graphic3d_Structure::Remove (Graphic3d_Structure* thePtr,
                                   const Graphic3d_TypeOfConnection theType)
 {
   if (theType == Graphic3d_TOC_DESCENDANT)
@@ -1074,9 +848,9 @@ void Graphic3d_Structure::addTransformed (Graphic3d_BndBox3d&    theBox,
   Graphic3d_BndBox3d aCombinedBox, aBox;
   getBox (aCombinedBox, theToIgnoreInfiniteFlag);
 
-  for (Graphic3d_IndexedMapOfAddress::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
+  for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
   {
-    const Graphic3d_Structure* aStruct = (const Graphic3d_Structure* )anIter.Value();
+    const Graphic3d_Structure* aStruct = anIter.Value();
     aStruct->getBox (aBox, theToIgnoreInfiniteFlag);
     aCombinedBox.Combine (aBox);
   }
@@ -1184,28 +958,29 @@ void Graphic3d_Structure::TransformBoundaries (const gp_Trsf& theTrsf,
 //function : Network
 //purpose  :
 //=============================================================================
-void Graphic3d_Structure::Network (const Handle(Graphic3d_Structure)& theStructure,
-                                   const Graphic3d_TypeOfConnection   theType,
-                                   Graphic3d_MapOfStructure&          theSet)
+void Graphic3d_Structure::Network (Graphic3d_Structure* theStructure,
+                                   const Graphic3d_TypeOfConnection theType,
+                                   NCollection_Map<Graphic3d_Structure*>& theSet)
 {
-  Graphic3d_MapOfStructure aSetD, aSetA;
-  theStructure->Descendants (aSetD);
-  theStructure->Ancestors   (aSetA);
   theSet.Add (theStructure);
   switch (theType)
   {
     case Graphic3d_TOC_DESCENDANT:
-      for (Graphic3d_MapIteratorOfMapOfStructure anIter (aSetD); anIter.More(); anIter.Next())
+    {
+      for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (theStructure->myDescendants); anIter.More(); anIter.Next())
       {
-        Graphic3d_Structure::Network (anIter.Key(), theType, theSet);
+        Graphic3d_Structure::Network (anIter.Value(), theType, theSet);
       }
       break;
+    }
     case Graphic3d_TOC_ANCESTOR:
-      for (Graphic3d_MapIteratorOfMapOfStructure anIter (aSetA); anIter.More(); anIter.Next())
+    {
+      for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (theStructure->myAncestors); anIter.More(); anIter.Next())
       {
-        Graphic3d_Structure::Network (anIter.Key (), theType, theSet);
+        Graphic3d_Structure::Network (anIter.Value(), theType, theSet);
       }
       break;
+    }
   }
 }
 
@@ -1216,9 +991,9 @@ void Graphic3d_Structure::Network (const Handle(Graphic3d_Structure)& theStructu
 void Graphic3d_Structure::PrintNetwork (const Handle(Graphic3d_Structure)& theStructure,
                                         const Graphic3d_TypeOfConnection   theType)
 {
-  Graphic3d_MapOfStructure aSet;
-  Graphic3d_Structure::Network (theStructure, theType, aSet);
-  for (Graphic3d_MapIteratorOfMapOfStructure anIter (aSet); anIter.More(); anIter.Next())
+  NCollection_Map<Graphic3d_Structure*> aSet;
+  Graphic3d_Structure::Network (theStructure.get(), theType, aSet);
+  for (NCollection_Map<Graphic3d_Structure*>::Iterator anIter (aSet); anIter.More(); anIter.Next())
   {
     std::cout << "\tIdent " << (anIter.Key())->Identification () << "\n";
   }
@@ -1239,60 +1014,6 @@ void Graphic3d_Structure::Update (const bool theUpdateLayer) const
   myStructureManager->Update (theUpdateLayer ? myCStructure->ZLayer() : Graphic3d_ZLayerId_UNKNOWN);
 }
 
-//=============================================================================
-//function : GraphicTransform
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::GraphicTransform (const Handle(Geom_Transformation)& theTrsf)
-{
-  myCStructure->SetTransformation (theTrsf);
-}
-
-//=============================================================================
-//function : ComputeVisual
-//purpose  :
-//=============================================================================
-Graphic3d_TypeOfStructure Graphic3d_Structure::ComputeVisual() const
-{
-  return myComputeVisual;
-}
-
-//=============================================================================
-//function : SetComputeVisual
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::SetComputeVisual (const Graphic3d_TypeOfStructure theVisual)
-{
-  // The ComputeVisual is saved only if the structure is declared TOS_ALL, TOS_WIREFRAME or TOS_SHADING.
-  // This declaration permits to calculate proper representation of the structure calculated by Compute instead of passage to TOS_COMPUTED.
-  if (theVisual != Graphic3d_TOS_COMPUTED)
-  {
-    myComputeVisual = theVisual;
-  }
-}
-
-//=============================================================================
-//function : SetHLRValidation
-//purpose  :
-//=============================================================================
-void Graphic3d_Structure::SetHLRValidation (const Standard_Boolean theFlag)
-{
-  myCStructure->HLRValidation = theFlag ? 1 : 0;
-}
-
-//=============================================================================
-//function : HLRValidation
-//purpose  :
-//=============================================================================
-Standard_Boolean Graphic3d_Structure::HLRValidation() const
-{
-  // Hidden parts stored in <me> are valid if :
-  // 1/ the owner is defined.
-  // 2/ they are not invalid.
-  return myOwner != NULL
-      && myCStructure->HLRValidation != 0;
-}
-
 //=======================================================================
 //function : SetZLayer
 //purpose  :
@@ -1306,48 +1027,3 @@ void Graphic3d_Structure::SetZLayer (const Graphic3d_ZLayerId theLayerId)
   myStructureManager->ChangeZLayer (this, theLayerId);
   myCStructure->SetZLayer (theLayerId);
 }
-
-//=======================================================================
-//function : GetZLayer
-//purpose  :
-//=======================================================================
-Graphic3d_ZLayerId Graphic3d_Structure::GetZLayer() const
-{
-  return myCStructure->ZLayer();
-}
-
-//=======================================================================
-//function : SetClipPlanes
-//purpose  :
-//=======================================================================
-void Graphic3d_Structure::SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes)
-{
-  myCStructure->SetClipPlanes (thePlanes);
-}
-
-//=======================================================================
-//function : GetClipPlanes
-//purpose  :
-//=======================================================================
-const Handle(Graphic3d_SequenceOfHClipPlane)& Graphic3d_Structure::ClipPlanes() const
-{
-  return myCStructure->ClipPlanes();
-}
-
-//=======================================================================
-//function : SetMutable
-//purpose  :
-//=======================================================================
-void Graphic3d_Structure::SetMutable (const Standard_Boolean theIsMutable)
-{
-  myCStructure->IsMutable = theIsMutable;
-}
-
-//=======================================================================
-//function : IsMutable
-//purpose  :
-//=======================================================================
-Standard_Boolean Graphic3d_Structure::IsMutable() const
-{
-  return myCStructure->IsMutable;
-}
index d366406615eadde05a4b1c8ab0ddcc27e92de0a6..3854a4389ab8fb41c3067af43dbfdf60479c3380 100644 (file)
 #ifndef _Graphic3d_Structure_HeaderFile
 #define _Graphic3d_Structure_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
+#include <Graphic3d_BndBox4f.hxx>
+#include <Graphic3d_BndBox4d.hxx>
 #include <Graphic3d_CStructure.hxx>
-#include <Graphic3d_IndexedMapOfAddress.hxx>
-#include <Standard_Address.hxx>
-#include <Graphic3d_TypeOfStructure.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Integer.hxx>
-#include <Graphic3d_ZLayerId.hxx>
-#include <Graphic3d_SequenceOfHClipPlane.hxx>
-#include <Standard_Real.hxx>
-#include <Graphic3d_SequenceOfGroup.hxx>
-#include <Graphic3d_TypeOfConnection.hxx>
 #include <Graphic3d_MapOfStructure.hxx>
+#include <Graphic3d_SequenceOfGroup.hxx>
+#include <Graphic3d_SequenceOfHClipPlane.hxx>
 #include <Graphic3d_TypeOfComposition.hxx>
+#include <Graphic3d_TypeOfConnection.hxx>
+#include <Graphic3d_TypeOfStructure.hxx>
 #include <Graphic3d_TransformPers.hxx>
 #include <Graphic3d_TransModeFlags.hxx>
-#include <Graphic3d_BndBox4f.hxx>
-#include <Graphic3d_BndBox4d.hxx>
 #include <Graphic3d_Vertex.hxx>
-class Graphic3d_PriorityDefinitionError;
-class Graphic3d_StructureDefinitionError;
-class Graphic3d_TransformError;
-class Graphic3d_Group;
+#include <Graphic3d_ZLayerId.hxx>
+#include <NCollection_IndexedMap.hxx>
+
 class Graphic3d_StructureManager;
 class Graphic3d_DataStructureManager;
 class Bnd_Box;
 class gp_Pnt;
 
-
-class Graphic3d_Structure;
 DEFINE_STANDARD_HANDLE(Graphic3d_Structure, Standard_Transient)
 
 //! This class allows the definition a graphic object.
-//! This graphic structure can be displayed,
-//! erased, or highlighted.
-//! This graphic structure can be connected with
-//! another graphic structure.
-//! Keywords: Structure, StructureManager, Display, Erase, Highlight,
-//! UnHighlight, Visible, Priority, Selectable, Visible,
-//! Visual, Connection, Ancestors, Descendants, Transformation
+//! This graphic structure can be displayed, erased, or highlighted.
+//! This graphic structure can be connected with another graphic structure.
 class Graphic3d_Structure : public Standard_Transient
 {
-
+  DEFINE_STANDARD_RTTIEXT(Graphic3d_Structure, Standard_Transient)
+  friend class Graphic3d_Group;
 public:
 
-  
   //! Creates a graphic object in the manager theManager.
   //! It will appear in all the views of the visualiser.
   //! The structure is not displayed when it is created.
-  Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager);
-  
-  //! Creates a shadow link to existing graphic object.
-  Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager, const Handle(Graphic3d_Structure)& thePrs);
+  //! @param theManager structure manager holding this structure
+  //! @param theLinkPrs another structure for creating a shadow (linked) structure
+  Standard_EXPORT Graphic3d_Structure (const Handle(Graphic3d_StructureManager)& theManager,
+                                       const Handle(Graphic3d_Structure)& theLinkPrs = Handle(Graphic3d_Structure)());
   
   //! if WithDestruction == Standard_True then
   //! suppress all the groups of primitives in the structure.
@@ -88,14 +70,13 @@ public:
   
   //! Suppresses the structure <me>.
   //! It will be erased at the next screen update.
-  Standard_EXPORT ~Graphic3d_Structure();
+  Standard_EXPORT virtual ~Graphic3d_Structure();
   
   //! Displays the structure <me> in all the views of the visualiser.
   Standard_EXPORT virtual void Display();
-  
-  //! Returns the current display priority for the
-  //! structure <me>.
-  Standard_EXPORT Standard_Integer DisplayPriority() const;
+
+  //! Returns the current display priority for this structure.
+  Standard_Integer DisplayPriority() const { return myCStructure->Priority; }
   
   //! Erases the structure <me> in all the views
   //! of the visualiser.
@@ -116,13 +97,13 @@ public:
   //! Computes axis-aligned bounding box of a structure.
   Standard_EXPORT virtual void CalculateBoundBox();
   
-  //! If <theToSet> is Standard_True then <me> is infinite and
-  //! the MinMaxValues method method return :
+  //! Sets infinite flag.
+  //! When TRUE, the MinMaxValues method returns:
   //! theXMin = theYMin = theZMin = RealFirst().
   //! theXMax = theYMax = theZMax = RealLast().
-  //! By default, <me> is not infinite but empty.
-  Standard_EXPORT void SetInfiniteState (const Standard_Boolean theToSet);
-  
+  //! By default, structure is created not infinite but empty.
+  void SetInfiniteState (const Standard_Boolean theToSet) { myCStructure->IsInfinite = theToSet ? 1 : 0; }
+
   //! Modifies the order of displaying the structure.
   //! Values are between 0 and 10.
   //! Structures are drawn according to their display priorities
@@ -151,17 +132,17 @@ public:
   //! test between layers
   Standard_EXPORT void SetZLayer (const Graphic3d_ZLayerId theLayerId);
   
-  //! Get Z layer ID of displayed structure. The method
-  //! returns -1 if the structure has no ID (deleted from graphic driver).
-  Standard_EXPORT Graphic3d_ZLayerId GetZLayer() const;
+  //! Get Z layer ID of displayed structure.
+  //! The method returns -1 if the structure has no ID (deleted from graphic driver).
+  Graphic3d_ZLayerId GetZLayer() const { return myCStructure->ZLayer(); }
   
   //! Changes a sequence of clip planes slicing the structure on rendering.
   //! @param thePlanes [in] the set of clip planes.
-  Standard_EXPORT void SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes);
+  void SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes) { myCStructure->SetClipPlanes (thePlanes); }
   
   //! Get clip planes slicing the structure on rendering.
   //! @return set of clip planes.
-  Standard_EXPORT const Handle(Graphic3d_SequenceOfHClipPlane)& ClipPlanes() const;
+  const Handle(Graphic3d_SequenceOfHClipPlane)& ClipPlanes() const { return myCStructure->ClipPlanes(); }
 
   //! Modifies the visibility indicator to Standard_True or
   //! Standard_False for the structure <me>.
@@ -180,32 +161,52 @@ public:
   //! greater than <LimitSup> or if <LimitInf> or
   //! <LimitSup> is a negative value.
   Standard_EXPORT void SetZoomLimit (const Standard_Real LimitInf, const Standard_Real LimitSup);
-  
-  //! marks the structure <me> representing wired structure needed for
-  //! highlight only so it won't be added to BVH tree.
-  //! Category: Methods to modify the class definition
-  Standard_EXPORT void SetIsForHighlight (const Standard_Boolean isForHighlight);
+
+  //! Marks the structure <me> representing wired structure needed for highlight only so it won't be added to BVH tree.
+  void SetIsForHighlight (const Standard_Boolean isForHighlight) { myCStructure->IsForHighlight = isForHighlight; }
   
   //! Suppresses the highlight for the structure <me>
   //! in all the views of the visualiser.
   Standard_EXPORT void UnHighlight();
   
-  Standard_EXPORT virtual void Compute();
+  virtual void Compute()
+  {
+    //
+  }
   
   //! Returns the new Structure defined for the new visualization
-  Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector);
+  virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector)
+  {
+    (void )theProjector;
+    return this;
+  }
   
   //! Returns the new Structure defined for the new visualization
-  Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                                                               const Handle(Geom_Transformation)& theTrsf);
-  
+  virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
+                                               const Handle(Geom_Transformation)& theTrsf)
+  {
+    (void )theProjector;
+    (void )theTrsf;
+    return this;
+  }
+
   //! Returns the new Structure defined for the new visualization
-  Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, Handle(Graphic3d_Structure)& aStructure);
+  virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
+                        Handle(Graphic3d_Structure)& theStructure)
+  {
+    (void )theProjector;
+    (void )theStructure;
+  }
   
   //! Returns the new Structure defined for the new visualization
-  Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                                        const Handle(Geom_Transformation)& theTrsf,
-                                        Handle(Graphic3d_Structure)& theStructure);
+  virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
+                        const Handle(Geom_Transformation)& theTrsf,
+                        Handle(Graphic3d_Structure)& theStructure)
+  {
+    (void )theProjector;
+    (void )theTrsf;
+    (void )theStructure;
+  }
 
   //! Forces a new construction of the structure <me>
   //! if <me> is displayed and TOS_COMPUTED.
@@ -219,26 +220,33 @@ public:
   //! Polygons, Triangles or Quadrangles.
   Standard_EXPORT Standard_Boolean ContainsFacet() const;
 
-  //! Returns the groups sequence included in the structure <me> (internal storage).
-  Standard_EXPORT const Graphic3d_SequenceOfGroup& Groups() const;
-  
-  //! Returns the current number of groups in the
-  //! structure <me>.
-  Standard_EXPORT Standard_Integer NumberOfGroups() const;
+  //! Returns the groups sequence included in this structure.
+  const Graphic3d_SequenceOfGroup& Groups() const { return myCStructure->Groups(); }
+
+  //! Returns the current number of groups in this structure.
+  Standard_Integer NumberOfGroups() const { return myCStructure->Groups().Length(); }
   
   //! Append new group to this structure.
   Standard_EXPORT Handle(Graphic3d_Group) NewGroup();
+
+  //! Returns the last created group or creates new one if list is empty.
+  Handle(Graphic3d_Group) CurrentGroup()
+  {
+    if (Groups().IsEmpty())
+    {
+      return NewGroup();
+    }
+    return Groups().Last();
+  }
+
+  //! Returns the highlight attributes.
+  const Handle(Graphic3d_PresentationAttributes)& HighlightStyle() const { return myCStructure->HighlightStyle(); }
+
+  //! Returns TRUE if this structure is deleted (after Remove() call).
+  Standard_Boolean IsDeleted() const { return myCStructure.IsNull(); }
   
-  //! Returns the highlight color for the Highlight method
-  //! with the highlight method TOHM_COLOR or TOHM_BOUNDBOX.
-  Standard_EXPORT const Handle(Graphic3d_PresentationAttributes)& HighlightStyle() const;
-  
-  //! Returns Standard_True if the structure <me> is deleted.
-  //! <me> is deleted after the call Remove (me).
-  Standard_EXPORT Standard_Boolean IsDeleted() const;
-  
-  //! Returns the display indicator for the structure <me>.
-  Standard_EXPORT virtual Standard_Boolean IsDisplayed() const;
+  //! Returns the display indicator for this structure.
+  virtual Standard_Boolean IsDisplayed() const { return myCStructure->stick != 0; }
   
   //! Returns Standard_True if the structure <me> is empty.
   //! Warning: A structure is empty if :
@@ -248,17 +256,24 @@ public:
   Standard_EXPORT Standard_Boolean IsEmpty() const;
   
   //! Returns Standard_True if the structure <me> is infinite.
-  Standard_EXPORT Standard_Boolean IsInfinite() const;
+  Standard_Boolean IsInfinite() const
+  {
+    return IsDeleted()
+        || myCStructure->IsInfinite;
+  }
   
-  //! Returns the highlight indicator for the structure <me>.
-  Standard_EXPORT virtual Standard_Boolean IsHighlighted() const;
+  //! Returns the highlight indicator for this structure.
+  virtual Standard_Boolean IsHighlighted() const { return myCStructure->highlight != 0; }
   
-  //! Returns Standard_True if the structure <me> is transformed.
-  //! <=> The transformation != Identity.
-  Standard_EXPORT Standard_Boolean IsTransformed() const;
+  //! Returns TRUE if the structure is transformed.
+  Standard_Boolean IsTransformed() const
+  {
+    return !myCStructure->Transformation().IsNull()
+         && myCStructure->Transformation()->Form() != gp_Identity;
+  }
   
-  //! Returns the visibility indicator for the structure <me>.
-  Standard_EXPORT Standard_Boolean IsVisible() const;
+  //! Returns the visibility indicator for this structure.
+  Standard_Boolean IsVisible() const { return myCStructure->visible != 0; }
 
   //! Returns the coordinates of the boundary box of the structure <me>.
   //! If <theToIgnoreInfiniteFlag> is TRUE, the method returns actual graphical
@@ -272,7 +287,7 @@ public:
   Standard_EXPORT Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
 
   //! Returns the visualisation mode for the structure <me>.
-  Standard_EXPORT Graphic3d_TypeOfStructure Visual() const;
+  Graphic3d_TypeOfStructure Visual() const { return myVisual; }
   
   //! Returns Standard_True if the connection is possible between
   //! <AStructure1> and <AStructure2> without a creation
@@ -287,7 +302,9 @@ public:
   //! - the set of all descendants of <AStructure1> contains
   //! <AStructure2> and if the
   //! TypeOfConnection == TOC_ANCESTOR
-  Standard_EXPORT static Standard_Boolean AcceptConnection (const Handle(Graphic3d_Structure)& AStructure1, const Handle(Graphic3d_Structure)& AStructure2, const Graphic3d_TypeOfConnection AType);
+  Standard_EXPORT static Standard_Boolean AcceptConnection (Graphic3d_Structure* theStructure1,
+                                                            Graphic3d_Structure* theStructure2,
+                                                            Graphic3d_TypeOfConnection theType);
   
   //! Returns the group of structures to which <me> is connected.
   Standard_EXPORT void Ancestors (Graphic3d_MapOfStructure& SG) const;
@@ -300,34 +317,57 @@ public:
   //! Remove, and stacks the transformations.
   //! No connection if the graph of the structures
   //! contains a cycle and <WithCheck> is Standard_True;
-  Standard_EXPORT void Connect (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType, const Standard_Boolean WithCheck = Standard_False);
+  Standard_EXPORT void Connect (Graphic3d_Structure* theStructure,
+                                Graphic3d_TypeOfConnection theType,
+                                Standard_Boolean theWithCheck = Standard_False);
+
+  Standard_DEPRECATED("Deprecated short-cut")
+  void Connect (const Handle(Graphic3d_Structure)& thePrs)
+  {
+    Connect (thePrs.get(), Graphic3d_TOC_DESCENDANT);
+  }
   
   //! Returns the group of structures connected to <me>.
   Standard_EXPORT void Descendants (Graphic3d_MapOfStructure& SG) const;
   
   //! Suppress the connection between <AStructure> and <me>.
-  Standard_EXPORT void Disconnect (const Handle(Graphic3d_Structure)& AStructure);
+  Standard_EXPORT void Disconnect (Graphic3d_Structure* theStructure);
+
+  Standard_DEPRECATED("Deprecated alias for Disconnect()")
+  void Remove (const Handle(Graphic3d_Structure)& thePrs) { Disconnect (thePrs.get()); }
   
   //! If Atype is TOC_DESCENDANT then suppress all
   //! the connections with the child structures of <me>.
   //! If Atype is TOC_ANCESTOR then suppress all
   //! the connections with the parent structures of <me>.
   Standard_EXPORT void DisconnectAll (const Graphic3d_TypeOfConnection AType);
+
+  Standard_DEPRECATED("Deprecated alias for DisconnectAll()")
+  void RemoveAll() { DisconnectAll (Graphic3d_TOC_DESCENDANT); }
   
   //! Returns <ASet> the group of structures :
   //! - directly or indirectly connected to <AStructure> if the
   //! TypeOfConnection == TOC_DESCENDANT
   //! - to which <AStructure> is directly or indirectly connected
   //! if the TypeOfConnection == TOC_ANCESTOR
-  Standard_EXPORT static void Network (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType, Graphic3d_MapOfStructure& ASet);
-  
-  Standard_EXPORT void SetOwner (const Standard_Address Owner);
+  Standard_EXPORT static void Network (Graphic3d_Structure* theStructure,
+                                       const Graphic3d_TypeOfConnection theType,
+                                       NCollection_Map<Graphic3d_Structure*>& theSet);
   
-  Standard_EXPORT Standard_Address Owner() const;
+  void SetOwner (const Standard_Address theOwner) { myOwner = theOwner; }
   
-  Standard_EXPORT void SetHLRValidation (const Standard_Boolean AFlag);
+  Standard_Address Owner() const { return myOwner; }
   
-  Standard_EXPORT Standard_Boolean HLRValidation() const;
+  void SetHLRValidation (const Standard_Boolean theFlag) { myCStructure->HLRValidation = theFlag ? 1 : 0; }
+
+  //! Hidden parts stored in this structure are valid if:
+  //! 1) the owner is defined.
+  //! 2) they are not invalid.
+  Standard_Boolean HLRValidation() const
+  {
+    return myOwner != NULL
+        && myCStructure->HLRValidation != 0;
+  }
 
   //! Return local transformation.
   const Handle(Geom_Transformation)& Transformation() const { return myCStructure->Transformation(); }
@@ -345,36 +385,44 @@ public:
   const Handle(Graphic3d_TransformPers)& TransformPersistence() const { return myCStructure->TransformPersistence(); }
 
   //! Sets if the structure location has mutable nature (content or location will be changed regularly).
-  Standard_EXPORT void SetMutable (const Standard_Boolean theIsMutable);
+  void SetMutable (const Standard_Boolean theIsMutable) { myCStructure->IsMutable = theIsMutable; }
   
   //! Returns true if structure has mutable nature (content or location are be changed regularly).
   //! Mutable structure will be managed in different way than static onces.
-  Standard_EXPORT Standard_Boolean IsMutable() const;
+  Standard_Boolean IsMutable() const { return myCStructure->IsMutable; }
   
-  Standard_EXPORT Graphic3d_TypeOfStructure ComputeVisual() const;
+  Graphic3d_TypeOfStructure ComputeVisual() const { return myComputeVisual; }
   
   //! Clears the structure <me>.
   Standard_EXPORT void GraphicClear (const Standard_Boolean WithDestruction);
   
-  Standard_EXPORT void GraphicConnect (const Handle(Graphic3d_Structure)& ADaughter);
+  void GraphicConnect (const Handle(Graphic3d_Structure)& theDaughter) { myCStructure->Connect (*theDaughter->myCStructure); }
   
-  Standard_EXPORT void GraphicDisconnect (const Handle(Graphic3d_Structure)& ADaughter);
+  void GraphicDisconnect (const Handle(Graphic3d_Structure)& theDaughter) { myCStructure->Disconnect (*theDaughter->myCStructure); }
 
   //! Internal method which sets new transformation without calling graphic manager callbacks.
-  Standard_EXPORT void GraphicTransform (const Handle(Geom_Transformation)& theTrsf);
+  void GraphicTransform (const Handle(Geom_Transformation)& theTrsf) { myCStructure->SetTransformation (theTrsf); }
 
-  //! Returns the identification number of the structure <me>.
-  Standard_EXPORT Standard_Integer Identification() const;
+  //! Returns the identification number of this structure.
+  Standard_Integer Identification() const { return myCStructure->Id; }
   
   //! Prints informations about the network associated
   //! with the structure <AStructure>.
   Standard_EXPORT static void PrintNetwork (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType);
   
-  //! Suppress the adress <APtr> in the list
-  //! of descendants or in the list of ancestors.
-  Standard_EXPORT void Remove (const Standard_Address APtr, const Graphic3d_TypeOfConnection AType);
+  //! Suppress the structure in the list of descendants or in the list of ancestors.
+  Standard_EXPORT void Remove (Graphic3d_Structure* thePtr,
+                               const Graphic3d_TypeOfConnection theType);
   
-  Standard_EXPORT void SetComputeVisual (const Graphic3d_TypeOfStructure AVisual);
+  void SetComputeVisual (const Graphic3d_TypeOfStructure theVisual)
+  {
+    // The ComputeVisual is saved only if the structure is declared TOS_ALL, TOS_WIREFRAME or TOS_SHADING.
+    // This declaration permits to calculate proper representation of the structure calculated by Compute instead of passage to TOS_COMPUTED.
+    if (theVisual != Graphic3d_TOS_COMPUTED)
+    {
+      myComputeVisual = theVisual;
+    }
+  }
   
   //! Transforms theX, theY, theZ with the transformation theTrsf.
   Standard_EXPORT static void Transforms (const gp_Trsf& theTrsf,
@@ -384,11 +432,6 @@ public:
   //! Returns the low-level structure
   const Handle(Graphic3d_CStructure)& CStructure() const { return myCStructure; }
 
-friend class Graphic3d_Group;
-
-
-  DEFINE_STANDARD_RTTIEXT(Graphic3d_Structure,Standard_Transient)
-
 protected:
 
   //! Transforms boundaries with <theTrsf> transformation.
@@ -397,16 +440,16 @@ protected:
                                                    Standard_Real& theXMax, Standard_Real& theYMax, Standard_Real& theZMax);
 
   //! Appends new descendant structure.
-  Standard_EXPORT Standard_Boolean AppendDescendant (const Standard_Address theDescendant);
+  Standard_EXPORT Standard_Boolean AppendDescendant (Graphic3d_Structure* theDescendant);
   
   //! Removes the given descendant structure.
-  Standard_EXPORT Standard_Boolean RemoveDescendant (const Standard_Address theDescendant);
+  Standard_EXPORT Standard_Boolean RemoveDescendant (Graphic3d_Structure* theDescendant);
   
   //! Appends new ancestor structure.
-  Standard_EXPORT Standard_Boolean AppendAncestor (const Standard_Address theAncestor);
+  Standard_EXPORT Standard_Boolean AppendAncestor (Graphic3d_Structure* theAncestor);
   
   //! Removes the given ancestor structure.
-  Standard_EXPORT Standard_Boolean RemoveAncestor (const Standard_Address theAncestor);
+  Standard_EXPORT Standard_Boolean RemoveAncestor (Graphic3d_Structure* theAncestor);
 
 private:
 
@@ -438,14 +481,13 @@ private:
 
 protected:
 
-  Graphic3d_StructureManager* myStructureManager;
-  Graphic3d_TypeOfStructure   myComputeVisual;
-
-  Handle(Graphic3d_CStructure) myCStructure;
-  Graphic3d_IndexedMapOfAddress myAncestors;
-  Graphic3d_IndexedMapOfAddress myDescendants;
-  Standard_Address myOwner;
-  Graphic3d_TypeOfStructure myVisual;
+  Graphic3d_StructureManager*   myStructureManager;
+  Handle(Graphic3d_CStructure)  myCStructure;
+  NCollection_IndexedMap<Graphic3d_Structure*> myAncestors;
+  NCollection_IndexedMap<Graphic3d_Structure*> myDescendants;
+  Standard_Address              myOwner;
+  Graphic3d_TypeOfStructure     myVisual;
+  Graphic3d_TypeOfStructure     myComputeVisual;
 
 };
 
index 572c27e4e467c95007d78b207b2e834e452a0844..0c1728b7175988180591e4469d6d86d227349441 100644 (file)
@@ -162,21 +162,21 @@ void Graphic3d_StructureManager::RecomputeStructures()
   myDeviceLostFlag = Standard_False;
 
   // Go through all unique structures including child (connected) ones and ensure that they are computed.
-  Graphic3d_MapOfStructure aStructNetwork;
+  NCollection_Map<Graphic3d_Structure*> aStructNetwork;
   for (Graphic3d_MapIteratorOfMapOfStructure anIter(myDisplayedStructure); anIter.More(); anIter.Next())
   {
     Handle(Graphic3d_Structure) aStructure = anIter.Key();
-    anIter.Key()->Network (anIter.Key(), Graphic3d_TOC_DESCENDANT, aStructNetwork);
+    anIter.Key()->Network (anIter.Key().get(), Graphic3d_TOC_DESCENDANT, aStructNetwork);
   }
 
   RecomputeStructures (aStructNetwork);
 }
 
-void Graphic3d_StructureManager::RecomputeStructures (const Graphic3d_MapOfStructure& theStructures)
+void Graphic3d_StructureManager::RecomputeStructures (const NCollection_Map<Graphic3d_Structure*>& theStructures)
 {
-  for (Graphic3d_MapIteratorOfMapOfStructure anIter (theStructures); anIter.More(); anIter.Next())
+  for (NCollection_Map<Graphic3d_Structure*>::Iterator anIter (theStructures); anIter.More(); anIter.Next())
   {
-    Handle(Graphic3d_Structure) aStruct = anIter.Key();
+    Graphic3d_Structure* aStruct = anIter.Key();
     aStruct->Clear();
     aStruct->Compute();
   }
@@ -295,7 +295,7 @@ void Graphic3d_StructureManager::ReCompute (const Handle(Graphic3d_Structure)& t
 // function : Clear
 // purpose  :
 // ========================================================================
-void Graphic3d_StructureManager::Clear (const Handle(Graphic3d_Structure)& theStructure,
+void Graphic3d_StructureManager::Clear (Graphic3d_Structure* theStructure,
                                         const Standard_Boolean theWithDestruction)
 {
   for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
@@ -308,8 +308,8 @@ void Graphic3d_StructureManager::Clear (const Handle(Graphic3d_Structure)& theSt
 // function : Connect
 // purpose  :
 // ========================================================================
-void Graphic3d_StructureManager::Connect (const Handle(Graphic3d_Structure)& theMother,
-                                          const Handle(Graphic3d_Structure)& theDaughter)
+void Graphic3d_StructureManager::Connect (const Graphic3d_Structure* theMother,
+                                          const Graphic3d_Structure* theDaughter)
 {
   for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
   {
@@ -321,8 +321,8 @@ void Graphic3d_StructureManager::Connect (const Handle(Graphic3d_Structure)& the
 // function : Disconnect
 // purpose  :
 // ========================================================================
-void Graphic3d_StructureManager::Disconnect (const Handle(Graphic3d_Structure)& theMother,
-                                             const Handle(Graphic3d_Structure)& theDaughter)
+void Graphic3d_StructureManager::Disconnect (const Graphic3d_Structure* theMother,
+                                             const Graphic3d_Structure* theDaughter)
 {
   for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
   {
index c5b7e87ecab00fcf70ce7cf265a76e86c9b89974..0f36aa2b233ec36134cb18c084ab61f4ff6ed55d 100644 (file)
@@ -89,13 +89,15 @@ public:
   Standard_EXPORT virtual void ReCompute (const Handle(Graphic3d_Structure)& theStructure, const Handle(Graphic3d_DataStructureManager)& theProjector);
 
   //! Clears the structure.
-  Standard_EXPORT virtual void Clear (const Handle(Graphic3d_Structure)& theStructure, const Standard_Boolean theWithDestruction);
+  Standard_EXPORT virtual void Clear (Graphic3d_Structure* theStructure, const Standard_Boolean theWithDestruction);
 
   //! Connects the structures.
-  Standard_EXPORT virtual void Connect (const Handle(Graphic3d_Structure)& theMother, const Handle(Graphic3d_Structure)& theDaughter);
+  Standard_EXPORT virtual void Connect (const Graphic3d_Structure* theMother,
+                                        const Graphic3d_Structure* theDaughter);
 
   //! Disconnects the structures.
-  Standard_EXPORT virtual void Disconnect (const Handle(Graphic3d_Structure)& theMother, const Handle(Graphic3d_Structure)& theDaughter);
+  Standard_EXPORT virtual void Disconnect (const Graphic3d_Structure* theMother,
+                                           const Graphic3d_Structure* theDaughter);
 
   //! Display the structure.
   Standard_EXPORT virtual void Display (const Handle(Graphic3d_Structure)& theStructure);
@@ -147,7 +149,7 @@ public:
   Standard_EXPORT void RecomputeStructures();
 
   //! Recomputes all structures from theStructures.
-  Standard_EXPORT void RecomputeStructures (const Graphic3d_MapOfStructure& theStructures);
+  Standard_EXPORT void RecomputeStructures (const NCollection_Map<Graphic3d_Structure*>& theStructures);
 
   Standard_EXPORT Handle(Graphic3d_ViewAffinity) RegisterObject (const Handle(Standard_Transient)& theObject);
 
index c24f715ec65d94f0456b74955cbdd8e272354b0e..c093048832bd2149ed3df3cf0bf464bfb78a6caf 100644 (file)
 #ifndef _MeshVS_ElementalColorPrsBuilder_HeaderFile
 #define _MeshVS_ElementalColorPrsBuilder_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <MeshVS_DataMapOfIntegerColor.hxx>
 #include <MeshVS_DataMapOfIntegerTwoColors.hxx>
 #include <MeshVS_PrsBuilder.hxx>
 #include <MeshVS_DisplayModeFlags.hxx>
-#include <Standard_Integer.hxx>
 #include <MeshVS_BuilderPriority.hxx>
-#include <TColStd_PackedMapOfInteger.hxx>
-#include <Standard_Boolean.hxx>
 #include <MeshVS_TwoColors.hxx>
+
 class MeshVS_Mesh;
 class MeshVS_DataSource;
-class Prs3d_Presentation;
 class Quantity_Color;
 
 
index 1df85334e45b3c3b833ce9dc345d3a58f10ae977..108dc57e354db02d09d2834e0ce63c67a7505445 100644 (file)
@@ -44,7 +44,6 @@
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_Root.hxx>
 #include <Prs3d_ShadingAspect.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <PrsMgr_PresentationManager3d.hxx>
 #include <Select3D_SensitiveBox.hxx>
 #include <Select3D_SensitiveGroup.hxx>
index 817bed9864efa544a69da9c137f7b92c818ff89c..06a027504668fca87b8be72e0f98d6c2f6b620c8 100644 (file)
 #ifndef _MeshVS_Mesh_HeaderFile
 #define _MeshVS_Mesh_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <MeshVS_SequenceOfPrsBuilder.hxx>
 #include <MeshVS_DataMapOfIntegerOwner.hxx>
 #include <MeshVS_MeshSelectionMethod.hxx>
 #include <AIS_InteractiveObject.hxx>
-#include <Standard_Boolean.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
-#include <SelectMgr_Selection.hxx>
 #include <SelectMgr_SequenceOfOwner.hxx>
 #include <Quantity_NameOfColor.hxx>
 #include <Standard_CString.hxx>
+
 class MeshVS_PrsBuilder;
 class TColStd_HPackedMapOfInteger;
 class MeshVS_DataSource;
 class MeshVS_Drawer;
 class SelectMgr_EntityOwner;
-class Prs3d_Presentation;
-
 
-class MeshVS_Mesh;
 DEFINE_STANDARD_HANDLE(MeshVS_Mesh, AIS_InteractiveObject)
 
 //! the main class provides interface to create mesh presentation as a whole
index acdd26d717ac2b927acc6c17a6ef7639ee9f9d4b..818c90c9313cdf66a77bb0518938e52d888afe88 100644 (file)
 #ifndef _MeshVS_MeshPrsBuilder_HeaderFile
 #define _MeshVS_MeshPrsBuilder_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <MeshVS_PrsBuilder.hxx>
 #include <MeshVS_DisplayModeFlags.hxx>
-#include <Standard_Integer.hxx>
 #include <MeshVS_BuilderPriority.hxx>
 #include <TColStd_PackedMapOfInteger.hxx>
-#include <Standard_Boolean.hxx>
 #include <TColStd_Array1OfReal.hxx>
-#include <Standard_Real.hxx>
 #include <MeshVS_HArray1OfSequenceOfInteger.hxx>
+
 class MeshVS_Mesh;
 class MeshVS_DataSource;
-class Prs3d_Presentation;
 class Graphic3d_ArrayOfSegments;
 class Graphic3d_ArrayOfTriangles;
 class Graphic3d_ArrayOfPrimitives;
 class Graphic3d_AspectFillArea3d;
 class Graphic3d_AspectLine3d;
 
-
-class MeshVS_MeshPrsBuilder;
 DEFINE_STANDARD_HANDLE(MeshVS_MeshPrsBuilder, MeshVS_PrsBuilder)
 
 //! This class provides methods to compute base mesh presentation
index c87f836d528dd8662558b8d0186296cfd7e80fc1..259f2ad85af727a95d459f98209d6ccf1fb9bdbd 100644 (file)
 #ifndef _MeshVS_NodalColorPrsBuilder_HeaderFile
 #define _MeshVS_NodalColorPrsBuilder_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <MeshVS_DataMapOfIntegerColor.hxx>
-#include <Standard_Boolean.hxx>
 #include <Aspect_SequenceOfColor.hxx>
 #include <TColStd_DataMapOfIntegerReal.hxx>
 #include <Quantity_Color.hxx>
 #include <MeshVS_PrsBuilder.hxx>
 #include <MeshVS_DisplayModeFlags.hxx>
-#include <Standard_Integer.hxx>
 #include <MeshVS_BuilderPriority.hxx>
 #include <TColStd_PackedMapOfInteger.hxx>
-#include <Standard_Real.hxx>
 #include <MeshVS_HArray1OfSequenceOfInteger.hxx>
 #include <TColStd_Array1OfInteger.hxx>
 #include <TColStd_Array1OfReal.hxx>
+
 class MeshVS_Mesh;
 class MeshVS_DataSource;
-class Prs3d_Presentation;
 class Quantity_Color;
 class Graphic3d_Texture2D;
 class Graphic3d_ArrayOfPrimitives;
 
-
-class MeshVS_NodalColorPrsBuilder;
 DEFINE_STANDARD_HANDLE(MeshVS_NodalColorPrsBuilder, MeshVS_PrsBuilder)
 
 //! This class provides methods to create presentation of nodes with assigned color.
index 87b4189350a2c42e06a44fa5dae7393556494f15..eb5007209e4d181f9d5e826bfe60dcce0c3e0bd1 100644 (file)
 #ifndef _MeshVS_PrsBuilder_HeaderFile
 #define _MeshVS_PrsBuilder_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <Standard_Boolean.hxx>
 #include <MeshVS_MeshPtr.hxx>
-#include <Standard_Integer.hxx>
 #include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Transient.hxx>
+#include <Prs3d_Presentation.hxx>
 #include <MeshVS_DisplayModeFlags.hxx>
 #include <MeshVS_BuilderPriority.hxx>
 #include <TColStd_PackedMapOfInteger.hxx>
+
 class MeshVS_DataSource;
 class MeshVS_Drawer;
 class MeshVS_Mesh;
-class Prs3d_Presentation;
 class SelectBasics_SensitiveEntity;
 class SelectBasics_EntityOwner;
 
index 6e3356d0d03ede1dd5872cbd56f3ac29fda74a02..7dad18b4efb560f714c99cec0e4a111413d53f0a 100644 (file)
 #ifndef _MeshVS_TextPrsBuilder_HeaderFile
 #define _MeshVS_TextPrsBuilder_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <MeshVS_DataMapOfIntegerAsciiString.hxx>
 #include <MeshVS_PrsBuilder.hxx>
-#include <Standard_Real.hxx>
 #include <MeshVS_DisplayModeFlags.hxx>
-#include <Standard_Integer.hxx>
 #include <MeshVS_BuilderPriority.hxx>
-#include <TColStd_PackedMapOfInteger.hxx>
-#include <Standard_Boolean.hxx>
+
 class MeshVS_Mesh;
 class Quantity_Color;
 class MeshVS_DataSource;
-class Prs3d_Presentation;
 class TCollection_AsciiString;
 
-
-class MeshVS_TextPrsBuilder;
 DEFINE_STANDARD_HANDLE(MeshVS_TextPrsBuilder, MeshVS_PrsBuilder)
 
 //! This class provides methods to create text data presentation.
index 4f2bed81b5d7da91518342b149ff997c62645810..295cea0e455490d7128742c8af47bd59c3ee3f31 100644 (file)
 #ifndef _MeshVS_VectorPrsBuilder_HeaderFile
 #define _MeshVS_VectorPrsBuilder_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <Standard_Boolean.hxx>
-#include <Standard_Real.hxx>
 #include <MeshVS_DataMapOfIntegerVector.hxx>
 #include <MeshVS_PrsBuilder.hxx>
 #include <MeshVS_DisplayModeFlags.hxx>
-#include <Standard_Integer.hxx>
 #include <MeshVS_BuilderPriority.hxx>
-#include <TColStd_PackedMapOfInteger.hxx>
 #include <TColgp_Array1OfPnt.hxx>
+
 class MeshVS_Mesh;
 class Quantity_Color;
 class MeshVS_DataSource;
-class Prs3d_Presentation;
 class gp_Trsf;
 class Graphic3d_ArrayOfPrimitives;
 class gp_Vec;
 
-
-class MeshVS_VectorPrsBuilder;
 DEFINE_STANDARD_HANDLE(MeshVS_VectorPrsBuilder, MeshVS_PrsBuilder)
 
 //! This class provides methods to create vector data presentation.
index 52ee3aef5632d97f9e38dc48b0696b467ef9cebd..31d2a551e648cb3599e7781da7c6fc8dd953382b 100755 (executable)
@@ -32,7 +32,6 @@ Prs3d_PlaneAspect.hxx
 Prs3d_Point.hxx
 Prs3d_PointAspect.cxx
 Prs3d_PointAspect.hxx
-Prs3d_Presentation.cxx
 Prs3d_Presentation.hxx
 Prs3d_PresentationShadow.cxx
 Prs3d_PresentationShadow.hxx
index 0fc819df50446726343dad0b3f1fa890f1bb3479..73e10d5300779b1b03927ebb63a2d314c650f18c 100644 (file)
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Real.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_NListOfSequenceOfPnt.hxx>
+#include <Prs3d_Presentation.hxx>
 
 class TopoDS_Shape;
-class Prs3d_Presentation;
 
 //! The Prs3d package provides the following services
 //! -   a presentation object (the context for all
diff --git a/src/Prs3d/Prs3d_Presentation.cxx b/src/Prs3d/Prs3d_Presentation.cxx
deleted file mode 100644 (file)
index f3796a5..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <Prs3d_Presentation.hxx>
-
-#include <Geom_Transformation.hxx>
-#include <gp_Ax1.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Pnt.hxx>
-#include <gp_Trsf.hxx>
-#include <gp_Vec.hxx>
-#include <Graphic3d_DataStructureManager.hxx>
-#include <Graphic3d_Group.hxx>
-#include <Graphic3d_NameOfMaterial.hxx>
-#include <Graphic3d_Structure.hxx>
-#include <Graphic3d_StructureManager.hxx>
-#include <Prs3d_Root.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Type.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Presentation,Graphic3d_Structure)
-
-//=======================================================================
-//function : Prs3d_Presentation
-//purpose  :
-//=======================================================================
-Prs3d_Presentation::Prs3d_Presentation (const Handle(Graphic3d_StructureManager)& theViewer,
-                                        const Standard_Boolean                    theToInit)
-: Graphic3d_Structure (theViewer)
-{
-  if (!theToInit)
-  {
-    return;
-  }
-}
-
-//=======================================================================
-//function : Prs3d_Presentation
-//purpose  :
-//=======================================================================
-Prs3d_Presentation::Prs3d_Presentation (const Handle(Graphic3d_StructureManager)& theViewer,
-                                        const Handle(Prs3d_Presentation)&         thePrs)
-: Graphic3d_Structure (theViewer, thePrs)
-{
-  //
-}
-
-
-//=======================================================================
-//function : Connect
-//purpose  : 
-//=======================================================================
-void Prs3d_Presentation::Connect
-  ( const Handle(Prs3d_Presentation)& aPresentation) 
-{
-  Graphic3d_Structure::Connect(aPresentation, Graphic3d_TOC_DESCENDANT);
-}
-
-
-//=======================================================================
-//function : Remove
-//purpose  : 
-//=======================================================================
-void Prs3d_Presentation::Remove (const Handle(Prs3d_Presentation)& aPresentation) 
-{
-  Disconnect(aPresentation);
-}
-
-//=======================================================================
-//function : RemoveAll
-//purpose  : 
-//=======================================================================
-void Prs3d_Presentation::RemoveAll () 
-{
-  DisconnectAll(Graphic3d_TOC_DESCENDANT);
-}
-
-
-//=======================================================================
-//function : CurrentGroup
-//purpose  : 
-//=======================================================================
-Handle(Graphic3d_Group) Prs3d_Presentation::CurrentGroup () const 
-{
-  if (Groups().IsEmpty())
-  {
-    return const_cast<Prs3d_Presentation* >(this)->NewGroup();
-  }
-  return Groups().Last();
-}
-
-//=======================================================================
-//function : Compute
-//purpose  : 
-//=======================================================================
-
-Handle(Graphic3d_Structure) Prs3d_Presentation::
-       Compute(const Handle(Graphic3d_DataStructureManager)& /*aProjector*/) 
-{
-  return this;
-}
-
-//=======================================================================
-//function : Compute
-//purpose  : 
-//=======================================================================
-
-void Prs3d_Presentation::Compute(const Handle(Graphic3d_DataStructureManager)& aDataStruct, 
-                                 Handle(Graphic3d_Structure)& aStruct)
-{
- Graphic3d_Structure::Compute(aDataStruct,aStruct );
-}
-
-//=======================================================================
-//function : Compute
-//purpose  :
-//=======================================================================
-
-Handle(Graphic3d_Structure) Prs3d_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theDataStruc,
-                                                         const Handle(Geom_Transformation)& theTrsf)
-{
-  return Graphic3d_Structure::Compute (theDataStruc, theTrsf);
-}
-
-//=======================================================================
-//function : Compute
-//purpose  :
-//=======================================================================
-
-void Prs3d_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theDataStruc,
-                                  const Handle(Geom_Transformation)& theTrsf,
-                                  Handle(Graphic3d_Structure)& theStruc)
-{
-  Graphic3d_Structure::Compute (theDataStruc, theTrsf, theStruc);
-}
index 09c5386be18bb67e8019309897d9a64031d21dd5..aa6c0eaf5ec80818683aee5df8f5353c8db7fac1 100644 (file)
 #ifndef _Prs3d_Presentation_HeaderFile
 #define _Prs3d_Presentation_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <Graphic3d_Structure.hxx>
-#include <Standard_Boolean.hxx>
-
-class Prs3d_Root;
-class Graphic3d_StructureManager;
-class Graphic3d_Structure;
-class Graphic3d_DataStructureManager;
-class Geom_Transformation;
-class Graphic3d_Group;
-
-class Prs3d_Presentation;
-DEFINE_STANDARD_HANDLE(Prs3d_Presentation, Graphic3d_Structure)
-
-//! Defines a presentation object which can be displayed,
-//! highlighted or erased.
-//! The presentation object stores the results of the
-//! presentation algorithms as defined in the StdPrs
-//! classes and the Prs3d classes inheriting Prs3d_Root.
-//! This presentation object is used to give display
-//! attributes defined at this level to
-//! ApplicationInteractiveServices classes at the level above.
-//! A presentation object is attached to a given Viewer.
-class Prs3d_Presentation : public Graphic3d_Structure
-{
-
-public:
-
-  //! Constructs a presentation object
-  //! if <Init> is false, no color initialization is done.
-  Standard_EXPORT Prs3d_Presentation(const Handle(Graphic3d_StructureManager)& theStructManager, const Standard_Boolean theToInit = Standard_True);
-  
-  //! Constructs a presentation object.
-  Standard_EXPORT Prs3d_Presentation(const Handle(Graphic3d_StructureManager)& theStructManager, const Handle(Prs3d_Presentation)& thePrs);
-  
-  Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector) Standard_OVERRIDE;
-  
-  //! Returns the new Structure defined for the new visualization
-  Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                                                               const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE;
-
-  //! Returns the new Structure defined for the new visualization
-  Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, Handle(Graphic3d_Structure)& aStructure) Standard_OVERRIDE;
-  
-  //! Returns the new Structure defined for the new visualization
-  Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                                        const Handle(Geom_Transformation)& theTrsf,
-                                        Handle(Graphic3d_Structure)& theStructure) Standard_OVERRIDE;
-
-  Standard_EXPORT void Connect (const Handle(Prs3d_Presentation)& aPresentation);
-  
-  Standard_EXPORT void Remove (const Handle(Prs3d_Presentation)& aPresentation);
-  
-  Standard_EXPORT void RemoveAll();
-
-friend class Prs3d_Root;
-
-  DEFINE_STANDARD_RTTIEXT(Prs3d_Presentation,Graphic3d_Structure)
-
-private:
-  
-  Standard_EXPORT Handle(Graphic3d_Group) CurrentGroup() const;
 
-};
+//! Alias for porting code.
+typedef Graphic3d_Structure Prs3d_Presentation;
 
 #endif // _Prs3d_Presentation_HeaderFile
index 37e4fa24bf50515cfd2b4fcee40f1ca6a7f3025b..ab7d417b2212fb351fb613bf6d301846170c127d 100644 (file)
 
 #include <Prs3d_PresentationShadow.hxx>
 
-
-IMPLEMENT_STANDARD_RTTIEXT(Prs3d_PresentationShadow,Prs3d_Presentation)
+IMPLEMENT_STANDARD_RTTIEXT(Prs3d_PresentationShadow, Graphic3d_Structure)
 
 //=======================================================================
 //function : Prs3d_PresentationShadow
 //purpose  :
 //=======================================================================
 Prs3d_PresentationShadow::Prs3d_PresentationShadow (const Handle(Graphic3d_StructureManager)& theViewer,
-                                                    const Handle(Prs3d_Presentation)&         thePrs)
-: Prs3d_Presentation (theViewer, thePrs),
-  myParentStructId (thePrs->Identification()),
-  myParentAffinity (thePrs->CStructure()->ViewAffinity)
+                                                    const Handle(Graphic3d_Structure)&        thePrs)
+: Graphic3d_Structure (theViewer, thePrs),
+  myParentAffinity (thePrs->CStructure()->ViewAffinity),
+  myParentStructId (thePrs->Identification())
 {
   //
 }
index 9d680affddac0515a9814905f4dc11e31c4fba88..bf68cdcb0cc936f9f9bfa0e83e8348e72879acab 100644 (file)
 #include <Prs3d_Presentation.hxx>
 
 //! Defines a "shadow" of existing presentation object with custom aspects.
-class Prs3d_PresentationShadow : public Prs3d_Presentation
+class Prs3d_PresentationShadow : public Graphic3d_Structure
 {
-
+  DEFINE_STANDARD_RTTIEXT(Prs3d_PresentationShadow, Graphic3d_Structure)
 public:
 
   //! Constructs a shadow of existing presentation object.
   Standard_EXPORT Prs3d_PresentationShadow (const Handle(Graphic3d_StructureManager)& theViewer,
-                                            const Handle(Prs3d_Presentation)&         thePrs);
+                                            const Handle(Graphic3d_Structure)&        thePrs);
 
   //! Returns the id of the parent presentation
   inline Standard_Integer ParentId() const { return myParentStructId; }
@@ -37,16 +37,13 @@ public:
   //! Do nothing - axis-aligned bounding box should be initialized from parent structure.
   Standard_EXPORT virtual void CalculateBoundBox() Standard_OVERRIDE;
 
-private: 
-
-  DEFINE_STANDARD_RTTIEXT(Prs3d_PresentationShadow,Prs3d_Presentation)
-
 private:
-  Standard_Integer               myParentStructId;
+
   Handle(Graphic3d_ViewAffinity) myParentAffinity;
+  Standard_Integer               myParentStructId;
 
 };
 
-DEFINE_STANDARD_HANDLE(Prs3d_PresentationShadow, Prs3d_Presentation)
+DEFINE_STANDARD_HANDLE(Prs3d_PresentationShadow, Graphic3d_Structure)
 
 #endif // _Prs3d_PresentationShadow_HeaderFile
index e540bbd95c7b2098957f39e5b2644aaf66b6a3b2..e09bd0bdbc36fc2865fc083194ceaeb6a6a05685 100644 (file)
@@ -1,7 +1,5 @@
 PrsMgr_ListOfPresentableObjects.hxx
 PrsMgr_ListOfPresentations.hxx
-PrsMgr_ModedPresentation.cxx
-PrsMgr_ModedPresentation.hxx
 PrsMgr_PresentableObject.cxx
 PrsMgr_PresentableObject.hxx
 PrsMgr_Presentation.cxx
@@ -11,6 +9,4 @@ PrsMgr_PresentationManager.cxx
 PrsMgr_PresentationManager.hxx
 PrsMgr_PresentationManager3d.hxx
 PrsMgr_Presentations.hxx
-PrsMgr_Prs.cxx
-PrsMgr_Prs.hxx
 PrsMgr_TypeOfPresentation3d.hxx
diff --git a/src/PrsMgr/PrsMgr_ModedPresentation.cxx b/src/PrsMgr/PrsMgr_ModedPresentation.cxx
deleted file mode 100644 (file)
index 5b96dc8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 1998-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <PrsMgr_ModedPresentation.hxx>
-#include <PrsMgr_Presentation.hxx>
-
-PrsMgr_ModedPresentation::PrsMgr_ModedPresentation()
-: myMode (0) {}
-
-PrsMgr_ModedPresentation::PrsMgr_ModedPresentation (const Handle(PrsMgr_Presentation)& thePrs,
-                                                    const Standard_Integer             theMode)
-: myPresentation (thePrs),
-  myMode (theMode)
-{
-  //
-}
-
-const Handle(PrsMgr_Presentation)& PrsMgr_ModedPresentation::Presentation() const
-{
-  return myPresentation;
-}
-
-Standard_Integer PrsMgr_ModedPresentation::Mode() const
-{
-  return myMode;
-}
diff --git a/src/PrsMgr/PrsMgr_ModedPresentation.hxx b/src/PrsMgr/PrsMgr_ModedPresentation.hxx
deleted file mode 100644 (file)
index 2109183..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-// Created on: 1995-01-30
-// Created by: Mister rmi
-// Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _PrsMgr_ModedPresentation_HeaderFile
-#define _PrsMgr_ModedPresentation_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
-#include <Standard_Integer.hxx>
-class PrsMgr_Presentation;
-
-
-
-class PrsMgr_ModedPresentation 
-{
-public:
-
-  DEFINE_STANDARD_ALLOC
-
-  
-  Standard_EXPORT PrsMgr_ModedPresentation();
-  
-  Standard_EXPORT PrsMgr_ModedPresentation(const Handle(PrsMgr_Presentation)& thePrs, const Standard_Integer theMode);
-  
-  Standard_EXPORT const Handle(PrsMgr_Presentation)& Presentation() const;
-  
-  Standard_EXPORT Standard_Integer Mode() const;
-
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
-  Handle(PrsMgr_Presentation) myPresentation;
-  Standard_Integer myMode;
-
-
-};
-
-
-
-
-
-
-
-#endif // _PrsMgr_ModedPresentation_HeaderFile
index 342ea9930406e50378dbce4b019029b1bcbec2c9..4d33a1b87c6b04a49da26b0904ed4f099beb121d 100644 (file)
@@ -23,7 +23,8 @@
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_Projector.hxx>
 #include <Prs3d_ShadingAspect.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
+#include <PrsMgr_Presentation.hxx>
+#include <PrsMgr_PresentationManager.hxx>
 #include <Standard_NotImplemented.hxx>
 #include <TColStd_MapOfInteger.hxx>
 
@@ -66,6 +67,14 @@ PrsMgr_PresentableObject::PrsMgr_PresentableObject (const PrsMgr_TypeOfPresentat
 //=======================================================================
 PrsMgr_PresentableObject::~PrsMgr_PresentableObject()
 {
+  for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
+  {
+    // should never happen - assertion can be used
+    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value();
+    aPrs3d->Erase();
+    aPrs3d->myPresentableObject = NULL;
+  }
+
   for (PrsMgr_ListOfPresentableObjectsIter anIter (myChildren); anIter.More(); anIter.Next())
   {
     anIter.Value()->SetCombinedParentTransform (Handle(Geom_Transformation)());
@@ -81,7 +90,7 @@ void PrsMgr_PresentableObject::Fill (const Handle(PrsMgr_PresentationManager)& t
                                      const Handle(PrsMgr_Presentation)&        thePrs,
                                      const Standard_Integer                    theMode)
 {
-  Handle(Prs3d_Presentation) aStruct3d = thePrs->Presentation();
+  const Handle(Prs3d_Presentation)& aStruct3d = thePrs;
   Compute (thePrsMgr, aStruct3d, theMode);
   aStruct3d->SetTransformation (myTransformation);
   aStruct3d->SetClipPlanes (myClipPlanes);
@@ -117,17 +126,17 @@ Standard_Boolean PrsMgr_PresentableObject::ToBeUpdated (Standard_Boolean theToIn
 {
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aModedPrs = aPrsIter.Value();
-    if (aModedPrs.Presentation()->MustBeUpdated())
+    const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
+    if (aModedPrs->MustBeUpdated())
     {
       if (theToIncludeHidden)
       {
         return Standard_True;
       }
 
-      Handle(PrsMgr_PresentationManager) aPrsMgr = aModedPrs.Presentation()->PresentationManager();
-      if (aPrsMgr->IsDisplayed  (this, aModedPrs.Mode())
-       || aPrsMgr->IsHighlighted(this, aModedPrs.Mode()))
+      Handle(PrsMgr_PresentationManager) aPrsMgr = aModedPrs->PresentationManager();
+      if (aPrsMgr->IsDisplayed  (this, aModedPrs->Mode())
+       || aPrsMgr->IsHighlighted(this, aModedPrs->Mode()))
       {
         return Standard_True;
       }
@@ -145,16 +154,16 @@ Standard_Boolean PrsMgr_PresentableObject::UpdatePresentations (Standard_Boolean
   Standard_Boolean hasUpdates = Standard_False;
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aModedPrs = aPrsIter.Value();
-    if (aModedPrs.Presentation()->MustBeUpdated())
+    const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
+    if (aModedPrs->MustBeUpdated())
     {
-      Handle(PrsMgr_PresentationManager) aPrsMgr = aModedPrs.Presentation()->PresentationManager();
+      Handle(PrsMgr_PresentationManager) aPrsMgr = aModedPrs->PresentationManager();
       if (theToIncludeHidden
-       || aPrsMgr->IsDisplayed  (this, aModedPrs.Mode())
-       || aPrsMgr->IsHighlighted(this, aModedPrs.Mode()))
+       || aPrsMgr->IsDisplayed  (this, aModedPrs->Mode())
+       || aPrsMgr->IsHighlighted(this, aModedPrs->Mode()))
       {
         hasUpdates = Standard_True;
-        aPrsMgr->Update (this, aModedPrs.Mode());
+        aPrsMgr->Update (this, aModedPrs->Mode());
       }
     }
   }
@@ -169,18 +178,18 @@ void PrsMgr_PresentableObject::Update (Standard_Integer theMode, Standard_Boolea
 {
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More();)
   {
-    if (aPrsIter.Value().Mode() == theMode)
+    if (aPrsIter.Value()->Mode() == theMode)
     {
-      Handle(PrsMgr_PresentationManager) aPrsMgr = aPrsIter.Value().Presentation()->PresentationManager();
+      Handle(PrsMgr_PresentationManager) aPrsMgr = aPrsIter.Value()->PresentationManager();
       if (aPrsMgr->IsDisplayed  (this, theMode)
        || aPrsMgr->IsHighlighted(this, theMode))
       {
         aPrsMgr->Update (this, theMode);
-        aPrsIter.Value().Presentation()->SetUpdateStatus (Standard_False);
+        aPrsIter.Value()->SetUpdateStatus (Standard_False);
       }
       else
       {
-        SetToUpdate (aPrsIter.Value().Mode());
+        SetToUpdate (aPrsIter.Value()->Mode());
       }
     }
     else if (theToClearOther)
@@ -201,9 +210,9 @@ void PrsMgr_PresentableObject::SetToUpdate (Standard_Integer theMode)
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
     if (theMode == -1
-     || aPrsIter.Value().Mode() == theMode)
+     || aPrsIter.Value()->Mode() == theMode)
     {
-      aPrsIter.ChangeValue().Presentation()->SetUpdateStatus(Standard_True);
+      aPrsIter.ChangeValue()->SetUpdateStatus (Standard_True);
     }
   }
 }
@@ -218,11 +227,11 @@ void PrsMgr_PresentableObject::ToBeUpdated (TColStd_ListOfInteger& theOutList) c
   TColStd_MapOfInteger MI(myPresentations.Length()); 
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aModedPrs = aPrsIter.Value();
-    if (aModedPrs.Presentation()->MustBeUpdated()
-     && MI.Add (aModedPrs.Mode()))
+    const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
+    if (aModedPrs->MustBeUpdated()
+     && MI.Add (aModedPrs->Mode()))
     {
-      theOutList.Append (aModedPrs.Mode());
+      theOutList.Append (aModedPrs->Mode());
     }
   }
 }
@@ -236,10 +245,10 @@ void PrsMgr_PresentableObject::SetTypeOfPresentation (const PrsMgr_TypeOfPresent
   myTypeOfPresentation3d = theType;
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const Handle(PrsMgr_Presentation)& aPrs  = aPrsIter.Value().Presentation();
-    aPrs->Presentation()->SetVisual (myTypeOfPresentation3d == PrsMgr_TOP_ProjectorDependant
-                                   ? Graphic3d_TOS_COMPUTED
-                                   : Graphic3d_TOS_ALL);
+    const Handle(PrsMgr_Presentation)& aPrs  = aPrsIter.Value();
+    aPrs->SetVisual (myTypeOfPresentation3d == PrsMgr_TOP_ProjectorDependant
+                   ? Graphic3d_TOS_COMPUTED
+                   : Graphic3d_TOS_ALL);
   }
 }
 
@@ -302,7 +311,7 @@ void PrsMgr_PresentableObject::UpdateTransformation()
 
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    aPrsIter.ChangeValue().Presentation()->SetTransformation (myTransformation);
+    aPrsIter.ChangeValue()->SetTransformation (myTransformation);
   }
 
   for (PrsMgr_ListOfPresentableObjectsIter aChildIter (myChildren); aChildIter.More(); aChildIter.Next())
@@ -319,12 +328,8 @@ void PrsMgr_PresentableObject::recomputeComputed() const
 {
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value().Presentation();
-    if (!aPrs3d.IsNull()
-     && !aPrs3d->Presentation().IsNull())
-    {
-      aPrs3d->Presentation()->ReCompute();
-    }
+    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value();
+    aPrs3d->ReCompute();
   }
 }
 
@@ -337,13 +342,9 @@ void PrsMgr_PresentableObject::SetTransformPersistence (const Handle(Graphic3d_T
   myTransformPersistence = theTrsfPers;
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value().Presentation();
-    if (!aPrs3d.IsNull()
-     && !aPrs3d->Presentation().IsNull())
-    {
-      aPrs3d->Presentation()->SetTransformPersistence (myTransformPersistence);
-      aPrs3d->Presentation()->ReCompute();
-    }
+    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.Value();
+    aPrs3d->SetTransformPersistence (myTransformPersistence);
+    aPrs3d->ReCompute();
   }
 }
 
@@ -439,14 +440,8 @@ void PrsMgr_PresentableObject::SetZLayer (const Graphic3d_ZLayerId theLayerId)
   myDrawer->SetZLayer (theLayerId);
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aModedPrs = aPrsIter.Value();
-    if (aModedPrs.Presentation().IsNull()
-     || aModedPrs.Presentation()->Presentation().IsNull())
-    {
-      continue;
-    }
-
-    aModedPrs.Presentation()->Presentation()->SetZLayer (theLayerId);
+    const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
+    aModedPrs->SetZLayer (theLayerId);
   }
 }
 
@@ -509,12 +504,8 @@ void PrsMgr_PresentableObject::UpdateClipping()
 {
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aModedPrs = aPrsIter.Value();
-    if (!aModedPrs.Presentation().IsNull()
-     && !aModedPrs.Presentation()->Presentation().IsNull())
-    {
-      aModedPrs.Presentation()->Presentation()->SetClipPlanes (myClipPlanes);
-    }
+    const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
+    aModedPrs->SetClipPlanes (myClipPlanes);
   }
 }
 
@@ -532,12 +523,8 @@ void PrsMgr_PresentableObject::SetInfiniteState (const Standard_Boolean theFlag)
   myInfiniteState = theFlag;
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aModedPrs = aPrsIter.Value();
-    if (!aModedPrs.Presentation().IsNull()
-     && !aModedPrs.Presentation()->Presentation().IsNull())
-    {
-      aModedPrs.Presentation()->Presentation()->SetInfiniteState (theFlag);
-    }
+    const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
+    aModedPrs->SetInfiniteState (theFlag);
   }
 }
 
@@ -555,12 +542,8 @@ void PrsMgr_PresentableObject::SetMutable (const Standard_Boolean theIsMutable)
   myIsMutable = theIsMutable;
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation& aModedPrs = aPrsIter.Value();
-    if (!aModedPrs.Presentation().IsNull()
-     && !aModedPrs.Presentation()->Presentation().IsNull())
-    {
-      aModedPrs.Presentation()->Presentation()->SetMutable (theIsMutable);
-    }
+    const Handle(PrsMgr_Presentation)& aModedPrs = aPrsIter.Value();
+    aModedPrs->SetMutable (theIsMutable);
   }
 }
 
@@ -617,14 +600,8 @@ void PrsMgr_PresentableObject::SynchronizeAspects()
 {
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.ChangeValue().Presentation();
-    if (aPrs3d.IsNull()
-     || aPrs3d->Presentation().IsNull())
-    {
-      continue;
-    }
-
-    for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Presentation()->Groups()); aGroupIter.More(); aGroupIter.Next())
+    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.ChangeValue();
+    for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Groups()); aGroupIter.More(); aGroupIter.Next())
     {
       if (!aGroupIter.Value().IsNull())
       {
@@ -647,14 +624,8 @@ void PrsMgr_PresentableObject::replaceAspects (const Graphic3d_MapOfAspectsToAsp
 
   for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.ChangeValue().Presentation();
-    if (aPrs3d.IsNull()
-     || aPrs3d->Presentation().IsNull())
-    {
-      continue;
-    }
-
-    for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Presentation()->Groups()); aGroupIter.More(); aGroupIter.Next())
+    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.ChangeValue();
+    for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPrs3d->Groups()); aGroupIter.More(); aGroupIter.Next())
     {
       if (!aGroupIter.Value().IsNull())
       {
@@ -674,9 +645,8 @@ void PrsMgr_PresentableObject::BoundingBox (Bnd_Box& theBndBox)
   {
     if (!myPresentations.IsEmpty())
     {
-      const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations.First().Presentation();
-      const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
-      const Graphic3d_BndBox3d& aBndBox = aStruct->CStructure()->BoundingBox();
+      const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations.First();
+      const Graphic3d_BndBox3d& aBndBox = aPrs3d->CStructure()->BoundingBox();
       if (aBndBox.IsValid())
       {
         theBndBox.Update (aBndBox.CornerMin().x(), aBndBox.CornerMin().y(), aBndBox.CornerMin().z(),
@@ -701,13 +671,12 @@ void PrsMgr_PresentableObject::BoundingBox (Bnd_Box& theBndBox)
     return;
   }
 
-  for (Standard_Integer aPrsIter = 1; aPrsIter <= myPresentations.Length(); ++aPrsIter)
+  for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
   {
-    if (myPresentations (aPrsIter).Mode() == myDrawer->DisplayMode())
+    const Handle(PrsMgr_Presentation)& aPrs3d = aPrsIter.ChangeValue();
+    if (aPrs3d->Mode() == myDrawer->DisplayMode())
     {
-      const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter).Presentation();
-      const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
-      const Graphic3d_BndBox3d& aBndBox = aStruct->CStructure()->BoundingBox();
+      const Graphic3d_BndBox3d& aBndBox = aPrs3d->CStructure()->BoundingBox();
       if (aBndBox.IsValid())
       {
         theBndBox.Update (aBndBox.CornerMin().x(), aBndBox.CornerMin().y(), aBndBox.CornerMin().z(),
index 34fcae2c96d3020ef5079709d3767e0096e28864..c79bc8deb606db5bfa629dcc06c408367c0eb447 100644 (file)
 #include <PrsMgr_ListOfPresentableObjects.hxx>
 #include <PrsMgr_Presentation.hxx>
 #include <PrsMgr_Presentations.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
 #include <PrsMgr_TypeOfPresentation3d.hxx>
 #include <TColStd_ListOfInteger.hxx>
 
+class PrsMgr_PresentationManager;
+typedef PrsMgr_PresentationManager PrsMgr_PresentationManager3d;
+
 //! A framework to supply the Graphic3d structure of the object to be presented.
 //! On the first display request, this structure is created by calling the appropriate algorithm and retaining this framework for further display.
 //! This abstract framework is inherited in Application Interactive Services (AIS), notably by AIS_InteractiveObject.
index ff8b5ee8dce41c044df5f795a8c3b4e7b14e8b48..fa647c6bc25f41668e2a97777ec8c11db591aae8 100644 (file)
 
 #include <Geom_Transformation.hxx>
 #include <Graphic3d_DataStructureManager.hxx>
-#include <Graphic3d_Structure.hxx>
 #include <Precision.hxx>
 #include <Prs3d_Drawer.hxx>
-#include <Prs3d_Presentation.hxx>
 #include <Prs3d_Projector.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <PrsMgr_PresentableObject.hxx>
 #include <PrsMgr_PresentationManager.hxx>
-#include <PrsMgr_Prs.hxx>
 #include <Quantity_Color.hxx>
-#include <Standard_Type.hxx>
 #include <Graphic3d_CView.hxx>
 
-IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_Presentation, Standard_Transient)
+IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_Presentation, Graphic3d_Structure)
 
 namespace
 {
@@ -40,7 +35,7 @@ namespace
     State_Visible
   };
 
-  static BeforeHighlightState StructureState(const Handle(Prs3d_Presentation)& theStructure)
+  static BeforeHighlightState StructureState (const Graphic3d_Structure* theStructure)
   {
     return !theStructure->IsDisplayed() ?
       State_Empty : !theStructure->IsVisible() ?
@@ -53,16 +48,21 @@ namespace
 //purpose  :
 //=======================================================================
 PrsMgr_Presentation::PrsMgr_Presentation (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
-                                          const Handle(PrsMgr_PresentableObject)&     thePrsObject)
-: myPresentationManager  (thePrsMgr),
-  myPresentableObject    (thePrsObject.operator->()),
-  myMustBeUpdated        (Standard_False),
-  myBeforeHighlightState (State_Empty)
+                                          const Handle(PrsMgr_PresentableObject)& thePrsObject,
+                                          const Standard_Integer theMode)
+: Graphic3d_Structure (thePrsMgr->StructureManager()),
+  myPresentationManager  (thePrsMgr),
+  myPresentableObject    (thePrsObject.get()),
+  myBeforeHighlightState (State_Empty),
+  myMode                 (theMode),
+  myMustBeUpdated        (Standard_False)
 {
-  myStructure = new PrsMgr_Prs (thePrsMgr->StructureManager(),
-                                this, thePrsObject->TypeOfPresentation3d());
-  myStructure->SetOwner (myPresentableObject);
-  myStructure->SetMutable (myPresentableObject->IsMutable());
+  if (thePrsObject->TypeOfPresentation3d() == PrsMgr_TOP_ProjectorDependant)
+  {
+    SetVisual (Graphic3d_TOS_COMPUTED);
+  }
+  SetOwner (myPresentableObject);
+  SetMutable (myPresentableObject->IsMutable());
 }
 
 //=======================================================================
@@ -81,15 +81,15 @@ void PrsMgr_Presentation::Display()
 //=======================================================================
 void PrsMgr_Presentation::display (const Standard_Boolean theIsHighlight)
 {
-  if (!myStructure->IsDisplayed())
+  if (!base_type::IsDisplayed())
   {
-    myStructure->SetIsForHighlight (theIsHighlight);
-    myStructure->Display();
+    base_type::SetIsForHighlight (theIsHighlight);
+    base_type::Display();
   }
-  else if (!myStructure->IsVisible())
+  else if (!base_type::IsVisible())
   {
-    SetVisible (Standard_True);
-    myStructure->SetIsForHighlight (theIsHighlight);
+    base_type::SetVisible (Standard_True);
+    base_type::SetIsForHighlight (theIsHighlight);
   }
 }
 
@@ -99,27 +99,18 @@ void PrsMgr_Presentation::display (const Standard_Boolean theIsHighlight)
 //=======================================================================
 void PrsMgr_Presentation::Erase()
 {
-  if (myStructure.IsNull())
+  if (IsDeleted())
   {
     return;
   }
 
   // Erase structure from structure manager
-  myStructure->Erase();
-  myStructure->Clear();
+  base_type::Erase();
+  base_type::Clear();
   // Disconnect other structures
-  myStructure->DisconnectAll (Graphic3d_TOC_DESCENDANT);
+  base_type::DisconnectAll (Graphic3d_TOC_DESCENDANT);
   // Clear groups and remove graphic structure
-  myStructure.Nullify();
-}
-
-//=======================================================================
-//function : SetVisible
-//purpose  :
-//=======================================================================
-void PrsMgr_Presentation::SetVisible (const Standard_Boolean theValue)
-{
-  myStructure->SetVisible (theValue);
+  base_type::Remove();
 }
 
 //=======================================================================
@@ -130,30 +121,30 @@ void PrsMgr_Presentation::Highlight (const Handle(Prs3d_Drawer)& theStyle)
 {
   if (!IsHighlighted())
   {
-    myBeforeHighlightState = StructureState (myStructure);
+    myBeforeHighlightState = StructureState (this);
   }
 
   display (Standard_True);
-  myStructure->Highlight (theStyle);
+  base_type::Highlight (theStyle);
 }
 
 //=======================================================================
 //function : Unhighlight
 //purpose  :
 //=======================================================================
-void PrsMgr_Presentation::Unhighlight() const
+void PrsMgr_Presentation::Unhighlight()
 {
-  myStructure->UnHighlight();
+  base_type::UnHighlight();
   switch (myBeforeHighlightState)
   {
- case State_Visible:
-    return;
- case State_Hidden:
-    myStructure->SetVisible (Standard_False);
-    break;
- case State_Empty:
-    myStructure->Erase();
-    break;
   case State_Visible:
+      return;
   case State_Hidden:
+      base_type::SetVisible (Standard_False);
+      break;
   case State_Empty:
+      base_type::Erase();
+      break;
   }
 }
 
@@ -161,7 +152,7 @@ void PrsMgr_Presentation::Unhighlight() const
 //function : Clear
 //purpose  :
 //=======================================================================
-void PrsMgr_Presentation::Clear()
+void PrsMgr_Presentation::Clear (const Standard_Boolean theWithDestruction)
 {
   // This modification remove the contain of the structure:
   // Consequence:
@@ -169,69 +160,33 @@ void PrsMgr_Presentation::Clear()
   //    2. The speed for animation is constant
   //myPresentableObject = NULL;
   SetUpdateStatus (Standard_True);
-  if (myStructure.IsNull())
+  if (IsDeleted())
   {
     return;
   }
 
-  myStructure->Clear (Standard_True);
-  //  myStructure->Clear(Standard_False);
-  myStructure->RemoveAll();
+  base_type::Clear (theWithDestruction);
+  base_type::DisconnectAll (Graphic3d_TOC_DESCENDANT);
 }
 
 //=======================================================================
-//function : IsDisplayed
-//purpose  :
-//=======================================================================
-Standard_Boolean PrsMgr_Presentation::IsDisplayed() const
-{
-  return  myStructure->IsDisplayed()
-      &&  myStructure->IsVisible();
-}
-
-//=======================================================================
-//function : IsHighlighted
-//purpose  :
-//=======================================================================
-Standard_Boolean PrsMgr_Presentation::IsHighlighted() const
-{
-  return myStructure->IsHighlighted();
-}
-
-//=======================================================================
-//function : DisplayPriority
-//purpose  :
-//=======================================================================
-Standard_Integer PrsMgr_Presentation::DisplayPriority() const
-{
-  return myStructure->DisplayPriority();
-}
-
-//=======================================================================
-//function : SetDisplayPriority
-//purpose  :
-//=======================================================================
-void PrsMgr_Presentation::SetDisplayPriority (const Standard_Integer theNewPrior)
-{
-  myStructure->SetDisplayPriority (theNewPrior);
-}
-
-//=======================================================================
-//function : Connect
+//function : Compute
 //purpose  :
 //=======================================================================
-void PrsMgr_Presentation::Connect (const Handle(PrsMgr_Presentation)& theOther) const
+void PrsMgr_Presentation::Compute()
 {
-  myStructure->Connect (theOther->Presentation());
-}
+  Standard_Integer aDispMode = 0;
+  for (PrsMgr_Presentations::Iterator aPrsIter (myPresentableObject->myPresentations); aPrsIter.More(); aPrsIter.Next())
+  {
+    const Handle(PrsMgr_Presentation)& aModedPresentation = aPrsIter.Value();
+    if (aModedPresentation == this)
+    {
+      aDispMode = aModedPresentation->Mode();
+      break;
+    }
+  }
 
-//=======================================================================
-//function : SetTransformation
-//purpose  :
-//=======================================================================
-void PrsMgr_Presentation::SetTransformation (const Handle(Geom_Transformation)& theTrsf) const
-{
-  myStructure->SetTransformation (theTrsf);
+  myPresentableObject->Compute (myPresentationManager, this, aDispMode);
 }
 
 //=======================================================================
@@ -240,42 +195,20 @@ void PrsMgr_Presentation::SetTransformation (const Handle(Geom_Transformation)&
 //=======================================================================
 Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector)
 {
-  Handle(Prs3d_Presentation) aPrs = new Prs3d_Presentation (myPresentationManager->StructureManager());
+  Handle(Graphic3d_Structure) aPrs = new Graphic3d_Structure (myPresentationManager->StructureManager());
   myPresentableObject->Compute (Projector (theProjector), aPrs);
   return aPrs;
 }
 
-//=======================================================================
-//function : Compute
-//purpose  :
-//=======================================================================
-void PrsMgr_Presentation::Compute (const Handle(Graphic3d_Structure)& theStructure)
-{
-  Standard_Integer aDispMode = 0;
-  Standard_Integer aPresentationsNumber = myPresentableObject->myPresentations.Length();
-  for (Standard_Integer anIter = 1; anIter <= aPresentationsNumber; ++anIter)
-  {
-    const PrsMgr_ModedPresentation& aModedPresentation = myPresentableObject->myPresentations.Value (anIter);
-    if (aModedPresentation.Presentation().operator->() == this)
-    {
-      aDispMode = aModedPresentation.Mode();
-      break;
-    }
-  }
-
-  Handle(Prs3d_Presentation) aPrs3d = Handle(Prs3d_Presentation)::DownCast (theStructure);
-  myPresentableObject->Compute (myPresentationManager, aPrs3d, aDispMode);
-}
-
 //=======================================================================
 //function : Compute
 //purpose  :
 //=======================================================================
 void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                                   const Handle(Graphic3d_Structure)&            theStructToFill)
+                                   Handle(Graphic3d_Structure)& theStructToFill)
 {
   theStructToFill->Clear();
-  Handle(Prs3d_Presentation) aPrs (Handle(Prs3d_Presentation)::DownCast (theStructToFill));
+  Handle(Prs3d_Presentation) aPrs = theStructToFill;
   myPresentableObject->Compute (Projector (theProjector), aPrs);
 }
 
@@ -296,11 +229,11 @@ Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d
 //purpose  :
 //=======================================================================
 void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                                   const Handle(Geom_Transformation)&            theTrsf,
-                                   const Handle(Graphic3d_Structure)&            theStructToFill)
+                                   const Handle(Geom_Transformation)& theTrsf,
+                                   Handle(Graphic3d_Structure)& theStructToFill)
 {
   // recompute HLR after transformation in all the case
-  Handle(Prs3d_Presentation) aPrs = Handle(Prs3d_Presentation)::DownCast (theStructToFill);
+  Handle(Graphic3d_Structure) aPrs = theStructToFill;
   theStructToFill->Clear();
   myPresentableObject->Compute (Projector (theProjector), theTrsf, aPrs);
 }
@@ -331,21 +264,3 @@ PrsMgr_Presentation::~PrsMgr_Presentation()
 {
   Erase();
 }
-
-//=======================================================================
-//function : SetZLayer
-//purpose  :
-//=======================================================================
-void PrsMgr_Presentation::SetZLayer (Graphic3d_ZLayerId theLayerId)
-{
-  myStructure->SetZLayer (theLayerId);
-}
-
-//=======================================================================
-//function : GetZLayer
-//purpose  :
-//=======================================================================
-Graphic3d_ZLayerId PrsMgr_Presentation::GetZLayer() const
-{
-  return myStructure->GetZLayer();
-}
index 9df9a7059fd7d7005c0389246b83c5df9e163544..b91c2802c5d9bdb9d9bc7dfbb84bb78fde0440b2 100644 (file)
 #ifndef _PrsMgr_Presentation_HeaderFile
 #define _PrsMgr_Presentation_HeaderFile
 
-#include <Graphic3d_ZLayerId.hxx>
-#include <Standard.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
 #include <Aspect_TypeOfHighlightMethod.hxx>
+#include <Prs3d_Presentation.hxx>
 
 class PrsMgr_PresentationManager;
-class PrsMgr_Prs;
 class PrsMgr_PresentableObject;
 class Quantity_Color;
 class Geom_Transformation;
-class Prs3d_Presentation;
 class Prs3d_Drawer;
 class Graphic3d_Structure;
 class Graphic3d_DataStructureManager;
 class Prs3d_Projector;
 
-DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, Standard_Transient)
+DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, Graphic3d_Structure)
 
-class PrsMgr_Presentation : public Standard_Transient
+class PrsMgr_Presentation : public Graphic3d_Structure
 {
-  DEFINE_STANDARD_RTTIEXT(PrsMgr_Presentation, Standard_Transient)
+  DEFINE_STANDARD_RTTIEXT(PrsMgr_Presentation, Graphic3d_Structure)
   friend class PrsMgr_PresentationManager;
   friend class PrsMgr_PresentableObject;
-  friend class PrsMgr_Prs;
 public:
 
   //! Destructor
   Standard_EXPORT ~PrsMgr_Presentation();
 
-  const Handle(Prs3d_Presentation)& Presentation() const { return myStructure; }
+  Standard_DEPRECATED("Dummy to simplify porting - returns self")
+  Prs3d_Presentation* Presentation() { return this; }
 
   //! returns the PresentationManager in which the presentation has been created.
   const Handle(PrsMgr_PresentationManager)& PresentationManager() const { return myPresentationManager; }
@@ -58,64 +51,66 @@ public:
 
   Standard_Boolean MustBeUpdated() const { return myMustBeUpdated; }
 
-private:
+  //! Return display mode index.
+  Standard_Integer Mode() const { return myMode; }
 
-  Standard_EXPORT PrsMgr_Presentation(const Handle(PrsMgr_PresentationManager)& thePresentationManager, const Handle(PrsMgr_PresentableObject)& thePresentableObject);
-  
-  Standard_EXPORT void Display();
-  
-  //! Displays myStructure.
-  Standard_EXPORT void display (const Standard_Boolean theIsHighlight);
-  
-  Standard_EXPORT void Erase();
-  
-  Standard_EXPORT void SetVisible (const Standard_Boolean theValue);
-  
+  //! Display structure.
+  Standard_EXPORT virtual void Display() Standard_OVERRIDE;
+
+  //! Remove structure.
+  Standard_EXPORT virtual void Erase() Standard_OVERRIDE;
+
+  //! Highlight structure.
   Standard_EXPORT void Highlight (const Handle(Prs3d_Drawer)& theStyle);
-  
-  Standard_EXPORT void Unhighlight() const;
-  
-  Standard_EXPORT Standard_Boolean IsHighlighted() const;
-  
-  Standard_EXPORT Standard_Boolean IsDisplayed() const;
-  
-  Standard_EXPORT Standard_Integer DisplayPriority() const;
-  
-  Standard_EXPORT void SetDisplayPriority (const Standard_Integer aNewPrior);
-  
-  //! Set Z layer ID for the presentation
-  Standard_EXPORT void SetZLayer (const Graphic3d_ZLayerId theLayerId);
-  
-  //! Get Z layer ID for the presentation
-  Standard_EXPORT Graphic3d_ZLayerId GetZLayer() const;
-  
+
+  //! Unhighlight structure.
+  Standard_EXPORT void Unhighlight();
+
+  //! Return TRUE if structure has been displayed and in no hidden state.
+  virtual Standard_Boolean IsDisplayed() const Standard_OVERRIDE
+  {
+    return base_type::IsDisplayed()
+        && base_type::IsVisible();
+  }
+
   //! removes the whole content of the presentation.
   //! Does not remove the other connected presentations.
-  Standard_EXPORT void Clear();
-  
-  Standard_EXPORT void Connect (const Handle(PrsMgr_Presentation)& theOther) const;
-  
-  Standard_EXPORT void SetTransformation (const Handle(Geom_Transformation)& theTrsf) const;
-
-  Standard_EXPORT void Compute (const Handle(Graphic3d_Structure)& theStructure);
-  
-  Standard_EXPORT Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector);
-  
-  Standard_EXPORT Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Geom_Transformation)& theTrsf);
-  
-  Standard_EXPORT void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Graphic3d_Structure)& theGivenStruct);
-  
-  Standard_EXPORT void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Geom_Transformation)& theTrsf, const Handle(Graphic3d_Structure)& theGivenStruct);
-  
+  Standard_EXPORT virtual void Clear (const Standard_Boolean theWithDestruction = Standard_True) Standard_OVERRIDE;
+
+  //! Compute structure using presentation manager.
+  Standard_EXPORT virtual void Compute() Standard_OVERRIDE;
+
+protected:
+
+  //! Main constructor.
+  Standard_EXPORT PrsMgr_Presentation (const Handle(PrsMgr_PresentationManager)& thePresentationManager,
+                                       const Handle(PrsMgr_PresentableObject)& thePresentableObject,
+                                       const Standard_Integer theMode);
+
+  //! Displays myStructure.
+  Standard_EXPORT void display (const Standard_Boolean theIsHighlight);
+
+  Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector) Standard_OVERRIDE;
+
+  Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
+                                                               const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE;
+
+  Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
+                                        Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
+
+  Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
+                                        const Handle(Geom_Transformation)& theTrsf,
+                                        Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
+
   Standard_EXPORT static Handle(Prs3d_Projector) Projector (const Handle(Graphic3d_DataStructureManager)& theProjector);
 
 protected:
 
   Handle(PrsMgr_PresentationManager) myPresentationManager;
-  Handle(Prs3d_Presentation) myStructure;
   PrsMgr_PresentableObject* myPresentableObject;
-  Standard_Boolean myMustBeUpdated;
   Standard_Integer myBeforeHighlightState;
+  Standard_Integer myMode;
+  Standard_Boolean myMustBeUpdated;
 
 };
 
index e237fe16013eeed0c39e4e19f805119905cabf5e..4cb5544d31b16c8febef3a682c9d6ed7870cd07b 100644 (file)
@@ -19,7 +19,6 @@
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_Presentation.hxx>
 #include <Prs3d_PresentationShadow.hxx>
-#include <PrsMgr_ModedPresentation.hxx>
 #include <PrsMgr_PresentableObject.hxx>
 #include <PrsMgr_Presentation.hxx>
 #include <PrsMgr_Presentations.hxx>
@@ -58,7 +57,7 @@ void PrsMgr_PresentationManager::Display (const Handle(PrsMgr_PresentableObject)
 
     if (myImmediateModeOn > 0)
     {
-      AddToImmediateList (aPrs->Presentation());
+      AddToImmediateList (aPrs);
     }
     else
     {
@@ -89,22 +88,22 @@ void PrsMgr_PresentationManager::Erase (const Handle(PrsMgr_PresentableObject)&
   }
 
   PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
-  for (PrsMgr_Presentations::Iterator anIt (aPrsList); anIt.More();)
+  for (PrsMgr_Presentations::Iterator aPrsIter (aPrsList); aPrsIter.More();)
   {
-    const PrsMgr_ModedPresentation& aModedPrs = anIt.Value();
-    if (aModedPrs.Presentation().IsNull())
+    const Handle(PrsMgr_Presentation)& aPrs = aPrsIter.Value();
+    if (aPrs.IsNull())
     {
-      anIt.Next();
+      aPrsIter.Next();
       continue;
     }
 
-    const Handle(PrsMgr_PresentationManager)& aPrsMgr = aModedPrs.Presentation()->PresentationManager();
-    if ((theMode == aModedPrs.Mode() || theMode == -1)
+    const Handle(PrsMgr_PresentationManager)& aPrsMgr = aPrs->PresentationManager();
+    if ((theMode == aPrs->Mode() || theMode == -1)
      && (this == aPrsMgr))
     {
-      aModedPrs.Presentation()->Erase();
+      aPrs->Erase();
 
-      aPrsList.Remove (anIt);
+      aPrsList.Remove (aPrsIter);
 
       if (theMode != -1)
       {
@@ -113,7 +112,7 @@ void PrsMgr_PresentationManager::Erase (const Handle(PrsMgr_PresentableObject)&
     }
     else
     {
-      anIt.Next();
+      aPrsIter.Next();
     }
   }
 }
@@ -173,11 +172,10 @@ void PrsMgr_PresentationManager::Unhighlight (const Handle(PrsMgr_PresentableObj
   }
 
   const PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
-  for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
+  for (PrsMgr_Presentations::Iterator aPrsIter (aPrsList); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation&           aModedPrs = aPrsList.Value (aPrsIter);
-    const Handle(PrsMgr_Presentation)&        aPrs      = aModedPrs.Presentation();
-    const Handle(PrsMgr_PresentationManager)& aPrsMgr   = aPrs->PresentationManager();
+    const Handle(PrsMgr_Presentation)& aPrs = aPrsIter.Value();
+    const Handle(PrsMgr_PresentationManager)& aPrsMgr = aPrs->PresentationManager();
     if (this == aPrsMgr
     &&  aPrs->IsHighlighted())
     {
@@ -344,8 +342,7 @@ void PrsMgr_PresentationManager::displayImmediate (const Handle(V3d_Viewer)& the
       if (!aShadowPrs.IsNull() && aView->IsComputed (aShadowPrs->ParentId(), aViewDepPrs))
       {
         aShadowPrs.Nullify();
-        aShadowPrs = new Prs3d_PresentationShadow (myStructureManager, 
-                                                   Handle(Prs3d_Presentation)::DownCast (aViewDepPrs));
+        aShadowPrs = new Prs3d_PresentationShadow (myStructureManager, aViewDepPrs);
         aShadowPrs->SetZLayer (aViewDepPrs->CStructure()->ZLayer());
         aShadowPrs->SetClipPlanes (aViewDepPrs->ClipPlanes());
         aShadowPrs->CStructure()->IsForHighlight = 1;
@@ -447,11 +444,11 @@ Standard_Boolean PrsMgr_PresentationManager::HasPresentation (const Handle(PrsMg
     return Standard_False;
 
   const PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
-  for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
+  for (PrsMgr_Presentations::Iterator aPrsIter (aPrsList); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation&           aModedPrs = aPrsList.Value (aPrsIter);
-    const Handle(PrsMgr_PresentationManager)& aPrsMgr   = aModedPrs.Presentation()->PresentationManager();
-    if (theMode == aModedPrs.Mode()
+    const Handle(PrsMgr_Presentation)& aPrs = aPrsIter.Value();
+    const Handle(PrsMgr_PresentationManager)& aPrsMgr = aPrs->PresentationManager();
+    if (theMode == aPrs->Mode()
      && this    == aPrsMgr)
     {
       return Standard_True;
@@ -470,14 +467,14 @@ Handle(PrsMgr_Presentation) PrsMgr_PresentationManager::Presentation (const Hand
                                                                       const Handle(PrsMgr_PresentableObject)& theSelObj) const
 {
   const PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
-  for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
+  for (PrsMgr_Presentations::Iterator aPrsIter (aPrsList); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation&           aModedPrs = aPrsList.Value (aPrsIter);
-    const Handle(PrsMgr_PresentationManager)& aPrsMgr   = aModedPrs.Presentation()->PresentationManager();
-    if (theMode == aModedPrs.Mode()
+    const Handle(PrsMgr_Presentation)& aPrs = aPrsIter.Value();
+    const Handle(PrsMgr_PresentationManager)& aPrsMgr = aPrs->PresentationManager();
+    if (theMode == aPrs->Mode()
      && this    == aPrsMgr)
     {
-      return aModedPrs.Presentation();
+      return aPrs;
     }
   }
 
@@ -486,10 +483,10 @@ Handle(PrsMgr_Presentation) PrsMgr_PresentationManager::Presentation (const Hand
     return Handle(PrsMgr_Presentation)();
   }
 
-  Handle(PrsMgr_Presentation) aPrs = new PrsMgr_Presentation (this, thePrsObj);
+  Handle(PrsMgr_Presentation) aPrs = new PrsMgr_Presentation (this, thePrsObj, theMode);
   aPrs->SetZLayer (thePrsObj->ZLayer());
-  aPrs->Presentation()->CStructure()->ViewAffinity = myStructureManager->ObjectAffinity (!theSelObj.IsNull() ? theSelObj : thePrsObj);
-  thePrsObj->Presentations().Append (PrsMgr_ModedPresentation (aPrs, theMode));
+  aPrs->CStructure()->ViewAffinity = myStructureManager->ObjectAffinity (!theSelObj.IsNull() ? theSelObj : thePrsObj);
+  thePrsObj->Presentations().Append (aPrs);
   thePrsObj->Fill (this, aPrs, theMode);
 
   // set layer index accordingly to object's presentations
@@ -505,11 +502,11 @@ Standard_Boolean PrsMgr_PresentationManager::RemovePresentation (const Handle(Pr
                                                                  const Standard_Integer                  theMode)
 {
   PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
-  for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
+  for (PrsMgr_Presentations::Iterator aPrsIter (aPrsList); aPrsIter.More(); aPrsIter.Next())
   {
-    const PrsMgr_ModedPresentation&           aModedPrs = aPrsList.Value (aPrsIter);
-    const Handle(PrsMgr_PresentationManager)& aPrsMgr   = aModedPrs.Presentation()->PresentationManager();
-    if (theMode == aPrsList (aPrsIter).Mode()
+    const Handle(PrsMgr_Presentation)& aPrs = aPrsIter.Value();
+    const Handle(PrsMgr_PresentationManager)& aPrsMgr = aPrs->PresentationManager();
+    if (theMode == aPrs->Mode()
      && this    == aPrsMgr)
     {
       aPrsList.Remove (aPrsIter);
@@ -558,7 +555,7 @@ void PrsMgr_PresentationManager::Connect (const Handle(PrsMgr_PresentableObject)
 {
   Handle(PrsMgr_Presentation) aPrs      = Presentation (thePrsObject,   theMode,      Standard_True);
   Handle(PrsMgr_Presentation) aPrsOther = Presentation (theOtherObject, theOtherMode, Standard_True);
-  aPrs->Connect (aPrsOther);
+  aPrs->Connect (aPrsOther.get(), Graphic3d_TOC_DESCENDANT);
 }
 
 // =======================================================================
@@ -599,9 +596,9 @@ void PrsMgr_PresentationManager::Color (const Handle(PrsMgr_PresentableObject)&
 
   if (myImmediateModeOn > 0)
   {
-    Handle(Prs3d_PresentationShadow) aShadow = new Prs3d_PresentationShadow (myStructureManager, aPrs->Presentation());
+    Handle(Prs3d_PresentationShadow) aShadow = new Prs3d_PresentationShadow (myStructureManager, aPrs);
     aShadow->SetZLayer (theImmediateStructLayerId);
-    aShadow->SetClipPlanes (aPrs->Presentation()->ClipPlanes());
+    aShadow->SetClipPlanes (aPrs->ClipPlanes());
     aShadow->CStructure()->IsForHighlight = 1;
     aShadow->Highlight (theStyle);
     AddToImmediateList (aShadow);
@@ -658,7 +655,7 @@ void PrsMgr_PresentationManager::UpdateHighlightTrsf (const Handle(V3d_Viewer)&
   }
 
   Handle(Geom_Transformation) aTrsf = theObj->LocalTransformationGeom();
-  const Standard_Integer aParentId = aPrs->Presentation()->CStructure()->Id;
+  const Standard_Integer aParentId = aPrs->CStructure()->Id;
   updatePrsTransformation (myImmediateList, aParentId, aTrsf);
 
   if (!myViewDependentImmediateList.IsEmpty())
index 70a8dd22c245b4e07f7ef58c9e5133eec7406689..ae94609f6c456f9cdbba246ef2ef14fc9b02c37b 100644 (file)
 #include <Standard_Integer.hxx>
 #include <Standard_Type.hxx>
 
+class Graphic3d_Structure;
+typedef Graphic3d_Structure Prs3d_Presentation;
+
 class Geom_Transformation;
 class Prs3d_Drawer;
-class Prs3d_Presentation;
-class PrsMgr_PresentableObject;
 class PrsMgr_Presentation;
+class PrsMgr_PresentableObject;
 class Standard_NoSuchObject;
 class V3d_Viewer;
 
index 179becd97cfa4fcbd48afc4e9cc3e921a6ebfc68..a77adb1a881759a66fd39c32c26fe446ae0a45d7 100644 (file)
 #ifndef PrsMgr_Presentations_HeaderFile
 #define PrsMgr_Presentations_HeaderFile
 
-#include <PrsMgr_ModedPresentation.hxx>
+#include <Standard_Type.hxx>
 #include <NCollection_Sequence.hxx>
 
-typedef NCollection_Sequence<PrsMgr_ModedPresentation> PrsMgr_Presentations;
-
+class PrsMgr_Presentation;
+typedef NCollection_Sequence<Handle(PrsMgr_Presentation)> PrsMgr_Presentations;
 
 #endif
diff --git a/src/PrsMgr/PrsMgr_Prs.cxx b/src/PrsMgr/PrsMgr_Prs.cxx
deleted file mode 100644 (file)
index 1f02d67..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 1998-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <PrsMgr_Prs.hxx>
-
-#include <Geom_Transformation.hxx>
-#include <gp_Trsf.hxx>
-#include <Graphic3d_DataStructureManager.hxx>
-#include <Graphic3d_Structure.hxx>
-#include <Graphic3d_StructureManager.hxx>
-#include <Precision.hxx>
-#include <PrsMgr_Presentation.hxx>
-#include <Standard_Type.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_Prs,Prs3d_Presentation)
-
-PrsMgr_Prs::PrsMgr_Prs (const Handle(Graphic3d_StructureManager)& theStructManager,
-                        PrsMgr_Presentation* thePrs,
-                        PrsMgr_TypeOfPresentation3d theTypeOfPresentation)
-: Prs3d_Presentation (theStructManager),
-  myPresentation3d   (thePrs)
-{
-  if (theTypeOfPresentation == PrsMgr_TOP_ProjectorDependant)
-    SetVisual(Graphic3d_TOS_COMPUTED);
-}
-
-//=======================================================================
-//function : Compute
-//purpose  : 
-//=======================================================================
-
-void PrsMgr_Prs::Compute()
-{
-  myPresentation3d->Compute (this);
-}
-
-//=======================================================================
-//function : Compute
-//purpose  : 
-//=======================================================================
-
-Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector) {
-  return myPresentation3d->Compute(aProjector);
-}
-//=======================================================================
-//function : Compute
-//purpose  :
-//=======================================================================
-
-Handle(Graphic3d_Structure) PrsMgr_Prs::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                                                                                    const Handle(Geom_Transformation)& theTrsf)
-{
-  return myPresentation3d->Compute (theProjector, theTrsf);
-}
-
-//=======================================================================
-//function : Compute
-//purpose  : 
-//=======================================================================
-
-void PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector,
-                        Handle(Graphic3d_Structure)& aGivenStruct) 
-{
-  myPresentation3d->Compute(aProjector,aGivenStruct);
-}
-
-
-//=======================================================================
-//function : Compute
-//purpose  :
-//=======================================================================
-
-void PrsMgr_Prs::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                          const Handle(Geom_Transformation)& theTrsf,
-                          Handle(Graphic3d_Structure)& theGivenStruct)
-{
-  myPresentation3d->Compute (theProjector, theTrsf, theGivenStruct);
-}
diff --git a/src/PrsMgr/PrsMgr_Prs.hxx b/src/PrsMgr/PrsMgr_Prs.hxx
deleted file mode 100644 (file)
index 9b2b933..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// Created on: 1995-01-31
-// Created by: Mister rmi
-// Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _PrsMgr_Prs_HeaderFile
-#define _PrsMgr_Prs_HeaderFile
-
-#include <Prs3d_Presentation.hxx>
-#include <PrsMgr_TypeOfPresentation3d.hxx>
-#include <TColStd_Array2OfReal.hxx>
-
-class Graphic3d_StructureManager;
-class Graphic3d_Structure;
-class Graphic3d_DataStructureManager;
-class PrsMgr_Presentation;
-
-DEFINE_STANDARD_HANDLE(PrsMgr_Prs, Prs3d_Presentation)
-
-class PrsMgr_Prs : public Prs3d_Presentation
-{
-  DEFINE_STANDARD_RTTIEXT(PrsMgr_Prs, Prs3d_Presentation)
-public:
-  
-  Standard_EXPORT PrsMgr_Prs (const Handle(Graphic3d_StructureManager)& theStructManager,
-                              PrsMgr_Presentation* thePresentation,
-                              PrsMgr_TypeOfPresentation3d theTypeOfPresentation3d);
-
-  Standard_EXPORT virtual void Compute() Standard_OVERRIDE;
-  
-  Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector) Standard_OVERRIDE;
-  
-  //! the "degenerated" Structure is displayed with
-  //! a transformation defined by <AMatrix>
-  //! which is not a Pure Translation.
-  //! We have to take in account this Transformation
-  //! in the computation of hidden line removal...
-  //! returns a filled Graphic Structure.
-  Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                                                               const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE;
-
-  //! No need to return a structure, just to fill
-  //! <ComputedStruct> ....
-  Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, Handle(Graphic3d_Structure)& ComputedStruct) Standard_OVERRIDE;
-  
-  //! No Need to return a Structure, just to
-  //! Fill <aStructure>. The Trsf has to be taken in account
-  //! in the computation (Rotation Part....)
-  Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
-                                        const Handle(Geom_Transformation)& theTrsf,
-                                        Handle(Graphic3d_Structure)& theStructure) Standard_OVERRIDE;
-
-private:
-
-  PrsMgr_Presentation* myPresentation3d;
-
-};
-
-#endif // _PrsMgr_Prs_HeaderFile
index d5d7dca1a5f8c25e1470f89b72f13acb31fdf1fd..002a131cc60af859d826797b0a02b84b2dcbdf38 100644 (file)
 #ifndef _QABugs_PresentableObject_HeaderFile
 #define _QABugs_PresentableObject_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <AIS_InteractiveObject.hxx>
-#include <PrsMgr_TypeOfPresentation3d.hxx>
-#include <SelectMgr_Selection.hxx>
-#include <Standard_Integer.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-class Prs3d_Presentation;
-
 
-class QABugs_PresentableObject;
 DEFINE_STANDARD_HANDLE(QABugs_PresentableObject, AIS_InteractiveObject)
 
-
 class QABugs_PresentableObject : public AIS_InteractiveObject
 {
-
+  DEFINE_STANDARD_RTTIEXT(QABugs_PresentableObject, AIS_InteractiveObject)
 public:
 
-  
   Standard_EXPORT QABugs_PresentableObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
 
-
-
-
-  DEFINE_STANDARD_RTTIEXT(QABugs_PresentableObject,AIS_InteractiveObject)
-
 protected:
 
-  
   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
   
   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
 
-
-
-private:
-
-
-
-
 };
 
-
-
-
-
-
-
 #endif // _QABugs_PresentableObject_HeaderFile
index efb7604a469a1cf411dc40c0f90e058881bd4320..2da46a41202ad5c490f1a2d6124f1497f59af063 100644 (file)
@@ -24,7 +24,6 @@
 #include <SelectMgr_SequenceOfOwner.hxx>
 
 class SelectMgr_EntityOwner;
-class Prs3d_Presentation;
 class Standard_NotImplemented;
 class SelectMgr_SelectionManager;
 
index 2e69da3b8dd3b4f984e6872ad0c4b23f4879b282..5fced62612e2838daf0007b23963233221e0b44d 100644 (file)
 #ifndef _StdPrs_Curve_HeaderFile
 #define _StdPrs_Curve_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Real.hxx>
 #include <TColgp_SequenceOfPnt.hxx>
-#include <Standard_Integer.hxx>
-class Prs3d_Presentation;
-class Adaptor3d_Curve;
 
+class Adaptor3d_Curve;
 
 //! A framework to define display of lines, arcs of circles
 //! and conic sections.
index 8cd4bb31745be88feab70c3f71d8b18781edc1c0..5f26d89b1aaa17292c5aefa132fa7b64c06c3155 100644 (file)
 #ifndef _StdPrs_DeflectionCurve_HeaderFile
 #define _StdPrs_DeflectionCurve_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Real.hxx>
 #include <TColgp_SequenceOfPnt.hxx>
 
-class Prs3d_Presentation;
 class Adaptor3d_Curve;
 
-
 //! A framework to provide display of any curve with
 //! respect to the maximal chordal deviation defined in
 //! the Prs3d_Drawer attributes manager.
index 707ffa6c2dbe0e95c7224f17eb3d1f8bea427df4..5edfc044e2337157bcaba446e7027a04d74bf880 100644 (file)
 #ifndef _StdPrs_HLRPolyShape_HeaderFile
 #define _StdPrs_HLRPolyShape_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
+
 class TopoDS_Shape;
 class Prs3d_Projector;
 
-
 //! Instantiates Prs3d_PolyHLRShape to define a
 //! display of a shape where hidden and visible lines are
 //! identified with respect to a given projection.
index 0c91ebd7e8c8089be8f3d065e57f9915a90562cb..4d29fa18c639c68b6f5ebcc03da4c846c8006afa 100644 (file)
 #ifndef _StdPrs_Plane_HeaderFile
 #define _StdPrs_Plane_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Boolean.hxx>
 
-class Prs3d_Presentation;
 class Adaptor3d_Surface;
 
-
 //! A framework to display infinite planes.
 class StdPrs_Plane  : public Prs3d_Root
 {
index 9c78baad011958da61ec46479d3efeffc4b76279..a42562aa77c7aa715240a3a58a9f4048c1963510 100644 (file)
 #ifndef _StdPrs_PoleCurve_HeaderFile
 #define _StdPrs_PoleCurve_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Integer.hxx>
 
-class Prs3d_Presentation;
 class Adaptor3d_Curve;
 
-
 //! A framework to provide display of Bezier or BSpline curves
 //! (by drawing a broken line linking the poles of the curve).
 class StdPrs_PoleCurve  : public Prs3d_Root
index 0bd9d8bd3458350e09e80f736962b4c366fa0783..f65e762ce2fa671b6036716c24671208d6a4d0c7 100644 (file)
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <StdPrs_Volume.hxx>
-#include <Standard_Boolean.hxx>
 
 class Graphic3d_ArrayOfSegments;
 class Graphic3d_ArrayOfTriangles;
-class Prs3d_Presentation;
 class TopoDS_Shape;
 class gp_Pnt2d;
 class BRep_Builder;
index 5a38ebedb90c2c5a169dba66940d89fc62a78db0..3bb48cb5ff7e52157c2788f0683f7e256a834eb1 100644 (file)
 #ifndef _StdPrs_ShadedSurface_HeaderFile
 #define _StdPrs_ShadedSurface_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
-class Adaptor3d_Surface;
 
+class Adaptor3d_Surface;
 
 //! Computes the shading presentation of surfaces.
 //! Draws a surface by drawing the isoparametric curves with respect to
index 64fd2031f51327a385dd515be9bd101e762a3c67..be7d35f9f7dc8bd1f683082abdd83003c16de114 100644 (file)
 #ifndef _StdPrs_WFDeflectionRestrictedFace_HeaderFile
 #define _StdPrs_WFDeflectionRestrictedFace_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Integer.hxx>
 #include <Prs3d_NListOfSequenceOfPnt.hxx>
 
-class Prs3d_Presentation;
 class BRepAdaptor_HSurface;
 class Bnd_Box;
 
-
 //! A framework to provide display of U and V
 //! isoparameters of faces, while allowing you to impose
 //! a deflection on them.
index 1db12e2cefc871cc2d96b3480d534fb253bd1338..87f832b27bd34840c7b6533d9bfaff79a7054991 100644 (file)
 #ifndef _StdPrs_WFDeflectionSurface_HeaderFile
 #define _StdPrs_WFDeflectionSurface_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
-class Adaptor3d_HSurface;
 
+class Adaptor3d_HSurface;
 
 //! Draws a surface by drawing the isoparametric curves with respect to
 //! a maximal chordial deviation.
index 3ed460482e539d6baacd27bac687c3f2bfffa7b0..f0ffaeb55092ac61848e001b350c80a545ba5914 100644 (file)
 #ifndef _StdPrs_WFPoleSurface_HeaderFile
 #define _StdPrs_WFPoleSurface_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
-class Adaptor3d_Surface;
 
+class Adaptor3d_Surface;
 
 //! Computes the presentation of surfaces by drawing a
 //! double network of lines linking the poles of the surface
index f5e0faa36ac3487cf78e6d70147a7b675e10395c..dacdba11c3b4f4f0e91915911b16c3341b5c1514 100644 (file)
 #ifndef _StdPrs_WFSurface_HeaderFile
 #define _StdPrs_WFSurface_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
 #include <Prs3d_Root.hxx>
 #include <Prs3d_Drawer.hxx>
-class Prs3d_Presentation;
-class Adaptor3d_HSurface;
 
+class Adaptor3d_HSurface;
 
 //! Computes the wireframe presentation of surfaces
 //! by displaying a given number of U and/or V isoparametric
index 250f1992b96c833f24e66cc4585f1d702096344d..f6ebdd44c489047b3c7ba58ead05fe2b73076fd4 100644 (file)
 #ifndef _StdSelect_Shape_HeaderFile
 #define _StdSelect_Shape_HeaderFile
 
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
 #include <TopoDS_Shape.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <PrsMgr_PresentableObject.hxx>
-#include <PrsMgr_PresentationManager3d.hxx>
-#include <Standard_Integer.hxx>
 
 class TopoDS_Shape;
-class Prs3d_Presentation;
-class Prs3d_Projector;
-class Geom_Transformation;
 
 //! Presentable shape only for purpose of display for BRepOwner...
 class StdSelect_Shape : public PrsMgr_PresentableObject
index 47604eff680c6ef16f7733a4c9551647367b959e..321044872ec602a68d29680a01930d4683adf8cb 100644 (file)
@@ -3870,10 +3870,10 @@ inline void bndPresentation (Draw_Interpretor&                         theDI,
       Bnd_Box aBox;
       for (PrsMgr_Presentations::Iterator aPrsIter (theObj->Presentations()); aPrsIter.More(); aPrsIter.Next())
       {
-        if (aPrsIter.Value().Mode() != theDispMode)
+        if (aPrsIter.Value()->Mode() != theDispMode)
           continue;
 
-        aBox = aPrsIter.Value().Presentation()->Presentation()->MinMaxValues();
+        aBox = aPrsIter.Value()->MinMaxValues();
       }
       gp_Pnt aMin = aBox.CornerMin();
       gp_Pnt aMax = aBox.CornerMax();
index 46c7bf47852d07030507df247ad13d7bbeeaa438..21ad5880d5023e68aa9b5fc9392f707e8be902de 100644 (file)
@@ -207,8 +207,8 @@ void XCAFPrs_AISObject::Compute (const Handle(PrsMgr_PresentationManager3d)& the
     Standard_Boolean toMapStyles = myToSyncStyles;
     for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
     {
-      if (aPrsIter.Value().Presentation()->Presentation() != thePrs
-      && !aPrsIter.Value().Presentation()->MustBeUpdated())
+      if (aPrsIter.Value() != thePrs
+      && !aPrsIter.Value()->MustBeUpdated())
       {
         toMapStyles = Standard_False;
         break;