]> OCCT Git - occt.git/commitdiff
0031354: Visualization - Dump improvement for V3d, Graphic3d, Aspect IR-2020-09-04 WEEK-36
authorsshutina <sshutina@opencascade.com>
Thu, 6 Feb 2020 15:17:35 +0000 (18:17 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 4 Sep 2020 15:14:24 +0000 (18:14 +0300)
- do not dump light in view as it's dumped in the viewer

72 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_Aspects.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/NCollection/NCollection_Vec2.hxx
src/NCollection/NCollection_Vec3.hxx
src/NCollection/NCollection_Vec4.hxx
src/SelectMgr/SelectMgr_Frustum.hxx
src/SelectMgr/SelectMgr_Frustum.lxx
src/SelectMgr/SelectMgr_RectangularFrustum.cxx
src/SelectMgr/SelectMgr_RectangularFrustum.hxx
src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx
src/SelectMgr/SelectMgr_SelectionManager.hxx
src/SelectMgr/SelectMgr_TriangularFrustum.cxx
src/SelectMgr/SelectMgr_TriangularFrustum.hxx
src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx
src/SelectMgr/SelectMgr_TriangularFrustumSet.hxx
src/SelectMgr/SelectMgr_ViewerSelector.cxx
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_ItemSelectMgrViewerSelector.cxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemSelectMgrViewerSelector.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..88739b2efceb62721ddf8d0702e91ca52552816a 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,14 @@ Quantity_Color Aspect_Background::Color () const {
        return (MyColor);
 
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void Aspect_Background::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, Aspect_Background)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor)
+}
index f37eec261344c22c72e1ea4eafd97f2e8ac2efaa..64630779f2e6b3862ed7f198c4d9e049eeae4955 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 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..b8bb709ef96b4833ffa58fdfc1f866f129f9147f 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 virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 private:
 
index 6788bb50f7aac5edff82802d63fbd76bc18d23fb..ea4937551d81656b33c4ac6382e4cfd1bfd6bba1 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) 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..6bbfc67a349319dd2215531e2236466735b39cac 100644 (file)
@@ -55,3 +55,18 @@ Aspect_GradientFillMethod Aspect_GradientBackground::BgGradientFillMethod( ) con
 {
   return MyGradientMethod;
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+void Aspect_GradientBackground::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, Aspect_GradientBackground)
+
+  Quantity_Color aColor = Color();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aColor)
+
+  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..8e4146e95dc2424cd27394b69725c14cacb8e33b 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 virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 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..22ace08ffb3179815cbfba4a2cb7f01b219bfd82 100644 (file)
@@ -55,3 +55,13 @@ Graphic3d_AspectText3d::Graphic3d_AspectText3d (const Quantity_Color& theColor,
     myTextFont = new TCollection_HAsciiString (theFont);
   }
 }
+
+// =======================================================================
+// function : DumpJson
+// purpose  :
+// =======================================================================
+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..70a558123f3f31bdb147e136eec5a23575327a45 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 virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 };
 
index bc024802aaff0414310f4e26b62c8e35ae944c7f..65b9f1a70d60a940d54c12af3ab4cb98f8a9c115 100644 (file)
@@ -537,7 +537,7 @@ public:
   }
 
   //! Dumps the content of me into the stream
-  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 protected:
index 0e8941cd2d019483af3a242ab48d38deabd6ced5..f46c67587c34cd299e930b57b7d0a76135ffad7e 100644 (file)
@@ -245,4 +245,50 @@ 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_POINTER (theOStream, this)
+  
+  OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myId)
+  OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)
+  
+  if (myType == Graphic3d_TOLS_SPOT || myType == Graphic3d_TOLS_POSITIONAL)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPosition)
+  }
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIntensity)
+
+  if (myType == Graphic3d_TOLS_SPOT || myType == Graphic3d_TOLS_DIRECTIONAL)
+  {
+    gp_Dir aDirection = Direction();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aDirection)
+  }
+  if (myType == Graphic3d_TOLS_POSITIONAL || myType == Graphic3d_TOLS_SPOT)
+  {
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ConstAttenuation())
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, LinearAttenuation())
+  }
+  if (myType == Graphic3d_TOLS_SPOT)
+  {
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Angle())
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Concentration())
+  }
+  if (myType == Graphic3d_TOLS_POSITIONAL || myType == Graphic3d_TOLS_SPOT)
+  {
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Range())
+  }
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySmoothness)
+  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 27f71d4e1dff01d35f7cb8eede738496ca71efd4..2219b947e91dfaba7b661fc943ce30a26c23fbd5 100644 (file)
@@ -1407,3 +1407,46 @@ void Graphic3d_CView::DiagnosticInformation (TColStd_IndexedDataMapOfStringStrin
     theDict.ChangeFromIndex (theDict.Add ("VRserial",  aSerial))  = aSerial;
   }
 }
