]> OCCT Git - occt-copy.git/commitdiff
0029451: Information Message Alert to debug an algorithm or object functionality
authornds <nds@opencascade.com>
Fri, 2 Aug 2019 05:07:13 +0000 (08:07 +0300)
committernds <nds@opencascade.com>
Fri, 2 Aug 2019 05:07:13 +0000 (08:07 +0300)
Dump/Init implementation in OCCT object and parsing it in VInspector (partially)

91 files changed:
src/AIS/AIS_InteractiveObject.cxx
src/AIS/AIS_InteractiveObject.hxx
src/BVH/BVH_Box.hxx
src/BVH/BVH_Tree.hxx
src/Bnd/Bnd_Box.cxx
src/Bnd/Bnd_Box.hxx
src/Bnd/Bnd_OBB.cxx
src/Bnd/Bnd_OBB.hxx
src/Graphic3d/FILES
src/Graphic3d/Graphic3d.cxx
src/Graphic3d/Graphic3d_Aspects.cxx
src/Graphic3d/Graphic3d_Aspects.hxx
src/Graphic3d/Graphic3d_PolygonOffset.cxx [new file with mode: 0644]
src/Graphic3d/Graphic3d_PolygonOffset.hxx
src/Prs3d/Prs3d_ArrowAspect.cxx
src/Prs3d/Prs3d_ArrowAspect.hxx
src/Prs3d/Prs3d_BasicAspect.hxx
src/Prs3d/Prs3d_DatumAspect.cxx
src/Prs3d/Prs3d_DatumAspect.hxx
src/Prs3d/Prs3d_DimensionAspect.cxx
src/Prs3d/Prs3d_DimensionAspect.hxx
src/Prs3d/Prs3d_LineAspect.cxx
src/Prs3d/Prs3d_LineAspect.hxx
src/Prs3d/Prs3d_PlaneAspect.cxx
src/Prs3d/Prs3d_PlaneAspect.hxx
src/Prs3d/Prs3d_PointAspect.cxx
src/Prs3d/Prs3d_PointAspect.hxx
src/Prs3d/Prs3d_ShadingAspect.cxx
src/Prs3d/Prs3d_ShadingAspect.hxx
src/Prs3d/Prs3d_TextAspect.cxx
src/Prs3d/Prs3d_TextAspect.hxx
src/PrsMgr/PrsMgr_PresentableObject.cxx
src/PrsMgr/PrsMgr_PresentableObject.hxx
src/Quantity/Quantity_Color.cxx
src/Quantity/Quantity_Color.hxx
src/Quantity/Quantity_ColorRGBA.cxx
src/Quantity/Quantity_ColorRGBA.hxx
src/SelectMgr/SelectMgr_EntityOwner.cxx
src/SelectMgr/SelectMgr_EntityOwner.hxx
src/SelectMgr/SelectMgr_SelectableObject.cxx
src/SelectMgr/SelectMgr_SelectableObject.hxx
src/SelectMgr/SelectMgr_ViewerSelector.cxx
src/Standard/FILES
src/Standard/Standard_DumpMask.hxx [deleted file]
src/TCollection/TCollection.cxx
src/TCollection/TCollection.hxx
src/TopLoc/TopLoc_Datum3D.cxx
src/TopLoc/TopLoc_Datum3D.hxx
src/TopLoc/TopLoc_ItemLocation.cxx
src/TopLoc/TopLoc_ItemLocation.hxx
src/TopLoc/TopLoc_Location.cxx
src/TopLoc/TopLoc_Location.hxx
src/TopoDS/TopoDS_Shape.cxx
src/TopoDS/TopoDS_Shape.hxx
src/XmlDrivers/XmlDrivers_MessageReportStorage.cxx
src/gp/gp_Mat.cxx
src/gp/gp_Mat.hxx
src/gp/gp_Trsf.cxx
src/gp/gp_Trsf.hxx
src/gp/gp_XYZ.cxx
src/gp/gp_XYZ.hxx
tools/MessageModel/FILES
tools/MessageModel/MessageModel_Actions.cxx
tools/MessageModel/MessageModel_ItemAlert.cxx
tools/MessageModel/MessageModel_ItemAlert.hxx
tools/MessageModel/MessageModel_ItemPropertiesAttributeStream.cxx [deleted file]
tools/MessageModel/MessageModel_ItemPropertiesAttributeStream.hxx [deleted file]
tools/MessageView/MessageView_Window.cxx
tools/TInspectorEXE/TInspectorEXE.cxx
tools/TKTreeModel/EXTERNLIB
tools/TreeModel/FILES
tools/TreeModel/TreeModel_ItemBase.cxx
tools/TreeModel/TreeModel_ItemBase.hxx
tools/TreeModel/TreeModel_ItemProperties.hxx
tools/TreeModel/TreeModel_ItemPropertiesStream.cxx [new file with mode: 0644]
tools/TreeModel/TreeModel_ItemPropertiesStream.hxx [new file with mode: 0644]
tools/TreeModel/TreeModel_ItemStream.cxx [new file with mode: 0644]
tools/TreeModel/TreeModel_ItemStream.hxx [new file with mode: 0644]
tools/TreeModel/TreeModel_ModelBase.cxx
tools/VInspector/VInspector_ItemBVHTree.cxx
tools/VInspector/VInspector_ItemFolderObject.hxx
tools/VInspector/VInspector_ItemOpenGlLayerArray.cxx [deleted file]
tools/VInspector/VInspector_ItemOpenGlLayerArray.hxx [deleted file]
tools/VInspector/VInspector_ItemPresentableObject.cxx
tools/VInspector/VInspector_ItemPresentableObject.hxx
tools/VInspector/VInspector_ItemPresentations.cxx
tools/VInspector/VInspector_ItemPrs3dAspect.cxx
tools/VInspector/VInspector_ItemPrs3dAspect.hxx
tools/VInspector/VInspector_ItemSelectBasicsEntityOwner.cxx
tools/VInspector/VInspector_ItemSelectBasicsEntityOwner.hxx
tools/VInspector/VInspector_Window.cxx

index 42e7796768ae54eaabb33720d9aea568b76b89ea..e9b86446f226503d4429d99bc78dacdbb9b8c58e 100644 (file)
@@ -98,7 +98,7 @@ void AIS_InteractiveObject::SetCappingStyle (const Handle(Graphic3d_AspectFillCa
     const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter);
     if (!aPrs3d.IsNull())
     {
-      const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
+      const Handle(Graphic3d_Structure)& aStruct = aPrs3d;
       if (!aStruct.IsNull())
       {
         const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups();
@@ -175,3 +175,27 @@ void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& theAspect
     aGroup->SetGroupPrimitivesAspect (aTextAspect->Aspect());
   }
 }
+
+const TCollection_AsciiString AIS_InteractiveObject_ClassName = "AIS_InteractiveObject";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void AIS_InteractiveObject::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, AIS_InteractiveObject_ClassName);
+
+  {
+    Standard_SStream aTmpStream;
+    SelectMgr_SelectableObject::Dump (aTmpStream);
+    DUMP_VALUES (OS, "SelectMgr_SelectableObject", TCollection::ToDumpString (aTmpStream));
+  }
+
+  DUMP_VALUES (OS, "InteractiveContext", TCollection::GetPointerInfo (myCTXPtr));
+  DUMP_VALUES (OS, "Owner", TCollection::GetPointerInfo (myOwner));
+  DUMP_VALUES (OS, "CappingStyle", TCollection::GetPointerInfo (myCappingStyle));
+
+  DUMP_STOP_KEY (OS, AIS_InteractiveObject_ClassName);
+
+}
index 5730d8e35d225316f5fd3a67dc12f58c0e4ff908..4e411b08e02a26f83ce4a36779fc867d6409f1ad 100644 (file)
@@ -124,6 +124,9 @@ public:
   Standard_DEPRECATED("Deprecated method, results might be undefined")
   Standard_EXPORT void SetAspect (const Handle(Prs3d_BasicAspect)& anAspect);
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   //! The TypeOfPresention3d means that the interactive object
index 47efa7fdecc28b88e58cd4167692570deec20b24..446aa5ac98a0675bb2a59a9941b6ddc846acfae0 100644 (file)
@@ -117,7 +117,7 @@ public:
     DUMP_VALUES (OS, "IsValid", IsValid());
 
     OS << "Bnd_Box" << TCollection::DumpSeparator();
-    BVH::ToBndBox (CornerMin(), CornerMax()).Dump (OS, Standard_DumpMask_SingleValue);
+    BVH::ToBndBox (CornerMin(), CornerMax()).Dump (OS);
     OS << TCollection::DumpSeparator();
   }
 
index c17e3817f37b7c21e9cb6c13ee9a75cec73353a6..a6dd5bfe737aad39150cb7f3bf38c5c70894f347 100644 (file)
@@ -212,7 +212,7 @@ public: //! @name methods for accessing serialized tree data
     DUMP_VALUES (OS, "NodeIndex", theNodeIndex);
 
     OS << "Bnd_Box" << TCollection::DumpSeparator();
-    BVH::ToBndBox (MinPoint (theNodeIndex), MaxPoint (theNodeIndex)).Dump (OS, Standard_DumpMask_SingleValue);
+    BVH::ToBndBox (MinPoint (theNodeIndex), MaxPoint (theNodeIndex)).Dump (OS);
     OS << TCollection::DumpSeparator();
 
     DUMP_VALUES (OS, "BegPrimitive", BegPrimitive (theNodeIndex));
index cdd9dc9d7347503e46e7db6cb4003245a7474d9a..2d09365bff6a82e8fae3aaab0e1788d726dcf6b6 100644 (file)
@@ -991,7 +991,7 @@ const TCollection_AsciiString Bnd_Box_ClassName = "Bnd_Box";
 //purpose  : 
 //=======================================================================
 
-void Bnd_Box::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void Bnd_Box::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, Bnd_Box_ClassName);
 
@@ -1012,32 +1012,32 @@ void Bnd_Box::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Bnd_Box::Init (const Standard_OStream& OS)
+Standard_Boolean Bnd_Box::Init (const Standard_SStream& OS)
 {
   NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aStreamValues;
-  Standard_SStream aSStream (OS);
-  TCollection::Split (aSStream, aStreamValues);
-
-  TCollection_AsciiString anXYZValue;
-  if (aStreamValues.Size() == 1)
-  {
-    TCollection_AsciiString aValueStr = aStreamValues.FindFromIndex (1);
-    Standard_Integer aPosition = aValueStr.Search (Bnd_Box_ClassName + TCollection::ClassNameSeparator());
-    if (aPosition < 1)
-      return Standard_False;
-    anXYZValue = aValueStr.Split (aPosition);
-  }
-
-  NCollection_Vector<Standard_Real> aValues;
-  if (!TCollection::SplitReal (anXYZValue, TCollection::VectorSeparator(), aValues))
+  TCollection_AsciiString aKey;
+  TCollection::Split (OS, aStreamValues, aKey);
+
+  TCollection_AsciiString aXmin, anYmin, aZmin, aXmax, anYmax, aZmax, aGap, aFlags;
+  if (!aStreamValues.FindFromKey ("Xmin", aXmin) ||
+      !aStreamValues.FindFromKey ("Ymin", anYmin) ||
+      !aStreamValues.FindFromKey ("Zmin", aZmin) ||
+      !aStreamValues.FindFromKey ("Xmax", aXmax) ||
+      !aStreamValues.FindFromKey ("Ymax", anYmax) ||
+      !aStreamValues.FindFromKey ("Zmax", aZmax) ||
+      !aStreamValues.FindFromKey ("Gap", aGap) ||
+      !aStreamValues.FindFromKey ("Flags", aFlags))
     return Standard_False;
 
-  if (aValues.Size() != 8)
-    return Standard_False;
+  Xmin = aXmin.RealValue();
+  Ymin = anYmin.RealValue();
+  Zmin = aZmin.RealValue();
+  Xmax = aXmax.RealValue();
+  Ymax = anYmax.RealValue();
+  Zmax = aZmax.RealValue();
 
-  Update (aValues.Value (1), aValues.Value (2), aValues.Value (3), aValues.Value (4), aValues.Value (5), aValues.Value (6));
-  Gap = aValues.Value (7);
-  Flags = (Standard_Integer)aValues.Value (8);
+  Gap = aGap.RealValue();
+  Flags = aFlags.IntegerValue();
 
   return Standard_True;
 }
index 30b41958e3c063c1161a8a033a16bf7006a55391..1859587d619e3bea7d4bac0b0161d347ba917433 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
 #include <Standard_Handle.hxx>
 
 #include <Standard_Real.hxx>
@@ -310,10 +309,18 @@ public:
   }
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT Standard_Boolean Init (const Standard_OStream& OS);
+  Standard_EXPORT Standard_Boolean Init (const Standard_SStream& OS);
+
+  //! Covers bounding box into string in format: (Xmin, Ymin, Zmin) - (Xmax, Ymax, Zmax)
+  //! \return the string value
+  Standard_EXPORT TCollection_AsciiString ToString() const { return ""; }
+
+  //! Converts text value into parameters if possible, the string format is: (Xmin, Ymin, Zmin) - (Xmax, Ymax, Zmax)
+  //! \return true if conversion is done
+  Standard_EXPORT Standard_Boolean FromString (const TCollection_AsciiString& theValue) { (void)theValue; return Standard_False; }
 
 protected:
 
index d59b0a058df90f674cdd00288bc1fcd7da403a9b..edc5effe9d32d9c2bfbdaa09afaf048867dfbe39 100644 (file)
@@ -685,7 +685,7 @@ const TCollection_AsciiString Bnd_OBB_ClassName = "Bnd_OBB";
 //purpose  : 
 //=======================================================================
 
