]> OCCT Git - occt-copy.git/commitdiff
0031354: Visualization - Dump improvement for V3d, Graphic3d, Aspect
authornds <nds@opencascade.com>
Wed, 18 Mar 2020 07:08:38 +0000 (10:08 +0300)
committernds <nds@opencascade.com>
Wed, 18 Mar 2020 07:08:38 +0000 (10:08 +0300)
12 files changed:
src/Graphic3d/Graphic3d_CView.cxx
src/Graphic3d/Graphic3d_CameraTile.cxx
src/Graphic3d/Graphic3d_DataStructureManager.cxx
src/Graphic3d/Graphic3d_RenderingParams.cxx
src/Graphic3d/Graphic3d_Structure.cxx
src/Graphic3d/Graphic3d_Vertex.cxx
src/Graphic3d/Graphic3d_WorldViewProjState.hxx
src/NCollection/NCollection_Vec2.hxx
src/V3d/V3d_Viewer.cxx
tools/MessageView/MessageView_Window.cxx
tools/VInspector/VInspector_ItemContextProperties.cxx
tools/VInspector/VInspector_ItemContextProperties.hxx

index 1aa54a8e50320fccfa5fc70318430cfefd31951f..6405f37256b88473305d32e4624941f64b92c671 100644 (file)
@@ -1119,17 +1119,12 @@ void Graphic3d_CView::DumpJson (Standard_OStream& theOStream, Standard_Integer t
     OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructToCompute.get())
   }
 
-  for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsToCompute); anIter.More(); anIter.Next())
+  for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsComputed); anIter.More(); anIter.Next())
   {
     Handle(Graphic3d_Structure) aStructComputed = anIter.Value();
     OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructComputed.get())
   }
 
-  for (Graphic3d_MapOfStructure::Iterator anIter (myStructsDisplayed); anIter.More(); anIter.Next())
-  {
-    Handle(Graphic3d_Structure) aStructDisplayed = anIter.Value();
-  }
-
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInComputedMode)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRemoved)
index 22caa5ec407c73486bdeed85d66e3479c3252c9a..dbc3868f502620e17457182ca83dd6dcef5a26c1 100644 (file)
 //function : DumpJson
 //purpose  : 
 //=======================================================================
-void Graphic3d_CameraTile::DumpJson (Standard_OStream& theOStream, Standard_Integer /*theDepth*/) const
+void Graphic3d_CameraTile::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, "TotalSize", 2, TotalSize.x(), TotalSize.y())
-  OCCT_DUMP_VECTOR_CLASS (theOStream, "TileSize", 2, TileSize.x(), TileSize.y())
-  OCCT_DUMP_VECTOR_CLASS (theOStream, "Offset", 2, Offset.x(), Offset.y())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &TotalSize)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &TileSize)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Offset)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsTopDown)
 }
index cc05c1828963a17042c3caf9d1c29875028064e4..41c5d24b330e795059ab37d71e972375c18cc548 100644 (file)
@@ -38,7 +38,7 @@ Graphic3d_DataStructureManager::Graphic3d_DataStructureManager () {
 //function : DumpJson
 //purpose  : 
 //=======================================================================
-void Graphic3d_DataStructureManager::DumpJson (Standard_OStream& theOStream, Standard_Integer /*theDepth*/) const
+void Graphic3d_DataStructureManager::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 }
index 7479c74a8bce73013b0946a9f03779564a19e2b1..885d7b26b1bdd602e4b53d409d0ca1f9c5c9fe50 100644 (file)
@@ -79,7 +79,7 @@ void Graphic3d_RenderingParams::DumpJson (Standard_OStream& theOStream, Standard
   
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, StatsPosition.get())
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, ChartPosition.get())
-  OCCT_DUMP_VECTOR_CLASS (theOStream, "ChartSize", 2, ChartSize.x(), ChartSize.y())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &ChartSize)
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, StatsTextAspect.get())
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StatsUpdateInterval)
   
index 087543115b0267a8ee75e8da7b21280475c7ea34..829c2911ca58ddf7fa47ad1b7483337fcda9b820 100644 (file)
@@ -1037,7 +1037,7 @@ void Graphic3d_Structure::SetZLayer (const Graphic3d_ZLayerId theLayerId)
 void Graphic3d_Structure::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
-  
+
   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStructureManager)
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCStructure.get())
 
index c8e6a6f81b20022c341b21c14ba858d9cdb6927b..d3f9ed74806bb02dcf2a62751980e553b284884d 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <Graphic3d_Vertex.hxx>
 