+
+//=======================================================================
+//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())
+  {
+    const Handle(Graphic3d_Structure)& aStructToCompute = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructToCompute.get())
+  }
+
+  for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsComputed); anIter.More(); anIter.Next())
+  {
+    const Handle(Graphic3d_Structure)& aStructComputed = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructComputed.get())
+  }
+
+  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)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBackXRCamera.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBaseXRCamera.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPosedXRCamera.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPosedXRCameraCopy.get())
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUnitFactor)
+}
index d0c0887347c1212b4251deb108feb6a94ca386d8..b54664cc35f3d7f54eaafa5e82b3f77274aeb71d 100644 (file)
@@ -534,6 +534,9 @@ public: //! @name obsolete Graduated Trihedron functionality
     (void )theMin;
     (void )theMax;
   }
+  
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 private:
 
index 541a1006bb50fed90761a35a0132138a574a25b3..e1056d6a58c508c10aaf77c130ad2a96e11820d0 100644 (file)
@@ -1742,4 +1742,23 @@ 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, 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 8aee88ec6f52d5c26ab9b170ec21d0ffbaf51e68..5a819622fc7f741eff5c49c9a0b965c761bb4259 100644 (file)
@@ -78,6 +78,23 @@ private:
 
     //! Return true if Projection was not invalidated.
     Standard_Boolean IsProjectionValid()  const { return myIsProjectionValid;  }
+    
+    //! Dumps the content of me into the stream
+    void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+    {
+      if (IsOrientationValid())
+      {
+        OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Orientation)
+      }
+      if (IsProjectionValid())
+      {
+        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..dbc3868
--- /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_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 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..41c5d24b330e795059ab37d71e972375c18cc548 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) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+}
index def5e631a774c447628d13f55efb54184c929a57..9a1ebd9ff9a28be29df3cc61e0dd3143332b1af0 100644 (file)
@@ -32,6 +32,7 @@ DEFINE_STANDARD_HANDLE(Graphic3d_DataStructureManager, Standard_Transient)
 //! It defines the global attributes.
 class Graphic3d_DataStructureManager : public Standard_Transient
 {
+
   DEFINE_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,Standard_Transient)
 protected:
 
@@ -41,6 +42,9 @@ protected:
   //! Returns camera object of the view.
   virtual const Handle(Graphic3d_Camera)& Camera() const = 0;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
 };
 
 #endif // _Graphic3d_DataStructureManager_HeaderFile
index 8253b4000533c587c1e913972ee4b58a02adebd7..4395ff576a36f8c3ac2439fc0f1e868c5f0617a9 100644 (file)
@@ -281,3 +281,20 @@ 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())
+  {
+    const Handle(Graphic3d_Layer)& aLayer = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aLayer.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..9ea7a7d29ba44608df87831f3cf0b38f15838e94 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_VALUE_POINTER (theOStream, 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..dbf05ea
--- /dev/null
@@ -0,0 +1,92 @@
+// 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_FIELD_VALUES_DUMPED (theOStream, theDepth, &ChartSize)
+  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 14ea591907bd8793e0daff9e3b0e61c738fc8066..472311ff16e454dcc6aa1ab1ad286008d1fface4 100644 (file)
@@ -176,6 +176,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 3492a3fd7392144ae45eb46f26c5ad1bf8c8edaa..3aa4780fdb3630b27c926008207dc792a76bf2c8 100644 (file)
@@ -1041,8 +1041,22 @@ void Graphic3d_Structure::DumpJson (Standard_OStream& theOStream, Standard_Integ
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStructureManager)
   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_VALUE_POINTER (theOStream, anAncestor)
+  }
+
+  for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
+  {
+    Graphic3d_Structure* aDescendant = anIter.Value();
+    OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, aDescendant)
+  }
+
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOwner)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisual)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComputeVisual)
 }
