]> OCCT Git - occt-copy.git/commitdiff
0031354: Visualization - Dump improvement for V3d, Graphic3d, Aspect
authorsshutina <sshutina@opencascade.com>
Thu, 6 Feb 2020 15:17:35 +0000 (18:17 +0300)
committernds <nds@opencascade.com>
Wed, 12 Feb 2020 22:30:50 +0000 (01:30 +0300)
(cherry picked from commit 4bda72dc94318deffa8517a31a9b81f4b1cb2e38)

55 files changed:
src/Aspect/Aspect_Background.cxx
src/Aspect/Aspect_Background.hxx
src/Aspect/Aspect_CircularGrid.cxx
src/Aspect/Aspect_CircularGrid.hxx
src/Aspect/Aspect_GenId.cxx
src/Aspect/Aspect_GenId.hxx
src/Aspect/Aspect_GradientBackground.cxx
src/Aspect/Aspect_GradientBackground.hxx
src/Aspect/Aspect_Grid.cxx
src/Aspect/Aspect_Grid.hxx
src/Aspect/Aspect_RectangularGrid.cxx
src/Aspect/Aspect_RectangularGrid.hxx
src/Aspect/Aspect_Window.cxx
src/Aspect/Aspect_Window.hxx
src/Graphic3d/FILES
src/Graphic3d/Graphic3d_AspectText3d.cxx
src/Graphic3d/Graphic3d_AspectText3d.hxx
src/Graphic3d/Graphic3d_CLight.cxx
src/Graphic3d/Graphic3d_CLight.hxx
src/Graphic3d/Graphic3d_CView.cxx
src/Graphic3d/Graphic3d_CView.hxx
src/Graphic3d/Graphic3d_Camera.cxx
src/Graphic3d/Graphic3d_Camera.hxx
src/Graphic3d/Graphic3d_CameraTile.cxx [new file with mode: 0644]
src/Graphic3d/Graphic3d_CameraTile.hxx
src/Graphic3d/Graphic3d_DataStructureManager.cxx
src/Graphic3d/Graphic3d_DataStructureManager.hxx
src/Graphic3d/Graphic3d_GraphicDriver.cxx
src/Graphic3d/Graphic3d_GraphicDriver.hxx
src/Graphic3d/Graphic3d_Group.cxx
src/Graphic3d/Graphic3d_RenderingParams.cxx [new file with mode: 0644]
src/Graphic3d/Graphic3d_RenderingParams.hxx
src/Graphic3d/Graphic3d_Structure.cxx
src/Graphic3d/Graphic3d_StructureManager.cxx
src/Graphic3d/Graphic3d_StructureManager.hxx
src/Graphic3d/Graphic3d_Vertex.cxx
src/Graphic3d/Graphic3d_Vertex.hxx
src/Graphic3d/Graphic3d_WorldViewProjState.hxx
src/V3d/V3d_CircularGrid.cxx
src/V3d/V3d_CircularGrid.hxx
src/V3d/V3d_RectangularGrid.cxx
src/V3d/V3d_RectangularGrid.hxx
src/V3d/V3d_Trihedron.cxx
src/V3d/V3d_Trihedron.hxx
src/V3d/V3d_View.cxx
src/V3d/V3d_View.hxx
src/V3d/V3d_Viewer.cxx
src/gp/gp_Vec.cxx
src/gp/gp_Vec.hxx
tools/VInspector/FILES
tools/VInspector/VInspector_ItemContext.cxx
tools/VInspector/VInspector_ItemContextProperties.cxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemContextProperties.hxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemV3dViewer.cxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemV3dViewer.hxx [new file with mode: 0644]

index 220c9332ae85521d2eac9b63c26b669a9613199f..ae933567d2b93b0c0a13e4b091315fd2d329d384 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <Aspect_Background.hxx>
 #include <Quantity_Color.hxx>
+#include <Standard_Dump.hxx>
 
 //-Aliases
 //-Global data definitions
@@ -56,3 +57,12 @@ Quantity_Color Aspect_Background::Color () const {
        return (MyColor);
 
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void Aspect_Background::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor)
+}
index f37eec261344c22c72e1ea4eafd97f2e8ac2efaa..0503c639ea6f245b05ed6bf18ce9836fa7d9d9ff 100644 (file)
@@ -46,6 +46,9 @@ public:
   
   //! Returns the colour of the window background <me>.
   Standard_EXPORT Quantity_Color Color() const;
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index 7ba90c1c55c67e6bcecd656996d70fffa7cb00f3..400fdeaac00e1525e6304b3b4671d976eb82366f 100644 (file)
@@ -140,3 +140,20 @@ void Aspect_CircularGrid::Init () {
   myAlpha = M_PI / Standard_Real(myDivisionNumber);
   myA1 = Cos(myAlpha); myB1=Sin(myAlpha);
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Aspect_CircularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRadiusStep)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDivisionNumber)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlpha)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myA1)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myB1)
+}
index f3f82d1713785598d838f0befb42c3cbcc0c9455..a915bcaa9410ecd2c4531b24b980aeb1914525ea 100644 (file)
@@ -55,6 +55,9 @@ public:
   Standard_EXPORT Standard_Integer DivisionNumber() const;
   
   Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 private:
 
index 6788bb50f7aac5edff82802d63fbd76bc18d23fb..85069e0b25713cff950f5648336c7f2797b6595e 100644 (file)
@@ -18,6 +18,8 @@
 #include <Aspect_GenId.hxx>
 #include <Aspect_IdentDefinitionError.hxx>
 
