]> OCCT Git - occt-copy.git/commitdiff
0030268: Inspectors - improvements in VInspector plugin
authornds <nds@opencascade.com>
Sat, 28 Dec 2019 13:44:13 +0000 (16:44 +0300)
committernds <nds@opencascade.com>
Sat, 28 Dec 2019 13:44:13 +0000 (16:44 +0300)
51 files changed:
src/BVH/BVH_Box.hxx
src/Bnd/Bnd_Box.cxx
src/MeshVS/MeshVS_CommonSensitiveEntity.cxx
src/MeshVS/MeshVS_CommonSensitiveEntity.hxx
src/MeshVS/MeshVS_DummySensitiveEntity.cxx
src/MeshVS/MeshVS_DummySensitiveEntity.hxx
src/MeshVS/MeshVS_SensitiveMesh.cxx
src/MeshVS/MeshVS_SensitiveMesh.hxx
src/MeshVS/MeshVS_SensitivePolyhedron.cxx
src/MeshVS/MeshVS_SensitivePolyhedron.hxx
src/MeshVS/MeshVS_SensitiveQuad.hxx
src/Message/Message_Report.cxx
src/Quantity/Quantity_Color.cxx
src/Quantity/Quantity_ColorRGBA.cxx
src/Select3D/Select3D_InteriorSensitivePointSet.cxx
src/Select3D/Select3D_InteriorSensitivePointSet.hxx
src/Select3D/Select3D_SensitiveBox.cxx
src/Select3D/Select3D_SensitiveBox.hxx
src/Select3D/Select3D_SensitiveEntity.cxx
src/Select3D/Select3D_SensitiveEntity.hxx
src/Select3D/Select3D_SensitiveFace.cxx
src/Select3D/Select3D_SensitiveFace.hxx
src/Select3D/Select3D_SensitiveGroup.cxx
src/Select3D/Select3D_SensitiveGroup.hxx
src/Select3D/Select3D_SensitivePoint.cxx
src/Select3D/Select3D_SensitivePoint.hxx
src/Select3D/Select3D_SensitivePoly.cxx
src/Select3D/Select3D_SensitivePoly.hxx
src/Select3D/Select3D_SensitivePrimitiveArray.cxx
src/Select3D/Select3D_SensitivePrimitiveArray.hxx
src/Select3D/Select3D_SensitiveSegment.cxx
src/Select3D/Select3D_SensitiveSegment.hxx
src/Select3D/Select3D_SensitiveSet.cxx
src/Select3D/Select3D_SensitiveSet.hxx
src/Select3D/Select3D_SensitiveTriangle.cxx
src/Select3D/Select3D_SensitiveTriangle.hxx
src/Select3D/Select3D_SensitiveTriangulation.cxx
src/Select3D/Select3D_SensitiveTriangulation.hxx
src/Select3D/Select3D_SensitiveWire.cxx
src/Select3D/Select3D_SensitiveWire.hxx
src/Standard/Standard_Dump.cxx
src/Standard/Standard_Dump.hxx
src/gp/gp_Ax1.cxx
src/gp/gp_Ax2.cxx
src/gp/gp_Ax3.cxx
src/gp/gp_Dir.cxx
src/gp/gp_Mat.cxx
src/gp/gp_Pnt.cxx
src/gp/gp_Trsf.cxx
src/gp/gp_XYZ.cxx
tools/Convert/Convert_Tools.cxx

index 5d584604e029f8e4e737e303720942d4f0ebfc95..81a1de70c3bed5264b482b98b5bf00898d5beebe 100644 (file)
@@ -18,8 +18,9 @@
 
 #include <BVH_Constants.hxx>
 #include <BVH_Types.hxx>
-#include <Standard_ShortReal.hxx>
+#include <Standard_Macro.hxx>
 #include <Standard_Dump.hxx>
+#include <Standard_ShortReal.hxx>
 
 #include <limits>
 
@@ -113,7 +114,7 @@ public:
   void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
   {
     (void)theDepth;
-    OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_Box);
+    //OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_Box);
     OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInited);
 
     int n = Min (N, 3);
@@ -134,6 +135,34 @@ public:
     }
   }
 
+  //! Inits the content of me into the stream
+  Standard_Boolean InitJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
+  {
+    Standard_Integer aPos = theStreamPos;
+
+    OCCT_INIT_FIELD_VALUE_BOOLEAN (theSStream, aPos, myIsInited);
+
+    int n = Min (N, 3);
+    if (n == 1)
+    {
+      OCCT_INIT_FIELD_VALUE_REAL (theSStream, aPos, myMinPoint[0]);
+      OCCT_INIT_FIELD_VALUE_REAL (theSStream, aPos, myMinPoint[0]);
+    }
+    if (n == 2)
+    {
+      OCCT_INIT_VECTOR_CLASS (theSStream, "MinPoint", aPos, n, &myMinPoint[0], &myMinPoint[1]);
+      OCCT_INIT_VECTOR_CLASS (theSStream, "MaxPoint", aPos, n, &myMaxPoint[0], &myMaxPoint[1]);
+    }
+    if (n == 3)
+    {
+      OCCT_INIT_VECTOR_CLASS (theSStream, "MinPoint", aPos, n, &myMinPoint[0], &myMinPoint[1], &myMinPoint[2]);
+      OCCT_INIT_VECTOR_CLASS (theSStream, "MaxPoint", aPos, n, &myMaxPoint[0], &myMaxPoint[1], &myMaxPoint[2]);
+    }
+
+    theStreamPos = aPos;
+    return Standard_True;
+  }
+
 public:
 
   //! Checks if the Box is out of the other box.