+#include <gp_XYZ.hxx>
 #include <Standard_Dump.hxx>
 
 Standard_ShortReal Graphic3d_Vertex::Distance(const Graphic3d_Vertex& AOther) const
@@ -28,7 +29,8 @@ Standard_ShortReal Graphic3d_Vertex::Distance(const Graphic3d_Vertex& AOther) co
 // function : DumpJson
 // purpose  :
 // =======================================================================
-void Graphic3d_Vertex::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+void Graphic3d_Vertex::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, "Graphic3d_Vertex", 3, xyz[0], xyz[1], xyz[2])
+  gp_XYZ aCoord (xyz[0], xyz[1], xyz[2]);
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aCoord)
 }
index c1f7973916d7d17ec661416f37b9c55c446ef963..b8d72ba071463ee990235fb96be966d8c5ade717 100644 (file)
@@ -150,7 +150,7 @@ public:
     myWorldViewState  = theOther.myWorldViewState;
   }
   
-  void DumpJson (Standard_OStream& theOStream, Standard_Integer /*theDepth*/) const
+  void DumpJson (Standard_OStream& theOStream, Standard_Integer) const
   {
     OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsValid)
     OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCamera)
index f54cae29def746e1b17c20c7ec60c821554888de..38b354d1acca524a9b4ae713a2eb558acef90548 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <cmath> // std::sqrt()
 
+#include <Standard_Dump.hxx>
+
 //! Auxiliary macros to define couple of similar access components as vector methods.
 //! @return 2 components by their names in specified order
 #define NCOLLECTION_VEC_COMPONENTS_2D(theX, theY) \
@@ -289,6 +291,13 @@ public:
     return NCollection_Vec2 (Element_t(0), Element_t(1));
   }
 
+  //! Dumps the content of me into the stream
+  void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    (void)theDepth;
+    OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "Vec2", 2, v[0], v[1])
+  }
+
 private:
 
   Element_t v[2];
index 2ddeb4bf9d9469b20aa4fa9abba0e1f90e4eabf5..0a7e1f6eab9ad454e206340294ba496560586932 100644 (file)
@@ -584,7 +584,6 @@ void V3d_Viewer::DumpJson (Standard_OStream& theOStream, Standard_Integer theDep
   
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDriver.get())
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructureManager.get())
-  //TColStd_MapOfInteger myLayerIds;
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myZLayerGenId)
   
   for (V3d_ListOfView::Iterator anIter (myDefinedViews); anIter.More(); anIter.Next())
@@ -610,6 +609,7 @@ void V3d_Viewer::DumpJson (Standard_OStream& theOStream, Standard_Integer theDep
     Handle(Graphic3d_CLight) anActiveLight = anIter.Value();
     OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anActiveLight.get())
   }
+
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBackground)
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myGradientBackground)
 
index 1dfb89beb9cfcb9ef3477eeef30088eeb69551cb..aaa2c61dd2e8b97ed7b56204720ebc416c71a6b3 100644 (file)
@@ -883,7 +883,6 @@ void MessageView_Window::updatePreviewPresentation()
 void MessageView_Window::updateVisibleColumns()
 {
   MessageModel_TreeModel* aViewModel = dynamic_cast<MessageModel_TreeModel*> (myTreeView->model());
-  const NCollection_List<MessageModel_ReportInformation>& aReports = aViewModel->Reports();
 
   NCollection_Map<Message_MetricType> anActiveMetrics;
   for (NCollection_List<MessageModel_ReportInformation>::Iterator anIterator (aViewModel->Reports()); anIterator.More(); anIterator.Next())
index 6d23052f97c50a5aafb0e53f0fcb4ac220186a09..798345f2663c69fc7d2d9816542f255caf2c3579 100644 (file)
 #include <inspector/VInspector_ItemContext.hxx>
 #include <inspector/VInspector_ItemV3dViewer.hxx>
 
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
-void VInspector_ItemContextProperties::Init()
-{
-  TreeModel_ItemBase::Init(); // to use getIO() without circling initialization
-}
-
 // =======================================================================
 // function : initValue
 // purpose :
index c9d07861dc2649d7b192162d7d5fffb37907712c..cb53b44855603b2d99a871aa59c54c777bf0aa0f 100644 (file)
@@ -39,9 +39,6 @@ public:
   //! Destructor
   virtual ~VInspector_ItemContextProperties() Standard_OVERRIDE {};
 
-  //! Inits the item, fills internal containers
-  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
-
 protected:
   //! Initializes the current item. It is empty because Reset() is also empty.
   virtual void initItem() const Standard_OVERRIDE;