+#include <Standard_Dump.hxx>
+
 // =======================================================================
 // function : Aspect_GenId
 // purpose  :
@@ -114,3 +116,21 @@ Standard_Boolean Aspect_GenId::Next (Standard_Integer& theId)
   theId = myLowerBound + myLength - myFreeCount - 1;
   return Standard_True;
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void Aspect_GenId::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFreeCount)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLength)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLowerBound)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUpperBound)
+
+  for (TColStd_ListOfInteger::Iterator anIter (myFreeIds); anIter.More(); anIter.Next())
+  {
+    Standard_Integer aFreeId = anIter.Value();
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aFreeId)
+  }
+}
index c565d3d1f206ab7b04733a120074279873414bcc..73d6702ce3e321da566c9ff9f856a13191bc2411 100644 (file)
@@ -72,6 +72,9 @@ public:
   
   //! Returns the upper identifier in range.
   Standard_Integer Upper() const { return myUpperBound; }
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 private:
 
index aa49d0ac3c02b038fad6060b93259c4c96a717d7..da035420e44ca3f03befa91bf346229ae7b4ce17 100644 (file)
@@ -55,3 +55,15 @@ Aspect_GradientFillMethod Aspect_GradientBackground::BgGradientFillMethod( ) con
 {
   return MyGradientMethod;
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void Aspect_GradientBackground::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Background)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor2)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyGradientMethod)
+}
index ea3e7d594fabf83dae4b3c4e4a312020d84e94b2..2bc111e7318ebccaa7394ab8bf034518280960f7 100644 (file)
@@ -51,6 +51,9 @@ public:
   
   //! Returns the current gradient background fill mode.
   Standard_EXPORT Aspect_GradientFillMethod BgGradientFillMethod() const;
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index e06917f495c524a61bc3b6681c7ff7955d1d825b..eed3460bd8babc80b6bd6355f6b4749e48f9aaab 100644 (file)
@@ -104,3 +104,22 @@ void Aspect_Grid::SetDrawMode (const Aspect_GridDrawMode theDrawMode)
   myDrawMode = theDrawMode;
   UpdateDisplay();
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Aspect_Grid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRotationAngle)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXOrigin)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYOrigin)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTenthColor)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawMode)
+}
index 8127e46bb8fa24541b936a9780f13874dc1ec704..a7034b9eddb83810dde9ceb1c5fdcbcef5d7ce74 100644 (file)
@@ -96,6 +96,9 @@ public:
   Standard_EXPORT virtual Standard_Boolean IsDisplayed() const = 0;
   
   Standard_EXPORT virtual void Init() = 0;
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 protected:
 
index b41c32f2776ac41d37019a634554e23639ea504f..ad8712fafdadd56a40a5615ffc6548d9daadcb7e 100644 (file)
@@ -155,3 +155,25 @@ Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha,
                                             const Standard_Real beta) const {
   return (Abs( Sin(alpha) * Cos(beta + M_PI / 2.) - Cos(alpha) * Sin(beta + M_PI / 2.)) != 0) ;
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Aspect_RectangularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXStep)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYStep)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirstAngle)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySecondAngle)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a1)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b1)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c1)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a2)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b2)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c2)
+}
index 14dd93cdc575ab8bebef6d5dcffa0c80637dc39d..79513d35d530fef88e937fc1bc711bcbfd0d47c0 100644 (file)
@@ -67,6 +67,9 @@ public:
   Standard_EXPORT Standard_Real SecondAngle() const;
   
   Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 private:
 
index 6f1d31018d202acf9f90cac97e4564231b69ae58..d41d1250b735f0a7febfc75ccc2b39261646ec90 100644 (file)
@@ -92,3 +92,18 @@ void Aspect_Window::SetBackground (const Quantity_Color& theFirstColor,
 {
   MyGradientBackground.SetColors (theFirstColor, theSecondColor, theFillMethod);
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Aspect_Window::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyBackground)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyGradientBackground)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyBackgroundFillMethod)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyIsVirtual)
+}
index 0fc634cba4ae37168540645a056259e00ff7e5fc..dff828ce96fe4336d9f45b349c07b09111e44a9b 100644 (file)
@@ -114,6 +114,9 @@ public:
   //! on platforms implementing thread-unsafe connections to display.
   //! NULL can be passed instead otherwise.
   virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
   DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
 
index 31ac8824818fa6049364f3a96e2044687c33e624..69e09418f2c4097f44df59eccf846748e1140d7d 100755 (executable)
@@ -39,6 +39,7 @@ Graphic3d_BvhCStructureSetTrsfPers.cxx
 Graphic3d_BvhCStructureSetTrsfPers.hxx
 Graphic3d_Camera.cxx
 Graphic3d_Camera.hxx
+Graphic3d_CameraTile.cxx
 Graphic3d_CameraTile.hxx
 Graphic3d_CappingFlags.hxx
 Graphic3d_CLight.cxx
@@ -116,6 +117,7 @@ Graphic3d_PolygonOffset.cxx
 Graphic3d_PolygonOffset.hxx
 Graphic3d_PriorityDefinitionError.hxx
 Graphic3d_RenderingMode.hxx
+Graphic3d_RenderingParams.cxx
 Graphic3d_RenderingParams.hxx
 Graphic3d_RenderTransparentMethod.hxx
 Graphic3d_SequenceOfGroup.hxx