index 12f15e2e328a0fa090c23db554825396a6b2361d..c8961f8613812d42ded61d71ac81ec10404b87de 100644 (file)
@@ -993,13 +993,11 @@ Standard_Boolean Bnd_Box::InitJson (const Standard_SStream& theSStream, Standard
 {
   Standard_Integer aPos = theStreamPos;
 
-  OCCT_INIT_VECTOR_CLASS (theSStream, CornerMin, aPos, 3, &Xmin, &Ymin, &Zmin)
-  OCCT_INIT_VECTOR_CLASS (theSStream, CornerMax, aPos, 3, &Xmax, &Ymax, &Zmax)
+  OCCT_INIT_VECTOR_CLASS (theSStream, "CornerMin", aPos, 3, &Xmin, &Ymin, &Zmin)
+  OCCT_INIT_VECTOR_CLASS (theSStream, "CornerMax", aPos, 3, &Xmax, &Ymax, &Zmax)
 
-  OCCT_INIT_FIELD_VALUE_NUMERICAL (theSStream, aPos, Gap);
-  Standard_Real myFlags;
-  OCCT_INIT_FIELD_VALUE_NUMERICAL (theSStream, aPos, myFlags);
-  Flags = (Standard_Integer)myFlags;
+  OCCT_INIT_FIELD_VALUE_REAL (theSStream, aPos, Gap);
+  OCCT_INIT_FIELD_VALUE_INTEGER (theSStream, aPos, Flags);
 
   theStreamPos = aPos;
   return Standard_True;
index 2f118c1adb7c9c4be8a0ba731f00c6262b413292..933df83ea76e92ce29ff39d7c4f4b2242ab70789 100644 (file)
@@ -117,7 +117,7 @@ MeshVS_CommonSensitiveEntity::~MeshVS_CommonSensitiveEntity()
 //function : NbSubElements
 //purpose  :
 //=======================================================================
-Standard_Integer MeshVS_CommonSensitiveEntity::NbSubElements()
+Standard_Integer MeshVS_CommonSensitiveEntity::NbSubElements() const
 {
   return myItemIndexes.Size();
 }
index fd87f9e08f8962f568feb646a2200b163731c9c7..21dca5ea0bee9e3e2e01b280607e9b55d78bff37 100644 (file)
@@ -36,7 +36,7 @@ public:
   Standard_EXPORT virtual ~MeshVS_CommonSensitiveEntity();
 
   //! Number of elements.
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   //! Returns the amount of sub-entities of the complex entity
   Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
index 143f277daae1daaffc8a64d890e2ac16f2dd0378..3da2f9d3011b4b0aae2c640bef348d21d8ba46bb 100644 (file)
@@ -29,7 +29,7 @@ MeshVS_DummySensitiveEntity::MeshVS_DummySensitiveEntity (const Handle(SelectMgr
 // Function : NbSubElements
 // Purpose  :
 //================================================================
-Standard_Integer MeshVS_DummySensitiveEntity::NbSubElements()
+Standard_Integer MeshVS_DummySensitiveEntity::NbSubElements() const
 {
   return -1;
 }
index 729cad77a9ab9f395289cd888e54ae4116e503c3..049e5f41bd0bf81ed77c88b79a5e2130e71cd3c7 100644 (file)
@@ -36,7 +36,7 @@ public:
   Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
 
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
 
index 3feb84de21133050ae8aad516983f3ed629c7b51..b5bfed934ab7e7e5a6f57d10a85901ac2cd80c61 100644 (file)
@@ -77,7 +77,7 @@ Handle(Select3D_SensitiveEntity) MeshVS_SensitiveMesh::GetConnected()
 // function : NbSubElements
 // purpose  : Returns the amount of mesh nodes
 //=======================================================================
-Standard_Integer MeshVS_SensitiveMesh::NbSubElements()
+Standard_Integer MeshVS_SensitiveMesh::NbSubElements() const
 {
   Handle(MeshVS_MeshOwner) anOwner = Handle(MeshVS_MeshOwner)::DownCast (OwnerId());
   if (anOwner.IsNull())
index c24ec2aedd4f8812296c71b14022cbc5167cc8b5..3bedd055706b14e8bcf598d72dc4b9502c95e92d 100644 (file)
@@ -48,7 +48,7 @@ public:
   }
 
   //! Returns the amount of mesh nodes
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   //! Returns bounding box of mesh
   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
index f367406f2da06d38ba1b21f42da20a83b9710789..d64f3224497f2ea7d5707681382c0f94644717f9 100644 (file)
@@ -104,7 +104,7 @@ Standard_Boolean MeshVS_SensitivePolyhedron::Matches (SelectBasics_SelectingVolu
 // function : NbSubElements
 // purpose  : Returns the amount of nodes of polyhedron
 //=======================================================================
-Standard_Integer MeshVS_SensitivePolyhedron::NbSubElements()
+Standard_Integer MeshVS_SensitivePolyhedron::NbSubElements() const
 {
   return myNodes->Length();
 }
index 0aac9ccd0c506c6366defd4b7f6a9c9392a805cc..2283b6d1ebc110533eed89937ae62d309db3d6b8 100644 (file)
@@ -55,7 +55,7 @@ public:
                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
 
   //! Returns the amount of nodes of polyhedron
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
 
index 07cbf3d7c0c292460b5486de2a76a6deb7ca25e0..d4306f669371d418fc6e0b9fead9b43f08048c45 100644 (file)
@@ -38,7 +38,7 @@ public:
                                         const gp_Pnt& thePnt4);
 
   //! Returns the amount of sub-entities in sensitive
-  virtual Standard_Integer NbSubElements() Standard_OVERRIDE
+  virtual Standard_Integer NbSubElements() const Standard_OVERRIDE
   {
     return 1;
   };
index b0bc7948746505045f5a1fd56c927e45cf10906d..fc57f328e32a8a57a93ee1beb539afd43ec062f0 100644 (file)
@@ -521,12 +521,10 @@ Standard_Boolean Message_Report::InitJson (const Standard_SStream& theSStream, S
   Standard_Integer aPos = theStreamPos;
 
   Standard_Real PerfMeterMode;
-  OCCT_INIT_FIELD_VALUE_NUMERICAL (theSStream, aPos, PerfMeterMode);
+  OCCT_INIT_FIELD_VALUE_INTEGER (theSStream, aPos, PerfMeterMode);
   myPerfMeterMode = (Message_PerfMeterMode)((Standard_Integer)PerfMeterMode);
 
-  Standard_Real Limit;
-  OCCT_INIT_FIELD_VALUE_NUMERICAL (theSStream, aPos, Limit);
-  myLimit = (Standard_Integer)Limit;
+  OCCT_INIT_FIELD_VALUE_INTEGER (theSStream, aPos, myLimit);
 
   theStreamPos = aPos;
   return Standard_True;
index 1d81b262b1b30b3a247aad8dc9d0b149005e159e..de7844512a3c2c5dbff7d1f19aec2356ed373d37 100644 (file)
@@ -3943,7 +3943,7 @@ Standard_Boolean Quantity_Color::InitJson (const Standard_SStream& theSStream, S
 {
   Standard_Integer aPos = theStreamPos;
   Standard_Real  aRed, aGreen, aBlue;
-  OCCT_INIT_VECTOR_CLASS (theSStream, RGB, aPos, 3, &aRed, &aGreen, &aBlue)
+  OCCT_INIT_VECTOR_CLASS (theSStream, "RGB", aPos, 3, &aRed, &aGreen, &aBlue)
 
   SetValues ((Standard_ShortReal)aRed, (Standard_ShortReal)aGreen, (Standard_ShortReal)aBlue, Quantity_TOC_RGB);
   return Standard_True;
index 19beb28c7cbbfeb9e6b266c9905494beba4a683a..53ffa540dbfa11c42bba90fb55bbc92257cb2fa2 100644 (file)
@@ -218,7 +218,7 @@ Standard_Boolean Quantity_ColorRGBA::InitJson (const Standard_SStream& theSStrea
   Standard_Integer aPos = theStreamPos;
 
   Standard_Real aRed, aGreen, aBlue, anAlpha;
-  OCCT_INIT_VECTOR_CLASS (theSStream, RGBA, aPos, 4, &aRed, &aGreen, &aBlue, &anAlpha)
+  OCCT_INIT_VECTOR_CLASS (theSStream, "RGBA", aPos, 4, &aRed, &aGreen, &aBlue, &anAlpha)
 
   SetValues ((Standard_ShortReal)aRed, (Standard_ShortReal)aGreen, (Standard_ShortReal)aBlue, (Standard_ShortReal)anAlpha);
   return Standard_True;
index 0b457f469b099a032c95a4b8c036b398e2957725..e275aa021b9e40977737b29b25804be7471f79fb 100644 (file)
@@ -319,7 +319,7 @@ gp_Pnt Select3D_InteriorSensitivePointSet::CenterOfGeometry() const
 // function : NbSubElements
 // purpose  : Returns the amount of points in set
 //=======================================================================
-Standard_Integer Select3D_InteriorSensitivePointSet::NbSubElements()
+Standard_Integer Select3D_InteriorSensitivePointSet::NbSubElements() const
 {
   return myPlanarPolygons.Length();
 }
@@ -333,9 +333,7 @@ void Select3D_InteriorSensitivePointSet::DumpJson (Standard_OStream& theOStream,
   OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_InteriorSensitivePointSet);
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveSet);
 
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox);
   //Select3D_VectorOfHPoly          myPlanarPolygons;     //!< Vector of planar polygons
   //Handle(TColStd_HArray1OfInteger) myPolygonsIdxs;       //!< Indexes array for BVH calculation
-
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCOG);
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox);
 }
index 6f9d7ebd5be85806073a96f4d665809c8eb09145..e18a0b4a1b8abf5fa56c2a870263d975cb26b778 100644 (file)
@@ -68,7 +68,7 @@ public:
   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
 
   //! Returns the amount of points in set
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   //! Dumps the content of me into the stream
   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
index bef2dd1b84a72e5f9a4dab397d2b563e5d5df929..6e3f4cbbb9ceeb42e71d662cb36bbd70de6bed0e 100644 (file)
@@ -59,7 +59,7 @@ Select3D_SensitiveBox::Select3D_SensitiveBox (const Handle(SelectMgr_EntityOwner
 // function : NbSubElements
 // purpose  : Returns the amount of sub-entities in sensitive
 //=======================================================================
-Standard_Integer Select3D_SensitiveBox::NbSubElements()
+Standard_Integer Select3D_SensitiveBox::NbSubElements() const
 {
   return 1;
 }
@@ -131,5 +131,4 @@ void Select3D_SensitiveBox::DumpJson (Standard_OStream& theOStream, const Standa
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
 
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBox);
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter3d);
 }
index cb735264c2a9d7be51b7d0179f56379a88728126..cf152f98b70e0b66ae959bdb600778d92cec0cda 100644 (file)
@@ -45,7 +45,7 @@ public:
                                          const Standard_Real theZMax);
 
   //! Returns the amount of sub-entities in sensitive
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index 43804bad6973f73113b42733d4bc1147826cb015..4f1cdf5b218903620ce85c5267d40e5924b19016 100644 (file)
@@ -41,4 +41,15 @@ void Select3D_SensitiveEntity::DumpJson (Standard_OStream& theOStream, const Sta
 
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myOwnerId.get());
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySFactor);
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbSubElements());
+
+  gp_Pnt aCenterOfGeometry = CenterOfGeometry();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aCenterOfGeometry);
+
+  Standard_Boolean aHasInitLocation = HasInitLocation();
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aHasInitLocation);
+
+  gp_GTrsf anInvInitLocation = InvInitLocation();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &anInvInitLocation);
 }
