From 6b0fcd0b4c8c4e4e36e61e9cbcbc1973939f7d8d Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 18 Mar 2020 10:08:38 +0300 Subject: [PATCH] 0031354: Visualization - Dump improvement for V3d, Graphic3d, Aspect --- src/Graphic3d/Graphic3d_CView.cxx | 7 +------ src/Graphic3d/Graphic3d_CameraTile.cxx | 8 ++++---- src/Graphic3d/Graphic3d_DataStructureManager.cxx | 2 +- src/Graphic3d/Graphic3d_RenderingParams.cxx | 2 +- src/Graphic3d/Graphic3d_Structure.cxx | 2 +- src/Graphic3d/Graphic3d_Vertex.cxx | 6 ++++-- src/Graphic3d/Graphic3d_WorldViewProjState.hxx | 2 +- src/NCollection/NCollection_Vec2.hxx | 9 +++++++++ src/V3d/V3d_Viewer.cxx | 2 +- tools/MessageView/MessageView_Window.cxx | 1 - tools/VInspector/VInspector_ItemContextProperties.cxx | 9 --------- tools/VInspector/VInspector_ItemContextProperties.hxx | 3 --- 12 files changed, 23 insertions(+), 30 deletions(-) diff --git a/src/Graphic3d/Graphic3d_CView.cxx b/src/Graphic3d/Graphic3d_CView.cxx index 1aa54a8e50..6405f37256 100644 --- a/src/Graphic3d/Graphic3d_CView.cxx +++ b/src/Graphic3d/Graphic3d_CView.cxx @@ -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) diff --git a/src/Graphic3d/Graphic3d_CameraTile.cxx b/src/Graphic3d/Graphic3d_CameraTile.cxx index 22caa5ec40..dbc3868f50 100644 --- a/src/Graphic3d/Graphic3d_CameraTile.cxx +++ b/src/Graphic3d/Graphic3d_CameraTile.cxx @@ -21,10 +21,10 @@ //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) } diff --git a/src/Graphic3d/Graphic3d_DataStructureManager.cxx b/src/Graphic3d/Graphic3d_DataStructureManager.cxx index cc05c18289..41c5d24b33 100644 --- a/src/Graphic3d/Graphic3d_DataStructureManager.cxx +++ b/src/Graphic3d/Graphic3d_DataStructureManager.cxx @@ -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) } diff --git a/src/Graphic3d/Graphic3d_RenderingParams.cxx b/src/Graphic3d/Graphic3d_RenderingParams.cxx index 7479c74a8b..885d7b26b1 100644 --- a/src/Graphic3d/Graphic3d_RenderingParams.cxx +++ b/src/Graphic3d/Graphic3d_RenderingParams.cxx @@ -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) diff --git a/src/Graphic3d/Graphic3d_Structure.cxx b/src/Graphic3d/Graphic3d_Structure.cxx index 087543115b..829c2911ca 100644 --- a/src/Graphic3d/Graphic3d_Structure.cxx +++ b/src/Graphic3d/Graphic3d_Structure.cxx @@ -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()) diff --git a/src/Graphic3d/Graphic3d_Vertex.cxx b/src/Graphic3d/Graphic3d_Vertex.cxx index c8e6a6f81b..d3f9ed7480 100644 --- a/src/Graphic3d/Graphic3d_Vertex.cxx +++ b/src/Graphic3d/Graphic3d_Vertex.cxx @@ -15,6 +15,7 @@ #include +#include #include 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) } diff --git a/src/Graphic3d/Graphic3d_WorldViewProjState.hxx b/src/Graphic3d/Graphic3d_WorldViewProjState.hxx index c1f7973916..b8d72ba071 100644 --- a/src/Graphic3d/Graphic3d_WorldViewProjState.hxx +++ b/src/Graphic3d/Graphic3d_WorldViewProjState.hxx @@ -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) diff --git a/src/NCollection/NCollection_Vec2.hxx b/src/NCollection/NCollection_Vec2.hxx index f54cae29de..38b354d1ac 100644 --- a/src/NCollection/NCollection_Vec2.hxx +++ b/src/NCollection/NCollection_Vec2.hxx @@ -17,6 +17,8 @@ #include // std::sqrt() +#include + //! 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]; diff --git a/src/V3d/V3d_Viewer.cxx b/src/V3d/V3d_Viewer.cxx index 2ddeb4bf9d..0a7e1f6eab 100644 --- a/src/V3d/V3d_Viewer.cxx +++ b/src/V3d/V3d_Viewer.cxx @@ -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) diff --git a/tools/MessageView/MessageView_Window.cxx b/tools/MessageView/MessageView_Window.cxx index 1dfb89beb9..aaa2c61dd2 100644 --- a/tools/MessageView/MessageView_Window.cxx +++ b/tools/MessageView/MessageView_Window.cxx @@ -883,7 +883,6 @@ void MessageView_Window::updatePreviewPresentation() void MessageView_Window::updateVisibleColumns() { MessageModel_TreeModel* aViewModel = dynamic_cast (myTreeView->model()); - const NCollection_List& aReports = aViewModel->Reports(); NCollection_Map anActiveMetrics; for (NCollection_List::Iterator anIterator (aViewModel->Reports()); anIterator.More(); anIterator.Next()) diff --git a/tools/VInspector/VInspector_ItemContextProperties.cxx b/tools/VInspector/VInspector_ItemContextProperties.cxx index 6d23052f97..798345f266 100644 --- a/tools/VInspector/VInspector_ItemContextProperties.cxx +++ b/tools/VInspector/VInspector_ItemContextProperties.cxx @@ -18,15 +18,6 @@ #include #include -// ======================================================================= -// function : Init -// purpose : -// ======================================================================= -void VInspector_ItemContextProperties::Init() -{ - TreeModel_ItemBase::Init(); // to use getIO() without circling initialization -} - // ======================================================================= // function : initValue // purpose : diff --git a/tools/VInspector/VInspector_ItemContextProperties.hxx b/tools/VInspector/VInspector_ItemContextProperties.hxx index c9d07861dc..cb53b44855 100644 --- a/tools/VInspector/VInspector_ItemContextProperties.hxx +++ b/tools/VInspector/VInspector_ItemContextProperties.hxx @@ -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; -- 2.39.5