index a7c9fe36af14055bc2f6c6476fbeea98182238ba..c2d7312ca939ba7323a0213174fe8edeffd88393 100644 (file)
@@ -55,3 +55,9 @@ Graphic3d_AspectText3d::Graphic3d_AspectText3d (const Quantity_Color& theColor,
     myTextFont = new TCollection_HAsciiString (theFont);
   }
 }
+
+void Graphic3d_AspectText3d::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Graphic3d_Aspects)
+}
index ec3cd669d8090b0dc8ac23b0745bb596ae68196c..f2e09c02f099cbafb7b139e3be9c0fe76de61f34 100644 (file)
@@ -110,6 +110,9 @@ public:
 
   //! Returns text FontAspect
   Font_FontAspect GetTextFontAspect() const { return myTextFontAspect; }
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 };
 
index 0e8941cd2d019483af3a242ab48d38deabd6ced5..5fdf569a0c01eec647154f7eff309e955d99b1ce 100644 (file)
@@ -245,4 +245,28 @@ void Graphic3d_CLight::SetRange (Standard_ShortReal theValue)
   Standard_OutOfRange_Raise_if (theValue < 0.0, "Graphic3d_CLight::SetRange(), Bad value for falloff range");
   updateRevisionIf (Abs (Range() - theValue) > ShortRealEpsilon());
   myDirection.w() = theValue;
-};
\ No newline at end of file
+};
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Graphic3d_CLight::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  
+  OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myId)
+  OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPosition)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDirection)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParams)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySmoothness)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIntensity)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myType)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRevision)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsHeadlight)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsEnabled)
+}
index 54276d7cc2eb8d65121192758120f033a9e24182..a52f0dad2c083d8b7fc2f949dc7d74af61ee9160 100644 (file)
@@ -204,6 +204,9 @@ public:
 
   //! @return modification counter
   Standard_Size Revision() const { return myRevision; }
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 private:
 
index 829151db39beb063d0ea0ddc24e609fa60843385..1aa54a8e50320fccfa5fc70318430cfefd31951f 100644 (file)
@@ -1096,3 +1096,44 @@ void Graphic3d_CView::SetShadingModel (Graphic3d_TypeOfShadingModel theModel)
 
   myShadingModel = theModel;
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Graphic3d_CView::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Graphic3d_DataStructureManager);
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myId)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myRenderParams)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBgColor)
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStructureManager)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCamera.get())
+
+  for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsToCompute); anIter.More(); anIter.Next())
+  {
+    Handle(Graphic3d_Structure) aStructToCompute = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructToCompute.get())
+  }
+
+  for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsToCompute); 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)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShadingModel)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisualization)
+}
index f3a283699701a8cb04304dc06c883f0d5fd5e0b5..a9c06b9a0f5d61488d46f411330af678547ec131 100644 (file)
@@ -455,6 +455,9 @@ public: //! @name obsolete Graduated Trihedron functionality
     (void )theMin;
     (void )theMax;
   }
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 private:
 
index a251811e3398d05e0e415f93b729a0147cad166e..acd3da2c266bc85a6331089058f0db5230c1dab1 100644 (file)
@@ -1560,4 +1560,24 @@ void Graphic3d_Camera::DumpJson (Standard_OStream& theOStream, Standard_Integer
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEye)
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDistance)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxialScale)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myProjType)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFOVy)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFOVyTan)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZNear)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZFar)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAspect)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myScale)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZFocus)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZFocusType)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIOD)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIODType)
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTile)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMatricesD)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMatricesF)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myWorldViewProjState)
 }
index e2f3fbef0e5e3c1586cd4a1a1a49c70df4368d2f..10c07a98cd6a6fb4932efbcb4ef08931da1962cf 100644 (file)
@@ -76,6 +76,18 @@ private:
 
     //! Return true if Projection was not invalidated.
     Standard_Boolean IsProjectionValid()  const { return myIsProjectionValid;  }
+    
+    //! Dumps the content of me into the stream
+    Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+    {
+      OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Orientation)
+      OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MProjection)
+      OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &LProjection)
+      OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &RProjection)
+  
+      OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsOrientationValid)
+      OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsProjectionValid)
+    }
 
   public:
 
diff --git a/src/Graphic3d/Graphic3d_CameraTile.cxx b/src/Graphic3d/Graphic3d_CameraTile.cxx
new file mode 100644 (file)
index 0000000..22caa5e
--- /dev/null
@@ -0,0 +1,30 @@
+// Created on: 2020-02-06
+// Created by: Svetlana SHUTINA
+// Copyright (c) 2020 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_CameraTile.hxx>
+
+#include <Standard_Dump.hxx>
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+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_VALUE_NUMERICAL (theOStream, IsTopDown)
+}
index 9ad8051185ec499d64a2897f01a61feb614b54c0..637ccae83f0765b6ffcf8e266f330c320c53e094 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <Graphic3d_Vec2.hxx>
 #include <Standard_Integer.hxx>
+#include <Standard_OStream.hxx>
 #include <Standard_TypeDef.hxx>
 
 //! Class defines the area (Tile) inside a view.
@@ -82,6 +83,9 @@ public:
         && anOffset1.x() == anOffset2.x()
         && anOffset1.y() == anOffset2.y();
   }
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 };
 