index 277a9d87de865e8616626e653fac41c82a72ea77..29e46b94fa7960c50eaf6ca0e42bd9ed2a724e37 100644 (file)
@@ -70,7 +70,7 @@ public:
   //! Returns the number of sub-entities or elements in sensitive entity.
   //! Is used to determine if entity is complex and needs to pre-build BVH at the creation of sensitive entity step
   //! or is light-weighted so the tree can be build on demand with unnoticeable delay.
-  virtual Standard_Integer NbSubElements() = 0;
+  virtual Standard_Integer NbSubElements() const = 0;
 
   //! Returns bounding box of a sensitive with transformation applied
   virtual Select3D_BndBox3d BoundingBox() = 0;
index 6feff18373fcfcda1cda37a1f17d6b87c7289923..f9fcb141e270808f53e6cb26a06f2a26f6a2a25b 100644 (file)
@@ -139,7 +139,7 @@ gp_Pnt Select3D_SensitiveFace::CenterOfGeometry() const
 // purpose  : Returns the amount of sub-entities (points or planar convex
 //            polygons)
 //=======================================================================
-Standard_Integer Select3D_SensitiveFace::NbSubElements()
+Standard_Integer Select3D_SensitiveFace::NbSubElements() const
 {
   return myFacePoints->NbSubElements();
 }
@@ -153,6 +153,7 @@ void Select3D_SensitiveFace::DumpJson (Standard_OStream& theOStream, const Stand
   OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitiveFace);
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
 
+
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySensType);
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myFacePoints.get());
 }
index 2a0af16113004d4037e11c4104ead6bc0677b48a..f0da4f998d182c29231c759fe160b733979fde23 100644 (file)
@@ -71,7 +71,7 @@ public:
   Standard_EXPORT virtual void BVH() Standard_OVERRIDE;
 
   //! Returns the amount of sub-entities (points or planar convex polygons)
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   //! Dumps the content of me into the stream
   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
index 89c5e12cbf987d1b43f0913850a7bb9712b95c9d..09d3013b9d014f07286be15b7492a4c1d94fabd1 100644 (file)
@@ -164,7 +164,7 @@ void Select3D_SensitiveGroup::Clear()
 // function : NbSubElements
 // purpose  : Returns the amount of sub-entities
 //=======================================================================
-Standard_Integer Select3D_SensitiveGroup::NbSubElements()
+Standard_Integer Select3D_SensitiveGroup::NbSubElements() const
 {
   return myEntities.Size();
 }
@@ -379,7 +379,7 @@ void Select3D_SensitiveGroup::DumpJson (Standard_OStream& theOStream, const Stan
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMustMatchAll);
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToCheckOverlapAll);
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter);
+
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox);
 
   //NCollection_Vector<Standard_Integer> myBVHPrimIndexes;     //!< Vector of sub-entities indexes for BVH tree build
index 307d6a6c585e42607f1958a8517853402acbb6da..95b8e7125943adf8e112c3bdad939590cebc682f 100644 (file)
@@ -113,7 +113,7 @@ public:
                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
 
   //! Returns the amount of sub-entities
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index 72facedce07c1cb1cffbff692a14bd1d5a706ee5..4173e42b459ae2912d403e06f81aa769706de7c0 100644 (file)
@@ -81,7 +81,7 @@ Select3D_BndBox3d Select3D_SensitivePoint::BoundingBox()
 // function : NbSubElements
 // purpose  : Returns the amount of sub-entities in sensitive
 //=======================================================================
-Standard_Integer Select3D_SensitivePoint::NbSubElements()
+Standard_Integer Select3D_SensitivePoint::NbSubElements() const
 {
   return 1;
 }
@@ -94,6 +94,4 @@ void Select3D_SensitivePoint::DumpJson (Standard_OStream& theOStream, const Stan
 {
   OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitivePoint);
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
-
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPoint);
 }
