From c87f4a240745ae6760b19a8a9ca1f66048ba0cd2 Mon Sep 17 00:00:00 2001 From: nds Date: Sat, 28 Dec 2019 16:44:13 +0300 Subject: [PATCH] 0030268: Inspectors - improvements in VInspector plugin --- src/BVH/BVH_Box.hxx | 33 ++++++++++++- src/Bnd/Bnd_Box.cxx | 10 ++-- src/MeshVS/MeshVS_CommonSensitiveEntity.cxx | 2 +- src/MeshVS/MeshVS_CommonSensitiveEntity.hxx | 2 +- src/MeshVS/MeshVS_DummySensitiveEntity.cxx | 2 +- src/MeshVS/MeshVS_DummySensitiveEntity.hxx | 2 +- src/MeshVS/MeshVS_SensitiveMesh.cxx | 2 +- src/MeshVS/MeshVS_SensitiveMesh.hxx | 2 +- src/MeshVS/MeshVS_SensitivePolyhedron.cxx | 2 +- src/MeshVS/MeshVS_SensitivePolyhedron.hxx | 2 +- src/MeshVS/MeshVS_SensitiveQuad.hxx | 2 +- src/Message/Message_Report.cxx | 6 +-- src/Quantity/Quantity_Color.cxx | 2 +- src/Quantity/Quantity_ColorRGBA.cxx | 2 +- .../Select3D_InteriorSensitivePointSet.cxx | 6 +-- .../Select3D_InteriorSensitivePointSet.hxx | 2 +- src/Select3D/Select3D_SensitiveBox.cxx | 3 +- src/Select3D/Select3D_SensitiveBox.hxx | 2 +- src/Select3D/Select3D_SensitiveEntity.cxx | 11 +++++ src/Select3D/Select3D_SensitiveEntity.hxx | 2 +- src/Select3D/Select3D_SensitiveFace.cxx | 3 +- src/Select3D/Select3D_SensitiveFace.hxx | 2 +- src/Select3D/Select3D_SensitiveGroup.cxx | 4 +- src/Select3D/Select3D_SensitiveGroup.hxx | 2 +- src/Select3D/Select3D_SensitivePoint.cxx | 4 +- src/Select3D/Select3D_SensitivePoint.hxx | 2 +- src/Select3D/Select3D_SensitivePoly.cxx | 3 +- src/Select3D/Select3D_SensitivePoly.hxx | 2 +- .../Select3D_SensitivePrimitiveArray.cxx | 1 - .../Select3D_SensitivePrimitiveArray.hxx | 2 +- src/Select3D/Select3D_SensitiveSegment.cxx | 5 +- src/Select3D/Select3D_SensitiveSegment.hxx | 2 +- src/Select3D/Select3D_SensitiveSet.cxx | 5 ++ src/Select3D/Select3D_SensitiveSet.hxx | 4 ++ src/Select3D/Select3D_SensitiveTriangle.cxx | 4 +- src/Select3D/Select3D_SensitiveTriangle.hxx | 2 +- .../Select3D_SensitiveTriangulation.cxx | 3 +- .../Select3D_SensitiveTriangulation.hxx | 2 +- src/Select3D/Select3D_SensitiveWire.cxx | 3 +- src/Select3D/Select3D_SensitiveWire.hxx | 2 +- src/Standard/Standard_Dump.cxx | 18 +++---- src/Standard/Standard_Dump.hxx | 48 ++++++++++++++++--- src/gp/gp_Ax1.cxx | 8 ++-- src/gp/gp_Ax2.cxx | 16 +++---- src/gp/gp_Ax3.cxx | 16 +++---- src/gp/gp_Dir.cxx | 4 +- src/gp/gp_Mat.cxx | 2 +- src/gp/gp_Pnt.cxx | 4 +- src/gp/gp_Trsf.cxx | 30 ++++-------- src/gp/gp_XYZ.cxx | 4 +- tools/Convert/Convert_Tools.cxx | 33 +++++++++---- 51 files changed, 208 insertions(+), 129 deletions(-) diff --git a/src/BVH/BVH_Box.hxx b/src/BVH/BVH_Box.hxx index 5d584604e0..81a1de70c3 100644 --- a/src/BVH/BVH_Box.hxx +++ b/src/BVH/BVH_Box.hxx @@ -18,8 +18,9 @@ #include #include -#include +#include #include +#include #include @@ -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. diff --git a/src/Bnd/Bnd_Box.cxx b/src/Bnd/Bnd_Box.cxx index 12f15e2e32..c8961f8613 100644 --- a/src/Bnd/Bnd_Box.cxx +++ b/src/Bnd/Bnd_Box.cxx @@ -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; diff --git a/src/MeshVS/MeshVS_CommonSensitiveEntity.cxx b/src/MeshVS/MeshVS_CommonSensitiveEntity.cxx index 2f118c1adb..933df83ea7 100644 --- a/src/MeshVS/MeshVS_CommonSensitiveEntity.cxx +++ b/src/MeshVS/MeshVS_CommonSensitiveEntity.cxx @@ -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(); } diff --git a/src/MeshVS/MeshVS_CommonSensitiveEntity.hxx b/src/MeshVS/MeshVS_CommonSensitiveEntity.hxx index fd87f9e08f..21dca5ea0b 100644 --- a/src/MeshVS/MeshVS_CommonSensitiveEntity.hxx +++ b/src/MeshVS/MeshVS_CommonSensitiveEntity.hxx @@ -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; diff --git a/src/MeshVS/MeshVS_DummySensitiveEntity.cxx b/src/MeshVS/MeshVS_DummySensitiveEntity.cxx index 143f277daa..3da2f9d301 100644 --- a/src/MeshVS/MeshVS_DummySensitiveEntity.cxx +++ b/src/MeshVS/MeshVS_DummySensitiveEntity.cxx @@ -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; } diff --git a/src/MeshVS/MeshVS_DummySensitiveEntity.hxx b/src/MeshVS/MeshVS_DummySensitiveEntity.hxx index 729cad77a9..049e5f41bd 100644 --- a/src/MeshVS/MeshVS_DummySensitiveEntity.hxx +++ b/src/MeshVS/MeshVS_DummySensitiveEntity.hxx @@ -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; diff --git a/src/MeshVS/MeshVS_SensitiveMesh.cxx b/src/MeshVS/MeshVS_SensitiveMesh.cxx index 3feb84de21..b5bfed934a 100644 --- a/src/MeshVS/MeshVS_SensitiveMesh.cxx +++ b/src/MeshVS/MeshVS_SensitiveMesh.cxx @@ -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()) diff --git a/src/MeshVS/MeshVS_SensitiveMesh.hxx b/src/MeshVS/MeshVS_SensitiveMesh.hxx index c24ec2aedd..3bedd05570 100644 --- a/src/MeshVS/MeshVS_SensitiveMesh.hxx +++ b/src/MeshVS/MeshVS_SensitiveMesh.hxx @@ -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; diff --git a/src/MeshVS/MeshVS_SensitivePolyhedron.cxx b/src/MeshVS/MeshVS_SensitivePolyhedron.cxx index f367406f2d..d64f322449 100644 --- a/src/MeshVS/MeshVS_SensitivePolyhedron.cxx +++ b/src/MeshVS/MeshVS_SensitivePolyhedron.cxx @@ -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(); } diff --git a/src/MeshVS/MeshVS_SensitivePolyhedron.hxx b/src/MeshVS/MeshVS_SensitivePolyhedron.hxx index 0aac9ccd0c..2283b6d1eb 100644 --- a/src/MeshVS/MeshVS_SensitivePolyhedron.hxx +++ b/src/MeshVS/MeshVS_SensitivePolyhedron.hxx @@ -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; diff --git a/src/MeshVS/MeshVS_SensitiveQuad.hxx b/src/MeshVS/MeshVS_SensitiveQuad.hxx index 07cbf3d7c0..d4306f6693 100644 --- a/src/MeshVS/MeshVS_SensitiveQuad.hxx +++ b/src/MeshVS/MeshVS_SensitiveQuad.hxx @@ -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; }; diff --git a/src/Message/Message_Report.cxx b/src/Message/Message_Report.cxx index b0bc794874..fc57f328e3 100644 --- a/src/Message/Message_Report.cxx +++ b/src/Message/Message_Report.cxx @@ -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; diff --git a/src/Quantity/Quantity_Color.cxx b/src/Quantity/Quantity_Color.cxx index 1d81b262b1..de7844512a 100644 --- a/src/Quantity/Quantity_Color.cxx +++ b/src/Quantity/Quantity_Color.cxx @@ -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; diff --git a/src/Quantity/Quantity_ColorRGBA.cxx b/src/Quantity/Quantity_ColorRGBA.cxx index 19beb28c7c..53ffa540db 100644 --- a/src/Quantity/Quantity_ColorRGBA.cxx +++ b/src/Quantity/Quantity_ColorRGBA.cxx @@ -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; diff --git a/src/Select3D/Select3D_InteriorSensitivePointSet.cxx b/src/Select3D/Select3D_InteriorSensitivePointSet.cxx index 0b457f469b..e275aa021b 100644 --- a/src/Select3D/Select3D_InteriorSensitivePointSet.cxx +++ b/src/Select3D/Select3D_InteriorSensitivePointSet.cxx @@ -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); } diff --git a/src/Select3D/Select3D_InteriorSensitivePointSet.hxx b/src/Select3D/Select3D_InteriorSensitivePointSet.hxx index 6f9d7ebd5b..e18a0b4a1b 100644 --- a/src/Select3D/Select3D_InteriorSensitivePointSet.hxx +++ b/src/Select3D/Select3D_InteriorSensitivePointSet.hxx @@ -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; diff --git a/src/Select3D/Select3D_SensitiveBox.cxx b/src/Select3D/Select3D_SensitiveBox.cxx index bef2dd1b84..6e3f4cbbb9 100644 --- a/src/Select3D/Select3D_SensitiveBox.cxx +++ b/src/Select3D/Select3D_SensitiveBox.cxx @@ -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); } diff --git a/src/Select3D/Select3D_SensitiveBox.hxx b/src/Select3D/Select3D_SensitiveBox.hxx index cb735264c2..cf152f98b7 100644 --- a/src/Select3D/Select3D_SensitiveBox.hxx +++ b/src/Select3D/Select3D_SensitiveBox.hxx @@ -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; diff --git a/src/Select3D/Select3D_SensitiveEntity.cxx b/src/Select3D/Select3D_SensitiveEntity.cxx index 43804bad69..4f1cdf5b21 100644 --- a/src/Select3D/Select3D_SensitiveEntity.cxx +++ b/src/Select3D/Select3D_SensitiveEntity.cxx @@ -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); } diff --git a/src/Select3D/Select3D_SensitiveEntity.hxx b/src/Select3D/Select3D_SensitiveEntity.hxx index 277a9d87de..29e46b94fa 100644 --- a/src/Select3D/Select3D_SensitiveEntity.hxx +++ b/src/Select3D/Select3D_SensitiveEntity.hxx @@ -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; diff --git a/src/Select3D/Select3D_SensitiveFace.cxx b/src/Select3D/Select3D_SensitiveFace.cxx index 6feff18373..f9fcb141e2 100644 --- a/src/Select3D/Select3D_SensitiveFace.cxx +++ b/src/Select3D/Select3D_SensitiveFace.cxx @@ -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()); } diff --git a/src/Select3D/Select3D_SensitiveFace.hxx b/src/Select3D/Select3D_SensitiveFace.hxx index 2a0af16113..f0da4f998d 100644 --- a/src/Select3D/Select3D_SensitiveFace.hxx +++ b/src/Select3D/Select3D_SensitiveFace.hxx @@ -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; diff --git a/src/Select3D/Select3D_SensitiveGroup.cxx b/src/Select3D/Select3D_SensitiveGroup.cxx index 89c5e12cbf..09d3013b9d 100644 --- a/src/Select3D/Select3D_SensitiveGroup.cxx +++ b/src/Select3D/Select3D_SensitiveGroup.cxx @@ -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 myBVHPrimIndexes; //!< Vector of sub-entities indexes for BVH tree build diff --git a/src/Select3D/Select3D_SensitiveGroup.hxx b/src/Select3D/Select3D_SensitiveGroup.hxx index 307d6a6c58..95b8e71259 100644 --- a/src/Select3D/Select3D_SensitiveGroup.hxx +++ b/src/Select3D/Select3D_SensitiveGroup.hxx @@ -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; diff --git a/src/Select3D/Select3D_SensitivePoint.cxx b/src/Select3D/Select3D_SensitivePoint.cxx index 72facedce0..4173e42b45 100644 --- a/src/Select3D/Select3D_SensitivePoint.cxx +++ b/src/Select3D/Select3D_SensitivePoint.cxx @@ -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); } diff --git a/src/Select3D/Select3D_SensitivePoint.hxx b/src/Select3D/Select3D_SensitivePoint.hxx index 5906c5181d..4863940f5c 100644 --- a/src/Select3D/Select3D_SensitivePoint.hxx +++ b/src/Select3D/Select3D_SensitivePoint.hxx @@ -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; diff --git a/src/Select3D/Select3D_SensitivePoly.cxx b/src/Select3D/Select3D_SensitivePoly.cxx index 80d6ab4086..309d6d376e 100644 --- a/src/Select3D/Select3D_SensitivePoly.cxx +++ b/src/Select3D/Select3D_SensitivePoly.cxx @@ -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); diff --git a/src/Select3D/Select3D_SensitivePoly.hxx b/src/Select3D/Select3D_SensitivePoly.hxx index 7b71d10920..f16ff43e5b 100644 --- a/src/Select3D/Select3D_SensitivePoly.hxx +++ b/src/Select3D/Select3D_SensitivePoly.hxx @@ -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) diff --git a/src/Select3D/Select3D_SensitivePrimitiveArray.cxx b/src/Select3D/Select3D_SensitivePrimitiveArray.cxx index 897035ad2f..534331cc16 100644 --- a/src/Select3D/Select3D_SensitivePrimitiveArray.cxx +++ b/src/Select3D/Select3D_SensitivePrimitiveArray.cxx @@ -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 diff --git a/src/Select3D/Select3D_SensitivePrimitiveArray.hxx b/src/Select3D/Select3D_SensitivePrimitiveArray.hxx index b06a1a269a..fd75942ddc 100644 --- a/src/Select3D/Select3D_SensitivePrimitiveArray.hxx +++ b/src/Select3D/Select3D_SensitivePrimitiveArray.hxx @@ -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; } diff --git a/src/Select3D/Select3D_SensitiveSegment.cxx b/src/Select3D/Select3D_SensitiveSegment.cxx index 7d707139cc..5b389e9a3a 100644 --- a/src/Select3D/Select3D_SensitiveSegment.cxx +++ b/src/Select3D/Select3D_SensitiveSegment.cxx @@ -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); } diff --git a/src/Select3D/Select3D_SensitiveSegment.hxx b/src/Select3D/Select3D_SensitiveSegment.hxx index 17ff4c3b96..a8cc4e39f3 100644 --- a/src/Select3D/Select3D_SensitiveSegment.hxx +++ b/src/Select3D/Select3D_SensitiveSegment.hxx @@ -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; diff --git a/src/Select3D/Select3D_SensitiveSet.cxx b/src/Select3D/Select3D_SensitiveSet.cxx index bb1f80ab2d..9e65270783 100644 --- a/src/Select3D/Select3D_SensitiveSet.cxx +++ b/src/Select3D/Select3D_SensitiveSet.cxx @@ -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); } diff --git a/src/Select3D/Select3D_SensitiveSet.hxx b/src/Select3D/Select3D_SensitiveSet.hxx index 261c4cb315..b309293bb6 100644 --- a/src/Select3D/Select3D_SensitiveSet.hxx +++ b/src/Select3D/Select3D_SensitiveSet.hxx @@ -176,6 +176,10 @@ protected: //! Returns the tree built for set of sensitives const opencascade::handle >& 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 }; diff --git a/src/Select3D/Select3D_SensitiveTriangle.cxx b/src/Select3D/Select3D_SensitiveTriangle.cxx index c3d0002e2d..0a8a4a6c3e 100644 --- a/src/Select3D/Select3D_SensitiveTriangle.cxx +++ b/src/Select3D/Select3D_SensitiveTriangle.cxx @@ -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); } diff --git a/src/Select3D/Select3D_SensitiveTriangle.hxx b/src/Select3D/Select3D_SensitiveTriangle.hxx index 6e0b789769..6a37c503c7 100644 --- a/src/Select3D/Select3D_SensitiveTriangle.hxx +++ b/src/Select3D/Select3D_SensitiveTriangle.hxx @@ -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; } diff --git a/src/Select3D/Select3D_SensitiveTriangulation.cxx b/src/Select3D/Select3D_SensitiveTriangulation.cxx index 9bc774af08..f5736e2b29 100644 --- a/src/Select3D/Select3D_SensitiveTriangulation.cxx +++ b/src/Select3D/Select3D_SensitiveTriangulation.cxx @@ -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); diff --git a/src/Select3D/Select3D_SensitiveTriangulation.hxx b/src/Select3D/Select3D_SensitiveTriangulation.hxx index 92ef699d55..4a0a282fff 100644 --- a/src/Select3D/Select3D_SensitiveTriangulation.hxx +++ b/src/Select3D/Select3D_SensitiveTriangulation.hxx @@ -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; diff --git a/src/Select3D/Select3D_SensitiveWire.cxx b/src/Select3D/Select3D_SensitiveWire.cxx index 410ee06483..841bfd6950 100644 --- a/src/Select3D/Select3D_SensitiveWire.cxx +++ b/src/Select3D/Select3D_SensitiveWire.cxx @@ -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 myEntityIndexes; //!< Indexes of entities for BVH build - OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter); OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox); } diff --git a/src/Select3D/Select3D_SensitiveWire.hxx b/src/Select3D/Select3D_SensitiveWire.hxx index eca3ac58e7..32fed62c9b 100644 --- a/src/Select3D/Select3D_SensitiveWire.hxx +++ b/src/Select3D/Select3D_SensitiveWire.hxx @@ -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; diff --git a/src/Standard/Standard_Dump.cxx b/src/Standard/Standard_Dump.cxx index e6831d98e5..4c70849142 100644 --- a/src/Standard/Standard_Dump.cxx +++ b/src/Standard/Standard_Dump.cxx @@ -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; } diff --git a/src/Standard/Standard_Dump.hxx b/src/Standard/Standard_Dump.hxx index 3fb31eabf3..8f9b423424 100644 --- a/src/Standard/Standard_Dump.hxx +++ b/src/Standard/Standard_Dump.hxx @@ -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 diff --git a/src/gp/gp_Ax1.cxx b/src/gp/gp_Ax1.cxx index 3421373bef..1c9c1eed24 100644 --- a/src/gp/gp_Ax1.cxx +++ b/src/gp/gp_Ax1.cxx @@ -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; diff --git a/src/gp/gp_Ax2.cxx b/src/gp/gp_Ax2.cxx index 537c251b8a..2478308034 100644 --- a/src/gp/gp_Ax2.cxx +++ b/src/gp/gp_Ax2.cxx @@ -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); diff --git a/src/gp/gp_Ax3.cxx b/src/gp/gp_Ax3.cxx index e2ed05513b..384b21e3a0 100644 --- a/src/gp/gp_Ax3.cxx +++ b/src/gp/gp_Ax3.cxx @@ -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); diff --git a/src/gp/gp_Dir.cxx b/src/gp/gp_Dir.cxx index f58d8cc5df..24c1fc355e 100644 --- a/src/gp/gp_Dir.cxx +++ b/src/gp/gp_Dir.cxx @@ -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; diff --git a/src/gp/gp_Mat.cxx b/src/gp/gp_Mat.cxx index 014797b851..44c9fb404f 100644 --- a/src/gp/gp_Mat.cxx +++ b/src/gp/gp_Mat.cxx @@ -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); } diff --git a/src/gp/gp_Pnt.cxx b/src/gp/gp_Pnt.cxx index 515267108d..288343769e 100644 --- a/src/gp/gp_Pnt.cxx +++ b/src/gp/gp_Pnt.cxx @@ -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; diff --git a/src/gp/gp_Trsf.cxx b/src/gp/gp_Trsf.cxx index 9ad34a3a80..1f483bef55 100644 --- a/src/gp/gp_Trsf.cxx +++ b/src/gp/gp_Trsf.cxx @@ -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; diff --git a/src/gp/gp_XYZ.cxx b/src/gp/gp_XYZ.cxx index 72317f4fbe..8f3162c37e 100644 --- a/src/gp/gp_XYZ.cxx +++ b/src/gp/gp_XYZ.cxx @@ -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; diff --git a/tools/Convert/Convert_Tools.cxx b/tools/Convert/Convert_Tools.cxx index 2cf944f29e..e2504dd5ae 100644 --- a/tools/Convert/Convert_Tools.cxx +++ b/tools/Convert/Convert_Tools.cxx @@ -98,6 +98,17 @@ void Convert_Tools::ConvertStreamToPresentations (const Standard_SStream& theSSt thePresentations.Append (new Convert_TransientShape (aShape)); return; } + + BVH_Box 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)); -- 2.39.5