index b7ba3bc69aed3528948c4eef01d5ac42e7e4d358..cc05c1828963a17042c3caf9d1c29875028064e4 100644 (file)
@@ -23,6 +23,7 @@
 // for the class
 
 #include <Graphic3d_DataStructureManager.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,Standard_Transient)
@@ -32,3 +33,12 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,Standard_Transient)
 //-Constructors
 Graphic3d_DataStructureManager::Graphic3d_DataStructureManager () {
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Graphic3d_DataStructureManager::DumpJson (Standard_OStream& theOStream, Standard_Integer /*theDepth*/) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+}
index 294a95fdb5506cb9a9d54ed8ebd5e6fa810cfa82..3f98654e23cea0446b175153a51db3453a5270a8 100644 (file)
@@ -33,6 +33,9 @@ class Graphic3d_DataStructureManager : public Standard_Transient
 {
 
 public:
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
   DEFINE_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,Standard_Transient)
 
index 8253b4000533c587c1e913972ee4b58a02adebd7..36c890252e910daf186269da8f8ff9d2b2c4b40d 100644 (file)
@@ -281,3 +281,28 @@ void Graphic3d_GraphicDriver::SetZLayerSettings (const Graphic3d_ZLayerId theLay
                          "Graphic3d_GraphicDriver::SetZLayerSettings, Layer with theLayerId does not exist");
   aLayerDef->SetLayerSettings (theSettings);
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void Graphic3d_GraphicDriver::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myStructGenId)
+
+  for (NCollection_List<Handle(Graphic3d_Layer)>::Iterator anIter (myLayers); anIter.More(); anIter.Next())
+  {
+    Handle(Graphic3d_Layer) aLayer = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aLayer.get())
+  }
+  
+  for (NCollection_DataMap<Graphic3d_ZLayerId, Handle(Graphic3d_Layer)>::Iterator anIter (myLayerIds); anIter.More(); anIter.Next())
+  {
+    Handle(Graphic3d_Layer) aLayerId = anIter.Value();
+    Graphic3d_ZLayerId aZLayerId = anIter.Key();
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aZLayerId)
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aLayerId.get())
+  }
+}
index 6fe63e4c5c928a8dbce610507a6a4a3d31b66ef8..20d6aedc480f301aec25382aea8522042ee5b848 100644 (file)
@@ -155,6 +155,9 @@ public:
 
   //! Frees the identifier of a structure.
   Standard_EXPORT void RemoveIdentification(const Standard_Integer theId);
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 protected:
   
index 53207a5af072445a2ec9d31b6c58371581d51971..8fcdcabee09953394e2fb66fc62eadb916a94497 100644 (file)
@@ -452,11 +452,15 @@ void Graphic3d_Group::AddText (const Handle(Graphic3d_Text)& theTextParams,
 // function : DumpJson
 // purpose  :
 // =======================================================================
-void Graphic3d_Group::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+void Graphic3d_Group::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructure)  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBounds)
+
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet)
 }
diff --git a/src/Graphic3d/Graphic3d_RenderingParams.cxx b/src/Graphic3d/Graphic3d_RenderingParams.cxx
new file mode 100644 (file)
index 0000000..7479c74
--- /dev/null
@@ -0,0 +1,94 @@
+// Created on: 2020-02-06
+// Created by: Svetlana SHUTINA
+// Copyright (c) 2020 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_RenderingParams.hxx>
+
+#include <Standard_Dump.hxx>
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Graphic3d_RenderingParams::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Method)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, TransparencyMethod)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, LineFeather)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvPow2Size)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvSpecMapNbLevels)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvBakingDiffNbSamples)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvBakingSpecNbSamples)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvBakingProbability)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, OitDepthFactor)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbMsaaSamples)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RenderResolutionScale)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToEnableDepthPrepass)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToEnableAlphaToCoverage)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsGlobalIlluminationEnabled)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, SamplesPerPixel)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RaytracingDepth)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsShadowEnabled)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsReflectionEnabled)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsAntialiasingEnabled)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsTransparentShadowEnabled)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, UseEnvironmentMapBackground)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToIgnoreNormalMapInRayTracing)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, CoherentPathTracingMode)
+
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, AdaptiveScreenSampling)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, AdaptiveScreenSamplingAtomic)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ShowSamplingTiles)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, TwoSidedBsdfModels)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RadianceClampingValue)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RebuildRayTracingShaders)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RayTracingTileSize)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbRayTracingTiles)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, CameraApertureRadius)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, CameraFocalPlaneDist)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, FrustumCullingState)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToneMappingMethod)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Exposure)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, WhitePoint)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StereoMode)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, AnaglyphFilter)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &AnaglyphLeft)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &AnaglyphRight)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToReverseStereo)
+  
+  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, StatsTextAspect.get())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StatsUpdateInterval)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StatsTextHeight)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StatsNbFrames)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StatsMaxChartTime)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, CollectedStats)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToShowStats)
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Resolution)
+}
index fa18c5b73b3ec23a77512065338cf5b644334758..beceec078984945b4628dc775a66eecd6a250a9c 100644 (file)
@@ -172,6 +172,9 @@ public:
   {
     return Resolution / static_cast<Standard_ShortReal> (THE_DEFAULT_RESOLUTION);
   }
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 public:
 