index 82dc50cea31c019429a6182ae39cdd6a6a0d8fac..e979b644f350c620dc42843460d16905ddbd2ffa 100644 (file)
@@ -446,3 +446,37 @@ 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())
+  {
+    const 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())
+  {
+    const 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())
+  {
+    const 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 e4676adcc7a6029f544472fee8b88a6f3b1919d5..19c376fa229845073562bef3fa23a8f4a43c4f88 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..d3f9ed74806bb02dcf2a62751980e553b284884d 100644 (file)
 
 #include <Graphic3d_Vertex.hxx>
 
+#include <gp_XYZ.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
+{
+  gp_XYZ aCoord (xyz[0], xyz[1], xyz[2]);
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aCoord)
+}
index 136c9e9f9cc2cf036b0646963323505e101c7700..1f5d785ef0fbd6ed21a291640bb92e84b5444433 100644 (file)
@@ -102,6 +102,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 void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
   float xyz[3];
 
index 0793bda90ea67d0943e6dd195f32921cd03d7246..c46f38e411fdd70e43273c232902dbe930632a65 100644 (file)
@@ -141,6 +141,15 @@ public:
         && myWorldViewState  == theOther.myWorldViewState;
   }
 
+  //! Dumps the content of me into the stream
+  void DumpJson (Standard_OStream& theOStream, Standard_Integer) 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:
 
   Standard_Boolean    myIsValid;
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 7e25b74e6da7e7e4d9d8ec8f660c4781a5687eab..108349fe61da6b205229c9acf51f11c2bc256988 100644 (file)
@@ -18,7 +18,6 @@
 #include <cstring>
 #include <cmath>
 #include <NCollection_Vec2.hxx>
-#include <Standard_Dump.hxx>
 
 //! Auxiliary macros to define couple of similar access components as vector methods
 #define NCOLLECTION_VEC_COMPONENTS_3D(theX, theY, theZ) \
index 52960a82a2a8b53e0438c7ba75b5d9203244c899..995033fe10b3edad973cf291828e1b1b2a1c140f 100644 (file)
@@ -16,7 +16,6 @@
 #define _NCollection_Vec4_H__
 
 #include <NCollection_Vec3.hxx>
-#include <Standard_Dump.hxx>
 
 //! Generic 4-components vector.
 //! To be used as RGBA color vector or XYZW 3D-point with special W-component
index 020247ca5961fda6ef362f61933abe58581f13a1..b2bcdecf83ccdbbdbb9bd7c13533f6b6fafc47b9 100644 (file)
@@ -64,6 +64,9 @@ public:
     memset (myMinVertsProjections, 0, sizeof (myMinVertsProjections));
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
 protected:
 
   // SAT Tests for different objects