-void Bnd_OBB::Dump (Standard_OStream& OS, const Standard_Integer /*theMask*/) const
+void Bnd_OBB::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, Bnd_OBB_ClassName);
   {
@@ -722,11 +722,10 @@ void Bnd_OBB::Dump (Standard_OStream& OS, const Standard_Integer /*theMask*/) co
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Bnd_OBB::Init (const Standard_OStream& /*OS*/)
+Standard_Boolean Bnd_OBB::Init (const Standard_SStream& /*OS*/)
 {
   //NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString> aStreamValues;
-  //Standard_SStream aSStream (OS);
-  //TCollection::Split (aSStream, aStreamValues);
+  //TCollection::Split (OS, aStreamValues, aKey);
 
   //TCollection_AsciiString anXYZValue;
   //if (aStreamValues.Size() == 1)
index 0a3b2212cf6cb478dbda085180ee6cd304109b2e..f4fe73ea28ff6ac6ca19abf37bc57d7cd5f48fd7 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
 #include <Standard_Handle.hxx>
 #include <Standard_Real.hxx>
 #include <Standard_Boolean.hxx>
@@ -279,10 +278,18 @@ public:
   Standard_EXPORT void Add(const gp_Pnt& theP);
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT Standard_Boolean Init (const Standard_OStream& OS);
+  Standard_EXPORT Standard_Boolean Init (const Standard_SStream& OS);
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
+
+  //! Covers bounding box into string in format: (Xmin, Ymin, Zmin) - (Xmax, Ymax, Zmax)
+  //! \return the string value
+  Standard_EXPORT TCollection_AsciiString ToString() const { return ""; }
+
+  //! Converts text value into parameters if possible, the string format is: (Xmin, Ymin, Zmin) - (Xmax, Ymax, Zmax)
+  //! \return true if conversion is done
+  Standard_EXPORT Standard_Boolean FromString (const TCollection_AsciiString& theValue) { (void)theValue; return Standard_False; }
 
 protected:
 
index f217793daefdf94c8bff2494bc42b3be989bded7..79e16c91fb55ce876170cef06a7844edef011a36 100755 (executable)
@@ -105,6 +105,7 @@ Graphic3d_NameOfTexture2D.hxx
 Graphic3d_NameOfTextureEnv.hxx
 Graphic3d_NameOfTexturePlane.hxx
 Graphic3d_NMapOfTransient.hxx
+Graphic3d_PolygonOffset.cxx
 Graphic3d_PolygonOffset.hxx
 Graphic3d_PriorityDefinitionError.hxx
 Graphic3d_RenderingMode.hxx
index 19e05b2e8f94002e8d20b65eae8742fb2747fada..e56b15c8fe2605b75c74442af625177c92f978f0 100644 (file)
@@ -19,7 +19,7 @@ namespace
 {
   static Standard_CString Graphic3d_Table_PrintZLayerId[6] =
   {
-    "INKNOWN", "DEFAULT", "TOP", "TOPMOST", "TOP_OSD", "BOT_OSD"
+    "UNKNOWN", "DEFAULT", "TOP", "TOPMOST", "TOP_OSD", "BOT_OSD"
   };
 
   static Standard_CString Graphic3d_Table_PrintHorizontalTextAlignment[3] =
index b8d12a4937c914ad60e56f163176c877bdd368be..37da13eee733a925f7ed554ac782e88a8603b74a 100644 (file)
@@ -12,6 +12,7 @@
 // commercial license or contractual agreement.
 
 #include <Graphic3d_Aspects.hxx>
+#include <TCollection.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient)
 
@@ -60,3 +61,61 @@ void Graphic3d_Aspects::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTe
 
   myTextureSet = new Graphic3d_TextureSet (theTexture);
 }
+
+const TCollection_AsciiString Graphic3d_Aspects_ClassName = "Graphic3d_Aspects";
+
+//=======================================================================
+//function : Dump
+//purpose  : 
+//=======================================================================
+
+void Graphic3d_Aspects::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Graphic3d_Aspects_ClassName);
+  
+  /*Handle(Graphic3d_ShaderProgram)  myProgram;
+  Handle(Graphic3d_TextureSet)     myTextureSet;
+  Handle(Graphic3d_MarkerImage)    myMarkerImage;
+  Handle(Graphic3d_HatchStyle)     myHatchStyle;
+  Handle(TCollection_HAsciiString) myTextFont;
+  Graphic3d_MaterialAspect         myFrontMaterial;
+  Graphic3d_MaterialAspect         myBackMaterial;
+
+  Quantity_ColorRGBA           myInteriorColor;
+  Quantity_ColorRGBA           myBackInteriorColor;
+  Quantity_ColorRGBA           myEdgeColor;
+  */
+  {
+    Standard_SStream aTmpStream;
+    myPolygonOffset.Dump (aTmpStream);
+    DUMP_VALUES (OS, "PolygonOffset", TCollection::ToDumpString (aTmpStream));
+  }
+
+  /*Aspect_InteriorStyle         myInteriorStyle;
+  Graphic3d_TypeOfShadingModel myShadingModel;
+  Graphic3d_AlphaMode          myAlphaMode;
+  Standard_ShortReal           myAlphaCutoff;
+
+  Aspect_TypeOfLine            myLineType;
+  Standard_ShortReal           myLineWidth;
+
+  Aspect_TypeOfMarker          myMarkerType;
+  Standard_ShortReal           myMarkerScale;
+
+  Aspect_TypeOfStyleText   myTextStyle;
+  Aspect_TypeOfDisplayText myTextDisplayType;
+  Font_FontAspect          myTextFontAspect;
+  Standard_ShortReal       myTextAngle;
+  */
+
+  DUMP_VALUES (OS, "ToSkipFirstEdge", myToSkipFirstEdge);
+  DUMP_VALUES (OS, "ToDistinguishMaterials", myToDistinguishMaterials);
+  DUMP_VALUES (OS, "ToDrawEdges", myToDrawEdges);
+  DUMP_VALUES (OS, "ToDrawSilhouette", myToDrawSilhouette);
+  DUMP_VALUES (OS, "ToSuppressBackFaces", myToSuppressBackFaces);
+  DUMP_VALUES (OS, "ToMapTexture", myToMapTexture);
+  DUMP_VALUES (OS, "IsTextZoomable", myIsTextZoomable);
+
+
+  DUMP_STOP_KEY (OS, Graphic3d_Aspects_ClassName);
+}
index 70aa6a2779e874163b36161fa985e8128e0fd3ce..b3de6527090d8180125a2e943f108b862d7fd3be 100644 (file)
@@ -477,6 +477,9 @@ public:
         && myIsTextZoomable == theOther.myIsTextZoomable;
   }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
+
 protected:
 
   Handle(Graphic3d_ShaderProgram)  myProgram;
diff --git a/src/Graphic3d/Graphic3d_PolygonOffset.cxx b/src/Graphic3d/Graphic3d_PolygonOffset.cxx
new file mode 100644 (file)
index 0000000..28b1ac5
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright (c) 2016 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 <Graphic3d_PolygonOffset.hxx>
+
+#include <Aspect.hxx>
+#include <TCollection.hxx>
+
+const TCollection_AsciiString Graphic3d_PolygonOffset_ClassName = "Graphic3d_PolygonOffset";
+
+//=======================================================================
+//function : Dump
+//purpose  : 
+//=======================================================================
+
+void Graphic3d_PolygonOffset::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Graphic3d_PolygonOffset_ClassName);
+
+  DUMP_VALUES (OS, "Mode", Aspect::PolygonOffsetModeToString (Mode));
+  DUMP_VALUES (OS, "Factor", Factor);
+  DUMP_VALUES (OS, "Units", Units);
+
+  DUMP_STOP_KEY (OS, Graphic3d_PolygonOffset_ClassName);
+}
index 6bc5d092974c5f7a98e3ece52554d1db59caf6ed..ce85b2f63eeb461160ee3cd5634720f9d1181330 100644 (file)
@@ -15,6 +15,7 @@
 #define _Graphic3d_PolygonOffset_HeaderFile
 
 #include <Aspect_PolygonOffsetMode.hxx>
+#include <Standard_OStream.hxx>
 
 //! Polygon offset parameters.
 struct Graphic3d_PolygonOffset
@@ -33,6 +34,10 @@ struct Graphic3d_PolygonOffset
         && Factor == theOther.Factor
         && Units == theOther.Units;
   }
+
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
+
 };
 
 #endif // _Graphic3d_PolygonOffset_HeaderFile
index dcd3b0204cc9d39a15a0e30b67afdbf0796569b5..87a1d7336c4366e8e03236256dcf686ba2bfc574 100644 (file)
@@ -15,6 +15,7 @@
 #include <Prs3d_ArrowAspect.hxx>
 
 #include <Prs3d_InvalidAngle.hxx>
+#include <TCollection.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_ArrowAspect, Prs3d_BasicAspect)
 
@@ -65,3 +66,24 @@ void Prs3d_ArrowAspect::SetAngle (const Standard_Real theAngle)
                             || theAngle >= M_PI / 2.0, "Prs3d_ArrowAspect::SetAngle() - angle out of range");
   myAngle = theAngle;
 }
+
+const TCollection_AsciiString Prs3d_ArrowAspect_ClassName = "Prs3d_ArrowAspect";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void Prs3d_ArrowAspect::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Prs3d_ArrowAspect_ClassName);
+  {
+    Standard_SStream aTmpStream;
+    myArrowAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "ArrowAspect", TCollection::ToDumpString (aTmpStream));
+  }
+
+  DUMP_VALUES (OS, "Angle", myAngle);
+  DUMP_VALUES (OS, "Length", myLength);
+
+  DUMP_STOP_KEY (OS, Prs3d_ArrowAspect_ClassName);
+}
index 6489b5a0dbe723a87f3efd3a532733105c728076..7e24885672c01ccd2cae3eb5eab70e0b529f6b70 100644 (file)
@@ -57,6 +57,9 @@ public:
   
   void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myArrowAspect = theAspect; }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   Handle(Graphic3d_AspectLine3d) myArrowAspect;
index 7578c71a2077a987fab854d50054743fb6c28be5..cfde64bbc22255e48cd87d1427569b6afa482f63 100644 (file)
@@ -17,6 +17,7 @@
 #define _Prs3d_BasicAspect_HeaderFile
 
 #include <Standard.hxx>
+#include <Standard_OStream.hxx>
 #include <Standard_Type.hxx>
 #include <Standard_Transient.hxx>
 
 class Prs3d_BasicAspect : public Standard_Transient
 {
   DEFINE_STANDARD_RTTIEXT(Prs3d_BasicAspect, Standard_Transient)
+
+  //! Dumps the content of me on the stream <OS>.
+  virtual void Dump (Standard_OStream& OS) const = 0;
+
 };
 
 DEFINE_STANDARD_HANDLE(Prs3d_BasicAspect, Standard_Transient)
index 5afab0e8d72b863aa8d7aae0dff993baa3488fe1..5f92713a1173c160f867ac1e4214c43489fd80f0 100644 (file)
@@ -14,6 +14,9 @@
 
 #include <Prs3d_DatumAspect.hxx>
 
+#include <Prs3d.hxx>
+#include <TCollection.hxx>
+
 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_DatumAspect, Prs3d_BasicAspect)
 
 // =======================================================================
@@ -167,3 +170,40 @@ Prs3d_DatumParts Prs3d_DatumAspect::ArrowPartForAxis (Prs3d_DatumParts thePart)
   }
   return Prs3d_DP_None;
 }
+
+const TCollection_AsciiString Prs3d_DatumAspect_ClassName = "Prs3d_DatumAspect";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void Prs3d_DatumAspect::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Prs3d_DatumAspect_ClassName);
+
+  DUMP_VALUES (OS, "Axes", Prs3d::DatumAxesToString (myAxes));
+  DUMP_VALUES (OS, "ToDrawLabels", myToDrawLabels);
+  DUMP_VALUES (OS, "ToDrawArrows", myToDrawArrows);
+
+  //NCollection_DataMap<Prs3d_DatumAttribute, Standard_Real> myAttributes;
+  //NCollection_DataMap<Prs3d_DatumParts, Handle(Prs3d_ShadingAspect)> myShadedAspects;
+  //NCollection_DataMap<Prs3d_DatumParts, Handle(Prs3d_LineAspect)> myLineAspects;
+
+  {
+    Standard_SStream aTmpStream;
+    myTextAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "TextAspect", TCollection::ToDumpString (aTmpStream));
+  }
+  {
+    Standard_SStream aTmpStream;
+    myPointAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "PointAspect", TCollection::ToDumpString (aTmpStream));
+  }
+  {
+    Standard_SStream aTmpStream;
+    myArrowAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "ArrowAspect", TCollection::ToDumpString (aTmpStream));
+  }
+  DUMP_STOP_KEY (OS, Prs3d_DatumAspect_ClassName);
+}
+
index 42e90b8f04e9f77029c1077a731c04315219d306..1dc6726e5c9eb7ee7c6564490e0689afbc895016 100644 (file)
@@ -144,6 +144,9 @@ public:
   //! Returns type of arrow for a type of axis
   Standard_EXPORT Prs3d_DatumParts ArrowPartForAxis (Prs3d_DatumParts thePart) const;
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 private:
   Prs3d_DatumAxes myAxes;
   Standard_Boolean myToDrawLabels;
index 6e1141f9cd4a425fb70e060423cb5737b8ba9a17..e1029603b936996df649687a3a82ac4232d323ac 100755 (executable)
@@ -16,6 +16,8 @@
 
 #include <Aspect_TypeOfLine.hxx>
 #include <Graphic3d_AspectText3d.hxx>
+#include <Prs3d.hxx>
+#include <TCollection.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_DimensionAspect, Prs3d_BasicAspect)
 
@@ -59,3 +61,43 @@ void Prs3d_DimensionAspect::SetCommonColor (const Quantity_Color& theColor)
   myTextAspect->SetColor (theColor);
   myArrowAspect->SetColor (theColor);
 }
+
+const TCollection_AsciiString Prs3d_DimensionAspect_ClassName = "Prs3d_DimensionAspect";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void Prs3d_DimensionAspect::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Prs3d_DimensionAspect_ClassName);
+  {
+    Standard_SStream aTmpStream;
+    myLineAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "LineAspect", TCollection::ToDumpString (aTmpStream));
+  }
+  {
+    Standard_SStream aTmpStream;
+    myTextAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "TextAspect", TCollection::ToDumpString (aTmpStream));
+  }
+  {
+    Standard_SStream aTmpStream;
+    myArrowAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "ArrowAspect", TCollection::ToDumpString (aTmpStream));
+  }
+  DUMP_VALUES (OS, "ValueStringFormat", myValueStringFormat);
+  DUMP_VALUES (OS, "ExtensionSize", myExtensionSize);
+  DUMP_VALUES (OS, "ArrowTailSize", myArrowTailSize);
+  DUMP_VALUES (OS, "ArrowOrientation", Prs3d::DimensionArrowOrientationToString (myArrowOrientation));
+  DUMP_VALUES (OS, "TextHPosition", Prs3d::DimensionTextHorizontalPositionToString (myTextHPosition));
+  DUMP_VALUES (OS, "TextVPosition", Prs3d::DimensionTextVerticalPositionToString (myTextVPosition));
+
+  DUMP_VALUES (OS, "ToDisplayUnits", myToDisplayUnits);
+  DUMP_VALUES (OS, "IsText3d", myIsText3d);
+  DUMP_VALUES (OS, "IsTextShaded", myIsTextShaded);
+  DUMP_VALUES (OS, "IsArrows3d", myIsArrows3d);
+
+  DUMP_STOP_KEY (OS, Prs3d_DimensionAspect_ClassName);
+}
+
index c6b80ac0998232c5205e945f3870b323286a947e..7b5b18670c88f57e3ead55e891d23220f7f1953d 100644 (file)
@@ -115,6 +115,9 @@ public:
   //! Returns format.
   const TCollection_AsciiString& ValueStringFormat() const { return myValueStringFormat; }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   Handle(Prs3d_LineAspect)  myLineAspect;
index b648b1026a697fc0ed113ab1b5c8947a707e3d1e..2458f1ef7dacd03274a6fccdeae183d230976597 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <Prs3d_LineAspect.hxx>
 
+#include <TCollection.hxx>
+
 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_LineAspect, Prs3d_BasicAspect)
 
 // =======================================================================
@@ -27,3 +29,21 @@ Prs3d_LineAspect::Prs3d_LineAspect (const Quantity_Color& theColor,
 {
   //
 }
+
+const TCollection_AsciiString Prs3d_LineAspect_ClassName = "Prs3d_LineAspect";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void Prs3d_LineAspect::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Prs3d_LineAspect_ClassName);
+  {
+    Standard_SStream aTmpStream;
+    myAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "Aspect", TCollection::ToDumpString (aTmpStream));
+  }
+  DUMP_STOP_KEY (OS, Prs3d_LineAspect_ClassName);
+}
+
index cb20cfb64720e3e96c282635b40adc57f7108647..4947d06a4c89ede911f42dd392d47d52d0c81727 100644 (file)
@@ -63,6 +63,9 @@ public:
   
   void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myAspect = theAspect; }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   Handle(Graphic3d_AspectLine3d) myAspect;
index 8d71bb33bce4e22c59fe95c2d911d154de0daa28..840e23422b0588cd0eefe5b51f69d641ba64ea21 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <Prs3d_PlaneAspect.hxx>
 
+#include <TCollection.hxx>
+
 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_PlaneAspect, Prs3d_BasicAspect)
 
 // =======================================================================