index 202c0c57298c10f88b219fabd14d49ae4672f315..1cb7e0cbd642f2b446e8a9e14cd7145ace6548e9 100644 (file)
@@ -1037,9 +1037,23 @@ 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_VALUE_POINTER (theOStream, myCStructure)
 
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCStructure.get())
+  for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myAncestors); anIter.More(); anIter.Next())
+  {
+    Graphic3d_Structure* anAncestor = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anAncestor)
+  }
+
+  for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
+  {
+    Graphic3d_Structure* aDescendant = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aDescendant)
+  }
 
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOwner)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisual)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComputeVisual)
 }
index 0c1728b7175988180591e4469d6d86d227349441..c978af842d03ff712c1171749158569e109c0ec9 100644 (file)
@@ -446,3 +446,38 @@ void Graphic3d_StructureManager::ChangeZLayer (const Handle(Graphic3d_Structure)
     aViewIt.Value()->ChangeZLayer (theStructure, theLayerId);
   }
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void Graphic3d_StructureManager::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  for (Graphic3d_MapOfStructure::Iterator anIter (myDisplayedStructure); anIter.More(); anIter.Next())
+  {
+    Handle(Graphic3d_Structure) aDisplayedStructure = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aDisplayedStructure.get())
+  }
+  for (Graphic3d_MapOfStructure::Iterator anIter (myHighlightedStructure); anIter.More(); anIter.Next())
+  {
+    Handle(Graphic3d_Structure) aHighlightedStructure = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aHighlightedStructure.get())
+  }
+  for (Graphic3d_MapOfObject::Iterator anIter (myRegisteredObjects); anIter.More(); anIter.Next())
+  {
+    Handle(Graphic3d_ViewAffinity) aRegisteredObject = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aRegisteredObject.get())
+  }
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGraphicDriver.get())
+  for (Graphic3d_IndexedMapOfView::Iterator anIter (myDefinedViews); anIter.More(); anIter.Next())
+  {
+    Graphic3d_CView* aDefinedView = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aDefinedView)
+  }
+  
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDeviceLostFlag)
+
+}
index 0f36aa2b233ec36134cb18c084ab61f4ff6ed55d..8164884c631cb239ec680e6d8f9b76d71418a105 100644 (file)
@@ -162,6 +162,9 @@ public:
 
   //! Sets Device Lost flag.
   void SetDeviceLost() { myDeviceLostFlag = Standard_True; }
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 protected:
 
index df3b7405ffb849d2fa404f2204fb0569d6a3fb40..b810225902eab39ddf66a0d6b2a55bf648fb4141 100644 (file)
 
 #include <Graphic3d_Vertex.hxx>
 
+#include <Standard_Dump.hxx>
+
 Standard_ShortReal Graphic3d_Vertex::Distance(const Graphic3d_Vertex& AOther) const
 {
   return sqrt( (X() - AOther.X()) * (X() - AOther.X())
                     + (Y() - AOther.Y()) * (Y() - AOther.Y())
                     + (Z() - AOther.Z()) * (Z() - AOther.Z()) );
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+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])
+}
index 41484973f69bca91765e241e7b547b3c63fa4b56..85d2b221b27cdbe9d52cdabbc0df2fb6fa071867 100644 (file)
@@ -108,6 +108,9 @@ public:
 
   //! Returns the distance between two points.
   Standard_EXPORT Standard_ShortReal Distance (const Graphic3d_Vertex& theOther) const;
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
   float xyz[3];
 
index 03713cb8daee169d6303c2c1089a12d091fcc3e8..c1f7973916d7d17ec661416f37b9c55c446ef963 100644 (file)
@@ -149,6 +149,14 @@ public:
     myProjectionState = theOther.myProjectionState;
     myWorldViewState  = theOther.myWorldViewState;
   }
+  
+  void DumpJson (Standard_OStream& theOStream, Standard_Integer /*theDepth*/) const
+  {
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsValid)
+    OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCamera)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myProjectionState)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myWorldViewState)
+  }
 
 private:
 
index ccf2092719f416490109194d7cc195d4b89702fc..9850693556431ea911f11cabafdc2beef6ec9678 100644 (file)
@@ -361,3 +361,29 @@ void V3d_CircularGrid::SetGraphicValues (const Standard_Real theRadius, const St
   }
   if( !myCurAreDefined ) UpdateDisplay();
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void V3d_CircularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_CircularGrid)
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructure.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGroup.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCurViewPlane)
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myViewer)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurAreDefined)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToComputePrs)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurDrawMode)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurXo)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurYo)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurAngle)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurStep)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurDivi)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRadius)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOffSet)
+}
index 997b6bfecc3de5d55d9355752df23cd4e931f3b3..f797d0a69a26747ffc814da65fdc307fcb48e0bc 100644 (file)
@@ -50,6 +50,9 @@ public:
   Standard_EXPORT void GraphicValues (Standard_Real& Radius, Standard_Real& OffSet) const;
   
   Standard_EXPORT void SetGraphicValues (const Standard_Real Radius, const Standard_Real OffSet);
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 protected:
 
index 4a24e55306752e8122be54fe5a9bd259e8867b2a..5e7f138e5b51de9c1ac67523b3b3ab1051e04cda 100644 (file)
@@ -366,3 +366,30 @@ void V3d_RectangularGrid::SetGraphicValues (const Standard_Real theXSize, const
   }
   if( !myCurAreDefined ) UpdateDisplay();
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void V3d_RectangularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_RectangularGrid)
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructure.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGroup.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCurViewPlane)
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myViewer)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurAreDefined)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToComputePrs)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurDrawMode)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurXo)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurYo)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurAngle)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurXStep)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurYStep)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXSize)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYSize)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOffSet)
+}
index 834ef461b0a981f4ed52778ce0813e51a0b903f0..f75f8305c905fafa9f5581caa7c18936af6af046 100644 (file)
@@ -49,6 +49,9 @@ public:
   Standard_EXPORT void GraphicValues (Standard_Real& XSize, Standard_Real& YSize, Standard_Real& OffSet) const;
   
   Standard_EXPORT void SetGraphicValues (const Standard_Real XSize, const Standard_Real YSize, const Standard_Real OffSet);
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 protected:
   