index b923f0186465cd7cf9f3e66c59b517d2ea11aaeb..248a9c258cfe81dadf4590e8515c684fe6372e67 100644 (file)
@@ -461,3 +461,49 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt1,
 
   return Standard_True;
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+template <int N>
+void SelectMgr_Frustum<N>::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  const Standard_Integer anIncFactor = (myIsOrthographic && N == 4) ? 2 : 1;
+  for (Standard_Integer aPlaneIdx = 0; aPlaneIdx < N + 1; aPlaneIdx += anIncFactor)
+  {
+    const gp_Vec& aPlane = myPlanes[aPlaneIdx];
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aPlane)
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxVertsProjections[aPlaneIdx])
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMinVertsProjections[aPlaneIdx])
+  }
+
+  for (Standard_Integer aVertIdx = 0; aVertIdx < N * 2; ++aVertIdx)
+  {
+    const gp_Pnt& aVertex = myVertices[aVertIdx];
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aVertex)
+  }
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPixelTolerance)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsOrthographic)
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myBuilder)
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCamera)
+
+  for (Standard_Integer anIndex = 0; anIndex < 3; anIndex++)
+  {
+    Standard_Real aMaxOrthoVertsProjections = myMaxOrthoVertsProjections[anIndex];
+    Standard_Real aMinOrthoVertsProjections = myMinOrthoVertsProjections[anIndex];
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aMaxOrthoVertsProjections)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aMinOrthoVertsProjections)
+  }
+
+  for (Standard_Integer anIndex = 0; anIndex < 6; anIndex++)
+  {
+    const gp_Vec& anEdgeDir = myEdgeDirs[anIndex];
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &anEdgeDir)
+  }
+}
index 6ab3470e9bfd1fc9a968443e829cb040dd4585f5..17286557ad8e705cba886472f6266126518237a3 100644 (file)
@@ -763,3 +763,20 @@ void SelectMgr_RectangularFrustum::GetPlanes (NCollection_Vector<SelectMgr_Vec4>
     thePlaneEquations.Append (anEquation);
   }
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void SelectMgr_RectangularFrustum::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_RectangularFrustum)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_Frustum)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myNearPickedPnt)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myFarPickedPnt)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myViewRayDir)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMousePos)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myScale)
+}
index e5170fcccdda908bb0ced3c48d9831f6ee8f391b..d2d41157b1c9044d0f0964e415d30372cf4b12b5 100644 (file)
@@ -129,6 +129,9 @@ public:
   //! Ax + By + Cz + D = 0) to the given vector
   Standard_EXPORT virtual void GetPlanes (NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
 protected:
 
   Standard_EXPORT void segmentSegmentDistance (const gp_Pnt& theSegPnt1,
index f6e96e25bc2957be03305cc9cc33334f6ae9f3f8..3df0a5b92f3021b0a0f02decc2517ca4da460bbe 100644 (file)
@@ -495,7 +495,7 @@ void SelectMgr_SelectingVolumeManager::DumpJson (Standard_OStream& theOStream, S
   for (Standard_Integer anIdx = 0; anIdx < VolumeTypesNb; ++anIdx)
   {
     const Handle(SelectMgr_BaseFrustum)& aSelectingVolume = mySelectingVolumes[anIdx];
-    OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, aSelectingVolume.get())
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aSelectingVolume.get())
   }
 
   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myViewClipPlanes.get())
index 7c81974652ad708b3bf02d433e75b38c92d30a23..8962efa05bb57564fbaae0273552308c29aa1c7b 100644 (file)
@@ -35,7 +35,7 @@ public:
 
   //! Return the Selector.
   const Handle(SelectMgr_ViewerSelector)& Selector() const { return mySelector; }
-  
+
   //! Returns true if the manager contains the selectable object theObject.
   Standard_EXPORT Standard_Boolean Contains (const Handle(SelectMgr_SelectableObject)& theObject) const;
   
index 1de02a43260607ba358640fe15b7383728ce2399..e7b9aa37c42a340d3f140461ec6a25a805f87854 100644 (file)
@@ -302,3 +302,13 @@ void SelectMgr_TriangularFrustum::GetPlanes (NCollection_Vector<SelectMgr_Vec4>&
     thePlaneEquations.Append (aPlaneEquation);
   }
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void SelectMgr_TriangularFrustum::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_TriangularFrustum)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_Frustum)
+}
\ No newline at end of file
index fcebf8e3a95489bf68dcc9b8e88ae1173ec68922..2a37887542b54397a9fa79de51260adcaa8c7d2e 100644 (file)
@@ -93,6 +93,9 @@ public:
   //! Ax + By + Cz + D = 0) to the given vector
   Standard_EXPORT virtual void GetPlanes (NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
 private:
 
   void cacheVertexProjections (SelectMgr_TriangularFrustum* theFrustum) const;
index a03381e92215f1fdf48525644954b3b83d73044c..c7f50bf5bdb046b39edbe24b35b00a2e8eb28f82 100644 (file)
@@ -421,4 +421,20 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::segmentTriangleIntersection (co
   return Standard_True;
 }
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void SelectMgr_TriangularFrustumSet::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_TriangularFrustumSet)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_BaseFrustum)
+
+  for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
+  {
+    const Handle(SelectMgr_TriangularFrustum)& aFrustum = anIter.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aFrustum.get())
+  }
+}
+
 #undef MEMORY_BLOCK_SIZE