@@ -37,3 +39,43 @@ Prs3d_PlaneAspect::Prs3d_PlaneAspect()
 {
   //
 }
+
+const TCollection_AsciiString Prs3d_PlaneAspect_ClassName = "Prs3d_PlaneAspect";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void Prs3d_PlaneAspect::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Prs3d_PlaneAspect_ClassName);
+  {
+    Standard_SStream aTmpStream;
+    myEdgesAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "EdgesAspect", TCollection::ToDumpString (aTmpStream));
+  }
+  {
+    Standard_SStream aTmpStream;
+    myIsoAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "IsoAspect", TCollection::ToDumpString (aTmpStream));
+  }
+  {
+    Standard_SStream aTmpStream;
+    myArrowAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "ArrowAspect", TCollection::ToDumpString (aTmpStream));
+  }
+
+  DUMP_VALUES (OS, "ArrowsLength", myArrowsLength);
+  DUMP_VALUES (OS, "ArrowsSize", myArrowsSize);
+  DUMP_VALUES (OS, "ArrowsAngle", myArrowsAngle);
+  DUMP_VALUES (OS, "PlaneXLength", myPlaneXLength);
+  DUMP_VALUES (OS, "PlaneYLength", myPlaneYLength);
+  DUMP_VALUES (OS, "IsoDistance", myIsoDistance);
+  DUMP_VALUES (OS, "DrawCenterArrow", myDrawCenterArrow);
+  DUMP_VALUES (OS, "DrawEdgesArrows", myDrawEdgesArrows);
+  DUMP_VALUES (OS, "DrawEdges", myDrawEdges);
+  DUMP_VALUES (OS, "DrawIso", myDrawIso);
+
+  DUMP_STOP_KEY (OS, Prs3d_PlaneAspect_ClassName);
+}
+
index 4833059bc7aac44ef5051f4a0d3a194dd4ae48c8..8f9c407f4abe2f0bdc56026929a70dac01480de3 100644 (file)
@@ -96,6 +96,9 @@ public:
   //! Returns the distance between isoparameters used in the display of planes.
   Standard_Real IsoDistance() const { return myIsoDistance; }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   Handle(Prs3d_LineAspect) myEdgesAspect;
index b69b01689fc7163dee2a1f479f0663dbde62736a..0de1072148f13dfa3884f9a7c80ba58d41ddf3bc 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <Prs3d_PointAspect.hxx>
 
+#include <TCollection.hxx>
+
 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_PointAspect, Prs3d_BasicAspect)
 
 // =======================================================================
@@ -40,3 +42,22 @@ Prs3d_PointAspect::Prs3d_PointAspect (const Quantity_Color& theColor,
 {
   //
 }
+
+const TCollection_AsciiString Prs3d_PointAspect_ClassName = "Prs3d_PointAspect";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void Prs3d_PointAspect::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Prs3d_PointAspect_ClassName);
+  {
+    Standard_SStream aTmpStream;
+    myAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "Aspect", TCollection::ToDumpString (aTmpStream));
+  }
+
+  DUMP_STOP_KEY (OS, Prs3d_PointAspect_ClassName);
+}
+
index 7c2fcd3c70d8428dd672fdea325cbb54d4650291..315df2b4debb925441d83e53f0a78e64293abd85 100644 (file)
@@ -61,6 +61,9 @@ public:
   //! Returns marker's texture.
   const Handle(Graphic3d_MarkerImage)& GetTexture() const { return myAspect->GetMarkerImage(); }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   Handle(Graphic3d_AspectMarker3d) myAspect;
index 102deb416ad13fb0cc5f24af17213bde86bcfd17..37f20b0482ab5a591c032fe4f53f55d89e825d1a 100644 (file)
@@ -18,6 +18,7 @@
 #include <Graphic3d_MaterialAspect.hxx>
 #include <Quantity_Color.hxx>
 #include <Standard_Type.hxx>
+#include <TCollection.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_ShadingAspect, Prs3d_BasicAspect)
 
@@ -164,3 +165,22 @@ Standard_Real Prs3d_ShadingAspect::Transparency (const Aspect_TypeOfFacingModel
   }
   return 0.0;
 }
+
+const TCollection_AsciiString Prs3d_ShadingAspect_ClassName = "Prs3d_ShadingAspect";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void Prs3d_ShadingAspect::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Prs3d_ShadingAspect_ClassName);
+  {
+    Standard_SStream aTmpStream;
+    myAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "Aspect", TCollection::ToDumpString (aTmpStream));
+  }
+
+  DUMP_STOP_KEY (OS, Prs3d_ShadingAspect_ClassName);
+}
+
index 8510621a3161fea778681686dc25996222c548f1..377e7234b23b8e997df511180f9f614ddcba23c1 100644 (file)
@@ -62,6 +62,9 @@ public:
 
   void SetAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) { myAspect = theAspect; }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   Handle(Graphic3d_AspectFillArea3d) myAspect;
index d194818103ddf2cd075fccb3f18895923adf121e..8d41ce71749751001d53430d5b942af823364892 100644 (file)
@@ -17,6 +17,8 @@
 #include <Prs3d_TextAspect.hxx>
 
 #include <Font_NameOfFont.hxx>
+#include <Graphic3d.hxx>
+#include <TCollection.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(Prs3d_TextAspect, Prs3d_BasicAspect)
 
@@ -47,3 +49,28 @@ Prs3d_TextAspect::Prs3d_TextAspect (const Handle(Graphic3d_AspectText3d)& theAsp
 {
   //
 }
+
+const TCollection_AsciiString Prs3d_TextAspect_ClassName = "Prs3d_TextAspect";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void Prs3d_TextAspect::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, Prs3d_TextAspect_ClassName);
+  {
+    Standard_SStream aTmpStream;
+    myTextAspect->Dump (aTmpStream);
+    DUMP_VALUES (OS, "TextAspect", TCollection::ToDumpString (aTmpStream));
+  }
+
+  DUMP_VALUES (OS, "Height", myHeight);
+
+  DUMP_VALUES (OS, "HorizontalJustification", Graphic3d::HorizontalTextAlignmentToString (myHorizontalJustification));
+  DUMP_VALUES (OS, "VerticalJustification", Graphic3d::VerticalTextAlignmentToString (myVerticalJustification));
+  DUMP_VALUES (OS, "Orientation", Graphic3d::TextPathToString (myOrientation));
+
+  DUMP_STOP_KEY (OS, Prs3d_TextAspect_ClassName);
+}
+
index cf59e1aefa0d1833ce50ad375f37435a188ccf12..b9bc47381c660b8d9cd5df9f34ccd10d0b9eae27 100644 (file)
@@ -97,6 +97,9 @@ public:
 
   void SetAspect (const Handle(Graphic3d_AspectText3d)& theAspect) { myTextAspect = theAspect; }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   Handle(Graphic3d_AspectText3d) myTextAspect;
index 90c297b3e24c5fb9378817482a11e95e051d2677..f9820cdf0d439c5f2b56cdc556f337ae8e291d69 100644 (file)
@@ -836,3 +836,43 @@ void PrsMgr_PresentableObject::PolygonOffsets (Standard_Integer&   theMode,
     myDrawer->ShadingAspect()->Aspect()->PolygonOffsets (theMode, theFactor, theUnits);
   }
 }
+
+const TCollection_AsciiString PrsMgr_PresentableObject_ClassName = "PrsMgr_PresentableObject";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void PrsMgr_PresentableObject::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, PrsMgr_PresentableObject_ClassName);
+
+  DUMP_VALUES (OS, "Parent", TCollection::GetPointerInfo (myParent));
+
+  DUMP_VALUES (OS, "Width", myOwnWidth);
+  DUMP_VALUES (OS, "OwnColor", hasOwnColor);
+  DUMP_VALUES (OS, "OwnMaterial", hasOwnMaterial);
+
+  DUMP_VALUES (OS, "InfiniteState", myInfiniteState);
+  DUMP_VALUES (OS, "IsMutable", myIsMutable);
+  DUMP_VALUES (OS, "HasOwnPresentations", myHasOwnPresentations);
+
+  DUMP_STOP_KEY (OS, PrsMgr_PresentableObject_ClassName);
+
+/*
+  PrsMgr_Presentations                   myPresentations;           //!< list of presentations
+  Handle(Graphic3d_SequenceOfHClipPlane) myClipPlanes;              //!< sequence of object-specific clipping planes
+  Handle(Prs3d_Drawer)                   myDrawer;                  //!< main presentation attributes
+  Handle(Prs3d_Drawer)                   myHilightDrawer;           //!< (optional) custom presentation attributes for highlighting selected object
+  Handle(Prs3d_Drawer)                   myDynHilightDrawer;        //!< (optional) custom presentation attributes for highlighting detected object
+  Handle(Graphic3d_TransformPers)        myTransformPersistence;    //!< transformation persistence
+  Handle(Geom_Transformation)            myLocalTransformation;     //!< local transformation relative to parent object
+  Handle(Geom_Transformation)            myTransformation;          //!< absolute transformation of this object (combined parents + local transformations)
+  Handle(Geom_Transformation)            myCombinedParentTransform; //!< transformation of parent object (combined for all parents)
+  PrsMgr_ListOfPresentableObjects        myChildren;                //!< list of children
+  gp_GTrsf                               myInvTransformation;       //!< inversion of absolute transformation (combined parents + local transformations)
+  PrsMgr_TypeOfPresentation3d            myTypeOfPresentation3d;    //!< presentation type
+
+  Aspect_TypeOfFacingModel               myCurrentFacingModel;      //!< current facing model
+*/
+}
index 6275cc4cdd0b52fb5386b03bd89ecb9eb5e199aa..10a17585b3bfe970d8d1e79d0dc83a57eaa73b62 100644 (file)
@@ -479,6 +479,9 @@ public: //! @name simplified presentation properties API
   //! Clears settings provided by the drawing tool aDrawer.
   Standard_EXPORT virtual void UnsetAttributes();
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const;
+
 public: //! @name deprecated methods
 
   //! gives the list of modes which are flagged "to be updated".
index 5ade8c2482cad14b6c2e616dd953b4f97da57e6e..4033df494c703c4c38988d9eedab9853baed044e 100644 (file)
@@ -3937,7 +3937,7 @@ const TCollection_AsciiString Quantity_Color_ClassName = "Quantity_Color";
 //purpose  : 
 //=======================================================================
 
-void Quantity_Color::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void Quantity_Color::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, Quantity_Color_ClassName);
 
@@ -3953,11 +3953,12 @@ void Quantity_Color::Dump (Standard_OStream& OS, const Standard_Integer theMask)
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Quantity_Color::Init (const Standard_OStream& OS)
+Standard_Boolean Quantity_Color::Init (const Standard_OStream& /*OS*/)
 {
   //NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aStreamValues;
   //Standard_SStream aSStream (OS);
-  //TCollection::Split (aSStream, aStreamValues);
+  //TCollection_AsciiString aKey;
+  //TCollection::Split (aSStream, aStreamValues, aKey);
 
   //TCollection_AsciiString anXYZValue;
   //if (!aStreamValues.FindFromKey (Quantity_Color_ClassName, anXYZValue))
index f164e5a257e8e0f0fb7a56482574c86a540f74c6..d9687544eb7b4bc445348325f13624ddd2d37e4e 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
 #include <Standard_Handle.hxx>
 
 #include <Standard_ShortReal.hxx>
@@ -267,7 +266,7 @@ Standard_Boolean operator == (const Quantity_Color& Other) const
   Standard_EXPORT static void Test();
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
   //! Dumps the content of me on the stream <OS>.
   Standard_EXPORT Standard_Boolean Init (const Standard_OStream& OS);
index ddc623c5728058ddfcf5743deaaa37090ef804ff..ffada11dad7171c57e70a39511a3db24ed484f4e 100644 (file)
@@ -207,7 +207,7 @@ const TCollection_AsciiString Quantity_ColorRGBA_ClassName = "Quantity_ColorRGBA
 //purpose  : 
 //=======================================================================
 
-void Quantity_ColorRGBA::Dump (Standard_OStream& OS, const Standard_Integer /*theMask*/) const
+void Quantity_ColorRGBA::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, Quantity_ColorRGBA_ClassName);
 
index 3dcc33b1cf9cdcd83c943c5fece6f78e3c76e85e..11b1eafd0ef1b2ae6c9e8984c7c8f6f923274948 100644 (file)
@@ -122,7 +122,7 @@ public:
                                             const bool          theAlphaComponentIsOff = false);
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
 private:
 
index d537c01dd67f9aa3935d67bc53b344a3759eea60..5a8aa57b440858e35a4aba0c1ffd194b88fd993b 100644 (file)
@@ -82,3 +82,22 @@ void SelectMgr_EntityOwner::HilightWithColor (const Handle(PrsMgr_PresentationMa
     mySelectable->HilightOwnerWithColor (thePM, theStyle, this);
   }
 }
+
+const TCollection_AsciiString SelectMgr_EntityOwner_ClassName = "SelectMgr_EntityOwner";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void SelectMgr_EntityOwner::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, SelectMgr_EntityOwner_ClassName);
+
+
+  DUMP_VALUES (OS, "Selectable", TCollection::GetPointerInfo (mySelectable));
+  DUMP_VALUES (OS, "Priority", mypriority);
+  DUMP_VALUES (OS, "IsSelected", myIsSelected);
+  DUMP_VALUES (OS, "ComesFromDecomposition", myFromDecomposition);
+
+  DUMP_STOP_KEY (OS, SelectMgr_EntityOwner_ClassName);
+}
index eec5e128f1ab5ec026ec4fe5712fdedee5450bf8..a385c8b5965e05e149dcaceba622b7ccf1e8f07d 100644 (file)
@@ -170,6 +170,9 @@ public:
   //! Sets flag indicating this owner points to a part of object (TRUE) or to entire object (FALSE).
   void SetComesFromDecomposition (const Standard_Boolean theIsFromDecomposition) { myFromDecomposition = theIsFromDecomposition; }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const;
+
 public:
 
   //! Sets the selectable object.
index 4980ecf7b6b73232c40cb429e6d5395e33f35ea1..ab1d099be6154b50d58ca6c52af4ad278d52953f 100644 (file)
@@ -548,3 +548,32 @@ const Handle(SelectMgr_EntityOwner)& SelectMgr_SelectableObject::GetAssemblyOwne
 {
   return THE_NULL_ENTITYOWNER;
 }
+
+const TCollection_AsciiString SelectMgr_SelectableObject_ClassName = "SelectMgr_SelectableObject";
+
+// =======================================================================
+// function : Dump
+// purpose  :
+// =======================================================================
+void SelectMgr_SelectableObject::Dump (Standard_OStream& OS) const
+{
+  DUMP_START_KEY (OS, SelectMgr_SelectableObject_ClassName);
+
+  {
+    Standard_SStream aTmpStream;
+    PrsMgr_PresentableObject::Dump (aTmpStream);
+    DUMP_VALUES (OS, "PrsMgr_PresentableObject", TCollection::ToDumpString (aTmpStream));
+  }
+
+  DUMP_VALUES (OS, "GlobalSelectionMode", myGlobalSelMode);
+  //DUMP_VALUES (OS, "mycurrent", mycurrent);
+  DUMP_VALUES (OS, "IsAutoHilight", myAutoHilight);
+
+/*
+  SelectMgr_SequenceOfSelection myselections;    //!< list of selections
+  Handle(Prs3d_Presentation)    mySelectionPrs;  //!< optional presentation for highlighting selected object
+  Handle(Prs3d_Presentation)    myHilightPrs;    //!< optional presentation for highlighting detected object
+*/
+
+  DUMP_STOP_KEY (OS, SelectMgr_SelectableObject_ClassName);
+}
index 2da46a41202ad5c490f1a2d6124f1497f59af063..c4d525cc010a23016fe4db5f315c2a9c2211d973 100644 (file)
@@ -169,6 +169,9 @@ public:
   //! Returns common entity owner if the object is an assembly
   Standard_EXPORT virtual const Handle(SelectMgr_EntityOwner)& GetAssemblyOwner() const;
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 public:
 
   //! Begins the iteration scanning for sensitive primitives.