index 5906c5181dc742f07217bae4e1c1a273eeea780a..4863940f5c037e3279569bf40cfa8eb5d89b9d74 100644 (file)
@@ -31,7 +31,7 @@ public:
   Standard_EXPORT Select3D_SensitivePoint (const Handle(SelectMgr_EntityOwner)& theOwnerId, const gp_Pnt& thePoint);
 
   //! Returns the amount of sub-entities in sensitive
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index 80d6ab40867969b3eff52def7ead471ae186c184..309d6d376e59aa74775a0aefecc6ce12c3e9733b 100644 (file)
@@ -284,7 +284,7 @@ Standard_Real Select3D_SensitivePoly::distanceToCOG (SelectBasics_SelectingVolum
 // Function: NbSubElements
 // Purpose : Returns the amount of segments in poly
 //==================================================
-Standard_Integer Select3D_SensitivePoly::NbSubElements()
+Standard_Integer Select3D_SensitivePoly::NbSubElements() const
 {
   return myPolyg.Size();
 }
@@ -321,7 +321,6 @@ void Select3D_SensitivePoly::DumpJson (Standard_OStream& theOStream, const Stand
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveSet);
 
   //Select3D_PointData              myPolyg;              //!< Points of the poly
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCOG);
   //Handle(TColStd_HArray1OfInteger) mySegmentIndexes;     //!< Segment indexes for BVH tree build
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox);
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsComputed);
index 7b71d10920163480f94abb78e5e35e7c0d666e6b..f16ff43e5bea3ebfeafa7912b75d054dd1c23280 100644 (file)
@@ -56,7 +56,7 @@ public:
                                           const Standard_Integer theNbPnts = 6);
 
   //! Returns the amount of segments in poly
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   //! Returns the 3D points of the array used at construction time.
   void Points3D (Handle(TColgp_HArray1OfPnt)& theHArrayOfPnt)
index 897035ad2f7a2a9bfa6cf07bd54e4c384a09a6dc..534331cc16af61f06af676f45e30dc0e6f17fad9 100644 (file)
@@ -1240,7 +1240,6 @@ void Select3D_SensitivePrimitiveArray::DumpJson (Standard_OStream& theOStream, c
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPatchDistance);
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIs3d);
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInitLocation);
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCDG3D);
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox);
   //Handle(TColStd_HPackedMapOfInteger) myDetectedElemMap;    //!< index map of last detected elements
   //Handle(TColStd_HPackedMapOfInteger) myDetectedNodeMap;    //!< index map of last detected nodes
index b06a1a269aa655b994b5816961b929cdb337d625..fd75942ddce711e97bae448ff7c211823819a457 100644 (file)
@@ -212,7 +212,7 @@ public:
   Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
 
   //! Returns the amount of nodes in triangulation
-  virtual Standard_Integer NbSubElements() Standard_OVERRIDE
+  virtual Standard_Integer NbSubElements() const Standard_OVERRIDE
   {
     return !myGroups.IsNull() ? myGroups->Size() : myBvhIndices.NbElements;
   }
index 7d707139cce171f07f6daca4c6551baa56831010..5b389e9a3aa3601bd667d98c3c23acfc46045a27 100644 (file)
@@ -98,7 +98,7 @@ Select3D_BndBox3d Select3D_SensitiveSegment::BoundingBox()
 // function : NbSubElements
 // purpose  : Returns the amount of points
 //=======================================================================
-Standard_Integer Select3D_SensitiveSegment::NbSubElements()
+Standard_Integer Select3D_SensitiveSegment::NbSubElements() const
 {
   return 2;
 }
@@ -114,4 +114,7 @@ void Select3D_SensitiveSegment::DumpJson (Standard_OStream& theOStream, const St
 
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myStart);
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEnd);
+
+  Select3D_BndBox3d aBoundingBox = ((Select3D_SensitiveSegment*)this)->BoundingBox();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aBoundingBox);
 }
index 17ff4c3b96f45252be3a6930234c5bd5fb8d63ad..a8cc4e39f31a2aa95ebc5caf8fd0d2454a360b84 100644 (file)
@@ -46,7 +46,7 @@ public:
   const gp_Pnt& EndPoint() const { return myEnd; }
 
   //! Returns the amount of points
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index bb1f80ab2d2ab5b39cac044c775d5a31acb5f2a7..9e6527078366c8cf903fbfc29d7e88aaaf2a9c05 100644 (file)
@@ -242,5 +242,10 @@ void Select3D_SensitiveSet::DumpJson (Standard_OStream& theOStream, const Standa
   OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitiveSet);
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
 
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myContent);
+
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDetectedIdx);
+
+  Select3D_BndBox3d aBoundingBox = ((Select3D_SensitiveSet*)this)->BoundingBox();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aBoundingBox);
 }
index 261c4cb315fc49358e18b7b5fce7ff24eef543bb..b309293bb6e1f8097a9d9b25cd8695d239bd7252 100644 (file)
@@ -176,6 +176,10 @@ protected:
     //! Returns the tree built for set of sensitives
     const opencascade::handle<BVH_Tree<Standard_Real, 3> >& GetBVH() { return BVH(); }
 
+    //! Dumps the content of me into the stream
+    void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
+    { (void)theOStream; (void)theDepth; }
+
   protected:
     Select3D_SensitiveSet* mySensitiveSet; //!< Set of sensitive entities
   };
index c3d0002e2deb7f28245b5ff8c9ec3986b36f0ef0..0a8a4a6c3e87a0520c1e6fe4fd534e1f587c0dbb 100644 (file)
@@ -105,8 +105,10 @@ void Select3D_SensitiveTriangle::DumpJson (Standard_OStream& theOStream, const S
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySensType);
 
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCentroid);
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPoints[0]);
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPoints[1]);
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPoints[2]);
+
+  Select3D_BndBox3d aBoundingBox = ((Select3D_SensitiveTriangle*)this)->BoundingBox();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aBoundingBox);
 }
index 6e0b789769827b8d0537657de0f589059af7e483..6a37c503c72f4da2b2883db8df462df13c33d84d 100644 (file)
@@ -63,7 +63,7 @@ public:
   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
 
   //! Returns the amount of points
-  virtual Standard_Integer NbSubElements() Standard_OVERRIDE { return 3; }
+  virtual Standard_Integer NbSubElements() const Standard_OVERRIDE { return 3; }
 
   virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE { return myCentroid; }
 
index 9bc774af08f65cbc3900afb44b4c8dd9db30569a..f5736e2b29d4b305286f0db0e394506d8d93a755 100644 (file)
@@ -421,7 +421,7 @@ gp_Pnt Select3D_SensitiveTriangulation::CenterOfGeometry() const
 // function : NbSubElements
 // purpose  : Returns the amount of nodes in triangulation
 //=======================================================================
-Standard_Integer Select3D_SensitiveTriangulation::NbSubElements()
+Standard_Integer Select3D_SensitiveTriangulation::NbSubElements() const
 {
   return myTriangul->Nodes().Length();
 }