index 20bb0671c2776d5662f7f325f6c88dcc3ec833db..8ad3b466d0c2e4050494d0919c3b597b832b970f 100644 (file)
@@ -357,3 +357,37 @@ void V3d_Trihedron::compute()
     }
   }
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void V3d_Trihedron::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySphereShadingAspect.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySphereLineAspect.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get())
+
+  for (Standard_Integer anIter = 0; anIter < 3; anIter++)
+  {
+    Handle(Prs3d_ShadingAspect) anArrowShadinAspect = myArrowShadingAspects[anIter];
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anArrowShadinAspect.get())
+  }
+  for (Standard_Integer anIter = 0; anIter < 3; anIter++)
+  {
+    Handle(Prs3d_LineAspect) anArrowLineAspect = myArrowLineAspects[anIter];
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anArrowLineAspect.get())
+  }
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructure.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTransformPers.get())
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myScale)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRatio)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDiameter)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNbFacettes)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsWireframe)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToCompute)
+}
index d609857d4fca40da4910364ad13dcf305e8de185..6ac0159d1270b71a30eda36ac62169c41a6e30e6 100644 (file)
@@ -69,6 +69,9 @@ public:
 
   //! Erase trihedron.
   Standard_EXPORT void Erase();
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 protected:
 
index 4950ea4cb56854d6b1f35654559d43f0b6001f8a..783f4f43df908807018348fd723319965d116fdf 100644 (file)
@@ -3211,3 +3211,56 @@ Graphic3d_RenderingParams& V3d_View::ChangeRenderingParams()
 {
   return myView->ChangeRenderingParams();
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void V3d_View::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOldMouseX)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOldMouseY)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCamStartOpUp)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCamStartOpDir)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCamStartOpEye)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCamStartOpBnd[6])
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCamStartOpCenter)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDefaultCamera.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myView.get())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myImmediateUpdate)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInvalidatedImmediate)
+  
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, MyViewer)
+  for (V3d_ListOfLight::Iterator anIterator (myActiveLights); anIterator.More(); anIterator.Next())
+  {
+    Handle(Graphic3d_CLight) anActiveLight = anIterator.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anActiveLight.get())
+  }
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDefaultViewAxis)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDefaultViewPoint)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, MyWindow.get())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, sx)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, sy)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, rx)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ry)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myRotateGravity)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComputedMode)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, SwitchSetFront)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZRotation)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyZoomAtPointX)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyZoomAtPointY)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTrihedron.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, MyGrid.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyPlane)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, MyGridEchoStructure.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, MyGridEchoGroup.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myXscreenAxis)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myYscreenAxis)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myZscreenAxis)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myViewAxis)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myGravityReferencePoint)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAutoZFitIsOn)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAutoZFitScaleFactor)
+}
index 98af39c189d545a58c96017e733fc539e5a024ca..968c19806690d7da8827ddd2fb8ef54e2aed326a 100644 (file)
@@ -955,6 +955,9 @@ public:
   //! Returns the Objects number and the gravity center of ALL viewable points in the view
   Standard_EXPORT gp_Pnt GravityPoint() const;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
   DEFINE_STANDARD_RTTIEXT(V3d_View,Standard_Transient)
 
 public: //! @name deprecated methods
index a21cef0143a6b07940ee93ad6085c2c3895a43b1..2ddeb4bf9d9469b20aa4fa9abba0e1f90e4eabf5 100644 (file)
@@ -581,6 +581,60 @@ void V3d_Viewer::DisplayPrivilegedPlane (const Standard_Boolean theOnOff, const
 void V3d_Viewer::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  
+  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())
+  {
+    Handle(V3d_View) aDefinedView = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aDefinedView.get())
+  }
+
+  for (V3d_ListOfView::Iterator anIter (myActiveViews); anIter.More(); anIter.Next())
+  {
+    Handle(V3d_View) anActiveView = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anActiveView.get())
+  }
+    
+  for (V3d_ListOfLight::Iterator anIter (myDefinedLights); anIter.More(); anIter.Next())
+  {
+    Handle(Graphic3d_CLight) aDefinedLight = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aDefinedLight.get())
+  }
+
+  for (V3d_ListOfLight::Iterator anIter (myActiveLights); anIter.More(); anIter.Next())
+  {
+    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)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myViewSize)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myViewProj)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisualization)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShadingModel)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDefaultTypeOfView)
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDefaultRenderingParams)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComputedMode)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDefaultComputedMode)
 
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPrivilegedPlane)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPlaneStructure.get())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDisplayPlane)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDisplayPlaneLength)
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myRGrid.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCGrid.get())
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myGridType)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myGridEcho)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGridEchoStructure.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGridEchoGroup.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGridEchoAspect.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myGridEchoLastVert)
 }