index 08f4cb5b01f44e1cad7aabd5521799c7bfa24232..372dcce2080c6e8e785eaa84f750f45d0a5134aa 100644 (file)
@@ -88,6 +88,9 @@ public:
   //! mark both included and overlapped entities as matched
   Standard_EXPORT virtual void SetAllowOverlapDetection (const Standard_Boolean theIsToAllow);
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
 private:
 
   //! Checks whether the segment intersects with the boundary of the current volume selection
index 67e11c007415e671913f82c671a3d5b595da106b..da9b799587218f7087e223b8632c5f77e69512a3 100644 (file)
@@ -1095,7 +1095,7 @@ void SelectMgr_ViewerSelector::DumpJson (Standard_OStream& theOStream, Standard_
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToUpdateTolerance)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mystored.Extent())
 
-  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, &mySelectingVolumeMgr)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &mySelectingVolumeMgr)
   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, &mySelectableObjects)
 
   Standard_Integer aNbOfSelectableObjects = 0;
index ae7001af9ce44c931506b813f653f1f709b2017e..99691c455271621b7ec4fb712a432e091782beb0 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..b18b414d371e8fdcca389d395315eb80f3557621 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 virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 protected:
 
index 18b394aed6842ba5f5beb74327cecf070e57fdd7..cfa41e3dacda91ff549db4ea636785c149a38c3a 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..33594bb43d8275dd6b6fcc8b077e2dd74ee3fb7a 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 virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 protected:
   
index 6d28d637d9c997410fd0c4908cbaaffaf247dac6..d5964e93ffc3888ff8715fabf4421c7c1b773ff8 100644 (file)
@@ -359,3 +359,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++)
+  {
+    const Handle(Prs3d_ShadingAspect)& anArrowShadinAspect = myArrowShadingAspects[anIter];
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anArrowShadinAspect.get())
+  }
+  for (Standard_Integer anIter = 0; anIter < 3; anIter++)
+  {
+    const 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 fd97088fc7b857a55e0ff54adef4384645679586..6fcae6fa4154797c8e9db3c6893475c2c3e33f71 100644 (file)
@@ -3157,3 +3157,55 @@ 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_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())
+  {
+    class Handle(Graphic3d_CLight)& anActiveLight = anIterator.Value();
+    OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, anActiveLight)
+  }
+  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..61d5d9627d4b16bf8b1e9da71be38f7779b7e10b 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
@@ -1026,7 +1029,6 @@ protected:
   gp_Dir myCamStartOpUp;
   gp_Dir myCamStartOpDir;
   gp_Pnt myCamStartOpEye;
-  Standard_Real myCamStartOpBnd[6];
   gp_Pnt myCamStartOpCenter;
   Handle(Graphic3d_Camera) myDefaultCamera;
   Handle(Graphic3d_CView) myView;
index a21cef0143a6b07940ee93ad6085c2c3895a43b1..e44e2ae3a127707085a3dcfa37d9a3314aa389b5 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())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myZLayerGenId)
+  
+  for (V3d_ListOfView::Iterator anIter (myDefinedViews); anIter.More(); anIter.Next())
+  {
+    const 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())
+  {
+    const 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())
+  {
+    const 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())
+  {
+    const 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..5b6d0662f2ad2222a132ae99f331a1d77ccc0366 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) const
+{
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "gp_Vec", 3, coord.X(), coord.Y(), coord.Z())
+}
index 5b17efa2ba20015c2a47fbdf2bcad7388f956f1b..b537f560b062125a537d9ff1bc51cfbc3bce4fe6 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 void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index 0394262f8d73c358aa96c08d68b5ab1b1b880cb5..85d375571085a670727c7609309990203147d725 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,10 @@ VInspector_ItemHistoryType.hxx
 VInspector_ItemHistoryTypeInfo.hxx
 VInspector_ItemPresentableObject.cxx
 VInspector_ItemPresentableObject.hxx