@@ -455,7 +455,6 @@ void Select3D_SensitiveTriangulation::DumpJson (Standard_OStream& theOStream, co
 
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTriangul.get());
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInitLocation);
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCDG3D);
   //Handle(TColStd_HArray1OfInteger) myFreeEdges;
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySensType);
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPrimitivesNb);
index 92ef699d55ef2d810daa0931102b2b1bc4c890f6..4a0a282ffff49bf599e422c68e53118d9155c600 100644 (file)
@@ -55,7 +55,7 @@ public:
                                                    const Standard_Boolean theIsInterior);
 
   //! Returns the amount of nodes in triangulation
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index 410ee06483dde052b81f9aa4d59e812f0b6e6610..841bfd6950ce2b06f953809768106432b5dec48b 100644 (file)
@@ -54,7 +54,7 @@ void Select3D_SensitiveWire::Add (const Handle(Select3D_SensitiveEntity)& theSen
 // function : NbSubElements
 // purpose  : Returns the amount of sub-entities
 //=======================================================================
-Standard_Integer Select3D_SensitiveWire::NbSubElements()
+Standard_Integer Select3D_SensitiveWire::NbSubElements() const
 {
   return myEntities.Length();
 }
@@ -242,6 +242,5 @@ void Select3D_SensitiveWire::DumpJson (Standard_OStream& theOStream, const Stand
     OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anEntity.get());
   }
   //NCollection_Vector<Standard_Integer>                 myEntityIndexes;     //!< Indexes of entities for BVH build
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter);
   OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox);
 }
index eca3ac58e72d814538442c2bf46bbea5f4a5e7f8..32fed62c9b38eeac3cf189490e7b4f3ab7e30b9b 100644 (file)
@@ -33,7 +33,7 @@ public:
   Standard_EXPORT void Add (const Handle(Select3D_SensitiveEntity)& theSensitive);
 
   //! Returns the amount of sub-entities
-  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
 
   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
 
index e6831d98e57b6722ee591757fad46b9df3c57c8b..4c70849142acdc725eb1312980d1175c760bc64d 100644 (file)
@@ -187,7 +187,8 @@ Standard_Boolean Standard_Dump::InitRealValues (const Standard_SStream& theStrea
     if (!aValueText.IsRealValue())
       return Standard_False;
 
-    *(va_arg(vl, Standard_Real*)) = aValueText.RealValue();
+    Standard_Real aValue = aValueText.RealValue();
+    *(va_arg(vl, Standard_Real*)) = aValue;
 
     aStreamPos = aNextPos + JsonKeyLength (Standard_JsonKey_SeparatorValueToValue);
     //theOStream << va_arg(vl, Standard_Real);
@@ -200,12 +201,12 @@ Standard_Boolean Standard_Dump::InitRealValues (const Standard_SStream& theStrea
 }
 
 //=======================================================================
-//function : InitRealValue
+//function : InitValue
 //purpose  : 
 //=======================================================================
-Standard_Boolean Standard_Dump::InitRealValue (const Standard_SStream& theStream,
-                                               Standard_Integer& theStreamPos,
-                                               Standard_Real& theValue)
+Standard_Boolean Standard_Dump::InitValue (const Standard_SStream& theStream,
+                                           Standard_Integer& theStreamPos,
+                                           TCollection_AsciiString& theValue)
 {
   Standard_Integer aStreamPos = theStreamPos;
 
@@ -224,13 +225,8 @@ Standard_Boolean Standard_Dump::InitRealValue (const Standard_SStream& theStream
     aNextKey = Standard_JsonKey_CloseChild;
   }
 
-  TCollection_AsciiString aValueText = aNextPos ? aSubText.SubString (aStreamPos, aNextPos - 1) : aSubText;
-  if (!aValueText.IsRealValue())
-    return Standard_False;
-
-  theValue = aValueText.RealValue();
+  theValue = aNextPos ? aSubText.SubString (aStreamPos, aNextPos - 1) : aSubText;
   theStreamPos = aNextPos ? (theStreamPos + (aNextPos - aStreamPos) + JsonKeyLength (aNextKey)) : aText.Length();
-
   return Standard_True;
 }
 
index 3fb31eabf3a1d60495d82fa968d64f358dcffba9..8f9b423424ebccd8dfa2dc78f102b831fc524e09 100644 (file)
@@ -64,17 +64,51 @@ class Standard_DumpSentry;
   theOStream << "\"" << aName << "\": " << theField; \
 }
 