index cc403b7632fac2221e14b35aeea550b47ebced7f..e2c7ef5405ed9a033052656fc5ed3cce26847e88 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <algorithm>
 
-#define REPORT_SELECTION_BUILD
+//#define REPORT_SELECTION_BUILD
 #ifdef REPORT_SELECTION_BUILD
 #include <Message_Alerts.hxx>
 #include <Message_PerfMeter.hxx>
@@ -767,7 +767,9 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
     }
   }
 
+#ifdef REPORT_SELECTION_BUILD
   MESSAGE_INFO ("SortResult", "", &aPerfMeter, aParentAlert);
+#endif
   SortResult();
 #ifdef REPORT_SELECTION_BUILD
   Standard_SStream aStreamDone;
index 79bcc5a515ed5786af8e5e537727ee6d435dd6bf..1199f5f973318facc5a00ec24ea861e0ceaec81c 100755 (executable)
@@ -24,7 +24,6 @@ Standard_DimensionError.hxx
 Standard_DimensionMismatch.hxx
 Standard_DivideByZero.hxx
 Standard_DomainError.hxx
-Standard_DumpMask.hxx
 Standard_ErrorHandler.cxx
 Standard_ErrorHandler.hxx
 Standard_ExtCharacter.hxx
diff --git a/src/Standard/Standard_DumpMask.hxx b/src/Standard/Standard_DumpMask.hxx
deleted file mode 100644 (file)
index 5fe2355..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2019 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 _Standard_DumpMask_HeaderFile
-#define _Standard_DumpMask_HeaderFile
-
-
-//! Sets how much information should be dumped in Dump of the object
-enum Standard_DumpMask
-{
-  Standard_DumpMask_Empty        = 0x0000, //! empty output
-  Standard_DumpMask_Fields       = 0x0001, //! only class fields value
-  Standard_DumpMask_Methods      = 0x0002, //! only methods result
-  Standard_DumpMask_ClassName    = 0x0004, //! the first row of Dump has class name
-  Standard_DumpMask_SingleValue  = 0x0008, //! dump is combined in one value
-  Standard_DumpMask_Whole = Standard_DumpMask_Fields | Standard_DumpMask_Methods,
-  Standard_DumpMask_WholeAndClassName = Standard_DumpMask_Whole | Standard_DumpMask_ClassName
-};
-
-#endif // _Standard_DumpMask_HeaderFile
index e07f8f7f4bfa22707fce319fc926091c909b3ceb..b0f90d8c344baa8a421afb7bf9cb64eacf0c202f 100644 (file)
@@ -136,12 +136,23 @@ TCollection_AsciiString TCollection::Join (const NCollection_List<TCollection_As
 // ----------------------------------------------------------------------------
 
 void TCollection::Split (const Standard_SStream& theStream,
-  NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& theValues)
+  NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& theValues,
+  TCollection_AsciiString& theKey)
 {
   TCollection_AsciiString aStreamStr (theStream.str().c_str());
 
+  TCollection_AsciiString aSplitValue, aTailValue, aKey;
+  if (SplitKey (aStreamStr, aSplitValue, aTailValue, aKey))
+  {
+    if (aTailValue.IsEmpty())
+    {
+      theKey = aKey;
+      aStreamStr = aSplitValue;
+    }
+  }
+
   NCollection_List<TCollection_AsciiString> aValues;
-  Split (aStreamStr, DumpSeparator(), aValues);
+  split (aStreamStr, DumpSeparator(), aValues);
 
   for (NCollection_List<TCollection_AsciiString>::Iterator anIterator (aValues); anIterator.More(); anIterator.Next())
   {
@@ -155,10 +166,10 @@ void TCollection::Split (const Standard_SStream& theStream,
 
 
 // ----------------------------------------------------------------------------
-// Split
+// split
 // ----------------------------------------------------------------------------
 
-void TCollection::Split (const TCollection_AsciiString& theValue,
+void TCollection::split (const TCollection_AsciiString& theValue,
                          const TCollection_AsciiString& theSeparator,
                          NCollection_List<TCollection_AsciiString>& theValues)
 {
@@ -186,16 +197,6 @@ void TCollection::Split (const TCollection_AsciiString& theValue,
 
     aCurrentString = aCurrentString.Split (theSeparator.Length());
   }
-
-  if (theValues.Size() == 1)
-  {
-    TCollection_AsciiString aKey, aValue;
-    if (!SplitKey (theValues.First(), aValue, aKey))
-      return;
-
-    theValues.Clear();
-    Split (aValue, DumpSeparator(), theValues);
-  }
 }
 
 // ----------------------------------------------------------------------------
@@ -331,6 +332,7 @@ Standard_Boolean TCollection::SplitDumped (const TCollection_AsciiString& theSou
 
 Standard_Boolean TCollection::SplitKey (const TCollection_AsciiString& theSourceValue,
                                         TCollection_AsciiString& theSplitValue,
+                                        TCollection_AsciiString& theTailValue,
                                         TCollection_AsciiString& theKey)
 {
   Standard_Integer aBracketPosition = theSourceValue.Search (XMLBracketOpen());
@@ -350,11 +352,16 @@ Standard_Boolean TCollection::SplitKey (const TCollection_AsciiString& theSource
   aTailValue = aTailValue.SubString (2, aTailValue.Length()); // remove close bracket
   TCollection_AsciiString aStopKey = StopKey (theKey);
 
-  aBracketPosition = theSourceValue.Search (aStopKey);
-  if (aBracketPosition <= 1 || aBracketPosition  >= theSourceValue.Length())
+  aBracketPosition = aTailValue.Search (aStopKey);
+  if (aBracketPosition <= 1 || aBracketPosition  >= aTailValue.Length())
     return Standard_False;
 
   theSplitValue = aTailValue;
   aTailValue = theSplitValue.Split (aBracketPosition - 1);
+
+  if (aTailValue.Length() == aStopKey.Length())
+    theTailValue = "";
+  else
+    theTailValue = aTailValue.SubString (aStopKey.Length(), aTailValue.Length());
   return Standard_True;
 }
index 33f57f9852c26491576bef236806b9f9dcc4caeb..0fb4763509f3fb07d5a560548f684434480b299c 100644 (file)
@@ -25,6 +25,7 @@
 #include <TCollection_AsciiString.hxx>
 
 #include <NCollection_IndexedDataMap.hxx>
+#include <NCollection_IndexedMap.hxx>
 #include <NCollection_List.hxx>
 #include <NCollection_Vector.hxx>
 
@@ -113,13 +114,15 @@ public:
   //! \param theStream stream value
   //! \param theValues [out] container of split values
   Standard_EXPORT static void Split (const Standard_SStream& theStream,
-                                     NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& theValues);
+                                     NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& theValues,
+                                     TCollection_AsciiString& theKey);
 
+private:
   //! Unites list of string into one string using the separator
-  Standard_EXPORT static void Split (const TCollection_AsciiString& theValue,
+  Standard_EXPORT static void split (const TCollection_AsciiString& theValue,
                                      const TCollection_AsciiString& theSeparator,
                                      NCollection_List<TCollection_AsciiString>& theValues);
-
+public:
   //! Unites list of string into one string using the separator
   Standard_EXPORT static Standard_Boolean SplitReal (const TCollection_AsciiString& theValue,
                                                      const TCollection_AsciiString& theSeparator,
@@ -143,7 +146,7 @@ public:
   //! Splits a AsciiString into two sub-strings using Dump keys.
   //! Example:
   //! aString contains "<key>abc</key>defg"
-  //! aString.SplitDumped() gives <me> = "abc" and returns "defg"
+  //! aString.SplitDumped() gives theSplitValue = "abc", theTailValue = "defg", theKey = "key"
   Standard_EXPORT static Standard_Boolean SplitDumped (const TCollection_AsciiString& theSourceValue,
                                                        TCollection_AsciiString& theSplitValue,
                                                        TCollection_AsciiString& theTailValue,
@@ -153,8 +156,13 @@ public:
   //! theSplitValue = value, theKey = key.
   Standard_EXPORT static Standard_Boolean SplitKey (const TCollection_AsciiString& theSourceValue,
                                                     TCollection_AsciiString& theSplitValue,
+                                                    TCollection_AsciiString& theTailValue,
                                                     TCollection_AsciiString& theKey);
 
+  //! Returns true if the value has bracket key
+  static Standard_Boolean HasBracketKey (const TCollection_AsciiString& theSourceValue)
+  { return theSourceValue.Search (TCollection::XMLBracketOpen()) >= 0; }
+
 protected:
   static TCollection_AsciiString XMLBracketOpen() { return TCollection_AsciiString ("<"); }
   static TCollection_AsciiString XMLBracketClose() { return TCollection_AsciiString (">"); }
index 19ad955b37a4cddcdd3aad9ae85d275a3385400d..4197b30b5b04492bd26e8a2350ce50c12885b48a 100644 (file)
@@ -49,7 +49,7 @@ const TCollection_AsciiString TopLoc_Datum3D_ClassName = "TopLoc_Datum3D";
 //purpose  : 
 //=======================================================================
 
-void TopLoc_Datum3D::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void TopLoc_Datum3D::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, TopLoc_Datum3D_ClassName);
 
index 72830e6ffb3c920ccbeda033ec2caeb74e23448f..99b79163ef69f2365ad2141d6522e9b4dd8d2a33 100644 (file)
@@ -54,7 +54,7 @@ public:
   
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
   //! Writes the contents of this Datum3D to the stream S.
   Standard_EXPORT void ShallowDump (Standard_OStream& S) const;
index 86c35c0f1929e342ccee47b947d50835b1acf858..f8fb0a4cb5768acd4796180975233cf9ef03bdc1 100644 (file)
@@ -41,7 +41,7 @@ const TCollection_AsciiString TopLoc_ItemLocation_ClassName = "TopLoc_ItemLocati
 //purpose  : 
 //=======================================================================
 
-void TopLoc_ItemLocation::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void TopLoc_ItemLocation::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, TopLoc_ItemLocation_ClassName);
 
index e40fa8195e0de74d94ae267edf904b5a6ece76a3..62ab486b9c17c21a793a5e107aabdd3975761eba 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
 #include <Standard_Handle.hxx>
 
 #include <Standard_Integer.hxx>
@@ -52,7 +51,7 @@ public:
   Standard_EXPORT TopLoc_ItemLocation(const Handle(TopLoc_Datum3D)& D, const Standard_Integer P);
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
 
 friend class TopLoc_Location;
index 00672c5b4d20a14d619ec406401ca61a3dfe0d99..5ea95b97df7775636f33cbd7bef49e12445e048e 100644 (file)
@@ -238,7 +238,7 @@ const TCollection_AsciiString TopLoc_Location_ClassName = "TopLoc_Location";
 //purpose  : 
 //=======================================================================
 
-void TopLoc_Location::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void TopLoc_Location::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, TopLoc_Location_ClassName);
 
@@ -252,7 +252,6 @@ void TopLoc_Location::Dump (Standard_OStream& OS, const Standard_Integer theMask
   TopLoc_SListOfItemLocation items = myItems;
   if (!items.IsEmpty())
   {
-    DUMP_VALUES (OS, "Items", "");
     while (items.More())
     {
       Standard_SStream aTmpStream;
index 20cc07834845bd68b728cda0acdcf29f16cf069c..6be35f54c8cb9e473174c7ffaf0190fdcf732c6b 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <TopLoc_SListOfItemLocation.hxx>
 #include <Standard_Boolean.hxx>
-#include <Standard_DumpMask.hxx>
 #include <Standard_Integer.hxx>
 #include <Standard_OStream.hxx>
 
@@ -145,7 +144,7 @@ Standard_Boolean operator != (const TopLoc_Location& Other) const
 }
   
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
   //! Prints the contents of <me> on the stream <s>.
   Standard_EXPORT void ShallowDump (Standard_OStream& S) const;
index b586afb5251d99a434f887b25905af791d0d745a..f7b62f86280c37c7434c6351010c9f54f04d52e8 100644 (file)
@@ -42,7 +42,7 @@ const TCollection_AsciiString TopoDS_Shape_ClassName = "TopoDS_Shape";
 //purpose  : 
 //=======================================================================
 
-void TopoDS_Shape::Dump (Standard_OStream& OS, const Standard_Integer /*theMask*/) const
+void TopoDS_Shape::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, TopoDS_Shape_ClassName);
 
index d3173651afe751535d5a6bfe28b6b120aea315d4..0f014b7bf324d323370b1aae3e3d6d625a6d710b 100644 (file)
@@ -281,7 +281,7 @@ public:
   void TShape (const Handle(TopoDS_TShape)& theTShape) { myTShape = theTShape; }
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
 private:
 
index 4bb6d0108b84f930d9d3d284fe8291da56167ada..79eed21d1b7c9ccca148fae1914e80f0471901a3 100644 (file)
@@ -255,7 +255,8 @@ void XmlDrivers_MessageReportStorage::exportAlertParameters (const Handle(Messag
     Handle(Message_AttributeStream) aValuesArrayAlert = Handle(Message_AttributeStream)::DownCast (anAttribute);
     // store values
     NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aValues;
-    TCollection::Split (aValuesArrayAlert->GetStream(), aValues);
+    TCollection_AsciiString aKey;
+    TCollection::Split (aValuesArrayAlert->GetStream(), aValues, aKey);
     if (aValues.IsEmpty())
       return;
     int anArraySize = 2 * aValues.Size();
index fd2d13dd30dd428437673ca1c3935ced2e899cf9..bacfb35d6f76c41dbcb3c15e301e237f0472c74e 100644 (file)
@@ -273,7 +273,7 @@ void gp_Mat::Power (const Standard_Integer N)
 
 const TCollection_AsciiString gp_Map_ClassName = "gp_Mat";
 
-void gp_Mat::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void gp_Mat::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, gp_Map_ClassName);
 
index 4a0e36a01e386c9c1098dcc7d26b159768033ae3..041d0034625f98873157162b96a1b611a355ea43 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
 #include <Standard_Handle.hxx>
 
 #include <Standard_Real.hxx>
@@ -257,7 +256,7 @@ public:
     Standard_NODISCARD gp_Mat Transposed() const;
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
 
 friend class gp_XYZ;
index 98a83731fd201b6afa9df0e3d5b425cd247f50ce..31928dca70b7510ef41e6a0775b11d5dd76acb3f 100644 (file)
@@ -858,7 +858,7 @@ const TCollection_AsciiString gp_Trsf_ClassName = "gp_Trsf";
 //purpose  : 
 //=======================================================================
 
-void gp_Trsf::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void gp_Trsf::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, gp_Trsf_ClassName);
 
index 443eded074987125c8053994789f63c52eb54eec..66d6e22581efd2fdf00e9e75f2d9accfc773c29d 100644 (file)
@@ -22,7 +22,6 @@
 #include <Standard.hxx>
 #include <Standard_Boolean.hxx>
 #include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
 #include <Standard_Integer.hxx>
 #include <Standard_Handle.hxx>
 #include <Standard_OStream.hxx>
@@ -352,7 +351,7 @@ void operator *= (const gp_Trsf& T)
   }
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
 friend class gp_GTrsf;
 
index c6ea78353be4fcd17ebbd8366918de9827468877..5482e44a9690f64f0b58671ff329b9baa1629ca8 100644 (file)
@@ -45,7 +45,7 @@ const TCollection_AsciiString gp_XYZ_ClassName = "gp_XYZ";
 //purpose  : 
 //=======================================================================
 
-void gp_XYZ::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void gp_XYZ::Dump (Standard_OStream& OS) const
 {
   DUMP_START_KEY (OS, gp_XYZ_ClassName);
 
@@ -61,11 +61,12 @@ void gp_XYZ::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean gp_XYZ::Init (const Standard_OStream& OS)
+Standard_Boolean gp_XYZ::Init (const Standard_OStream& /*OS*/)
 {
   /*NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aStreamValues;
   Standard_SStream aSStream (OS);
-  TCollection::Split (aSStream, aStreamValues);
+  TCollection_AsciiString aKey;
+  TCollection::Split (aSStream, aStreamValues, aKey);
 
   TCollection_AsciiString anXYZValue;
   if (aStreamValues.FindFromKey (gp_XYZ_ClassName, anXYZValue))
index b18e51cc40f194311d2eac471724f0d8645f914e..1d22742917c3ca0d8f8c1f6d1a8a6de7420bd576 100644 (file)
@@ -23,7 +23,6 @@
 #include <Standard_Integer.hxx>
 #include <Standard_Boolean.hxx>
 
-#include <Standard_DumpMask.hxx>
 #include <Standard_OStream.hxx>
 
 class Standard_ConstructionError;
@@ -329,7 +328,7 @@ public:
 
 
   //! Dumps the content of me on the stream <OS>.
-  Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+  Standard_EXPORT void Dump (Standard_OStream& OS) const;
 
   //! Dumps the content of me on the stream <OS>.
   Standard_EXPORT Standard_Boolean Init (const Standard_OStream& OS);
index 3274a6ec51598c4bdfd2a77d49fdeb76b0bc8fc7..b51b3d85e69a9c99a96709c02dae8541dd4d0185 100644 (file)
@@ -6,8 +6,6 @@ MessageModel_ItemAlert.cxx
 MessageModel_ItemAlert.hxx
 MessageModel_ItemBase.cxx
 MessageModel_ItemBase.hxx
-MessageModel_ItemPropertiesAttributeStream.cxx
-MessageModel_ItemPropertiesAttributeStream.hxx
 MessageModel_ItemPropertiesReport.cxx
 MessageModel_ItemPropertiesReport.hxx
 MessageModel_ItemReport.cxx
index 0914b8d004baadf324c79ef8c73e95a9cfb19f8e..8122224588ca3c4867a5b7f6207d9646b54ed342 100644 (file)
@@ -336,14 +336,14 @@ void MessageModel_Actions::OnTestPropetyPanel()
   {
     gp_XYZ aCoords (1.3, 2.3, 3.4);
     Standard_SStream aStream;
-    aCoords.Dump (aStream, Standard_DumpMask_SingleValue);
+    aCoords.Dump (aStream);
     MESSAGE_INFO_STREAM(aStream, "gp_XYZ", "", &aPerfMeter, NULL);
   }
   // Bnd_Box
   {
     Bnd_Box aBox(20., 15., 10., 25., 20., 15.);
     Standard_SStream aStream;
-    aBox.Dump (aStream, Standard_DumpMask_SingleValue);
+    aBox.Dump (aStream);
     MESSAGE_INFO_STREAM(aStream, "Bnd_Box", "", &aPerfMeter, NULL);
   }
   // Bnd_OBB
@@ -351,7 +351,7 @@ void MessageModel_Actions::OnTestPropetyPanel()
     Bnd_OBB anOBB (gp_Pnt (-10., -15., -10.), gp_Dir (1., 0., 0.), gp_Dir (0., 1., 0.), gp_Dir (0., 0., 1.),
                   5., 10., 5.);
     Standard_SStream aStream;
-    anOBB.Dump (aStream, Standard_DumpMask_SingleValue);
+    anOBB.Dump (aStream);
     MESSAGE_INFO_STREAM(aStream, "Bnd_OBB", "", &aPerfMeter, NULL);
   }
   myTreeModel->UpdateTreeModel();
index 56c8d6f55050d7152a0a42f2d6b17dda2685634d..6fd070c8742aa95f04dc5baaca94dc897e56e239 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <inspector/MessageModel_ItemAlert.hxx>
 
-#include <inspector/MessageModel_ItemPropertiesAttributeStream.hxx>
 #include <inspector/MessageModel_ItemRoot.hxx>
 #include <inspector/MessageModel_ItemReport.hxx>
 #include <inspector/MessageModel_Tools.hxx>
@@ -170,6 +169,33 @@ int MessageModel_ItemAlert::initRowCount() const
   return aCurrentItem->myChildAlerts.Size();
 }
 
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void MessageModel_ItemAlert::GetStream (Standard_OStream& OS) const
+{
+  Handle(Message_AlertExtended) anExtendedAlert = Handle(Message_AlertExtended)::DownCast (getAlert());
+  if (!anExtendedAlert.IsNull() && !anExtendedAlert->Attribute().IsNull())
+  {
+    Handle(Message_Attribute) anAttribute = anExtendedAlert->Attribute();
+    if (!anAttribute.IsNull())
+    {
+      if (!Handle(Message_AttributeStream)::DownCast(anAttribute).IsNull())
+      {
+        //if (GetProperties().IsNull())
+        //{
+        //  TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
+        //  SetProperties (new MessageModel_ItemPropertiesAttributeStream (anItem));
+        //}
+        Handle(Message_AttributeStream) anAttributeStream = Handle(Message_AttributeStream)::DownCast (anExtendedAlert->Attribute());
+        //Handle(MessageModel_ItemPropertiesAttributeStream) aProperties = Handle(MessageModel_ItemPropertiesAttributeStream)::DownCast (GetProperties());
+        OS << anAttributeStream->GetStream().str();
+      }
+    }
+  }
+}
+
 // =======================================================================
 // function : createChild
 // purpose :
@@ -215,17 +241,22 @@ void MessageModel_ItemAlert::Init()
     }
   }
 
-  Handle(Message_AlertExtended) anExtendedAlert = Handle(Message_AlertExtended)::DownCast(myAlert);
+  /*Handle(Message_AlertExtended) anExtendedAlert = Handle(Message_AlertExtended)::DownCast(myAlert);
   if (!anExtendedAlert.IsNull() && !anExtendedAlert->Attribute().IsNull())
   {
     Handle(Message_Attribute) anAttribute = anExtendedAlert->Attribute();
-
     if (!anAttribute.IsNull())
     {
       if (!Handle(Message_AttributeStream)::DownCast(anAttribute).IsNull())
       {
-        TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
-        SetProperties (new MessageModel_ItemPropertiesAttributeStream (anItem));
+        if (GetProperties().IsNull())
+        {
+          TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
+          SetProperties (new MessageModel_ItemPropertiesAttributeStream (anItem));
+        }
+        Handle(Message_AttributeStream) anAttributeStream = Handle(Message_AttributeStream)::DownCast (anExtendedAlert->Attribute());
+        Handle(MessageModel_ItemPropertiesAttributeStream) aProperties = Handle(MessageModel_ItemPropertiesAttributeStream)::DownCast (GetProperties());
+        aProperties->Init (anAttributeStream->GetStream());
       }
       //if (anAttribute->IsKind (STANDARD_TYPE (Message_AttributeObject)))
       //  myPresentations.Append (Handle(Message_AttributeObject)::DownCast (anAttribute)->GetObject());
@@ -236,7 +267,7 @@ void MessageModel_ItemAlert::Init()
     //Bnd_Box aBox;
     //if (aBox.Init (Standard_SStream (aDescription.ToCString())))
     //  myPresentations.Append (new Convert_TransientShape (Convert_Tools::CreateShape (aBox)));
-  }
+  }*/
   MessageModel_ItemBase::Init();
 }
 
index f139fb54c2266faec87653dcbbe4c758a35ac748..c87d39a51eee0fbc610ea29f93ea1c571a309197 100644 (file)
@@ -77,6 +77,10 @@ public:
   //! \return number of children.
   Standard_EXPORT virtual int initRowCount() const Standard_OVERRIDE;
 
+  //! Returns stream value of the item to fulfill property panel.
+  //! \return stream value or dummy
+  Standard_EXPORT virtual void GetStream (Standard_OStream& OS) const Standard_OVERRIDE;
+
   //! Sets some shape to present the item
   //! \param theShape shape instance
   void SetCustomShape (const TopoDS_Shape& theShape) { myCustomShape = theShape; }
diff --git a/tools/MessageModel/MessageModel_ItemPropertiesAttributeStream.cxx b/tools/MessageModel/MessageModel_ItemPropertiesAttributeStream.cxx
deleted file mode 100644 (file)
index f0f24c9..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-// Created on: 2019-02-25
-// Created by: Natalia ERMOLAEVA
-// Copyright (c) 2019 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 <inspector/MessageModel_ItemPropertiesAttributeStream.hxx>
-#include <inspector/MessageModel_ItemAlert.hxx>
-
-#include <inspector/ShapeView_ItemShape.hxx>
-#include <inspector/ShapeView_Tools.hxx>
-
-#include <inspector/ViewControl_Tools.hxx>
-#include <BRep_Tool.hxx>
-#include <Message_AlertExtended.hxx>
-#include <TCollection.hxx>
-#include <TopoDS.hxx>
-
-#include <Standard_WarningsDisable.hxx>
-#include <QApplication>
-#include <QFont>
-#include <Standard_WarningsRestore.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(MessageModel_ItemPropertiesAttributeStream, TreeModel_ItemProperties)
-
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
-
-void MessageModel_ItemPropertiesAttributeStream::Init()
-{
-  MessageModel_ItemAlertPtr anAlertItem = itemDynamicCast<MessageModel_ItemAlert>(getItem());
-  if (!anAlertItem)
-    return;
-
-  Handle(Message_AlertExtended) anExtendedAlert = Handle(Message_AlertExtended)::DownCast(anAlertItem->GetAlert());
-  if (anExtendedAlert.IsNull() || anExtendedAlert->Attribute().IsNull())
-    return;
-
-  Handle(Message_AttributeStream) anAttributeStream = Handle(Message_AttributeStream)::DownCast (anExtendedAlert->Attribute());
-  if (anAttributeStream.IsNull())
-    return;
-
-  TCollection::Split (anAttributeStream->GetStream(), myValues);
-
-  TreeModel_ItemProperties::Init();
-}
-
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
-
-void MessageModel_ItemPropertiesAttributeStream::Reset()
-{
-  myValues.Clear();
-
-  TreeModel_ItemProperties::Reset();
-}
-
-// =======================================================================
-// function : RowCount
-// purpose :
-// =======================================================================
-
-int MessageModel_ItemPropertiesAttributeStream::GetTableRowCount() const
-{
-  const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& aValues = GetValues();
-  return aValues.Size();
-}
-
-// =======================================================================
-// function : Data
-// purpose :
-// =======================================================================
-
-QVariant MessageModel_ItemPropertiesAttributeStream::GetTableData (const int theRow, const int theColumn, int theRole) const
-{
-  const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& aValues = GetValues();
-
-  if (theRole == Qt::DisplayRole)
-  {
-    if (theColumn == 0) return aValues.FindKey (theRow + 1).ToCString();
-    else if (theColumn == 1) return aValues.FindFromIndex (theRow + 1).ToCString();
-  }
-  return QVariant();
-}
-
-// =======================================================================
-// function : GetTableEditType
-// purpose :
-// =======================================================================
-ViewControl_EditType MessageModel_ItemPropertiesAttributeStream::GetTableEditType (const int theRow, const int) const
-{
-  //switch (theRow)
-  //{
-  //  case 0: return ViewControl_EditType_Spin;
-  //  default: return ViewControl_EditType_None;
-  //}
-  return ViewControl_EditType_None;
-}
-
-// =======================================================================
-// function : SetTableData
-// purpose :
-// =======================================================================
-bool MessageModel_ItemPropertiesAttributeStream::SetTableData (const int theRow, const int theColumn, const QVariant& theValue)
-{
-  //Handle(Message_Report) aReport = getItemReport();
-  //switch (theRow)
-  //{
-  //  case 0:  aReport->SetLimit (theValue.toInt()); break;
-  //  default: break;
-  //}
-  return true;
-}
diff --git a/tools/MessageModel/MessageModel_ItemPropertiesAttributeStream.hxx b/tools/MessageModel/MessageModel_ItemPropertiesAttributeStream.hxx
deleted file mode 100644 (file)
index 96a86f6..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-// Created on: 2019-02-25
-// Created by: Natalia ERMOLAEVA
-// Copyright (c) 2019 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 MessageModel_ItemReportProperties_H
-#define MessageModel_ItemReportProperties_H
-
-#include <Standard.hxx>
-#include <Message_AttributeStream.hxx>
-#include <NCollection_IndexedDataMap.hxx>
-#include <TCollection_AsciiString.hxx>
-
-
-#include <inspector/TreeModel_ItemProperties.hxx>
-#include <inspector/TreeModel_ItemBase.hxx>
-
-#include <Standard_WarningsDisable.hxx>
-#include <QAbstractTableModel>
-#include <QColor>
-#include <QList>
-#include <QModelIndexList>
-#include <QVariant>
-#include <Standard_WarningsRestore.hxx>
-
-class QItemDelegate;
-
-DEFINE_STANDARD_HANDLE (MessageModel_ItemPropertiesAttributeStream, TreeModel_ItemProperties)
-
-//! \class MessageModel_ItemPropertiesAttributeStream
-//! \brief This is an interace for ViewControl_TableModel to give real values of the model
-//! It should be filled or redefined.
-class MessageModel_ItemPropertiesAttributeStream : public TreeModel_ItemProperties
-{
-public:
-
-  //! Constructor
-  Standard_EXPORT MessageModel_ItemPropertiesAttributeStream (TreeModel_ItemBasePtr theItem)
-    : TreeModel_ItemProperties (theItem) {}
-
-  //! Destructor
-  virtual ~MessageModel_ItemPropertiesAttributeStream() {}
-
-  //! If me has internal values, it should be initialized here.
-  Standard_EXPORT virtual void Init();
-
-  //! If the item has internal values, there should be reseted here.
-  Standard_EXPORT virtual void Reset();
-
-  //! Returns number of rows, depending on orientation: myColumnCount or size of values container
-  //! \param theParent an index of the parent item
-  //! \return an integer value
-  Standard_EXPORT virtual int GetTableRowCount() const Standard_OVERRIDE;
-
-  //! Returns content of the model index for the given role, it is obtained from internal container of values
-  //! It returns value only for DisplayRole.
-  //! \param theRow a model index row
-  //! \param theColumn a model index column
-  //! \param theRole a view role
-  //! \return value intepreted depending on the given role
-  Standard_EXPORT virtual QVariant GetTableData (const int theRow, const int theColumn, const int theRole = Qt::DisplayRole) const Standard_OVERRIDE;
-
-  //! Returns type of edit control for the model index. By default, it is an empty control
-  //! \param theRow a model index row
-  //! \param theColumn a model index column
-  //! \return edit type
-  Standard_EXPORT virtual ViewControl_EditType GetTableEditType (const int theRow, const int theColumn) const Standard_OVERRIDE;
-
-  //! Sets the value into the table cell. Only 1st column value might be modified.
-  //! \param theRow a model index row
-  //! \param theColumn a model index column
-  //! \param theValue a new cell value
-  Standard_EXPORT virtual bool SetTableData (const int theRow, const int theColumn, const QVariant& theValue) Standard_OVERRIDE;
-
-  DEFINE_STANDARD_RTTIEXT (MessageModel_ItemPropertiesAttributeStream, TreeModel_ItemProperties)
-
-protected:
-  //! Returns attribute with stream value
-  const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& GetValues() const
-  {
-    if (!IsInitialized())
-      const_cast<MessageModel_ItemPropertiesAttributeStream*>(this)->Init();
-    return myValues;
-  }
-
-protected:
-  NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> myValues;
-};
-
-#endif
index 72b06db0adcdcc6cc0b9c369868ceda6216b6254..420b2e7b4b801a184912c33d74424a8ddb9642ca 100644 (file)
@@ -443,6 +443,10 @@ void MessageView_Window::onTreeViewSelectionChanged (const QItemSelection&, cons
     if (!anItemBase)
       continue;
 
+    Handle(TreeModel_ItemProperties) anItemProperties = anItemBase->GetProperties();
+    if (anItemProperties)
+      anItemProperties->GetPresentations (-1, -1, aPresentations);
+
     MessageModel_ItemAlertPtr anAlertItem = itemDynamicCast<MessageModel_ItemAlert>(anItemBase);
     if (!anAlertItem)
       continue;
index 75ccf87870548781dee166fdca169b8cde469863..1c42a38530772e9c4ba7d3af93f7ca9286716d2b 100644 (file)
@@ -131,8 +131,8 @@ int main (int argc, char** argv)
     aReport->SetActive (Standard_True);//Standard_False);
     aPlugins.insert("TKMessageView");
 
-    //anActivatedPluginName = "TKVInspector";
-    anActivatedPluginName = "TKMessageView";
+    anActivatedPluginName = "TKVInspector";
+    //anActivatedPluginName = "TKMessageView";
   }
   else
     anActivatedPluginName = *aPlugins.rbegin();
index faee5c912f1f7c572b7f1694ddf7b747923d89e3..74b7426c2227d44ff69dc9a421f01b7602bb86ce 100644 (file)
@@ -2,4 +2,5 @@ TKernel
 TKMath
 TKPrim
 TKTopAlgo
+TKTInspectorAPI
 CSF_QT
\ No newline at end of file
index d7662e6a0e8dd634ca762c6950484adea46360a5..7e40097f829305b5f995cd9b12fcc16032515aa5 100644 (file)
@@ -10,7 +10,11 @@ TreeModel_ItemProperties.cxx
 TreeModel_ItemProperties.hxx
 TreeModel_ItemPropertiesCreator.cxx
 TreeModel_ItemPropertiesCreator.hxx
+TreeModel_ItemPropertiesStream.cxx
+TreeModel_ItemPropertiesStream.hxx
 TreeModel_ItemRole.hxx
+TreeModel_ItemStream.cxx
+TreeModel_ItemStream.hxx
 TreeModel_ModelBase.cxx
 TreeModel_ModelBase.hxx
 TreeModel_Tools.cxx
index af8dc1f860ac6470905d77e1052770ea7f936fbd..c988ace51fe496220d6e8944c951fc68863a956e 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <inspector/TreeModel_ItemBase.hxx>
 #include <inspector/TreeModel_ItemProperties.hxx>
+#include <inspector/TreeModel_ItemPropertiesStream.hxx>
 #include <inspector/TreeModel_ItemRole.hxx>
 
 #include <Standard_WarningsDisable.hxx>
@@ -48,6 +49,24 @@ void TreeModel_ItemBase::SetProperties (const Handle(TreeModel_ItemProperties)&
 // =======================================================================
 Handle(TreeModel_ItemProperties) TreeModel_ItemBase::GetProperties() const
 {
+  if (myProperties.IsNull() && Parent())
+  {
+    TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
+    //TreeModel_ItemBase* anItem = (TreeModel_ItemBase*)this;
+    anItem->SetProperties (new TreeModel_ItemPropertiesStream (anItem));
+  }
+
+  if (!myProperties.IsNull() && !myProperties->IsInitialized())
+  {
+    Handle(TreeModel_ItemPropertiesStream) aPropertiesStream = Handle(TreeModel_ItemPropertiesStream)::DownCast (myProperties);
+    if (!aPropertiesStream.IsNull())
+    {
+      Standard_SStream aStream;
+      GetStream (aStream);
+      aPropertiesStream->Init (aStream);
+    }
+  }
+
   return myProperties;
 }
 
@@ -96,10 +115,16 @@ TreeModel_ItemBasePtr TreeModel_ItemBase::Child (int theRow, int theColumn, cons
   TreeModel_ItemBasePtr anItem;
   if (isToCreate) {
     int aRowCount = rowCount();
-    if (myProperties.IsNull() || theRow < aRowCount - myProperties->ChildItemCount())
-      anItem = createChild (theRow, theColumn);
-    else if (!myProperties.IsNull())
-      anItem = myProperties->CreateChildItem (theRow, theColumn);
+    Handle(TreeModel_ItemProperties) aProperties = GetProperties();
+    int aChildOffset = aProperties.IsNull() ? 0 : aProperties->ChildItemCount();
+    if (!aProperties.IsNull() && theRow < aChildOffset)
+      anItem = aProperties->CreateChildItem (theRow, theColumn);
+    else
+      anItem = createChild (theRow - aChildOffset, theColumn);
+    //if (aProperties.IsNull() || theRow < aRowCount - aProperties->ChildItemCount())
+    //  anItem = createChild (theRow, theColumn);
+    //else if (!aProperties.IsNull())
+    //  anItem = aProperties->CreateChildItem (theRow, theColumn);
 
     if (anItem)
       m_ChildItems[aPos] = anItem;
@@ -128,7 +153,10 @@ QVariant TreeModel_ItemBase::cachedValue (const int theItemRole) const
   QVariant aValueToCache;
   if (theItemRole == TreeModel_ItemRole_RowCountRole)
   {
-    aValueToCache = myProperties.IsNull() ? initRowCount() : (initRowCount() + myProperties->ChildItemCount());
+    int aRowCount = initRowCount();
+    Handle(TreeModel_ItemProperties) aProperties = GetProperties();
+    int aChildOffset = aProperties.IsNull() ? 0 : aProperties->ChildItemCount();
+    aValueToCache = aRowCount + aChildOffset;
   }
   else
     aValueToCache = initValue (theItemRole);
@@ -137,6 +165,21 @@ QVariant TreeModel_ItemBase::cachedValue (const int theItemRole) const
   return myCachedValues.contains (theItemRole) ? myCachedValues[theItemRole] : QVariant();
 }
 
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void TreeModel_ItemBase::Init()
+{
+  //if (myProperties.IsNull() && Parent())
+  //{
+  //  TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
+  //  SetProperties (new TreeModel_ItemPropertiesStream (anItem));
+  //}
+
+  m_bInitialized = true;
+}
+
 // =======================================================================
 // function : initValue
 // purpose :
index 45da4d78055d6260fbf74a6850978bebb543f453..871d1afe507252c33f7aed782e82faeebdfa83c8 100644 (file)
@@ -85,7 +85,7 @@ public:
 
   //! Sets the item internal initialized state to the true. If the item has internal values,
   //! there should be initialized here.
-  virtual void Init() { m_bInitialized = true; }
+  Standard_EXPORT virtual void Init();
 
   //! Returns data object of the item.
   //! \return object
@@ -99,6 +99,10 @@ public:
   //! \param theRole an item role
   Standard_EXPORT virtual void Reset(int theRole);
 
+  //! Returns stream value of the item to fulfill property panel.
+  //! \return stream value or dummy
+  virtual void GetStream (Standard_OStream& OS) const { (void)OS; }
+
   //! Gets the parent of the item, or TreeModel_ItemBasePtr() if it has no parent.
   //! \return pointer to the item
   TreeModel_ItemBasePtr Parent() const { return m_pParent; };
index 8310cd3a617ba75a2ad7ebcb3ad3966445e0f7ee..82422cc0fc316ca1cc2f37c2e7f308da19152c7a 100644 (file)
@@ -50,7 +50,7 @@ class TreeModel_ItemProperties : public Standard_Transient
 
 public:
   //! Constructor
-  TreeModel_ItemProperties (const TreeModel_ItemBasePtr& theItem) : myItem (theItem) {}
+  TreeModel_ItemProperties (const TreeModel_ItemBasePtr& theItem) : myItem (theItem), m_bInitialized (Standard_False) {}
 
   //! Destructor
   ~TreeModel_ItemProperties() {}
diff --git a/tools/TreeModel/TreeModel_ItemPropertiesStream.cxx b/tools/TreeModel/TreeModel_ItemPropertiesStream.cxx
new file mode 100644 (file)
index 0000000..56e6b07
--- /dev/null
@@ -0,0 +1,204 @@
+// Created on: 2019-02-25
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2019 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 <inspector/TreeModel_ItemPropertiesStream.hxx>
+#include <inspector/TreeModel_ItemStream.hxx>
+
+#include <inspector/Convert_TransientShape.hxx>
+#include <inspector/Convert_Tools.hxx>
+
+#include <Bnd_Box.hxx>
+#include <gp_XYZ.hxx>
+#include <TCollection.hxx>
+
+#include <Standard_WarningsDisable.hxx>
+#include <QApplication>
+#include <QFont>
+#include <Standard_WarningsRestore.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(TreeModel_ItemPropertiesStream, TreeModel_ItemProperties)
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+
+void TreeModel_ItemPropertiesStream::Init (const Standard_SStream& theStream)
+{
+  myStream << theStream.str();
+
+  NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aValues;
+  TCollection::Split (theStream, aValues, myKey);
+
+  TreeModel_ItemStreamPtr aStreamParent = itemDynamicCast<TreeModel_ItemStream>(getItem());
+  if (!aStreamParent)
+    myKey = "Dump";
+
+  for (Standard_Integer anIndex = 1; anIndex <= aValues.Size(); anIndex++)
+  {
+    TCollection_AsciiString aValue = aValues.FindFromIndex (anIndex);
+    if (TCollection::HasBracketKey (aValue))
+      myChildren.Add (aValues.FindKey (anIndex), aValue);
+    else
+      myValues.Add (aValues.FindKey (anIndex), aValue);
+  }
+  TreeModel_ItemProperties::Init();
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+
+void TreeModel_ItemPropertiesStream::Reset()
+{
+  myStream.str (std::string());
+  myKey = "";
+  myValues.Clear();
+  myChildren.Clear();
+
+  TreeModel_ItemProperties::Reset();
+}
+
+// =======================================================================
+// function : GetChildKey
+// purpose :
+// =======================================================================
+TCollection_AsciiString TreeModel_ItemPropertiesStream::GetChildKey (const Standard_Integer theRow) const
+{
+  return GetChildrenValues().FindKey (theRow + 1).ToCString();
+}
+
+// =======================================================================
+// function : GetChildStream
+// purpose :
+// =======================================================================
+
+void TreeModel_ItemPropertiesStream::GetChildStream (const Standard_Integer theRow, Standard_OStream& OS) const
+{
+  TreeModel_ItemStreamPtr aStreamParent = itemDynamicCast<TreeModel_ItemStream>(getItem());
+  if (!aStreamParent)
+    OS << myStream.str();
+  else
+    OS << GetChildrenValues().FindFromIndex (theRow + 1);
+}
+
+// =======================================================================
+// function : RowCount
+// purpose :
+// =======================================================================
+
+int TreeModel_ItemPropertiesStream::GetTableRowCount() const
+{
+  const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& aValues = GetValues();
+  return aValues.Size();
+}
+
+// =======================================================================
+// function : Data
+// purpose :
+// =======================================================================
+
+QVariant TreeModel_ItemPropertiesStream::GetTableData (const int theRow, const int theColumn, int theRole) const
+{
+  const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& aValues = GetValues();
+
+  if (theRole == Qt::DisplayRole || theRole == Qt::ToolTipRole)
+  {
+    if (theColumn == 0) return aValues.FindKey (theRow + 1).ToCString();
+    else if (theColumn == 1) return aValues.FindFromIndex (theRow + 1).ToCString();
+  }
+  return QVariant();
+}
+
+// =======================================================================
+// function : GetTableEditType
+// purpose :
+// =======================================================================
+ViewControl_EditType TreeModel_ItemPropertiesStream::GetTableEditType (const int /*theRow*/, const int) const
+{
+  //switch (theRow)
+  //{
+  //  case 0: return ViewControl_EditType_Spin;
+  //  default: return ViewControl_EditType_None;
+  //}
+  return ViewControl_EditType_None;
+}
+
+// =======================================================================
+// function : SetTableData
+// purpose :
+// =======================================================================
+bool TreeModel_ItemPropertiesStream::SetTableData (const int /*theRow*/, const int /*theColumn*/, const QVariant& /*theValue*/)
+{
+  //Handle(Message_Report) aReport = getItemReport();
+  //switch (theRow)
+  //{
+  //  case 0:  aReport->SetLimit (theValue.toInt()); break;
+  //  default: break;
+  //}
+  return true;
+}
+
+// =======================================================================
+// function : GetPresentations
+// purpose :
+// =======================================================================
+
+void TreeModel_ItemPropertiesStream::GetPresentations (const int theRow, const int theColumn,
+  NCollection_List<Handle(Standard_Transient)>& thePresentations)
+{
+  if (theColumn == 0)
+    return;
+
+  if (theRow < 0) // full presentation
+  {
+    Bnd_Box aBox;
+    if (aBox.Init (myStream))
+      thePresentations.Append (new Convert_TransientShape (Convert_Tools::CreateShape (aBox)));
+  }
+
+
+  //QVariant aValue = GetTableData (theRow, theColumn, Qt::DisplayRole);
+  //TCollection_AsciiString aStrValue = aValue.toString().toStdString().c_str();
+
+  //gp_XYZ aPoint;
+  //if (!aPoint.Init (Standard_SStream (aStrValue.ToCString())))
+  //  return;
+
+  //thePresentations.Append (new Convert_TransientShape (BRepBuilderAPI_MakeVertex (aPoint)));
+}
+
+// =======================================================================
+// function : ChildItemCount
+// purpose :
+// =======================================================================
+int TreeModel_ItemPropertiesStream::ChildItemCount() const
+{
+  TreeModel_ItemStreamPtr aStreamParent = itemDynamicCast<TreeModel_ItemStream>(getItem());
+  if (!aStreamParent && (GetChildrenValues().Size() || GetValues().Size()))
+    return 1; // "Dump" item
+
+  return GetChildrenValues().Size();
+}
+
+// =======================================================================
+// function : CreateChildItem
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr TreeModel_ItemPropertiesStream::CreateChildItem (int theRow, int theColumn) const
+{
+  return TreeModel_ItemStream::CreateItem (getItem(), theRow, theColumn);
+}
diff --git a/tools/TreeModel/TreeModel_ItemPropertiesStream.hxx b/tools/TreeModel/TreeModel_ItemPropertiesStream.hxx
new file mode 100644 (file)
index 0000000..5df0f8a
--- /dev/null
@@ -0,0 +1,133 @@
+// Created on: 2019-02-25
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2019 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 MessageModel_ItemReportProperties_H
+#define MessageModel_ItemReportProperties_H
+
+#include <Standard.hxx>
+#include <Message_AttributeStream.hxx>
+#include <NCollection_IndexedDataMap.hxx>
+#include <TCollection_AsciiString.hxx>
+
+
+#include <inspector/TreeModel_ItemProperties.hxx>
+#include <inspector/TreeModel_ItemBase.hxx>
+
+#include <Standard_WarningsDisable.hxx>
+#include <QAbstractTableModel>
+#include <QColor>
+#include <QList>
+#include <QModelIndexList>
+#include <QVariant>
+#include <Standard_WarningsRestore.hxx>
+
+class QItemDelegate;
+
+DEFINE_STANDARD_HANDLE (TreeModel_ItemPropertiesStream, TreeModel_ItemProperties)
+
+//! \class TreeModel_ItemPropertiesStream
+//! \brief This is an interace for ViewControl_TableModel to give real values of the model
+//! It should be filled or redefined.
+class TreeModel_ItemPropertiesStream : public TreeModel_ItemProperties
+{
+public:
+
+  //! Constructor
+  Standard_EXPORT TreeModel_ItemPropertiesStream (TreeModel_ItemBasePtr theItem)
+    : TreeModel_ItemProperties (theItem) {}
+
+  //! Destructor
+  virtual ~TreeModel_ItemPropertiesStream() {}
+
+  //! Returns Key of the current stream
+  const TCollection_AsciiString& GetKey() const { return myKey; }
+
+  //! Returns Key of the current stream
+  Standard_EXPORT TCollection_AsciiString GetChildKey (const Standard_Integer theRow) const;
+
+  //! Returns sub stream inside the current stream
+  Standard_EXPORT void GetChildStream (const Standard_Integer theRow, Standard_OStream& OS) const;
+
+  //! If me has internal values, it should be initialized here.
+  Standard_EXPORT virtual void Init (const Standard_SStream& theStream);
+
+  //! If the item has internal values, there should be reseted here.
+  Standard_EXPORT virtual void Reset();
+
+  //! Returns number of rows, depending on orientation: myColumnCount or size of values container
+  //! \param theParent an index of the parent item
+  //! \return an integer value
+  Standard_EXPORT virtual int GetTableRowCount() const Standard_OVERRIDE;
+
+  //! Returns content of the model index for the given role, it is obtained from internal container of values
+  //! It returns value only for DisplayRole.
+  //! \param theRow a model index row
+  //! \param theColumn a model index column
+  //! \param theRole a view role
+  //! \return value intepreted depending on the given role
+  Standard_EXPORT virtual QVariant GetTableData (const int theRow, const int theColumn, const int theRole = Qt::DisplayRole) const Standard_OVERRIDE;
+
+  //! Returns type of edit control for the model index. By default, it is an empty control
+  //! \param theRow a model index row
+  //! \param theColumn a model index column
+  //! \return edit type
+  Standard_EXPORT virtual ViewControl_EditType GetTableEditType (const int theRow, const int theColumn) const Standard_OVERRIDE;
+
+  //! Sets the value into the table cell. Only 1st column value might be modified.
+  //! \param theRow a model index row
+  //! \param theColumn a model index column
+  //! \param theValue a new cell value
+  Standard_EXPORT virtual bool SetTableData (const int theRow, const int theColumn, const QVariant& theValue) Standard_OVERRIDE;
+
+  //! Returns presentation of the attribute to be visualized in the view
+  //! \param theRow a model index row
+  //! \param theColumn a model index column
+  //! \thePresentations [out] container of presentation handles to be visualized
+  Standard_EXPORT virtual void GetPresentations (const int theRow, const int theColumn,
+    NCollection_List<Handle(Standard_Transient)>& thePresentations) Standard_OVERRIDE;
+
+  //! Returns number of item children
+  //! \return an integer value, ZERO by default
+  Standard_EXPORT virtual int ChildItemCount() const Standard_OVERRIDE;
+
+  //! Creates a child item in the given position.
+  //! \param theRow the child row position
+  //! \param theColumn the child column position
+  //! \return the created item
+  Standard_EXPORT virtual TreeModel_ItemBasePtr CreateChildItem (int theRow, int theColumn) const;
+
+  DEFINE_STANDARD_RTTIEXT (TreeModel_ItemPropertiesStream, TreeModel_ItemProperties)
+
+protected:
+  //! Returns attribute with stream value
+  const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& GetChildrenValues() const
+  {
+    return myChildren;
+  }
+
+  //! Returns attribute with stream value
+  const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& GetValues() const
+  {
+    return myValues;
+  }
+
+protected:
+  TCollection_AsciiString myKey;
+  Standard_SStream myStream;
+  NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> myValues;
+  NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> myChildren;
+};
+
+#endif
diff --git a/tools/TreeModel/TreeModel_ItemStream.cxx b/tools/TreeModel/TreeModel_ItemStream.cxx
new file mode 100644 (file)
index 0000000..6255eea
--- /dev/null
@@ -0,0 +1,75 @@
+// Created on: 2019-02-25
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2019 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 <inspector/TreeModel_ItemStream.hxx>
+
+#include <inspector/TreeModel_ItemPropertiesStream.hxx>
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant TreeModel_ItemStream::initValue (const int theItemRole) const
+{
+  QVariant aParentValue = TreeModel_ItemBase::initValue (theItemRole);
+  if (aParentValue.isValid())
+    return aParentValue;
+
+  if (Column() != 0)
+    return QVariant();
+
+  if (theItemRole != Qt::DisplayRole && theItemRole != Qt::EditRole && theItemRole != Qt::ToolTipRole)
+    return QVariant();
+
+  TreeModel_ItemBasePtr aParentItem = Parent();
+  if (!aParentItem)
+    return QVariant();
+
+  TreeModel_ItemStreamPtr aStreamParent = itemDynamicCast<TreeModel_ItemStream>(aParentItem);
+  if (!aStreamParent)
+    return "Dump";
+
+  Handle(TreeModel_ItemPropertiesStream) aStreamProperties = Handle(TreeModel_ItemPropertiesStream)::DownCast (aParentItem->GetProperties());
+  if (aStreamProperties.IsNull())
+    return QVariant();
+
+  return aStreamProperties->GetChildKey (Row()).ToCString();
+}
+
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void TreeModel_ItemStream::GetStream (Standard_OStream& OS) const
+{
+  TreeModel_ItemBasePtr aParentItem = Parent();
+  if (!aParentItem)
+    return;
+
+  Handle(TreeModel_ItemPropertiesStream) aStreamProperties = Handle(TreeModel_ItemPropertiesStream)::DownCast (aParentItem->GetProperties());
+  if (aStreamProperties.IsNull())
+    return;
+
+  aStreamProperties->GetChildStream (Row(), OS);
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr TreeModel_ItemStream::createChild (int, int)
+{
+  return TreeModel_ItemBasePtr();
+}
diff --git a/tools/TreeModel/TreeModel_ItemStream.hxx b/tools/TreeModel/TreeModel_ItemStream.hxx
new file mode 100644 (file)
index 0000000..48e0edd
--- /dev/null
@@ -0,0 +1,78 @@
+// Created on: 2019-02-25
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2019 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 TreeModel_ItemStream_H
+#define TreeModel_ItemStream_H
+
+#include <Standard.hxx>
+#include <inspector/TreeModel_ItemBase.hxx>
+
+class TreeModel_ItemStream;
+typedef QExplicitlySharedDataPointer<TreeModel_ItemStream> TreeModel_ItemStreamPtr;
+
+//! \class TreeModel_ItemStream
+//! Parent item, that corresponds to AIS_InteractiveContext
+//! Children of the item are:
+//! - "Property" item to show context attributes such as selection filters and drawer properties
+//! - presentation items to show all interactive elements displayed/erased in the context
+class TreeModel_ItemStream : public TreeModel_ItemBase
+{
+public:
+
+  //! Creates an item wrapped by a shared pointer
+  static TreeModel_ItemStreamPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  { return TreeModel_ItemStreamPtr (new TreeModel_ItemStream (theParent, theRow, theColumn)); }
+
+  //! Destructor
+  virtual ~TreeModel_ItemStream() Standard_OVERRIDE {};
+
+  //! Returns number of displayed presentations
+  //! \return rows count
+  virtual int initRowCount() const Standard_OVERRIDE { return 0; }
+
+  //! Returns item information for the given role. Fills internal container if it was not filled yet
+  //! \param theItemRole a value role
+  //! \return the value
+  Standard_EXPORT virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
+
+  //! Returns stream value of the item to fulfill property panel.
+  //! \return stream value or dummy
+  Standard_EXPORT virtual void GetStream (Standard_OStream& OS) const Standard_OVERRIDE;
+
+protected:
+
+  //! Initialize the current item. It creates a backup of the specific item information
+  //! Do nothing as context has been already set into item
+  virtual void initItem() const Standard_OVERRIDE {}
+
+protected:
+
+  //! Creates a child item in the given position.
+  //! \param theRow the child row position
+  //! \param theColumn the child column position
+  //! \return the created item
+  virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE;
+
+private:
+
+  //! Constructor
+  //! param theParent a parent item
+  //! \param theRow the item row positition in the parent item
+  //! \param theColumn the item column positition in the parent item
+  TreeModel_ItemStream(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+    : TreeModel_ItemBase(theParent, theRow, theColumn) {}
+};
+
+#endif
index 1b07852a4541f9dd4966712f922201ddedd00bcc..c5d285cf4a2da0c44d27487125533acaed7a9a91 100644 (file)
@@ -198,8 +198,9 @@ int TreeModel_ModelBase::rowCount (const QModelIndex& theParent) const
         if (aProperties)
           break;
       }
+      // TODO: dump properties should be united with properties created by the creator
+      aParentItem->SetProperties (aProperties);
     }
-    aParentItem->SetProperties (aProperties);
   }
 
   return aParentItem ? aParentItem->rowCount() : 0;
index 01c8744aa2a90412621eebc35a900f641c7650b0..c18b8cd4d7b0a054ba6f0152c8663f4a324f5c4c 100644 (file)
@@ -163,7 +163,8 @@ TreeModel_ItemBasePtr VInspector_ItemBVHTree::createChild (int theRow, int theCo
 // =======================================================================
 TopoDS_Shape VInspector_ItemBVHTree::buildPresentationShape()
 {
-  opencascade::handle<BVH_Tree<Standard_Real, 3> > aBVHTree = myTree;
+  return TopoDS_Shape();
+  /*opencascade::handle<BVH_Tree<Standard_Real, 3> > aBVHTree = myTree;
   if (aBVHTree.IsNull())
     return TopoDS_Shape();
 
@@ -194,5 +195,5 @@ TopoDS_Shape VInspector_ItemBVHTree::buildPresentationShape()
       aBuilder.Add (aCompound, aShape);
     }
   }
-  return aCompound;
+  return aCompound;*/
 }
index dc4b36ac6577732dc0616c3b44debb63ddea791f..6d49bd9d216e94baafa5c5fb2376e00539a8688c 100644 (file)
@@ -20,7 +20,6 @@
 #include <inspector/VInspector_ItemBase.hxx>
 
 #include <AIS_InteractiveObject.hxx>
-#include <NCollection_List.hxx>
 #include <TCollection_AsciiString.hxx>
 
 class Prs3d_Drawer;
diff --git a/tools/VInspector/VInspector_ItemOpenGlLayerArray.cxx b/tools/VInspector/VInspector_ItemOpenGlLayerArray.cxx
deleted file mode 100644 (file)
index 9836ba0..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-// Created on: 2019-03-15
-// Created by: Natalia ERMOLAEVA
-// Copyright (c) 2019 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 <inspector/VInspector_ItemOpenGlLayer.hxx>
-
-#include <inspector/VInspector_ItemOpenGlLayerList.hxx>
-#include <inspector/VInspector_Tools.hxx>
-#include <inspector/ViewControl_Tools.hxx>
-
-#include <AIS.hxx>
-#include <AIS_ListOfInteractive.hxx>
-#include <Aspect.hxx>
-#include <Graphic3d.hxx>
-#include <OpenGl_Layer.hxx>
-#include <OpenGl_Group.hxx>
-#include <OpenGl_PrimitiveArray.hxx>
-#include <OpenGl_Text.hxx>
-#include <SelectMgr.hxx>
-#include <SelectMgr_EntityOwner.hxx>
-
-#include <Standard_WarningsDisable.hxx>
-#include <QStringList>
-#include <Standard_WarningsRestore.hxx>
-
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
-void VInspector_ItemOpenGlLayer::Init()
-{
-  VInspector_ItemOpenGlLayerListPtr aParentItem = itemDynamicCast<VInspector_ItemOpenGlLayerList>(Parent());
-  myLayer = aParentItem->GetLayer (Row(), myLayerId);
-
-  TreeModel_ItemBase::Init();
-}
-
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
-void VInspector_ItemOpenGlLayer::Reset()
-{
-  VInspector_ItemBase::Reset();
-  myLayer = NULL;
-}
-
-// =======================================================================
-// function : initItem
-// purpose :
-// =======================================================================
-void VInspector_ItemOpenGlLayer::initItem() const
-{
-  if (IsInitialized())
-    return;
-  const_cast<VInspector_ItemOpenGlLayer*>(this)->Init();
-}
-
-// =======================================================================
-// function : initRowCount
-// purpose :
-// =======================================================================
-int VInspector_ItemOpenGlLayer::initRowCount() const
-{
-  if (Column() != 0)
-    return 0;
-
-  return 0;
-}
-
-// =======================================================================
-// function : initValue
-// purpose :
-// =======================================================================
-QVariant VInspector_ItemOpenGlLayer::initValue (const int theItemRole) const
-{
-  QVariant aParentValue = VInspector_ItemBase::initValue (theItemRole);
-  if (aParentValue.isValid())
-    return aParentValue;
-
-  if (theItemRole != Qt::DisplayRole && theItemRole != Qt::EditRole && theItemRole != Qt::ToolTipRole)
-    return QVariant();
-
-  Handle(OpenGl_Layer) aLayer = GetLayer();
-  if (aLayer.IsNull())
-    return Column() == 0 ? "Empty element" : "";
-
-  switch (Column())
-  {
-    case 0:
-    {
-      TCollection_AsciiString aLayerId = Graphic3d::ZLayerIdToString (myLayerId);
-      if (aLayerId.IsEmpty())
-        aLayerId = TCollection_AsciiString (myLayerId);
-      return theItemRole == Qt::ToolTipRole ? QVariant ("")
-                                            : QVariant (QString("%1 (%2)")
-                                            .arg(aLayer->DynamicType()->Name())
-                                            .arg (aLayerId.ToCString()));
-    }
-    default:
-      break;
-  }
-  return QVariant();
-}
-
-// =======================================================================
-// function : GetTableRowCount
-// purpose :
-// =======================================================================
-int VInspector_ItemOpenGlLayer::GetTableRowCount() const
-{
-  return 40;
-}
-
-// =======================================================================
-// function : GetTableData
-// purpose :
-// =======================================================================
-QVariant VInspector_ItemOpenGlLayer::GetTableData (const int theRow, const int theColumn, const int theRole) const
-{
-  if (theRole != Qt::DisplayRole)
-    return QVariant();
-
-  Handle(OpenGl_Layer) aLayer = GetLayer();
-  if (aLayer.IsNull())
-    return QVariant();
-
-  bool isFirstColumn = theColumn == 0;
-
-  switch (theRow)
-  {
-    case 0: return isFirstColumn ? QVariant ("NbStructures") : QVariant (aLayer->NbStructures());
-    case 1: return isFirstColumn ? QVariant ("NbStructuresNotCulled") : QVariant (aLayer->NbStructuresNotCulled());
-    case 2: return isFirstColumn ? QVariant ("NbPriorities") : QVariant (aLayer->NbPriorities());
-
-    case 3: return isFirstColumn ? QVariant ("ArrayOfStructures") : QVariant (aLayer->ArrayOfStructures().Size());
-    case 4: return isFirstColumn ? QVariant ("IsCulled") : QVariant (aLayer->IsCulled());
-    case 5: return isFirstColumn ? QVariant ("NbOfTransformPersistenceObjects") : QVariant (aLayer->NbOfTransformPersistenceObjects());
-
-    case 6: return isFirstColumn ? QVariant ("CullableStructuresBVH") : QVariant (aLayer->CullableStructuresBVH().Size());
-    case 7: return isFirstColumn ? QVariant ("CullableTrsfPersStructuresBVH") : QVariant (aLayer->CullableTrsfPersStructuresBVH().Size());
-    case 8: return isFirstColumn ? QVariant ("NonCullableStructures") : QVariant (aLayer->NonCullableStructures().Size());
-
-    default:
-    break;
-  }
-
-  Standard_Integer aRow = theRow - 9;
-  return getLayerSettingsTableData (aRow, theColumn, theRole, aLayer->LayerSettings());
-}
-
-// =======================================================================
-// function : getLayerSettingsTableData
-// purpose :
-// =======================================================================
-QVariant VInspector_ItemOpenGlLayer::getLayerSettingsTableData (const int theRow, const int theColumn, const int theRole,
-                                                                const Graphic3d_ZLayerSettings& theSettings) const
-{
-  bool isFirstColumn = theColumn == 0;
-
-  switch (theRow)
-  {
-    case 0: return isFirstColumn ? QVariant ("LayerSettings:") : QVariant();
-    case 1: return isFirstColumn ? QVariant ("Name") : QVariant (theSettings.Name().ToCString());
-    case 2: return isFirstColumn ? QVariant ("Lights") : QVariant (ViewControl_Tools::GetPointerInfo (theSettings.Lights()).ToCString());
-
-    case 3: return isFirstColumn ? QVariant ("Origin") : QVariant (ViewControl_Tools::ToString (theSettings.Origin()).ToCString());
-    case 4: return isFirstColumn ? QVariant ("OriginTransformation")
-      : QVariant (ViewControl_Tools::ToString (theSettings.OriginTransformation()).ToCString());
-
-    case 5: return isFirstColumn ? QVariant ("HasCullingDistance") : QVariant (theSettings.HasCullingDistance());
-    case 6: return isFirstColumn ? QVariant ("CullingDistance")
-      : QVariant (theSettings.HasCullingDistance() ? theSettings.CullingDistance() : 0);
-
-    case 7: return isFirstColumn ? QVariant ("HasCullingSize") : QVariant (theSettings.HasCullingSize());
-    case 8: return isFirstColumn ? QVariant ("CullingSize")
-      : QVariant (theSettings.HasCullingSize() ? theSettings.CullingSize() : 0);
-
-    case 9: return isFirstColumn ? QVariant ("IsImmediate") : QVariant (theSettings.IsImmediate());
-    case 10: return isFirstColumn ? QVariant ("UseEnvironmentTexture") : QVariant (theSettings.UseEnvironmentTexture());
-    case 11: return isFirstColumn ? QVariant ("ToEnableDepthTest") : QVariant (theSettings.ToEnableDepthTest());
-    case 12: return isFirstColumn ? QVariant ("ToEnableDepthWrite") : QVariant (theSettings.ToEnableDepthWrite());
-    case 13: return isFirstColumn ? QVariant ("ToClearDepth") : QVariant (theSettings.ToClearDepth());
-    case 14: return isFirstColumn ? QVariant ("ToRenderInDepthPrepass") : QVariant (theSettings.ToRenderInDepthPrepass());
-
-    case 15: return isFirstColumn ? QVariant ("PolygonOffset: Mode")
-      : QVariant (Aspect::PolygonOffsetModeToString (theSettings.PolygonOffset().Mode));
-    case 16: return isFirstColumn ? QVariant ("PolygonOffset: Factor") : QVariant (theSettings.PolygonOffset().Factor);
-    case 17: return isFirstColumn ? QVariant ("PolygonOffset: Units") : QVariant (theSettings.PolygonOffset().Units);
-
-    default: break;
-  }
-  return QVariant();
-}
-
-// =======================================================================
-// function : createChild
-// purpose :
-// =======================================================================
-TreeModel_ItemBasePtr VInspector_ItemOpenGlLayer::createChild (int theRow, int theColumn)
-{
-  (void)theRow;
-  (void)theColumn;
-
-  return TreeModel_ItemBasePtr();
-}
diff --git a/tools/VInspector/VInspector_ItemOpenGlLayerArray.hxx b/tools/VInspector/VInspector_ItemOpenGlLayerArray.hxx
deleted file mode 100644 (file)
index b2c9546..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-// Created on: 2019-03-15
-// Created by: Natalia ERMOLAEVA
-// Copyright (c) 2019 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 VInspector_ItemOpenGlLayer_H
-#define VInspector_ItemOpenGlLayer_H
-
-#include <Standard.hxx>
-#include <inspector/VInspector_ItemBase.hxx>
-
-#include <Graphic3d_ZLayerSettings.hxx>
-#include <OpenGl_Layer.hxx>
-
-class Graphic3d_Group;
-
-class VInspector_ItemOpenGlLayer;
-typedef QExplicitlySharedDataPointer<VInspector_ItemOpenGlLayer> VInspector_ItemOpenGlLayerPtr;
-
-//! \class VInspector_ItemOpenGlLayer
-//! Parent item, that corresponds to AIS_InteractiveContext
-//! Children of the item are:
-//! - "Property" item to show context attributes such as selection filters and drawer properties
-//! - presentation items to show all interactive elements displayed/erased in the context
-class VInspector_ItemOpenGlLayer : public VInspector_ItemBase
-{
-public:
-
-  //! Creates an item wrapped by a shared pointer
-  static VInspector_ItemOpenGlLayerPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
-  { return VInspector_ItemOpenGlLayerPtr (new VInspector_ItemOpenGlLayer (theParent, theRow, theColumn)); }
-
-  //! Destructor
-  virtual ~VInspector_ItemOpenGlLayer() Standard_OVERRIDE {};
-
-  //! Returns data object of the item.
-  //! \return object
-  virtual Handle(Standard_Transient) GetObject() const { initItem(); return myLayer; }
-
-  //! Returns the current graphic3d group, init item if it was not initialized yet
-  //! \return graphic group
-  Standard_EXPORT Handle(OpenGl_Layer) GetLayer() const
-    { return Handle(OpenGl_Layer)::DownCast (GetObject());}
-
-  //! Inits the item, fills internal containers
-  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
-
-  //! Resets cached values
-  Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
-
-  //! Returns number of table rows
-  //! \return an integer value
-  virtual int GetTableRowCount() const Standard_OVERRIDE;
-
-  //! Returns table value for the row in form: <function name> <function value>
-  //! \param theRow a model index row
-  //! \param theColumn a model index column
-  virtual QVariant GetTableData (const int theRow, const int theColumn, const int theRole) const Standard_OVERRIDE;
-
-protected:
-
-  //! Initialize the current item. It creates a backup of the specific item information
-  //! Do nothing as context has been already set into item
-  virtual void initItem() const Standard_OVERRIDE;
-
-  //! Returns number of displayed presentations
-  //! \return rows count
-  Standard_EXPORT virtual int initRowCount() const Standard_OVERRIDE;
-
-  //! Returns item information for the given role. Fills internal container if it was not filled yet
-  //! \param theItemRole a value role
-  //! \return the value
-  Standard_EXPORT virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
-
-protected:
-  //! Returns table presentation of layer settings
-  QVariant getLayerSettingsTableData (const int theRow, const int theColumn, const int theRole,
-                                      const Graphic3d_ZLayerSettings& theSettings) const;
-
-  //! Creates a child item in the given position.
-  //! \param theRow the child row position
-  //! \param theColumn the child column position
-  //! \return the created item
-  virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE;
-
-private:
-
-  //! Constructor
-  //! param theParent a parent item
-  //! \param theRow the item row positition in the parent item
-  //! \param theColumn the item column positition in the parent item
-  VInspector_ItemOpenGlLayer(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
-    : VInspector_ItemBase(theParent, theRow, theColumn) {}
-
-private:
-  Handle(OpenGl_Layer) myLayer; //! current layer
-  Graphic3d_ZLayerId myLayerId; //! current Z layer index in OpenGl_View
-};
-
-#endif
index a66255ca63d4aba1de9dd547ceff924057c8caa4..10fa1d1e9d5657c61f882fb6187bad7fbd90db60 100644 (file)
@@ -267,6 +267,19 @@ void VInspector_ItemPresentableObject::GetPresentations (NCollection_List<Handle
   thePresentations.Append (GetInteractiveObject());
 }
 
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void VInspector_ItemPresentableObject::GetStream (Standard_OStream& OS) const
+{
+  Handle(AIS_InteractiveObject) anIO = GetInteractiveObject();
+  if (anIO.IsNull())
+    return;
+
+  anIO->Dump (OS);
+}
+
 // =======================================================================
 // function : GetTableRowCount
 // purpose :
index 6f1fab2a4d748f45eedbe063ec04dd7ae602dad3..358e171f0a98fe50d4ef3cc58fcbac24055b9387 100644 (file)
@@ -64,6 +64,10 @@ public:
   //! \thePresentations [out] container of presentation handles to be visualized
   Standard_EXPORT virtual void GetPresentations (NCollection_List<Handle(Standard_Transient)>& thePresentations);
 
+  //! Returns stream value of the item to fulfill property panel.
+  //! \return stream value or dummy
+  Standard_EXPORT virtual void GetStream (Standard_OStream& OS) const Standard_OVERRIDE;
+
   //! Returns number of table rows
   //! \return an integer value
   virtual int GetTableRowCount() const Standard_OVERRIDE;
index a90383eef68ca721a4d8b4e06a564bd5bb8637c7..d5a34974e684efc370d100b286e85db3e85cfe52 100644 (file)
@@ -145,7 +145,7 @@ Handle(Prs3d_Presentation) VInspector_ItemPresentations::GetPresentation (const
       continue;
     if (theRowId - aNextPresentationIndex == aCurrentIndex)
     {
-      theName = "";//QString ("Prs3d_Presentation (mode = %1)").arg (aPrsIter.ChangeValue().Mode()).toStdString().c_str();
+      theName = "Prs3d_Presentation";
       return aPrs3d;
     }
     aCurrentIndex++;
index 6f40a868a62c7d4e2ebb1814919a7ac8fd7d67e9..a8b4abafbbf79435796efe9b26093d1bb92db877 100644 (file)
@@ -119,6 +119,19 @@ int VInspector_ItemPrs3dAspect::initRowCount() const
   return 0;
 }
 
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void VInspector_ItemPrs3dAspect::GetStream (Standard_OStream& OS) const
+{
+  Handle(Prs3d_BasicAspect) anAspect = GetAspect();
+  if (anAspect.IsNull())
+    return;
+
+  anAspect->Dump (OS);
+}
+
 // =======================================================================
 // function : createChild
 // purpose :
index 8f34f7ba50c7d40c311de5b8ba9aeecd7ce5b4c3..1e7b839841a48262ccb570ebd1345fc058154bce 100644 (file)
@@ -103,6 +103,10 @@ protected:
   //! \return the value
   virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
 
+  //! Returns stream value of the item to fulfill property panel.
+  //! \return stream value or dummy
+  Standard_EXPORT virtual void GetStream (Standard_OStream& OS) const Standard_OVERRIDE;
+
   //! Creates a child item in the given position.
   //! \param theRow the child row position
   //! \param theColumn the child column position
index a52eefd941af7af046f4392856ee12e787d150be..2062f72aa2061158f4bcb8c332af38510d4b6cb6 100644 (file)
@@ -155,6 +155,19 @@ void VInspector_ItemSelectBasicsEntityOwner::initItem() const
   const_cast<VInspector_ItemSelectBasicsEntityOwner*>(this)->Init();
 }
 
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectBasicsEntityOwner::GetStream (Standard_OStream& OS) const
+{
+  Handle(SelectMgr_EntityOwner) anEntityOwner = Handle(SelectMgr_EntityOwner)::DownCast (getEntityOwner());
+  if (anEntityOwner.IsNull())
+    return;
+
+  anEntityOwner->Dump (OS);
+}
+
 // =======================================================================
 // function : GetTableRowCount
 // purpose :
index bf544d43c1e26c8f469033e1736b0d486adb5cc6..f32bbeda7556e149d7dbb0ae4980ed8759700de3 100644 (file)
@@ -52,6 +52,10 @@ public:
   //! Returns the current entity owner
   Handle(SelectBasics_EntityOwner) EntityOwner() const { return myOwner; }
 
+  //! Returns stream value of the item to fulfill property panel.
+  //! \return stream value or dummy
+  Standard_EXPORT virtual void GetStream (Standard_OStream& OS) const Standard_OVERRIDE;
+
   //! Returns number of table rows
   //! \return an integer value
   virtual int GetTableRowCount() const Standard_OVERRIDE;
index cab89e4ec79d91bf754b9b06c88b237bf00df678..1c2f6e405baab29af61c91dac2af5338024231d5 100644 (file)
@@ -48,7 +48,7 @@
 #include <inspector/VInspector_ItemSelectBasicsEntityOwner.hxx>
 #include <inspector/VInspector_ItemFolderObject.hxx>
 #include <inspector/VInspector_ItemPresentableObject.hxx>
-#include <inspector/VInspector_PropertiesCreator.hxx>
+//#include <inspector/VInspector_PropertiesCreator.hxx>
 #include <inspector/VInspector_TableModelValues.hxx>
 #include <inspector/VInspector_ToolBar.hxx>
 #include <inspector/VInspector_Tools.hxx>
@@ -134,7 +134,7 @@ VInspector_Window::VInspector_Window()
   //((ViewControl_TreeView*)myTreeView)->SetPredefinedSize (QSize (VINSPECTOR_DEFAULT_TREE_VIEW_WIDTH,
   //                                                               VINSPECTOR_DEFAULT_TREE_VIEW_HEIGHT));
   VInspector_ViewModel* aTreeModel = new VInspector_ViewModel (myTreeView);
-  aTreeModel-> AddPropertiesCreator(new VInspector_PropertiesCreator());
+  //aTreeModel->AddPropertiesCreator(new VInspector_PropertiesCreator());
   myTreeView->setModel (aTreeModel);
   // hide Visibility column
   TreeModel_HeaderSection anItem = aTreeModel->GetHeaderItem ((int)TreeModel_ColumnType_Visibility);
@@ -156,7 +156,7 @@ VInspector_Window::VInspector_Window()
 
   // property view
   myPaneCreators.Append (new VInspectorPaneAIS_PaneCreator());
-  aTreeModel->AddPropertiesCreator (new VInspectorPaneAIS_PropertiesCreator());
+  //aTreeModel->AddPropertiesCreator (new VInspectorPaneAIS_PropertiesCreator());
 
   myPropertyView = new ViewControl_PropertyView (myMainWindow,
     QSize(VINSPECTOR_DEFAULT_PROPERTY_VIEW_WIDTH, VINSPECTOR_DEFAULT_PROPERTY_VIEW_HEIGHT));
@@ -862,12 +862,12 @@ void VInspector_Window::onTreeViewSelectionChanged (const QItemSelection&,
   if (!aTreeItemSelected)
     return;
 
-  Handle(TreeModel_ItemProperties) anItemProperties = aTreeItemSelected->GetProperties();
   NCollection_List<Handle(Standard_Transient)> aSelPresentations;
+  Handle(TreeModel_ItemProperties) anItemProperties = aTreeItemSelected->GetProperties();
   if (anItemProperties)
     anItemProperties->GetPresentations (-1, -1, aSelPresentations);
-  else
-    GetSelectedShapes (aSelPresentations);
+  //else
+  GetSelectedShapes (aSelPresentations);
   myDisplayPreview->UpdatePreview (View_DisplayActionType_DisplayId, aSelPresentations);
 
   //Handle(Graphic3d_TransformPers) aSelectedPersistent = GetSelectedTransformPers();