+VInspector_ItemSelectMgrViewerSelector.cxx
+VInspector_ItemSelectMgrViewerSelector.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..020d028
--- /dev/null
@@ -0,0 +1,68 @@
+// 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>
+#include <inspector/VInspector_ItemSelectMgrViewerSelector.hxx>
+
+// =======================================================================
+// 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 2; // V3d_Viewer, SelectMgr_ViewerSelector
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr VInspector_ItemContextProperties::createChild (int theRow, int theColumn)
+{
+  if (theRow == 0)
+    return VInspector_ItemV3dViewer::CreateItem (currentItem(), theRow, theColumn);
+
+  return VInspector_ItemSelectMgrViewerSelector::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..cb53b44
--- /dev/null
@@ -0,0 +1,70 @@
+// 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 {};
+
+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_ItemSelectMgrViewerSelector.cxx b/tools/VInspector/VInspector_ItemSelectMgrViewerSelector.cxx
new file mode 100644 (file)
index 0000000..3846f94
--- /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_ItemSelectMgrViewerSelector.hxx>
+
+#include <AIS.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <inspector/VInspector_ItemContext.hxx>
+#include <inspector/VInspector_ItemContextProperties.hxx>
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemSelectMgrViewerSelector::initRowCount() const
+{
+  return 0;
+}
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemSelectMgrViewerSelector::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 (GetViewerSelector().IsNull())
+    return Column() == 0 ? "Empty viewer selector" : "";
+
+  return Column() == 0 ? GetViewerSelector()->DynamicType()->Name() : QVariant();
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrViewerSelector::Init()
+{
+  VInspector_ItemContextPropertiesPtr aParentItem = itemDynamicCast<VInspector_ItemContextProperties>(Parent());
+  Handle(SelectMgr_ViewerSelector) aViewerSelector;
+  if (aParentItem)
+  {
+    VInspector_ItemContextPtr aParentContextItem = itemDynamicCast<VInspector_ItemContext>(aParentItem->Parent());
+    if (aParentContextItem)
+    {
+      Handle(AIS_InteractiveContext) aContext = aParentContextItem->GetContext();
+      aViewerSelector = aContext->MainSelector();
+    }
+  }
+  myViewerSelector = aViewerSelector;
+  TreeModel_ItemBase::Init();
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrViewerSelector::Reset()
+{
+  VInspector_ItemBase::Reset();
+
+  myViewerSelector = NULL;
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrViewerSelector::initItem() const
+{
+  if (IsInitialized())
+    return;
+  const_cast<VInspector_ItemSelectMgrViewerSelector*>(this)->Init();
+}
+
+// =======================================================================
+// function : initStream
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrViewerSelector::initStream (Standard_OStream& theOStream) const
+{
+  Handle(SelectMgr_ViewerSelector) aViewerSelector = GetViewerSelector();
+  if (aViewerSelector.IsNull())
+    return;
+
+  aViewerSelector->DumpJson (theOStream);
+}
diff --git a/tools/VInspector/VInspector_ItemSelectMgrViewerSelector.hxx b/tools/VInspector/VInspector_ItemSelectMgrViewerSelector.hxx
new file mode 100644 (file)
index 0000000..aa2d4c7
--- /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_ItemSelectMgrViewerSelector_H
+#define VInspector_ItemSelectMgrViewerSelector_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+#include <SelectMgr_ViewerSelector.hxx>
+
+class VInspector_ItemSelectMgrViewerSelector;
+typedef QExplicitlySharedDataPointer<VInspector_ItemSelectMgrViewerSelector> VInspector_ItemSelectMgrViewerSelectorPtr;
+
+//! \class VInspector_ItemSelectMgrViewerSelector
+//! Parent item is context properties, that corresponds to SelectMgr_ViewerSelector
+class VInspector_ItemSelectMgrViewerSelector : public VInspector_ItemBase
+{
+public:
+
+  //! Creates an item wrapped by a shared pointer
+  static VInspector_ItemSelectMgrViewerSelectorPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  { return VInspector_ItemSelectMgrViewerSelectorPtr (new VInspector_ItemSelectMgrViewerSelector (theParent, theRow, theColumn)); }
+
+  //! Destructor
+  virtual ~VInspector_ItemSelectMgrViewerSelector() 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 myViewerSelector; }
+
+  //! Returns the current viewer, init item if it was not initialized yet
+  //! \return interactive object
+  Handle(SelectMgr_ViewerSelector) GetViewerSelector() const { return Handle(SelectMgr_ViewerSelector)::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_ItemSelectMgrViewerSelector (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+    : VInspector_ItemBase(theParent, theRow, theColumn) {}
+
+protected:
+
+  Handle(SelectMgr_ViewerSelector) myViewerSelector; //!< the current viewer selector
+};
+
+#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