index dd70d644177aefd1b042501a25c35adb463f01e3..ab42126d3e6bc321cf49f084f3fc0573fdeb5ba8 100644 (file)
@@ -30,6 +30,7 @@
 #include <gp_XYZ.hxx>
 #include <Standard_ConstructionError.hxx>
 #include <Standard_DomainError.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_OutOfRange.hxx>
 
 Standard_Boolean gp_Vec::IsEqual
@@ -126,3 +127,12 @@ gp_Vec gp_Vec::Mirrored (const gp_Ax2& A2) const
   Vres.Mirror (A2);
   return Vres;                     
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void gp_Vec::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "gp_Vec", 3, coord.X(), coord.Y(), coord.Z())
+}
index 5b17efa2ba20015c2a47fbdf2bcad7388f956f1b..5d5df609c470f8cf88b0975f4d41c76847b06901 100644 (file)
@@ -354,6 +354,9 @@ public:
   
   //! Transforms a vector with the transformation T.
   Standard_NODISCARD gp_Vec Transformed (const gp_Trsf& T) const;
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index 0394262f8d73c358aa96c08d68b5ab1b1b880cb5..ecbbb4c3f3da7e14670921e012602ed9968758de 100644 (file)
@@ -10,6 +10,8 @@ VInspector_ItemBase.cxx
 VInspector_ItemBase.hxx
 VInspector_ItemContext.cxx
 VInspector_ItemContext.hxx
+VInspector_ItemContextProperties.cxx
+VInspector_ItemContextProperties.hxx
 VInspector_ItemHistoryElement.cxx
 VInspector_ItemHistoryElement.hxx
 VInspector_ItemHistoryRoot.cxx
@@ -19,6 +21,8 @@ VInspector_ItemHistoryType.hxx
 VInspector_ItemHistoryTypeInfo.hxx
 VInspector_ItemPresentableObject.cxx
 VInspector_ItemPresentableObject.hxx
+VInspector_ItemV3dViewer.cxx
+VInspector_ItemV3dViewer.hxx
 VInspector_ToolActionType.hxx
 VInspector_ToolBar.cxx
 VInspector_ToolBar.hxx
index 27400ac661bc69d4db0595ff76653c3631012052..7725ff7313741b1d7d3bac8b0caad30bc00c3f8b 100644 (file)
@@ -18,6 +18,7 @@
 #include <AIS.hxx>
 #include <AIS_ListOfInteractive.hxx>
 #include <SelectMgr_EntityOwner.hxx>
+#include <inspector/VInspector_ItemContextProperties.hxx>
 #include <inspector/VInspector_ItemPresentableObject.hxx>
 #include <inspector/VInspector_Tools.hxx>
 
@@ -34,6 +35,8 @@ int VInspector_ItemContext::initRowCount() const
   if (Column() != 0)
     return 0;
 
+  int aNbProperties = 1; // item to visualize Viewer information of context
+
   Handle(AIS_InteractiveContext) aContext = Handle(AIS_InteractiveContext)::DownCast (Object());
   if (aContext.IsNull())
     return 0;
@@ -49,7 +52,7 @@ int VInspector_ItemContext::initRowCount() const
     aNbPresentations++;
   }
 
-  return aNbPresentations;
+  return aNbProperties + aNbPresentations;
 }
 
 // =======================================================================
@@ -124,7 +127,10 @@ void VInspector_ItemContext::initItem() const
 // =======================================================================
 TreeModel_ItemBasePtr VInspector_ItemContext::createChild (int theRow, int theColumn)
 {
-  return VInspector_ItemPresentableObject::CreateItem (currentItem(), theRow, theColumn);
+  if (theRow == 0)
+    return VInspector_ItemContextProperties::CreateItem (currentItem(), theRow, theColumn);
+  else
+    return VInspector_ItemPresentableObject::CreateItem (currentItem(), theRow, theColumn);
 }
 
 // =======================================================================