+//! @def OCCT_INIT_FIELD_VALUE_REAL
+//! Append vector values into output value: "Name": [value_1, value_2, ...]
+//! This macro is intended to have only one row for dumped object in Json.
+//! It's possible to use it without necessity of OCCT_DUMP_CLASS_BEGIN call, but pay attention that it should be only one row in the object dump.
+#define OCCT_INIT_FIELD_VALUE_REAL(theOStream, theStreamPos, theField) \
+{ \
+  Standard_Integer aStreamPos = theStreamPos; \
+  if (!Standard_Dump::ProcessFieldName (theOStream, #theField, aStreamPos)) \
+    return Standard_False; \
+  TCollection_AsciiString aValueText; \
+  if (!Standard_Dump::InitValue (theOStream, aStreamPos, aValueText) || !aValueText.IsRealValue()) \
+    return Standard_False; \
+  theField = aValueText.RealValue(); \
+  theStreamPos = aStreamPos; \
+}
+
+//! @def OCCT_INIT_FIELD_VALUE_NUMERICAL
+//! Append vector values into output value: "Name": [value_1, value_2, ...]
+//! This macro is intended to have only one row for dumped object in Json.
+//! It's possible to use it without necessity of OCCT_DUMP_CLASS_BEGIN call, but pay attention that it should be only one row in the object dump.
+#define OCCT_INIT_FIELD_VALUE_INTEGER(theOStream, theStreamPos, theField) \
+{ \
+  Standard_Integer aStreamPos = theStreamPos; \
+  if (!Standard_Dump::ProcessFieldName (theOStream, #theField, aStreamPos)) \
+    return Standard_False; \
+  TCollection_AsciiString aValueText; \
+  if (!Standard_Dump::InitValue (theOStream, aStreamPos, aValueText) || !aValueText.IsIntegerValue()) \
+    return Standard_False; \
+  theField = aValueText.IntegerValue(); \
+  theStreamPos = aStreamPos; \
+}
+
 //! @def OCCT_INIT_FIELD_VALUE_NUMERICAL
 //! Append vector values into output value: "Name": [value_1, value_2, ...]
 //! This macro is intended to have only one row for dumped object in Json.
 //! It's possible to use it without necessity of OCCT_DUMP_CLASS_BEGIN call, but pay attention that it should be only one row in the object dump.
-#define OCCT_INIT_FIELD_VALUE_NUMERICAL(theOStream, theStreamPos, theField) \
+#define OCCT_INIT_FIELD_VALUE_BOOLEAN(theOStream, theStreamPos, theField) \
 { \
   Standard_Integer aStreamPos = theStreamPos; \
   if (!Standard_Dump::ProcessFieldName (theOStream, #theField, aStreamPos)) \
     return Standard_False; \
-  if (!Standard_Dump::InitRealValue (theOStream, aStreamPos, theField)) \
+  TCollection_AsciiString aValueText; \
+  if (!Standard_Dump::InitValue (theOStream, aStreamPos, aValueText) || !aValueText.IsIntegerValue()) \
     return Standard_False; \
+  theField = (Standard_Boolean)aValueText.IntegerValue(); \
   theStreamPos = aStreamPos; \
 }
 
@@ -169,7 +203,7 @@ class Standard_DumpSentry;
 #define OCCT_DUMP_VECTOR_CLASS(theOStream, theName, theCount, ...) \
 { \
   Standard_Dump::AddValuesSeparator (theOStream); \
-  theOStream << "\"" << OCCT_CLASS_NAME(theName) << "\": ["; \
+  theOStream << "\"" << theName << "\": ["; \
   Standard_Dump::DumpRealValues (theOStream, theCount, __VA_ARGS__);\
   theOStream << "]"; \
 }
@@ -181,7 +215,7 @@ class Standard_DumpSentry;
 #define OCCT_INIT_VECTOR_CLASS(theOStream, theName, theStreamPos, theCount, ...) \
 { \
   Standard_Integer aStreamPos = theStreamPos; \
-  if (!Standard_Dump::ProcessStreamName (theOStream, OCCT_CLASS_NAME(theName), aStreamPos)) \
+  if (!Standard_Dump::ProcessStreamName (theOStream, theName, aStreamPos)) \
     return Standard_False; \
   if (!Standard_Dump::InitRealValues (theOStream, aStreamPos, theCount, __VA_ARGS__)) \
     return Standard_False; \
@@ -341,9 +375,9 @@ public:
   //! @param theSStream stream with values
   //! @param theStreamPos current position in the stream
   //! @param theValue stream value
-  Standard_EXPORT static Standard_Boolean InitRealValue (const Standard_SStream& theStream,
-                                                         Standard_Integer& theStreamPos,
-                                                         Standard_Real& theValue);
+  Standard_EXPORT static Standard_Boolean InitValue (const Standard_SStream& theStream,
+                                                     Standard_Integer& theStreamPos,
+                                                     TCollection_AsciiString& theValue);
 
   //! Convert field name into dump text value, removes "&" and "my" prefixes
   //! An example, for field myValue, theName is Value, for &myCLass, the name is Class
index 3421373befae748694857dfbba70df4af4e7488f..1c9c1eed24abfc676cc986f7f7ee5139250c9fa6 100644 (file)
@@ -88,8 +88,8 @@ gp_Ax1 gp_Ax1::Mirrored (const gp_Ax2& A2) const
 
 void gp_Ax1::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, Location, 3, loc.X(), loc.Y(), loc.Z())
-  OCCT_DUMP_VECTOR_CLASS (theOStream, Direction, 3, vdir.X(), vdir.Y(), vdir.Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "Location", 3, loc.X(), loc.Y(), loc.Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "Direction", 3, vdir.X(), vdir.Y(), vdir.Z())
 }
 
 Standard_Boolean gp_Ax1::InitJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
@@ -97,9 +97,9 @@ Standard_Boolean gp_Ax1::InitJson (const Standard_SStream& theSStream, Standard_
   Standard_Integer aPos = theStreamPos;
 
   gp_XYZ& anXYZLoc = loc.ChangeCoord();
-  OCCT_INIT_VECTOR_CLASS (theSStream, Location, aPos, 3, &anXYZLoc.ChangeCoord (1), &anXYZLoc.ChangeCoord (2), &anXYZLoc.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "Location", aPos, 3, &anXYZLoc.ChangeCoord (1), &anXYZLoc.ChangeCoord (2), &anXYZLoc.ChangeCoord (3))
   gp_XYZ aDir;
-  OCCT_INIT_VECTOR_CLASS (theSStream, Direction, aPos, 3, &aDir.ChangeCoord (1), &aDir.ChangeCoord (2), &aDir.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "Direction", aPos, 3, &aDir.ChangeCoord (1), &aDir.ChangeCoord (2), &aDir.ChangeCoord (3))
   SetDirection (aDir);
 
   theStreamPos = aPos;
index 537c251b8a937a6062a504fe24b1c06f81a54f88..2478308034431a8a21aa597ce5a2be25a69df1e5 100644 (file)
@@ -116,11 +116,11 @@ gp_Ax2 gp_Ax2::Mirrored(const gp_Ax2& A2) const
 
 void gp_Ax2::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, Location, 3, axis.Location().X(), axis.Location().Y(), axis.Location().Z())
-  OCCT_DUMP_VECTOR_CLASS (theOStream, Direction, 3, axis.Direction().X(), axis.Direction().Y(), axis.Direction().Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "Location", 3, axis.Location().X(), axis.Location().Y(), axis.Location().Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "Direction", 3, axis.Direction().X(), axis.Direction().Y(), axis.Direction().Z())
 
-  OCCT_DUMP_VECTOR_CLASS (theOStream, XDirection, 3, vxdir.X(), vxdir.Y(), vxdir.Z())
-  OCCT_DUMP_VECTOR_CLASS (theOStream, YDirection, 3, vydir.X(), vydir.Y(), vydir.Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "XDirection", 3, vxdir.X(), vxdir.Y(), vxdir.Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "YDirection", 3, vydir.X(), vydir.Y(), vydir.Z())
 }
 
 Standard_Boolean gp_Ax2::InitJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
@@ -128,15 +128,15 @@ Standard_Boolean gp_Ax2::InitJson (const Standard_SStream& theSStream, Standard_
   Standard_Integer aPos = theStreamPos;
 
   gp_XYZ anXYZLoc;
-  OCCT_INIT_VECTOR_CLASS (theSStream, Location, aPos, 3, &anXYZLoc.ChangeCoord (1), &anXYZLoc.ChangeCoord (2), &anXYZLoc.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "Location", aPos, 3, &anXYZLoc.ChangeCoord (1), &anXYZLoc.ChangeCoord (2), &anXYZLoc.ChangeCoord (3))
   SetLocation (anXYZLoc);
 
   gp_XYZ aDir;
-  OCCT_INIT_VECTOR_CLASS (theSStream, Direction, aPos, 3, &aDir.ChangeCoord (1), &aDir.ChangeCoord (2), &aDir.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "Direction", aPos, 3, &aDir.ChangeCoord (1), &aDir.ChangeCoord (2), &aDir.ChangeCoord (3))
   gp_XYZ aXDir;
-  OCCT_INIT_VECTOR_CLASS (theSStream, XDirection, aPos, 3, &aXDir.ChangeCoord (1), &aXDir.ChangeCoord (2), &aXDir.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "XDirection", aPos, 3, &aXDir.ChangeCoord (1), &aXDir.ChangeCoord (2), &aXDir.ChangeCoord (3))
   gp_XYZ anYDir;
-  OCCT_INIT_VECTOR_CLASS (theSStream, YDirection, aPos, 3, &anYDir.ChangeCoord (1), &anYDir.ChangeCoord (2), &anYDir.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "YDirection", aPos, 3, &anYDir.ChangeCoord (1), &anYDir.ChangeCoord (2), &anYDir.ChangeCoord (3))
 
   SetXDirection (aXDir);
   SetYDirection (anYDir);
index e2ed05513b8cea36082a6f3215a3f1480d55d0db..384b21e3a0058731cc09659604e2efdf8380ecde 100644 (file)
@@ -109,11 +109,11 @@ gp_Ax3  gp_Ax3::Mirrored(const gp_Ax2& A2)const
 
 void  gp_Ax3::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, Location, 3, Location().X(), Location().Y(), Location().Z())
-  OCCT_DUMP_VECTOR_CLASS (theOStream, Direction, 3, Direction().X(), Direction().Y(), Direction().Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "Location", 3, Location().X(), Location().Y(), Location().Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "Direction", 3, Direction().X(), Direction().Y(), Direction().Z())
 
-  OCCT_DUMP_VECTOR_CLASS (theOStream, XDirection, 3, XDirection().X(), XDirection().Y(), XDirection().Z())
-  OCCT_DUMP_VECTOR_CLASS (theOStream, YDirection, 3, YDirection().X(), YDirection().Y(), YDirection().Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "XDirection", 3, XDirection().X(), XDirection().Y(), XDirection().Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "YDirection", 3, YDirection().X(), YDirection().Y(), YDirection().Z())
 }
 
 Standard_Boolean  gp_Ax3::InitJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
@@ -121,15 +121,15 @@ Standard_Boolean  gp_Ax3::InitJson (const Standard_SStream& theSStream, Standard
   Standard_Integer aPos = theStreamPos;
 
   gp_XYZ anXYZLoc;
-  OCCT_INIT_VECTOR_CLASS (theSStream, Location, aPos, 3, &anXYZLoc.ChangeCoord (1), &anXYZLoc.ChangeCoord (2), &anXYZLoc.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "Location", aPos, 3, &anXYZLoc.ChangeCoord (1), &anXYZLoc.ChangeCoord (2), &anXYZLoc.ChangeCoord (3))
   SetLocation (anXYZLoc);
 
   gp_XYZ aDir;
-  OCCT_INIT_VECTOR_CLASS (theSStream, Direction, aPos, 3, &aDir.ChangeCoord (1), &aDir.ChangeCoord (2), &aDir.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "Direction", aPos, 3, &aDir.ChangeCoord (1), &aDir.ChangeCoord (2), &aDir.ChangeCoord (3))
   gp_XYZ aXDir;
-  OCCT_INIT_VECTOR_CLASS (theSStream, XDirection, aPos, 3, &aXDir.ChangeCoord (1), &aXDir.ChangeCoord (2), &aXDir.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "XDirection", aPos, 3, &aXDir.ChangeCoord (1), &aXDir.ChangeCoord (2), &aXDir.ChangeCoord (3))
   gp_XYZ anYDir;
-  OCCT_INIT_VECTOR_CLASS (theSStream, YDirection, aPos, 3, &anYDir.ChangeCoord (1), &anYDir.ChangeCoord (2), &anYDir.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "YDirection", aPos, 3, &anYDir.ChangeCoord (1), &anYDir.ChangeCoord (2), &anYDir.ChangeCoord (3))
 
   SetXDirection (aXDir);
   SetYDirection (anYDir);
index f58d8cc5dfc371c160c9af3148c919e84c317b23..24c1fc355efdf483ac08c7268d653dda6a4aab62 100644 (file)
@@ -142,14 +142,14 @@ gp_Dir gp_Dir::Mirrored (const gp_Ax2& A2) const
 
 void gp_Dir::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, gp_Dir, 3, coord.X(), coord.Y(), coord.Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "gp_Dir", 3, coord.X(), coord.Y(), coord.Z())
 }
 
 Standard_Boolean gp_Dir::InitJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
 {
   Standard_Integer aPos = theStreamPos;
 
-  OCCT_INIT_VECTOR_CLASS (theSStream, gp_Dir, aPos, 3, &coord.ChangeCoord (1), &coord.ChangeCoord (2), &coord.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "gp_Dir", aPos, 3, &coord.ChangeCoord (1), &coord.ChangeCoord (2), &coord.ChangeCoord (3))
 
   theStreamPos = aPos;
   return Standard_True;
index 014797b851cb1fe0745001f6e2e5474f3df02152..44c9fb404f005e879a17dc5f3479da582a8c2c25 100644 (file)
@@ -275,5 +275,5 @@ void gp_Mat::Power (const Standard_Integer N)
 //=======================================================================
 void gp_Mat::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, gp_Mat, 9, Mat00, Mat01, Mat02, Mat10, Mat11, Mat12, Mat20, Mat21, Mat22);
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "gp_Mat", 9, Mat00, Mat01, Mat02, Mat10, Mat11, Mat12, Mat20, Mat21, Mat22);
 }
index 515267108d526e3925a43185357f0cd7b503ecf7..288343769e8dd6fb8e2b872cc2f2bb59bd5e2e65 100644 (file)
@@ -88,14 +88,14 @@ gp_Pnt gp_Pnt::Mirrored (const gp_Ax2& A2) const
 
 void gp_Pnt::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, gp_Pnt, 3, coord.X(), coord.Y(), coord.Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "gp_Pnt", 3, coord.X(), coord.Y(), coord.Z())
 }
 
 Standard_Boolean gp_Pnt::InitJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
 {
   Standard_Integer aPos = theStreamPos;
 
-  OCCT_INIT_VECTOR_CLASS (theSStream, gp_Pnt, aPos, 3, &coord.ChangeCoord (1), &coord.ChangeCoord (2), &coord.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "gp_Pnt", aPos, 3, &coord.ChangeCoord (1), &coord.ChangeCoord (2), &coord.ChangeCoord (3))
 
   theStreamPos = aPos;
   return Standard_True;
index 9ad34a3a80f098a8b830b822b10f332c53aada60..1f483bef5541fc21eed6b64034001a835a7a26d6 100644 (file)
@@ -857,11 +857,10 @@ void gp_Trsf::Orthogonalize()
 //=======================================================================
 void gp_Trsf::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, Location, 3, loc.X(), loc.Y(), loc.Z())
-  OCCT_DUMP_VECTOR_CLASS (theOStream, Matrix, 9, matrix.Value(1, 1), matrix.Value(1, 2), matrix.Value(1, 3),
-                                                 matrix.Value(2, 1), matrix.Value(2, 2), matrix.Value(2, 3),
-                                                 matrix.Value(3, 1), matrix.Value(3, 2), matrix.Value(3, 3))
-
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "Location", 3, loc.X(), loc.Y(), loc.Z())
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "Matrix", 9, matrix.Value(1, 1), matrix.Value(1, 2), matrix.Value(1, 3),
+                                                   matrix.Value(2, 1), matrix.Value(2, 2), matrix.Value(2, 3),
+                                                   matrix.Value(3, 1), matrix.Value(3, 2), matrix.Value(3, 3))
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, shape);
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, scale);
 }