diff --git a/tools/VInspector/VInspector_ItemContextProperties.cxx b/tools/VInspector/VInspector_ItemContextProperties.cxx
new file mode 100644 (file)
index 0000000..6d23052
--- /dev/null
@@ -0,0 +1,73 @@
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 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_ItemContextProperties.hxx>
+
+#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 :
+// =======================================================================
+QVariant VInspector_ItemContextProperties::initValue (int theItemRole) const
+{
+  QVariant aParentValue = VInspector_ItemBase::initValue (theItemRole);
+  if (aParentValue.isValid())
+    return aParentValue;
+
+  if (Column() != 0 || (theItemRole != Qt::DisplayRole && theItemRole != Qt::ToolTipRole))
+    return QVariant();
+
+  return "Properties";
+}
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemContextProperties::initRowCount() const
+{
+  return 1; // V3d_Viewer
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr VInspector_ItemContextProperties::createChild (int theRow, int theColumn)
+{
+  return VInspector_ItemV3dViewer::CreateItem (currentItem(), theRow, theColumn);
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+void VInspector_ItemContextProperties::initItem() const
+{
+  if (IsInitialized())
+    return;
+  const_cast<VInspector_ItemContextProperties*> (this)->Init();
+}
diff --git a/tools/VInspector/VInspector_ItemContextProperties.hxx b/tools/VInspector/VInspector_ItemContextProperties.hxx
new file mode 100644 (file)
index 0000000..c9d0786
--- /dev/null
@@ -0,0 +1,73 @@
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 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_ItemContextProperties_H
+#define VInspector_ItemContextProperties_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+#include <AIS_InteractiveObject.hxx>
+#include <TCollection_AsciiString.hxx>
+
+class VInspector_ItemContextProperties;
+typedef QExplicitlySharedDataPointer<VInspector_ItemContextProperties> VInspector_ItemContextPropertiesPtr;
+
+//! \class VInspector_ItemContextProperties
+//! Item presents additional level of information in the tree model.
+//! Parent is item context, child is v3d viewer item.
+class VInspector_ItemContextProperties : public VInspector_ItemBase
+{
+public:
+
+  //! Creates an item wrapped by a shared pointer
+  static VInspector_ItemContextPropertiesPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  { return VInspector_ItemContextPropertiesPtr (new VInspector_ItemContextProperties (theParent, theRow, theColumn)); }
+
+  //! 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;
+
+  //! Returns number of item selected
+  //! \return rows count
+  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
+  virtual QVariant initValue (const int theItemRole) 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
+  virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE;
+
+private:
+
+  //! Constructor
+  //! param theParent a parent item
+  VInspector_ItemContextProperties (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+    : VInspector_ItemBase (theParent, theRow, theColumn) {}
+
+};
+
+#endif
diff --git a/tools/VInspector/VInspector_ItemV3dViewer.cxx b/tools/VInspector/VInspector_ItemV3dViewer.cxx
new file mode 100644 (file)
index 0000000..17edd0c
--- /dev/null
@@ -0,0 +1,105 @@
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 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_ItemV3dViewer.hxx>
+
+#include <AIS.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <inspector/VInspector_ItemContext.hxx>
+#include <inspector/VInspector_ItemContextProperties.hxx>
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemV3dViewer::initRowCount() const
+{
+  return 0;
+}
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemV3dViewer::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();
+
+  if (GetViewer().IsNull())
+    return Column() == 0 ? "Empty viewer" : "";
+
+  return Column() == 0 ? GetViewer()->DynamicType()->Name() : QVariant();
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void VInspector_ItemV3dViewer::Init()
+{
+  VInspector_ItemContextPropertiesPtr aParentItem = itemDynamicCast<VInspector_ItemContextProperties>(Parent());
+  Handle(V3d_Viewer) aViewer;
+  if (aParentItem)
+  {
+    VInspector_ItemContextPtr aParentContextItem = itemDynamicCast<VInspector_ItemContext>(aParentItem->Parent());
+    if (aParentContextItem)
+    {
+      Handle(AIS_InteractiveContext) aContext = aParentContextItem->GetContext();
+      aViewer = aContext->CurrentViewer();
+    }
+  }
+  myViewer = aViewer;
+  TreeModel_ItemBase::Init();
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+void VInspector_ItemV3dViewer::Reset()
+{
+  VInspector_ItemBase::Reset();
+
+  myViewer = NULL;
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+void VInspector_ItemV3dViewer::initItem() const
+{
+  if (IsInitialized())
+    return;
+  const_cast<VInspector_ItemV3dViewer*>(this)->Init();
+}
+
+// =======================================================================
+// function : initStream
+// purpose :
+// =======================================================================
+void VInspector_ItemV3dViewer::initStream (Standard_OStream& theOStream) const
+{
+  Handle(V3d_Viewer) aViewer = GetViewer();
+  if (aViewer.IsNull())
+    return;
+
+  aViewer->DumpJson (theOStream);
+}
diff --git a/tools/VInspector/VInspector_ItemV3dViewer.hxx b/tools/VInspector/VInspector_ItemV3dViewer.hxx
new file mode 100644 (file)
index 0000000..b70c046
--- /dev/null
@@ -0,0 +1,85 @@
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 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_ItemV3dViewer_H
+#define VInspector_ItemV3dViewer_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+#include <V3d_Viewer.hxx>
+
+class VInspector_ItemV3dViewer;
+typedef QExplicitlySharedDataPointer<VInspector_ItemV3dViewer> VInspector_ItemV3dViewerPtr;
+
+//! \class VInspector_ItemV3dViewer
+//! Parent item is context properties, that corresponds to AIS_InteractiveContext
+class VInspector_ItemV3dViewer : public VInspector_ItemBase
+{
+public:
+
+  //! Creates an item wrapped by a shared pointer
+  static VInspector_ItemV3dViewerPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  { return VInspector_ItemV3dViewerPtr (new VInspector_ItemV3dViewer (theParent, theRow, theColumn)); }
+
+  //! Destructor
+  virtual ~VInspector_ItemV3dViewer() Standard_OVERRIDE {};
+
+  //! Inits the item, fills internal containers
+  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+
+  //! Resets cached values
+  Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
+
+  //! Returns data object of the item.
+  //! \return object
+  virtual const Handle(Standard_Transient)& Object() const { initItem(); return myViewer; }
+
+  //! Returns the current viewer, init item if it was not initialized yet
+  //! \return interactive object
+  Handle(V3d_Viewer) GetViewer() const { return Handle(V3d_Viewer)::DownCast (Object()); }
+
+protected:
+  //! Initializes the current item. It is empty because Reset() is also empty.
+  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;
+
+  //! Returns stream value of the item to fulfill property panel.
+  //! \return stream value or dummy
+  Standard_EXPORT virtual void initStream (Standard_OStream& theOStream) const 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_ItemV3dViewer(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+    : VInspector_ItemBase(theParent, theRow, theColumn) {}
+
+protected:
+
+  Handle(V3d_Viewer) myViewer; //!< the current viewer
+};
+
+#endif