@@ -875,22 +874,13 @@ Standard_Boolean  gp_Trsf::InitJson (const Standard_SStream& theSStream, Standar
   Standard_Integer aPos = theStreamPos;
 
   gp_XYZ anXYZLoc;
-  OCCT_INIT_VECTOR_CLASS (theSStream, Location, aPos, 3, &anXYZLoc.ChangeCoord (1), &anXYZLoc.ChangeCoord (2), &anXYZLoc.ChangeCoord (3))
+  OCCT_INIT_VECTOR_CLASS (theSStream, "Location", aPos, 3, &anXYZLoc.ChangeCoord (1), &anXYZLoc.ChangeCoord (2), &anXYZLoc.ChangeCoord (3))
   SetTranslation (anXYZLoc);
 
-  //OCCT_INIT_VECTOR_CLASS (theSStream, Matrix, aPos, 9, matrix.ChangeValue (1, 1), matrix.ChangeValue (1, 2), matrix.ChangeValue (1, 3),
-  //                                                     matrix.ChangeValue (2, 1), matrix.ChangeValue (2, 2), matrix.ChangeValue (2, 3),
-  //                                                     matrix.ChangeValue (3, 1), matrix.ChangeValue (3, 2), matrix.ChangeValue (3, 3))
-
   Standard_Real mymatrix[3][3];
-  //Standard_Real M00, M01, M02, M10, M11, M12, M20, M21, M22;
-  //OCCT_INIT_VECTOR_CLASS (theSStream, Matrix, aPos, 9, &mymatrix[0][0], &mymatrix[0][1], &mymatrix[0][2],
-  //                                                     &mymatrix[1][0], &mymatrix[1][1], &mymatrix[1][2],
-  //                                                     &mymatrix[2][0], &mymatrix[2][1], &mymatrix[2][2])
-
-  OCCT_INIT_VECTOR_CLASS (theSStream, Matrix, aPos, 9, &mymatrix[0][0], &mymatrix[0][1], &mymatrix[0][2],
-                                                       &mymatrix[1][0], &mymatrix[1][1], &mymatrix[1][2],
-                                                       &mymatrix[2][0], &mymatrix[2][1], &mymatrix[2][2])
+  OCCT_INIT_VECTOR_CLASS (theSStream, "Matrix", aPos, 9, &mymatrix[0][0], &mymatrix[0][1], &mymatrix[0][2],
+                                                         &mymatrix[1][0], &mymatrix[1][1], &mymatrix[1][2],
+                                                         &mymatrix[2][0], &mymatrix[2][1], &mymatrix[2][2])
   for (int i = 0; i < 3; i++)
   {
     for (int j = 0; j < 3; j++)
@@ -900,10 +890,10 @@ Standard_Boolean  gp_Trsf::InitJson (const Standard_SStream& theSStream, Standar
   }
 
   Standard_Real myshape;
-  OCCT_INIT_FIELD_VALUE_NUMERICAL (theSStream, aPos, myshape);
+  OCCT_INIT_FIELD_VALUE_INTEGER (theSStream, aPos, myshape);
   shape = (gp_TrsfForm)((Standard_Integer)myshape);
 
-  OCCT_INIT_FIELD_VALUE_NUMERICAL (theSStream, aPos, scale);
+  OCCT_INIT_FIELD_VALUE_REAL (theSStream, aPos, scale);
 
   theStreamPos = aPos;
   return Standard_True;
index 72317f4fbe2bc3c081f822932d9629b23434438c..8f3162c37e7630abab34a7e537a77e3fbdef8961 100644 (file)
@@ -40,7 +40,7 @@ Standard_Boolean gp_XYZ::IsEqual (const gp_XYZ& Other,
 //=======================================================================
 void gp_XYZ::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
 {
-  OCCT_DUMP_VECTOR_CLASS (theOStream, gp_XYZ, 3, x, y, z)
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "gp_XYZ", 3, x, y, z)
 }
 
 //=======================================================================
@@ -50,7 +50,7 @@ void gp_XYZ::DumpJson (Standard_OStream& theOStream, const Standard_Integer) con
 Standard_Boolean gp_XYZ::InitJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
 {
   Standard_Integer aPos = theStreamPos;
-  OCCT_INIT_VECTOR_CLASS (theSStream, gp_XYZ, aPos, 3, &x, &y, &z)
+  OCCT_INIT_VECTOR_CLASS (theSStream, "gp_XYZ", aPos, 3, &x, &y, &z)
 
   theStreamPos = aPos;
   return Standard_True;
index 2cf944f29e1c763c334eaaa63d2e2b6737584f18..e2504dd5aeb9e403a5260b97bc3814e011ff584b 100644 (file)
@@ -98,6 +98,17 @@ void Convert_Tools::ConvertStreamToPresentations (const Standard_SStream& theSSt
       thePresentations.Append (new Convert_TransientShape (aShape));
     return;
   }
+
+  BVH_Box<Standard_Real, 3> aBVHBox;  // Graphic3d_BndBox3d
+  if (aBVHBox.InitJson (theSStream, aStartPos))
+  {
+    Bnd_Box aCornerBox (gp_Pnt (aBVHBox.CornerMin().x(), aBVHBox.CornerMin().y(), aBVHBox.CornerMin().z()),
+                        gp_Pnt (aBVHBox.CornerMax().x(), aBVHBox.CornerMax().y(), aBVHBox.CornerMax().z()));
+    TopoDS_Shape aShape;
+    if (Convert_Tools::CreateShape (aCornerBox, aShape))
+      thePresentations.Append (new Convert_TransientShape (aShape));
+    return;
+  }
 }
 
 //=======================================================================
@@ -178,19 +189,28 @@ Standard_Boolean Convert_Tools::CreateBoxShape (const gp_Pnt& thePntMin, const g
   Standard_Boolean aThinOnY = fabs (thePntMin.Y() - thePntMax.Y()) < Precision::Confusion();
   Standard_Boolean aThinOnZ = fabs (thePntMin.Z() - thePntMax.Z()) < Precision::Confusion();
 
-  if (((int)aThinOnX + (int)aThinOnY + (int)aThinOnZ) > 1) // thin box in several directions is a point
+  BRep_Builder aBuilder;
+  TopoDS_Compound aCompound;
+  aBuilder.MakeCompound (aCompound);
+
+  if (((int)aThinOnX + (int)aThinOnY + (int)aThinOnZ) == 3) // thin box in all directions is a point
   {
-    BRep_Builder aBuilder;
-    TopoDS_Compound aCompound;
-    aBuilder.MakeCompound (aCompound);
     aBuilder.Add (aCompound, BRepBuilderAPI_MakeVertex (thePntMin));
     theShape = aCompound;
     return Standard_True;
   }
 
+  if (((int)aThinOnX + (int)aThinOnY + (int)aThinOnZ) == 2) // thin box in two directions is a point
+  {
+    aBuilder.Add (aCompound, BRepBuilderAPI_MakeEdge (thePntMin, thePntMax));
+    theShape = aCompound;
+    return Standard_True;
+  }
+
+  // thin box in only one direction is a compuund of edges
   if (aThinOnX || aThinOnY || aThinOnZ)
   {
-    gp_Pnt aPnt1, aPnt2, aPnt3, aPnt4 ;
+    gp_Pnt aPnt1, aPnt2, aPnt3, aPnt4;
     if (aThinOnX)
     {
       aPnt1 = gp_Pnt(thePntMin.X(), thePntMin.Y(), thePntMin.Z());
@@ -212,9 +232,6 @@ Standard_Boolean Convert_Tools::CreateBoxShape (const gp_Pnt& thePntMin, const g
       aPnt3 = gp_Pnt(thePntMax.X(), thePntMax.Y(), thePntMin.Z());
       aPnt4 = gp_Pnt(thePntMin.X(), thePntMax.Y(), thePntMin.Z());
     }
-    BRep_Builder aBuilder;
-    TopoDS_Compound aCompound;
-    aBuilder.MakeCompound (aCompound);
     aBuilder.Add (aCompound, BRepBuilderAPI_MakeEdge (aPnt1, aPnt2));
     aBuilder.Add (aCompound, BRepBuilderAPI_MakeEdge (aPnt2, aPnt3));
     aBuilder.Add (aCompound, BRepBuilderAPI_MakeEdge (aPnt3, aPnt4));