]> OCCT Git - occt-copy.git/commitdiff
0031494: Mesh - Dump improvement for BRepMesh classes CR31494
authornds <nds@opencascade.com>
Mon, 2 Mar 2020 12:58:19 +0000 (15:58 +0300)
committerNatalia ERMOLAEVA <nds@nnov.opencascade.com>
Sat, 11 Apr 2020 08:28:46 +0000 (11:28 +0300)
116 files changed:
src/Adaptor2d/Adaptor2d_Curve2d.cxx
src/Adaptor2d/Adaptor2d_Curve2d.hxx
src/Adaptor2d/Adaptor2d_HCurve2d.hxx
src/Adaptor2d/Adaptor2d_HCurve2d.lxx
src/Adaptor3d/Adaptor3d_Curve.cxx
src/Adaptor3d/Adaptor3d_Curve.hxx
src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx
src/Adaptor3d/Adaptor3d_CurveOnSurface.hxx
src/Adaptor3d/Adaptor3d_HCurve.hxx
src/Adaptor3d/Adaptor3d_HCurve.lxx
src/Adaptor3d/Adaptor3d_HCurveOnSurface.hxx
src/Adaptor3d/Adaptor3d_HCurveOnSurface_0.cxx
src/Adaptor3d/Adaptor3d_HSurface.hxx
src/Adaptor3d/Adaptor3d_HSurface.lxx
src/Adaptor3d/Adaptor3d_Surface.cxx
src/Adaptor3d/Adaptor3d_Surface.hxx
src/BRepAdaptor/BRepAdaptor_Curve.cxx
src/BRepAdaptor/BRepAdaptor_Curve.hxx
src/BRepAdaptor/BRepAdaptor_Curve2d.cxx
src/BRepAdaptor/BRepAdaptor_Curve2d.hxx
src/BRepAdaptor/BRepAdaptor_HCurve2d.hxx
src/BRepAdaptor/BRepAdaptor_HCurve2d_0.cxx
src/BRepAdaptor/BRepAdaptor_HSurface.hxx
src/BRepAdaptor/BRepAdaptor_HSurface_0.cxx
src/BRepAdaptor/BRepAdaptor_Surface.cxx
src/BRepAdaptor/BRepAdaptor_Surface.hxx
src/BRepMesh/BRepMesh_BaseMeshAlgo.cxx
src/BRepMesh/BRepMesh_BaseMeshAlgo.hxx
src/BRepMesh/BRepMesh_Circle.hxx
src/BRepMesh/BRepMesh_CircleInspector.hxx
src/BRepMesh/BRepMesh_CircleTool.cxx
src/BRepMesh/BRepMesh_CircleTool.hxx
src/BRepMesh/BRepMesh_ConstrainedBaseMeshAlgo.hxx
src/BRepMesh/BRepMesh_Context.cxx
src/BRepMesh/BRepMesh_Context.hxx
src/BRepMesh/BRepMesh_CurveTessellator.cxx
src/BRepMesh/BRepMesh_CurveTessellator.hxx
src/BRepMesh/BRepMesh_CustomBaseMeshAlgo.hxx
src/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx
src/BRepMesh/BRepMesh_DataStructureOfDelaun.hxx
src/BRepMesh/BRepMesh_Delaun.cxx
src/BRepMesh/BRepMesh_Delaun.hxx
src/BRepMesh/BRepMesh_DelaunayBaseMeshAlgo.cxx
src/BRepMesh/BRepMesh_DelaunayBaseMeshAlgo.hxx
src/BRepMesh/BRepMesh_DiscretRoot.cxx
src/BRepMesh/BRepMesh_DiscretRoot.hxx
src/BRepMesh/BRepMesh_Edge.hxx
src/BRepMesh/BRepMesh_EdgeDiscret.cxx
src/BRepMesh/BRepMesh_EdgeDiscret.hxx
src/BRepMesh/BRepMesh_FaceDiscret.cxx
src/BRepMesh/BRepMesh_FaceDiscret.hxx
src/BRepMesh/BRepMesh_IncrementalMesh.cxx
src/BRepMesh/BRepMesh_IncrementalMesh.hxx
src/BRepMesh/BRepMesh_ModelBuilder.cxx
src/BRepMesh/BRepMesh_ModelBuilder.hxx
src/BRepMesh/BRepMesh_ModelHealer.cxx
src/BRepMesh/BRepMesh_ModelHealer.hxx
src/BRepMesh/BRepMesh_ModelPostProcessor.cxx
src/BRepMesh/BRepMesh_ModelPostProcessor.hxx
src/BRepMesh/BRepMesh_ModelPreProcessor.cxx
src/BRepMesh/BRepMesh_ModelPreProcessor.hxx
src/BRepMesh/BRepMesh_OrientedEdge.hxx
src/BRepMesh/BRepMesh_PairOfIndex.hxx
src/BRepMesh/BRepMesh_ShapeVisitor.cxx
src/BRepMesh/BRepMesh_Triangle.hxx
src/BRepMesh/BRepMesh_Vertex.hxx
src/BRepMesh/BRepMesh_VertexInspector.hxx
src/BRepMesh/BRepMesh_VertexTool.cxx
src/BRepMesh/BRepMesh_VertexTool.hxx
src/BRepMeshData/BRepMeshData_Curve.cxx
src/BRepMeshData/BRepMeshData_Curve.hxx
src/BRepMeshData/BRepMeshData_Edge.cxx
src/BRepMeshData/BRepMeshData_Edge.hxx
src/BRepMeshData/BRepMeshData_Face.cxx
src/BRepMeshData/BRepMeshData_Face.hxx
src/BRepMeshData/BRepMeshData_Model.cxx
src/BRepMeshData/BRepMeshData_Model.hxx
src/BRepMeshData/BRepMeshData_Wire.cxx
src/BRepMeshData/BRepMeshData_Wire.hxx
src/GCPnts/GCPnts_TangentialDeflection.cxx
src/GCPnts/GCPnts_TangentialDeflection.hxx
src/GeomAdaptor/GeomAdaptor_Curve.cxx
src/GeomAdaptor/GeomAdaptor_Curve.hxx
src/GeomAdaptor/GeomAdaptor_Surface.cxx
src/GeomAdaptor/GeomAdaptor_Surface.hxx
src/IMeshData/IMeshData_Curve.hxx
src/IMeshData/IMeshData_Edge.hxx
src/IMeshData/IMeshData_Face.hxx
src/IMeshData/IMeshData_Model.hxx
src/IMeshData/IMeshData_PCurve.hxx
src/IMeshData/IMeshData_ParametersList.hxx
src/IMeshData/IMeshData_Shape.hxx
src/IMeshData/IMeshData_TessellatedShape.hxx
src/IMeshData/IMeshData_Wire.hxx
src/IMeshTools/FILES
src/IMeshTools/IMeshTools_Context.cxx [new file with mode: 0644]
src/IMeshTools/IMeshTools_Context.hxx
src/IMeshTools/IMeshTools_CurveTessellator.hxx
src/IMeshTools/IMeshTools_MeshAlgo.hxx
src/IMeshTools/IMeshTools_MeshBuilder.cxx
src/IMeshTools/IMeshTools_MeshBuilder.hxx
src/IMeshTools/IMeshTools_ModelAlgo.hxx
src/IMeshTools/IMeshTools_ModelBuilder.hxx
src/IMeshTools/IMeshTools_Parameters.cxx [new file with mode: 0644]
src/IMeshTools/IMeshTools_Parameters.hxx
src/IMeshTools/IMeshTools_ShapeExplorer.cxx
src/Message/Message_Algorithm.cxx
src/Message/Message_Algorithm.hxx
src/NCollection/NCollection_CellFilter.hxx
src/TopoDS/TopoDS_TShape.cxx
src/gp/gp_Circ.cxx
src/gp/gp_Circ.hxx
src/gp/gp_Lin.cxx
src/gp/gp_Lin.hxx
src/gp/gp_XY.cxx
src/gp/gp_XY.hxx

index aabbf958420c8d2173cde1a4ca8db288084b5ca4..7924571a6afba99969236682734a308d5d787496 100644 (file)
@@ -378,3 +378,11 @@ Standard_Integer Adaptor2d_Curve2d::NbSamples() const
   return 20;  
 }
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Adaptor2d_Curve2d::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, Adaptor2d_Curve2d)
+}
index c845bcef7a349a576bb2e31f429d979652b8268a..46f4cd1816606609002b30ac9caec9d874ada353 100644 (file)
@@ -158,6 +158,8 @@ public:
   Standard_EXPORT virtual Handle(Geom2d_BSplineCurve) BSpline() const;
   Standard_EXPORT virtual ~Adaptor2d_Curve2d();
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index 1e2f8157517db006f51761455ecc992df63ed17e..4d99ec72c44b3b516017103d94ecafa69822ed7c 100644 (file)
@@ -118,6 +118,9 @@ public:
   
     virtual Handle(Geom2d_BSplineCurve) BSpline() const;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
 
   DEFINE_STANDARD_RTTIEXT(Adaptor2d_HCurve2d,Standard_Transient)
 };
index c8d728dc031d43b9b2e7dcccdd2e9539ff997ae0..1f5e891c0df3704ac0a78cd22877bb0657f8d77d 100644 (file)
@@ -294,3 +294,11 @@ inline Standard_Integer  Adaptor2d_HCurve2d::NbKnots() const
   return Curve2d().BSpline();
 }
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+ inline void Adaptor2d_HCurve2d::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, Adaptor2d_HCurve2d)
+}
index 49b02da158fb08c5ab37101734ecacc94290ea96..12e4c5bf66aef467db6878641473bc4a5de33276 100644 (file)
@@ -364,3 +364,12 @@ Handle(Geom_OffsetCurve) Adaptor3d_Curve::OffsetCurve() const
 {
   throw Standard_NotImplemented("Adaptor3d_Curve::OffsetCurve");
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Adaptor3d_Curve::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, Adaptor3d_Curve)
+}
index de882dc430913009e2f71bd38c8babd1019af3a4..15e48a7c2c9dca1e8e1cd93b5f6f01453d363bf6 100644 (file)
@@ -161,6 +161,8 @@ public:
 
   Standard_EXPORT virtual ~Adaptor3d_Curve();
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index 43f8530b9ab31fdb67de80aaab34c34fbe8ab2e4..b546560a033de2622b2cc070b2f2eae0d999cf71 100644 (file)
@@ -1796,5 +1796,23 @@ void Adaptor3d_CurveOnSurface::LocatePart(const gp_Pnt2d& UV, const gp_Vec2d& DU
     }
 }
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Adaptor3d_CurveOnSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, Adaptor3d_CurveOnSurface)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Adaptor3d_CurveOnSurface)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myType)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCirc)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLin)
+
+  if (!myIntervals.IsNull())
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIntervals->Length())
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIntCont)
+}
 
 
index c7431f67a4d2e6376f5f7c8e371a8f58ae868e3a..c3446f62c0336b34b627ca2f43eabe84d1537a85 100644 (file)
@@ -181,6 +181,9 @@ public:
   
   Standard_EXPORT Handle(Geom_BSplineCurve) BSpline() const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
 
 
 
index 3e4e321af0a363ec2f586937d67f79a00a1f7f62..16389fbcf2eb23295f9d1841496f38824557bc72 100644 (file)
@@ -137,6 +137,8 @@ public:
 
     Handle(Geom_OffsetCurve) OffsetCurve() const;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
   DEFINE_STANDARD_RTTIEXT(Adaptor3d_HCurve,Standard_Transient)
 
index 48b2d8d0d3bf9a16aec0da5a0884cf0185646451..70826ca0f63f9b2a9981f16400061a71114a4a12 100644 (file)
@@ -302,3 +302,12 @@ inline Standard_Integer  Adaptor3d_HCurve::NbKnots() const
 {
   return Curve().OffsetCurve();
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+ inline void Adaptor3d_HCurve::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, Adaptor3d_HCurve)
+}
index 4ccc7d0e0da23c9db9eda2723b1dde6129a23f3c..f22050ad436bd4ce9b042433f4b54825cc296a74 100644 (file)
@@ -59,6 +59,8 @@ public:
   //! Returns the curve used to create the GenHCurve.
     Adaptor3d_CurveOnSurface& ChangeCurve();
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 
 
index dedb934068b1f48cc61953dc7c304bab00032663..1f4328bd7dc849082bc3c663eee11f73aa566f58 100644 (file)
 #define Handle_Adaptor3d_GenHCurve Handle(Adaptor3d_HCurveOnSurface)
 #include <Adaptor3d_GenHCurve.gxx>
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Adaptor3d_HCurveOnSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Adaptor3d_HCurve)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCurve)
+}
index 80fd5f8199bea3c17ea453af5c5bbdcc44554de6..8d75b2a4c09b6c99c1349147c1ff8d4f7d9a1dce 100644 (file)
@@ -161,6 +161,8 @@ public:
   
     Standard_Real OffsetValue() const;
 
+    //! Dumps the content of me into the stream
+    virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index 3510b204ff3e55ef1f2312244b9bb03656c01eef..5c6c551f7ab7083d22c6c9f0d5973f9d13c96725 100644 (file)
@@ -483,3 +483,12 @@ inline Standard_Boolean  Adaptor3d_HSurface::IsVRational() const
 {
   return Surface().OffsetValue();
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+ inline void Adaptor3d_HSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+}
index 42adac71bbfe31532fd1cb12ee7c678ae6331473..e53e28a15c310b903f4ac9185faafc2d8ff6a88c 100644 (file)
@@ -571,3 +571,12 @@ Standard_Real Adaptor3d_Surface::OffsetValue() const
 {
   throw Standard_NotImplemented("Adaptor3d_Surface::OffsetValue");
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Adaptor3d_Surface::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, Adaptor3d_Surface)
+}
index 1f5c3061eeb170f355f9e6df5b18b0295627ca86..03f65b9a3fc0a8429ab76ab6d03aa802b25c985d 100644 (file)
@@ -20,6 +20,7 @@
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
+#include <Standard_OStream.hxx>
 
 #include <Standard_Real.hxx>
 #include <GeomAbs_Shape.hxx>
@@ -211,6 +212,9 @@ public:
   Standard_EXPORT virtual Standard_Real OffsetValue() const;
   Standard_EXPORT virtual ~Adaptor3d_Surface();
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
 
 
 
index 4b75698d0124284b057d4732ecbf0f9ce4280b85..0be3408aa3788b91d5ed52c8cda662099e3ac5ff 100644 (file)
@@ -679,3 +679,19 @@ Handle(Geom_OffsetCurve) BRepAdaptor_Curve::OffsetCurve() const
   return myTrsf.Form() == gp_Identity
     ? anOffC : Handle(Geom_OffsetCurve)::DownCast(anOffC->Transformed(myTrsf));
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepAdaptor_Curve::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, BRepAdaptor_Curve)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Adaptor3d_Curve)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTrsf)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCurve)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myConSurf.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdge)
+}
index 640505d6f7bacb0561d9b240d97f5e3ea9c106ba..cd9dfe31c55d86d315e24a046baec84253fc353b 100644 (file)
@@ -226,6 +226,9 @@ public:
 
   Standard_EXPORT Handle(Geom_OffsetCurve) OffsetCurve() const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
 
 
 protected:
index 2d121bed413d7c833fe9a4978a4f9cc825318086..b24fabf9ed4950fef1ab9f2e888117a12d882c0e 100644 (file)
@@ -77,4 +77,15 @@ const TopoDS_Face& BRepAdaptor_Curve2d::Face() const
   return myFace;
 }
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepAdaptor_Curve2d::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, BRepAdaptor_Curve2d)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2dAdaptor_Curve)
 
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdge)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myFace)
+}
index cf220cc57f9a4d5697763ccfedb176ca7ace5a37..35f23350f41b7f81bcce2d52f449eb78631b9f34 100644 (file)
@@ -61,6 +61,8 @@ public:
   //! Returns the Face.
   Standard_EXPORT const TopoDS_Face& Face() const;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index 95491450681abe9156cfd09b06575d844bce0b5a..a1d239b5e00911b5ddb1ff3cb264092472ea93b3 100644 (file)
@@ -55,6 +55,8 @@ public:
   //! Returns the curve used to create the GenHCurve.
     BRepAdaptor_Curve2d& ChangeCurve2d();
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index 008350d6b7d5b5592a7a1e39b2d093bda9ebf03d..e519fb4063e19bbfead959022547a1daf8ddd9e1 100644 (file)
 #define Handle_Adaptor2d_GenHCurve2d Handle(BRepAdaptor_HCurve2d)
 #include <Adaptor2d_GenHCurve2d.gxx>
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepAdaptor_HCurve2d::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Adaptor2d_HCurve2d)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCurve)
+}
index cc544cf03f61592cf73325cd1d067a213df00bfb..195eca483dd55332986f47585fbe05fb8af41797 100644 (file)
@@ -55,6 +55,8 @@ public:
   //! Returns the surface used to create the GenHSurface.
     BRepAdaptor_Surface& ChangeSurface();
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 
 
index a29b8b11f5f047a1b3111516c9b005fd352f44ea..a26b4ba22b1a5ed3f9f25052bbc4fc7a70a838dd 100644 (file)
 #define Handle_Adaptor3d_GenHSurface Handle(BRepAdaptor_HSurface)
 #include <Adaptor3d_GenHSurface.gxx>
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepAdaptor_HSurface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Adaptor3d_HSurface)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &mySurf)
+}
index 850facead96db0221981727a0997a9f048dbec2d..cdaa7a61108e5fd87fcbd5869aaca531a9056b8c 100644 (file)
@@ -442,3 +442,16 @@ Standard_Real BRepAdaptor_Surface::OffsetValue() const
   return mySurf.OffsetValue();
 }
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepAdaptor_Surface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, BRepAdaptor_Surface)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Adaptor3d_Surface)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &mySurf)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTrsf)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myFace)
+}
index 70858bf8faa77e87c245a2791feb62e60d400fed..32037fd8cfa33b40fc637d5f180da9ef9e98be0b 100644 (file)
@@ -247,6 +247,8 @@ public:
   
   Standard_EXPORT Standard_Real OffsetValue() const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 
 
index dce927a2c4b6df2a2c11b6f7a9730e0ba310260e..5e289f3d6c6b2d8ea0d9a2fea5df7aa83f0ce538 100644 (file)
@@ -22,6 +22,8 @@
 #include <IMeshData_Curve.hxx>
 #include <BRepMesh_Delaun.hxx>
 #include <BRepMesh_ShapeTool.hxx>
+#include <Message.hxx>
+#include <TopoDS_AlertAttribute.hxx>
 #include <Standard_ErrorHandler.hxx>
 
 //=======================================================================
@@ -61,7 +63,11 @@ void BRepMesh_BaseMeshAlgo::Perform(
 
     if (initDataStructure())
     {
+      OCCT_SEND_DUMPJSON (myStructure.get())
+      OCCT_SEND_SHAPE (myStructure->DumpToShape());
       generateMesh();
+      OCCT_SEND_DUMPJSON (myStructure.get())
+      OCCT_SEND_SHAPE (myStructure->DumpToShape());
       commitSurfaceTriangulation();
     }
   }
@@ -82,6 +88,10 @@ void BRepMesh_BaseMeshAlgo::Perform(
 //=======================================================================
 Standard_Boolean BRepMesh_BaseMeshAlgo::initDataStructure()
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("initDataStructure")
+  OCCT_SEND_DUMPJSON (this)
+
   for (Standard_Integer aWireIt = 0; aWireIt < myDFace->WiresNb(); ++aWireIt)
   {
     const IMeshData::IWireHandle& aDWire = myDFace->GetWire(aWireIt);
@@ -96,6 +106,9 @@ Standard_Boolean BRepMesh_BaseMeshAlgo::initDataStructure()
     {
       const IMeshData::IEdgeHandle    aDEdge = aDWire->GetEdge(aEdgeIt);
       const IMeshData::ICurveHandle&  aCurve = aDEdge->GetCurve();
+
+      OCCT_SEND_DUMPJSON (aCurve.get())
+
       const IMeshData::IPCurveHandle& aPCurve = aDEdge->GetPCurve(
         myDFace.get(), aDWire->GetEdgeOrientation(aEdgeIt));
 
@@ -110,17 +123,29 @@ Standard_Boolean BRepMesh_BaseMeshAlgo::initDataStructure()
           aPCurve->GetPoint(aPointIt),
           BRepMesh_Frontier, Standard_False/*aPointIt > 0 && aPointIt < aLastPoint*/);
 
+        gp_Pnt aPnt1 = aCurve ->GetPoint(aPointIt);
+        gp_Pnt2d aPnt1_2d = aPCurve ->GetPoint(aPointIt);
+        gp_Pnt aPnt2 (aPnt1_2d.X(), aPnt1_2d.Y(), 0.0);
+        OCCT_SEND_DUMPJSON (&aPnt1)
+        OCCT_SEND_DUMPJSON (&aPnt2)
+        TCollection_AsciiString anIndexStr = TCollection_AsciiString ("Index = ") + aNodeIndex;
+        OCCT_SEND_MESSAGE (anIndexStr)
+        TCollection_AsciiString aPIndexStr = TCollection_AsciiString ("PrevNodeIndex = ") + aPrevNodeIndex;
+        OCCT_SEND_MESSAGE (aPIndexStr)
+
         aPCurve->GetIndex(aPointIt) = aNodeIndex;
         myUsedNodes->Bind(aNodeIndex, aNodeIndex);
 
         if (aPrevNodeIndex != -1 && aPrevNodeIndex != aNodeIndex)
         {
+          OCCT_SEND_MESSAGE ("Add link")
           const Standard_Integer aLinksNb   = myStructure->NbLinks();
           const Standard_Integer aLinkIndex = addLinkToMesh(aPrevNodeIndex, aNodeIndex, aOri);
           if (aWireIt != 0 && aLinkIndex <= aLinksNb)
           {
             // Prevent holes around wire of zero area.
             BRepMesh_Edge& aLink = const_cast<BRepMesh_Edge&>(myStructure->GetLink(aLinkIndex));
+            OCCT_SEND_DUMPJSON (&aLink)
             aLink.SetMovability(BRepMesh_Fixed);
           }
         }
@@ -130,6 +155,7 @@ Standard_Boolean BRepMesh_BaseMeshAlgo::initDataStructure()
     }
   }
 
+  OCCT_SEND_DUMPJSON (this)
   return Standard_True;
 }
 
@@ -314,3 +340,39 @@ gp_Pnt2d BRepMesh_BaseMeshAlgo::getNodePoint2d(
 {
   return theVertex.Coord();
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMesh_BaseMeshAlgo::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshTools_MeshAlgo)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDFace.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParameters)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructure.get())
+
+  if (!myNodesMap.IsNull())
+  {
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNodesMap->Size())
+    for (VectorOfPnt::Iterator aNodesIt (*myNodesMap); aNodesIt.More(); aNodesIt.Next())
+    {
+      const gp_Pnt aNodePoint = aNodesIt.Value();
+      OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aNodePoint)
+    }
+  }
+  if (!myUsedNodes.IsNull())
+  {
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUsedNodes->Extent())
+    for (DMapOfIntegerInteger::Iterator aUsedIt (*myUsedNodes); aUsedIt.More(); aUsedIt.Next())
+    {
+      Standard_Integer aNodeIndex = aUsedIt.Key();
+      Standard_Integer aUsedCount = aUsedIt.Value();
+
+      OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aNodeIndex)
+      OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aUsedCount)
+    }
+  }
+}
index 56c03b2e8ac506560fc6cf62ebc9544877bcfd52..bf853fcc3229f6a5fd1e20dddb3508f4cecb0330 100644 (file)
@@ -44,6 +44,9 @@ public:
     const IMeshData::IFaceHandle& theDFace,
     const IMeshTools_Parameters&  theParameters) Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_BaseMeshAlgo, IMeshTools_MeshAlgo)
 
 protected:
index 15d748f1ca70258e24b69f462e7819d3072a93bc..ad227163f00c86a4b73fded57b1048e5bc12b323 100644 (file)
@@ -68,6 +68,13 @@ public:
     return myRadius;
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLocation)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRadius)
+  }
+
 private:
 
   gp_XY         myLocation;
index c954d7d50ce8415795482cd256859abca21d2a23..89eaf84a2759df67c64e64a70899acc11c0028bc 100644 (file)
@@ -127,6 +127,22 @@ public:
     return (theIndex == theTargetIndex);
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    OCCT_DUMP_CLASS_BEGIN (theOStream, BRepMesh_VertexInspector)
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySqTolerance)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myResIndices.Extent())
+
+    for (Standard_Integer anIt = 1; anIt <= myCircles.Length(); ++anIt)
+    {
+      const BRepMesh_Circle& aCircle = myCircles.Value(anIt - 1);
+      OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aCircle)
+    }
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPoint)
+  }
+
 private:
   Standard_Real             mySqTolerance;
   IMeshData::ListOfInteger  myResIndices;
index 67aa20ee60ae04c37379b8039f226f6c21426f5c..46c41ab3a9d939651c0fbf5baeaa58fca10a6f51 100644 (file)
@@ -186,3 +186,18 @@ void BRepMesh_CircleTool::MocBind(const Standard_Integer theIndex)
   BRepMesh_Circle aNullCir(gp::Origin2d().Coord(), -1.);
   mySelector.Bind(theIndex, aNullCir);
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMesh_CircleTool::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, BRepMesh_CircleTool)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &mySelector)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myFaceMax)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myFaceMin)
+}
index 3f5701d63dfb423dfbadaeac7d03a6243966c48e..f0f649876a215531f84df7a9e3a4600caa6423d2 100644 (file)
@@ -133,6 +133,9 @@ public:
   //! @param thePoint bullet point.
   Standard_EXPORT IMeshData::ListOfInteger& Select(const gp_XY& thePoint);
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
 private:
 
   //! Creates circle with the given parameters and binds it to the tool.
index 7edd4aac23a2db872180f144a3502bba01bcd219..3fe5fbddf33e3910466b338ab95c01c049b9b714 100644 (file)
@@ -19,6 +19,7 @@
 #include <BRepMesh_BaseMeshAlgo.hxx>
 #include <NCollection_Shared.hxx>
 #include <IMeshTools_Parameters.hxx>
+#include <Standard_Dump.hxx>
 
 class BRepMesh_DataStructureOfDelaun;
 class BRepMesh_Delaun;
@@ -39,6 +40,14 @@ public:
   {
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    (void)theDepth;
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRepMesh_BaseMeshAlgo)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_ConstrainedBaseMeshAlgo, BRepMesh_BaseMeshAlgo)
 
 protected:
index e48d038467c3efea18e13a1fc2bd8f387f505dec..cbb0592aa75fb786723322c4776be81cfdfa4637 100644 (file)
@@ -43,3 +43,13 @@ BRepMesh_Context::BRepMesh_Context ()
 BRepMesh_Context::~BRepMesh_Context ()
 {
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMesh_Context::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshTools_Context)
+}
index a802a6b44bf05184561e903f8f801f9cabd277f3..d4e3a2ffb3665692f21b98540c7aba463490aeba 100644 (file)
@@ -30,6 +30,9 @@ public:
   //! Destructor.
   Standard_EXPORT virtual ~BRepMesh_Context ();
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_Context, IMeshTools_Context)
 };
 
index bb780d27e0f0f0235d5e5e33d068e137d3c51ffc..dd150f793afd34c65dd986f931f956c0daa55b98 100644 (file)
@@ -340,3 +340,32 @@ void BRepMesh_CurveTessellator::splitSegment (
   splitSegment (theSurf, theCurve2d, theFirst, midpar, theNbIter + 1);
   splitSegment (theSurf, theCurve2d, midpar, theLast, theNbIter + 1);
 }
+
+//=======================================================================
+// Function: DumpJson
+// Purpose : 
+//=======================================================================
+void BRepMesh_CurveTessellator::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshTools_CurveTessellator)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDEdge.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParameters)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdge)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCurve)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDiscretTool)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myFirstVertex)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLastVertex)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySquareEdgeDef)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySquareMinSize)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myEdgeSqTol)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFaceRangeU[0])
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFaceRangeU[1])
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFaceRangeV[0])
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFaceRangeV[1])
+}
index 4a666be6b84937b6403c4be83733e3f9e86a3a60..1dae74f2d7944ccf5adf58055b0f2de6b03b4039 100644 (file)
@@ -60,6 +60,9 @@ public:
     gp_Pnt&                thePoint,
     Standard_Real&         theParameter) const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_CurveTessellator, IMeshTools_CurveTessellator)
 
 private:
index e175091de90818829d2886a37ee01196e9942edb..89854306e0149240e53bce8978abb7a02cf4cd9a 100644 (file)
@@ -41,6 +41,14 @@ public:
   {
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    (void)theDepth;
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRepMesh_ConstrainedBaseMeshAlgo)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_CustomBaseMeshAlgo, BRepMesh_ConstrainedBaseMeshAlgo)
 
 protected:
index 7a49413c9567d876912ac3ac2bad1794b3de27bf..e64243f499e900e0d486ac39a452a73512601934 100644 (file)
@@ -18,6 +18,7 @@
 #include <BRepBuilderAPI_MakeEdge.hxx>
 #include <BRepBuilderAPI_MakeVertex.hxx>
 #include <BRepMesh_Edge.hxx>
+#include <Message_Messenger.hxx>
 
 #include <TopoDS_Compound.hxx>
 #include <BRep_Builder.hxx>
@@ -191,6 +192,8 @@ Standard_Integer BRepMesh_DataStructureOfDelaun::AddElement(
 {
   myElements.Append(theElement);
   Standard_Integer aElementIndex = myElements.Size();
+  OCCT_SEND_MESSAGE (TCollection_AsciiString ("AddElement: ") + aElementIndex)
+
   myElementsOfDomain.Add(aElementIndex);
 
   const Standard_Integer (&e)[3] = theElement.myEdges;
@@ -207,6 +210,8 @@ Standard_Integer BRepMesh_DataStructureOfDelaun::AddElement(
 void BRepMesh_DataStructureOfDelaun::RemoveElement(
   const Standard_Integer theIndex)
 {
+  OCCT_SEND_MESSAGE (TCollection_AsciiString ("RemoveElement: ") + theIndex)
+
   BRepMesh_Triangle& aElement = (BRepMesh_Triangle&)GetElement(theIndex);
   if (aElement.Movability() == BRepMesh_Deleted)
     return;
@@ -482,6 +487,80 @@ void BRepMesh_DataStructureOfDelaun::Statistics(Standard_OStream& theStream) con
   theStream << "\n Elements : " << myElements.Size() << std::endl;
 }
 
+//=======================================================================
+//function : BRepMesh_DumpToShape
+//purpose  : 
+//  Global function not declared in any public header, intended for use 
+//  from debugger prompt (Command Window in Visual Studio).
+//
+//  Stores the mesh data structure to BRep file with the given name.
+//=======================================================================
+TopoDS_Shape BRepMesh_DumpToShape(void* theMeshHandlePtr)
+{
+  if (theMeshHandlePtr == 0)
+  {
+    return TopoDS_Shape();
+  }
+
+  Handle(BRepMesh_DataStructureOfDelaun) aMeshData =
+    *(Handle(BRepMesh_DataStructureOfDelaun)*)theMeshHandlePtr;
+
+  if (aMeshData.IsNull())
+    return TopoDS_Shape();
+
+  TopoDS_Compound aMesh;
+  BRep_Builder aBuilder;
+  aBuilder.MakeCompound(aMesh);
+
+  try
+  {
+    OCC_CATCH_SIGNALS
+
+    if (aMeshData->LinksOfDomain().IsEmpty())
+    {
+      const Standard_Integer aNodesNb = aMeshData->NbNodes();
+      for (Standard_Integer i = 1; i <= aNodesNb; ++i)
+      {
+        const gp_XY& aNode = aMeshData->GetNode(i).Coord();
+        gp_Pnt aPnt(aNode.X(), aNode.Y(), 0.);
+        aBuilder.Add(aMesh, BRepBuilderAPI_MakeVertex(aPnt));
+      }
+    }
+    else
+    {
+      IMeshData::IteratorOfMapOfInteger aLinksIt(aMeshData->LinksOfDomain());
+      for (; aLinksIt.More(); aLinksIt.Next())
+      {
+        const BRepMesh_Edge& aLink = aMeshData->GetLink(aLinksIt.Key());
+        gp_Pnt aPnt[2];
+        for (Standard_Integer i = 0; i < 2; ++i)
+        {
+          const Standard_Integer aNodeId = 
+            (i == 0) ? aLink.FirstNode() : aLink.LastNode();
+
+          const gp_XY& aNode = aMeshData->GetNode(aNodeId).Coord();
+          aPnt[i] = gp_Pnt(aNode.X(), aNode.Y(), 0.);
+        }
+
+        if (aPnt[0].SquareDistance(aPnt[1]) < Precision::SquareConfusion())
+          continue;
+
+        aBuilder.Add(aMesh, BRepBuilderAPI_MakeEdge(aPnt[0], aPnt[1]));
+      }
+    }
+
+    //if (!BRepTools::Write(aMesh, theFileNameStr))
+    //  return "Error: write failed";
+  }
+  catch (Standard_Failure const& anException)
+  {
+    //return anException.GetMessageString();
+  }
+  return aMesh;
+
+  //return theFileNameStr;
+}
+
 //=======================================================================
 //function : BRepMesh_Write
 //purpose  : 
@@ -504,7 +583,11 @@ Standard_CString BRepMesh_Dump(void*            theMeshHandlePtr,
   if (aMeshData.IsNull())
     return "Error: mesh data is empty";
 
-  TopoDS_Compound aMesh;
+  TopoDS_Shape aShape = BRepMesh_DumpToShape(theMeshHandlePtr);
+  if (!BRepTools::Write(aShape, theFileNameStr))
+    return "Error: write failed";
+
+  /*TopoDS_Compound aMesh;
   BRep_Builder aBuilder;
   aBuilder.MakeCompound(aMesh);
 
@@ -551,13 +634,48 @@ Standard_CString BRepMesh_Dump(void*            theMeshHandlePtr,
   catch (Standard_Failure const& anException)
   {
     return anException.GetMessageString();
-  }
+  }*/
 
   return theFileNameStr;
 }
 
+TopoDS_Shape BRepMesh_DataStructureOfDelaun::DumpToShape()
+{
+  Handle(BRepMesh_DataStructureOfDelaun) aMeshData (this);
+  return BRepMesh_DumpToShape((void*)&aMeshData);
+}
+
 void BRepMesh_DataStructureOfDelaun::Dump(Standard_CString theFileNameStr)
 {
   Handle(BRepMesh_DataStructureOfDelaun) aMeshData (this);
   BRepMesh_Dump((void*)&aMeshData, theFileNameStr);
 }
+
+void BRepMesh_DataStructureOfDelaun::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myNodes.get())
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNodeLinks.Size())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLinks.Size())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDelLinks.Size())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myElements.Size())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myElementsOfDomain.Extent())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLinksOfDomain.Extent())
+
+  for (IMeshData::VectorOfElements::Iterator aElementIt(myElements); aElementIt.More(); aElementIt.Next())
+  {
+    const BRepMesh_Triangle& anElement = aElementIt.Value();
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &anElement)
+  }
+
+  for (IMeshData::IDMapOfLink::Iterator aLinkIt (myLinks); aLinkIt.More(); aLinkIt.Next())
+  {
+    const BRepMesh_Edge& anEdge = aLinkIt.Key();
+    const BRepMesh_PairOfIndex& aPair = aLinkIt.Value();
+
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &anEdge)
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aPair)
+  }
+}
index cc6b714153a17fe8744dadfa0abc7d1b8926ab27..e760b94720ea04a38070aa9d0995d4980c463d6b 100644 (file)
@@ -59,7 +59,7 @@ public: //! @name API for accessing mesh nodes.
 
   //! Finds the index of the given node.
   //! @param theNode node to find.
-  //! @return index of the given element of zero if node is not in the mesh.
+  //! @return index of the given element or zero if node is not in the mesh.
   Standard_Integer IndexOf(const BRepMesh_Vertex& theNode)
   {
     return myNodes->FindIndex(theNode);
@@ -218,6 +218,8 @@ public: //! @name API for accessing mesh elements.
     const BRepMesh_Triangle& theElement,
     Standard_Integer         (&theNodes)[3]);
 
+  Standard_EXPORT TopoDS_Shape DumpToShape();
+
   Standard_EXPORT void Dump(Standard_CString theFileNameStr);
 
 
@@ -251,6 +253,9 @@ public: //! @name Auxilary API
     clearDeletedNodes();
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_DataStructureOfDelaun, Standard_Transient)
 
 private: 
index 435aae6f1590ab4d1820d7038aa70abe86884d53..782398b47b7d2f9703d8d6c3896022b3aed34d8e 100644 (file)
 #include <BRepMesh_Triangle.hxx>
 
 #include <NCollection_Vector.hxx>
+#include <Message.hxx>
+#include <Message_Level.hxx>
+#include <Message_Messenger.hxx>
+#include <TopoDS_AlertAttribute.hxx>
+
 
 #include <algorithm>
 #include <stack>
@@ -245,6 +250,10 @@ void BRepMesh_Delaun::perform(IMeshData::VectorOfInteger& theVertexIndices,
                               const Standard_Integer      theCellsCountU /* = -1 */,
                               const Standard_Integer      theCellsCountV /* = -1 */)
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("BRepMesh_Delaun::perform")
+  OCCT_SEND_DUMPJSON (this)
+
   if (theVertexIndices.Length () <= 2)
   {
     return;
@@ -267,6 +276,7 @@ void BRepMesh_Delaun::perform(IMeshData::VectorOfInteger& theVertexIndices,
   std::make_heap(theVertexIndices.begin(), theVertexIndices.end(), aCmp);
   std::sort_heap(theVertexIndices.begin(), theVertexIndices.end(), aCmp);
 
+  OCCT_SEND_DUMPJSON (this)
   compute( theVertexIndices );
 }
 
@@ -347,6 +357,9 @@ void BRepMesh_Delaun::deleteTriangle(const Standard_Integer          theIndex,
 //=======================================================================
 void BRepMesh_Delaun::compute(IMeshData::VectorOfInteger& theVertexIndexes)
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("BRepMesh_Delaun::compute")
+
   // Insertion of edges of super triangles in the list of free edges:
   Handle(NCollection_IncAllocator) aAllocator = new NCollection_IncAllocator(
     IMeshData::MEMORY_BLOCK_SIZE_HUGE);
@@ -358,15 +371,18 @@ void BRepMesh_Delaun::compute(IMeshData::VectorOfInteger& theVertexIndexes)
   aLoopEdges.Bind( e[1], Standard_True );
   aLoopEdges.Bind( e[2], Standard_True );
 
+  OCCT_SEND_SHAPE (myMeshData->DumpToShape());
   if ( theVertexIndexes.Length() > 0 )
   {
     // Creation of 3 trianglers with the first node and the edges of the super triangle:
     Standard_Integer anVertexIdx = theVertexIndexes.Lower();
     createTriangles( theVertexIndexes( anVertexIdx ), aLoopEdges );
+    OCCT_SEND_SHAPE (myMeshData->DumpToShape());
 
     // Add other nodes to the mesh
     createTrianglesOnNewVertices( theVertexIndexes );
   }
+  OCCT_SEND_SHAPE (myMeshData->DumpToShape());
 
   // Destruction of triangles containing a top of the super triangle
   BRepMesh_SelectorOfDataStructureOfDelaun aSelector( myMeshData );
@@ -399,6 +415,9 @@ void BRepMesh_Delaun::compute(IMeshData::VectorOfInteger& theVertexIndexes)
 void BRepMesh_Delaun::createTriangles(const Standard_Integer          theVertexIndex,  
                                       IMeshData::MapOfIntegerInteger& thePoly)
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("createTriangles")
+
   IMeshData::ListOfInteger aLoopEdges, anExternalEdges;
   const gp_XY& aVertexCoord = myMeshData->GetNode( theVertexIndex ).Coord();
   
@@ -520,6 +539,8 @@ void BRepMesh_Delaun::createTriangles(const Standard_Integer          theVertexI
 void BRepMesh_Delaun::createTrianglesOnNewVertices(
   IMeshData::VectorOfInteger& theVertexIndexes)
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("createTrianglesOnNewVertices")
   Handle(NCollection_IncAllocator) aAllocator =
     new NCollection_IncAllocator(IMeshData::MEMORY_BLOCK_SIZE_HUGE);
 
@@ -611,6 +632,9 @@ void BRepMesh_Delaun::createTrianglesOnNewVertices(
 //=======================================================================
 void BRepMesh_Delaun::insertInternalEdges()
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("insertInternalEdges")
+
   Handle(IMeshData::MapOfInteger) anInternalEdges = InternalEdges();
 
   // Destruction of triancles intersecting internal edges 
@@ -831,6 +855,10 @@ void BRepMesh_Delaun::cleanupMesh()
 //=======================================================================
 void BRepMesh_Delaun::frontierAdjust()
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("frontierAdjust")
+  OCCT_SEND_SHAPE (myMeshData->DumpToShape());
+
   Handle(IMeshData::MapOfInteger)  aFrontier = Frontier();
 
   Handle(NCollection_IncAllocator) aAllocator =
@@ -904,7 +932,16 @@ void BRepMesh_Delaun::frontierAdjust()
     }
   }
 
-  cleanupMesh();
+  OCCT_SEND_DUMPJSON (myMeshData.get())
+  OCCT_SEND_SHAPE (myMeshData->DumpToShape());
+  OCCT_SEND_MESSAGE ("cleanupMesh")
+
+  //Standard_SStream aStream;
+  //myMeshData->Statistics (aStream);
+  //Message::DefaultMessenger() << aStream;
+
+  OCCT_SEND_SHAPE (myMeshData->DumpToShape());
+  //cleanupMesh();
 
   // When the mesh has been cleaned up, try to process frontier edges 
   // once again to fill the possible gaps that might be occured in case of "saw" -
@@ -2549,3 +2586,22 @@ Standard_CString BRepMesh_DumpPoly(void*            thePolygon,
   return theFileNameStr;
 }
 #endif
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMesh_Delaun::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, BRepMesh_Delaun)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myMeshData.get())
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCircles)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySupVert[0])
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySupVert[1])
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySupVert[2])
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &mySupTrian)
+}
index 5038e89bd85de25f279927e734ba476dce1c94fb..59ea986aada1e479ea94bb079e86cc9c65031486 100755 (executable)
@@ -26,6 +26,8 @@
 #include <IMeshData_Types.hxx>
 #include <BRepMesh_DataStructureOfDelaun.hxx>
 #include <BRepMesh_GeomTool.hxx>
+#include <Message_Level.hxx>
+#include <Message_Messenger.hxx>
 #include <TColStd_Array1OfInteger.hxx>
 #include <TColStd_SequenceOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
@@ -90,6 +92,8 @@ public:
   //! Forces insertion of constraint edges into the base triangulation. 
   inline void ProcessConstraints()
   {
+    OCCT_ADD_MESSAGE_LEVEL_SENTRY
+    OCCT_SEND_MESSAGE ("ProcessConstraints")
     insertInternalEdges();
 
     // Adjustment of meshes to boundary edges
@@ -147,6 +151,9 @@ public:
                                              const Standard_Real    theSqTolerance,
                                              Standard_Integer&      theEdgeOn) const;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
 private:
 
   enum ReplaceFlag
index 1394bd7a4afa06ad904b1ac34848f5962f602742..3c1147b3659114e3e65913e47f8ba20bbc148e9e 100644 (file)
@@ -16,6 +16,8 @@
 #include <BRepMesh_DelaunayBaseMeshAlgo.hxx>
 #include <BRepMesh_MeshTool.hxx>
 #include <BRepMesh_Delaun.hxx>
+#include <Message_Level.hxx>
+#include <Message_Messenger.hxx>
 
 //=======================================================================
 // Function: Constructor
@@ -39,6 +41,8 @@ BRepMesh_DelaunayBaseMeshAlgo::~BRepMesh_DelaunayBaseMeshAlgo()
 //=======================================================================
 void BRepMesh_DelaunayBaseMeshAlgo::generateMesh()
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("generateMesh")
   const Handle(BRepMesh_DataStructureOfDelaun)& aStructure = getStructure();
   const Handle(VectorOfPnt)&                    aNodesMap  = getNodesMap();
 
index 81bfdc7c9fd7465e1d11beaf8492686027ce5d80..ba6e84b8ec26e9b2a2da642888f3ee132523e729 100644 (file)
@@ -35,6 +35,14 @@ public:
   //! Destructor.
   Standard_EXPORT virtual ~BRepMesh_DelaunayBaseMeshAlgo();
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    (void)theDepth;
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRepMesh_ConstrainedBaseMeshAlgo)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_DelaunayBaseMeshAlgo, BRepMesh_ConstrainedBaseMeshAlgo)
 
 protected:
index e6d0978e63ea4dc4edfba674545ad02952474a95..753e5360439c6e17239f2ff82541b205cc07883b 100644 (file)
@@ -42,3 +42,15 @@ BRepMesh_DiscretRoot::~BRepMesh_DiscretRoot()
 void BRepMesh_DiscretRoot::init()
 {
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMesh_DiscretRoot::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myShape)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDone)
+}
index 361cf0e242a67eca37094bff830d28d89d47814d..c62201363ffb94e48540fed604cf7dc5a039e56b 100644 (file)
@@ -48,6 +48,8 @@ public:
   //! Compute triangulation for set shape.
   virtual void Perform() = 0;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
   DEFINE_STANDARD_RTTIEXT(BRepMesh_DiscretRoot,Standard_Transient)
 
index 3ef815131180499b3be2312b04fd302dda4424a2..5519168dd9534ab3586895f7fc8988ea7fea6805 100644 (file)
@@ -81,6 +81,15 @@ public:
     return IsEqual(Other);
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    OCCT_DUMP_CLASS_BEGIN (theOStream, BRepMesh_Edge)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRepMesh_OrientedEdge)
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMovability)
+  }
+
 private:
 
   BRepMesh_DegreeOfFreedom  myMovability;
index 4a305440d4bdc3bbcb2047fbec2f418deeb9c52a..15881878d186a609c38d374f54c5e7ab7ecc27be 100644 (file)
@@ -24,6 +24,7 @@
 #include <BRepMesh_EdgeTessellationExtractor.hxx>
 #include <IMeshData_ParametersListArrayAdaptor.hxx>
 #include <BRepMesh_CurveTessellator.hxx>
+#include <Message_Level.hxx>
 #include <OSD_Parallel.hxx>
 
 //=======================================================================
@@ -96,6 +97,7 @@ Standard_Boolean BRepMesh_EdgeDiscret::performInternal (
   }
 
   OSD_Parallel::For (0, myModel->EdgesNb (), *this, !myParameters.InParallel);
+  OCCT_SEND_DUMPJSON (myModel.get())
 
   myModel.Nullify(); // Do not hold link to model.
   return Standard_True;
@@ -335,3 +337,16 @@ void BRepMesh_EdgeDiscret::Tessellate2d(
     }
   }
 }
+
+//=======================================================================
+// Function: DumpJson
+// Purpose : 
+//=======================================================================
+void BRepMesh_EdgeDiscret::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshTools_ModelAlgo)
+
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myModel.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParameters)
+}
index 82ac8e48d2cd0b598cc8709a3f73815f6766fba2..334cf9ebb63ca090f6df1276b9b7653860fad164 100644 (file)
@@ -68,6 +68,9 @@ public:
     const IMeshData::IEdgeHandle& theDEdge,
     const Standard_Boolean        theUpdateEnds);
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_EdgeDiscret, IMeshTools_ModelAlgo)
 
 protected:
index ce6db2102e1c3271f551bd0b813a28148ad571e8..792ffbc09fff652a0646c26efe708781a6ee9842 100644 (file)
@@ -54,8 +54,13 @@ Standard_Boolean BRepMesh_FaceDiscret::performInternal(
     return Standard_False;
   }
 
-  OSD_Parallel::For(0, myModel->FacesNb(), *this, !(myParameters.InParallel && myModel->FacesNb() > 1));
+  for (int i = 0; i < myModel->FacesNb(); i++)
+  {
+    process (i);
+  }
+  //OSD_Parallel::For(0, myModel->FacesNb(), *this, !(myParameters.InParallel && myModel->FacesNb() > 1));
 
+  OCCT_SEND_DUMPJSON (myModel.get())
   myModel.Nullify(); // Do not hold link to model.
   return Standard_True;
 }
@@ -93,3 +98,17 @@ void BRepMesh_FaceDiscret::process(const Standard_Integer theFaceIndex) const
     aDFace->SetStatus (IMeshData_Failure);
   }
 }
+
+//=======================================================================
+// Function: DumpJson
+// Purpose : 
+//=======================================================================
+void BRepMesh_FaceDiscret::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshTools_ModelAlgo)
+
+  //OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAlgoFactory)
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myModel.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParameters)
+}
index 9ca86800b637fbe32e61b144f2691c0439f92fdc..45b06e632a0078986339df0e039d336f08a9392c 100644 (file)
@@ -41,6 +41,9 @@ public:
     process(theFaceIndex);
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_FaceDiscret, IMeshTools_ModelAlgo)
 
 protected:
index 25627edc831140295ed8f365d9a8890e068a2035..77c53be9093ff483326ebc42d9319675e336198f 100644 (file)
@@ -97,15 +97,21 @@ void BRepMesh_IncrementalMesh::Perform()
 //=======================================================================
 void BRepMesh_IncrementalMesh::Perform(const Handle(IMeshTools_Context)& theContext)
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("BRepMesh_IncrementalMesh::Perform")
   initParameters();
 
   theContext->SetShape(Shape());
   theContext->ChangeParameters()            = myParameters;
   theContext->ChangeParameters().CleanModel = Standard_False;
 
+  OCCT_SEND_DUMPJSON (this)
+
   IMeshTools_MeshBuilder aIncMesh(theContext);
   aIncMesh.Perform();
 
+  OCCT_SEND_DUMPJSON (&aIncMesh)
+
   myStatus = IMeshData_NoError;
   const Handle(IMeshData_Model)& aModel = theContext->GetModel();
   if (!aModel.IsNull())
@@ -164,5 +170,19 @@ void BRepMesh_IncrementalMesh::SetParallelDefault(
   IS_IN_PARALLEL = theInParallel;
 }
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMesh_IncrementalMesh::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRepMesh_DiscretRoot)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParameters)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myModified)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myStatus)
+}
+
 //! Export Mesh Plugin entry function
 DISCRETPLUGIN(BRepMesh_IncrementalMesh)
index 4831ffa43463402f80673190b4807ed7f3311386..317d22b2c3af81c058b6ac5f719d721ae82c53b5 100644 (file)
@@ -129,6 +129,9 @@ public: //! @name plugin API
   //! Discret() static method (thus applied only to Mesh Factories).
   Standard_EXPORT static void SetParallelDefault(const Standard_Boolean isInParallel);
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_IncrementalMesh, BRepMesh_DiscretRoot)
 
 protected:
index 1a15482cdfb2636b6a9c63c7a3d32322a98d634a..8757ef39713d7840b26ce87e1886e4642bb3d186 100644 (file)
@@ -46,10 +46,14 @@ Handle (IMeshData_Model) BRepMesh_ModelBuilder::performInternal (
   const TopoDS_Shape&          theShape,
   const IMeshTools_Parameters& theParameters)
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("BRepMesh_ModelBuilder::performInternal")
+
   Handle (BRepMeshData_Model) aModel;
 
   Bnd_Box aBox;
   BRepBndLib::Add (theShape, aBox, Standard_False);
+  OCCT_SEND_DUMPJSON (&aBox)
 
   if (!aBox.IsVoid ())
   {
@@ -71,6 +75,8 @@ Handle (IMeshData_Model) BRepMesh_ModelBuilder::performInternal (
     Handle (IMeshTools_ShapeVisitor) aVisitor =
       new BRepMesh_ShapeVisitor (aModel);
 
+    OCCT_SEND_DUMPJSON (aModel.get())
+
     IMeshTools_ShapeExplorer aExplorer (theShape);
     aExplorer.Accept (aVisitor);
     SetStatus (Message_Done1);
@@ -82,3 +88,14 @@ Handle (IMeshData_Model) BRepMesh_ModelBuilder::performInternal (
 
   return aModel;
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMesh_ModelBuilder::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshTools_ModelBuilder)
+}
index 56898a1eebc90f396e47509a3b1d6e3da3c47532..218fed2f7f16bf5e9a0652b2b02313d9d14b58f4 100644 (file)
@@ -36,6 +36,9 @@ public:
   //! Destructor.
   Standard_EXPORT virtual ~BRepMesh_ModelBuilder ();
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_ModelBuilder, IMeshTools_ModelBuilder)
 
 protected:
index 6ad9b83f566c8f1c33a947452c933a88563b04d8..d4bfecb05921547c45259af7c9224a6ffd5be04f 100644 (file)
@@ -140,6 +140,7 @@ Standard_Boolean BRepMesh_ModelHealer::performInternal(
   }
 
   // TODO: Here we can process edges in order to remove close discrete points.
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
   OSD_Parallel::For(0, myModel->FacesNb(), *this, !isParallel());
   amplifyEdges();
 
@@ -153,6 +154,7 @@ Standard_Boolean BRepMesh_ModelHealer::performInternal(
       aDFace->SetStatus(IMeshData_Failure);
     }
   }
+  OCCT_SEND_DUMPJSON (myModel.get())
 
   myFaceIntersectingEdges.Nullify();
   myModel.Nullify(); // Do not hold link to model.
@@ -497,3 +499,13 @@ Standard_Boolean BRepMesh_ModelHealer::connectClosestPoints(
 
   return Standard_True;
 }
+
+//=======================================================================
+// Function: DumpJson
+// Purpose : 
+//=======================================================================
+void BRepMesh_ModelHealer::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshTools_ModelAlgo)
+}
index 2e95c02da448cdb6124ce7ae401cf91e916cc487..80da43f168b10002d907eb182cf4fb076b7d1879 100644 (file)
@@ -54,6 +54,9 @@ public:
     process(theDFace);
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_ModelHealer, IMeshTools_ModelAlgo)
 
 protected:
index 23150517d5ba1d31bc22cc7ddd0a6d2a67177a41..b439d8ad6f9c1cf02cce2223c5db6f40f53e668c 100644 (file)
@@ -188,5 +188,6 @@ Standard_Boolean BRepMesh_ModelPostProcessor::performInternal(
 
   // TODO: Force single threaded solution due to data races on edges sharing the same TShape
   OSD_Parallel::For(0, theModel->EdgesNb(), PolygonCommitter(theModel), Standard_True/*!theParameters.InParallel*/);
+  OCCT_SEND_DUMPJSON (theModel.get())
   return Standard_True;
 }
index 129ba74b9e640fd80a0ba6b89f07f92f62e4fc28..9155c4cc00763521e52c37425cb0c5e69f1a38ef 100644 (file)
@@ -32,7 +32,12 @@ public:
   //! Destructor.
   Standard_EXPORT virtual ~BRepMesh_ModelPostProcessor();
 
-  DEFINE_STANDARD_RTTI_INLINE(BRepMesh_ModelPostProcessor, IMeshTools_ModelAlgo)
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshTools_ModelAlgo)
+  }
 
 protected:
 
index df9d9e48d937c8597f0f2b69ce2e612192221834..a98be672338e74e77f08db0573ef97a94094cb05 100644 (file)
@@ -309,6 +309,7 @@ Standard_Boolean BRepMesh_ModelPreProcessor::performInternal(
       }
     }
   }
+  OCCT_SEND_DUMPJSON (theModel.get())
 
   return Standard_True;
 }
index 031053aa38de5b6957e8b7ff669d7b87e3548257..488f61a504adc6cfc5058786c0f94a83818fdacb 100644 (file)
@@ -33,6 +33,13 @@ public:
   //! Destructor.
   Standard_EXPORT virtual ~BRepMesh_ModelPreProcessor();
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshTools_ModelAlgo)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_ModelPreProcessor, IMeshTools_ModelAlgo)
 
 protected:
index 976c1ba4a26bb7cf351334f8d4b11c40ce9e13a0..45766cc7b69b19602c217deedd347c2fbdc9fddd 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Macro.hxx>
 #include <BRepMesh_DegreeOfFreedom.hxx>
 
@@ -76,6 +77,16 @@ public:
     return IsEqual(Other);
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    (void)theDepth;
+    OCCT_DUMP_CLASS_BEGIN (theOStream, BRepMesh_OrientedEdge)
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirstNode)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLastNode)
+  }
+
 private:
 
   Standard_Integer myFirstNode;
index 81808bcf5fd04e15eba7573282741246ad803eea..61c76860f908891fe278a4e4d1446f8497db7538 100644 (file)
@@ -122,6 +122,16 @@ public:
     myIndex[1] = -1;
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    (void)theDepth;
+    OCCT_DUMP_CLASS_BEGIN (theOStream, BRepMesh_PairOfIndex)
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIndex[0])
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIndex[1])
+  }
+
 private:
   Standard_Integer myIndex[2];
 };
index 0705c13cf033df8af2b511496a4a276432b38c10..133071a2d47e71e313aa22968e1e1e4f09bb99f8 100644 (file)
@@ -32,6 +32,9 @@
 #include <IMeshData_Status.hxx>
 #include <IMeshTools_Context.hxx>
 #include <BRepTools.hxx>
+#include <Message_Level.hxx>
+#include <Message_Messenger.hxx>
+#include <TopoDS_AlertAttribute.hxx>
 
 //=======================================================================
 // Function: Constructor
@@ -59,6 +62,9 @@ void BRepMesh_ShapeVisitor::Visit(const TopoDS_Edge& theEdge)
 {
   if (!myDEdgeMap.IsBound (theEdge))
   {
+    OCCT_SEND_MESSAGE ("BRepMesh_ShapeVisitor::Visit edge")
+    OCCT_SEND_SHAPE (theEdge)
+
     myModel->AddEdge (theEdge);
     myDEdgeMap.Bind  (theEdge, myModel->EdgesNb () - 1);
   }
@@ -70,6 +76,9 @@ void BRepMesh_ShapeVisitor::Visit(const TopoDS_Edge& theEdge)
 //=======================================================================
 void BRepMesh_ShapeVisitor::Visit (const TopoDS_Face& theFace)
 {
+  OCCT_SEND_MESSAGE ("BRepMesh_ShapeVisitor::Visit face")
+  OCCT_SEND_SHAPE (theFace)
+
   BRepTools::Update(theFace);
   const IMeshData::IFaceHandle& aDFace = myModel->AddFace (theFace);
 
index 6cb531a56bd5355ded9554b6d9ab624355d8607c..731591755294a3b33aa4b8ae4c8f17a2f5404d9a 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Macro.hxx>
 
 #include <BRepMesh_DegreeOfFreedom.hxx>
@@ -138,6 +139,21 @@ public:
     return IsEqual(theOther);
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    (void)theDepth;
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myEdges[0])
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myEdges[1])
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myEdges[2])
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOrientations[0])
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOrientations[1])
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOrientations[2])
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMovability)
+  }
   Standard_Integer          myEdges[3];
   Standard_Boolean          myOrientations[3];
   BRepMesh_DegreeOfFreedom  myMovability;
index 73a31798ea1cbab104b6fea7d64a35fced18b16b..3eb23418f5d1e5b5459f67b965c7e44195efe189 100644 (file)
@@ -132,6 +132,15 @@ public:
     return IsEqual(Other);
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myUV)
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLocation3d)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMovability)
+  }
+
 private:
 
   gp_XY                     myUV;
index dfd51ae926c0f6838a63fdd73ee5cfd9b209dc55..e815f5b529d69cdbeab935149a465bf9b4514874 100644 (file)
@@ -149,6 +149,27 @@ public:
     return (theIndex == theTargetIndex);
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    OCCT_DUMP_CLASS_BEGIN (theOStream, BRepMesh_VertexInspector)
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIndex)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMinSqDist)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance[0])
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance[1])
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVertices->Length())
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDelNodes.Extent())
+
+    for (Standard_Integer anIt = 1; anIt <= myVertices->Length(); ++anIt)
+    {
+      BRepMesh_Vertex& aVertex = myVertices->ChangeValue(anIt - 1);
+      OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aVertex)
+    }
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPoint)
+  }
+
 private:
 
   Standard_Integer                  myIndex;
index fffa7ac4da535fcc5d435f3fcffe1950f9d8c17b..7613dac073014480459db57812503d9a4062cb8c 100644 (file)
@@ -134,3 +134,35 @@ void BRepMesh_VertexTool::Statistics(Standard_OStream& theStream) const
   theStream << "\nStructure Statistics\n---------------\n\n";
   theStream << "This structure has " << mySelector.NbVertices() << " Nodes\n\n";
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMesh_VertexTool::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  //OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCellFilter)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance[0])
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance[1])
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &mySelector)
+
+  const NCollection_Map<NCollection_CellFilter<BRepMesh_VertexInspector>::Cell>& aCells = myCellFilter.Cells();
+  const NCollection_Array1<Standard_Real>& aCellSizes = myCellFilter.CellSize();
+
+  for (NCollection_Map<NCollection_CellFilter<BRepMesh_VertexInspector>::Cell>::Iterator aCellsIt (aCells); aCellsIt.More(); aCellsIt.Next())
+  {
+    const NCollection_LocalArray<long, 10>& anIndex = aCellsIt.Value().index;
+
+    const std::size_t aDim = anIndex.Size();
+    TCollection_AsciiString anIndexPair;
+    for (std::size_t i = 0; i < aDim; ++i)
+    {
+      if (!anIndexPair.IsEmpty()) anIndexPair += ", ";
+      anIndexPair += TCollection_AsciiString (anIndex[i]);
+    }
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, anIndexPair)
+  }
+}
index 35aa778a8ac8b1554095ab464e308849ddcdcff4..166aa1ecfe8e9c290e06d1714879a7a2142e1f8d 100644 (file)
@@ -158,6 +158,10 @@ public:
   //! Prints statistics.
   Standard_EXPORT void Statistics(Standard_OStream& theStream) const;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMesh_VertexTool, Standard_Transient)
 
 private:
index ac427f994609d4f8b88c6ae5eb6599865356d188..bb1db87f48d8f7fb01dab55ecabbfb7375bd05eb 100644 (file)
@@ -124,3 +124,28 @@ void BRepMeshData_Curve::Clear(const Standard_Boolean isKeepEndPoints)
     myParameters.erase(myParameters.begin() + 1, myParameters.begin() + (myParameters.size() - 1));
   }
 }
+
+//=======================================================================
+// Function: DumpJson
+// Purpose : 
+//=======================================================================
+void BRepMeshData_Curve::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_Curve)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPoints.size())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myParameters.size())
+
+  for (IMeshData::Model::SequenceOfPnt::const_iterator aPointIt = myPoints.begin(); aPointIt != myPoints.end(); aPointIt++)
+  {
+    const gp_Pnt& aPoint = *aPointIt;
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aPoint)
+  }
+
+  for (IMeshData::Model::SequenceOfReal::const_iterator aParamIt = myParameters.begin(); aParamIt != myParameters.end(); aParamIt++)
+  {
+    Standard_Real aParameter = *aParamIt;
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aParameter)
+  }
+}
index 1566a4d916a2c2fc88a1ccd2d6cb943ffbf37e47..b006679fa9d169f0e1d0f6acc077670201f0f248 100644 (file)
@@ -60,6 +60,9 @@ public:
   //! Clears parameters list.
   Standard_EXPORT virtual void Clear(const Standard_Boolean isKeepEndPoints) Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Curve, IMeshData_Curve)
 
 protected:
index 67ce8228ff7b0454ebda2f074e4a3408daf1f5e4..8f36f5a1bd26d471c08760367877e74c36921b54 100644 (file)
@@ -100,3 +100,23 @@ const IMeshData::IPCurveHandle& BRepMeshData_Edge::GetPCurve (
 {
   return myPCurves (theIndex);
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMeshData_Edge::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_Edge)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPCurves.Size())
+  for (Standard_Integer aPCurveIt = 0; aPCurveIt < myPCurves.Size(); ++aPCurveIt)
+  {
+    const IMeshData::IPCurveHandle& aPCurve = myPCurves (aPCurveIt);
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aPCurve.get())
+  }
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPCurvesMap.Size())
+  //IMeshData::DMapOfIFacePtrsListOfInteger myPCurvesMap;
+}
index d30e550da71f4109fd2880dfd0f120bbc9ad695e..47d2d2090ab0dfeab6da0ad11847f2d007417f1d 100644 (file)
@@ -53,6 +53,9 @@ public:
   Standard_EXPORT virtual const IMeshData::IPCurveHandle& GetPCurve (
     const Standard_Integer theIndex) const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Edge, IMeshData_Edge)
 
 private:
index 2dca22c8a4c2a7844fc20734e582b6a5145b157d..597532321524ae585bda0ea344eb54dd3a171ca9 100644 (file)
@@ -70,3 +70,20 @@ const IMeshData::IWireHandle& BRepMeshData_Face::GetWire (
 {
   return myDWires (theIndex);
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMeshData_Face::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_Face)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDWires.Size())
+  for (int aWireIt = 0; aWireIt < myDWires.Size(); aWireIt++)
+  {
+    const IMeshData::IWireHandle& aWire = GetWire (aWireIt);
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aWire.get())
+  }
+}
index 1f187f7cea261548bb3405ab995f5e1fda2af4ca..d8f1bdbc1aa27e7ab283b6f18d9af62dd7261118 100644 (file)
@@ -47,6 +47,9 @@ public:
     const TopoDS_Wire&     theWire,
     const Standard_Integer theEdgeNb = 0) Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Face, IMeshData_Face)
 
 private:
index 08c07f8c96d9a6ff5067a981cef05d35420499e7..f430063617d562ff5784fdfe206fe55fac636728 100644 (file)
@@ -100,3 +100,33 @@ const IMeshData::IEdgeHandle& BRepMeshData_Model::GetEdge (const Standard_Intege
 {
   return myDEdges (theIndex);
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMeshData_Model::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_Model)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxSize)
+  if (!myDFaces.IsEmpty())
+  {
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDFaces.Size())
+    for (Standard_Integer aFaceIt = 0; aFaceIt < FacesNb(); ++aFaceIt)
+    {
+      const IMeshData::IFaceHandle& aFace = GetFace(aFaceIt);
+      OCCT_SEND_DUMPJSON (aFace.get())
+    }
+  }
+  if (!myDEdges.IsEmpty())
+  {
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDEdges.Size())
+    for (int anEdgeIt = 0; anEdgeIt < EdgesNb(); anEdgeIt++)
+    {
+      const IMeshData::IEdgeHandle& anEdge = GetEdge (anEdgeIt);
+      OCCT_SEND_DUMPJSON (anEdge.get())
+    }
+  }
+}
index 2b19684a73710d05dd0baf7a75f579a224238773..1bd2f541a16c5d253e2c9137b4edb758a53c7c94 100644 (file)
@@ -70,6 +70,9 @@ public: //! @name discrete edges
   //! Gets model's edge with the given index.
   Standard_EXPORT virtual const IMeshData::IEdgeHandle& GetEdge (const Standard_Integer theIndex) const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
 private:
 
   Standard_Real                     myMaxSize;
index 8139f6a84a08d0034b1777f4ef9a200a9b217ad0..c1529f341df4081667d60279ae0047b3b67a42e6 100644 (file)
@@ -84,3 +84,27 @@ TopAbs_Orientation BRepMeshData_Wire::GetEdgeOrientation (
 {
   return myDEdgesOri (theIndex);
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void BRepMeshData_Wire::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_Wire)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDEdges.Size())
+  for (int anEdgeId = 0; anEdgeId < myDEdges.Size(); anEdgeId++)
+  {
+    const IMeshData::IEdgePtr& anEdge = GetEdge (anEdgeId);
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anEdge)
+  }
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDEdgesOri.Size())
+  for (int anEdgeId = 0; anEdgeId < myDEdgesOri.Size(); anEdgeId++)
+  {
+    TopAbs_Orientation anEdgeOri = GetEdgeOrientation (anEdgeId);
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, &anEdgeOri)
+  }
+}
index bf55509684bf30f2b97e9089c3cecab381014c3d..a070b8a9da1003fb50f41cafe910064dacf9678e 100644 (file)
@@ -52,6 +52,9 @@ public:
   Standard_EXPORT virtual TopAbs_Orientation GetEdgeOrientation (
     const Standard_Integer theIndex) const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(BRepMeshData_Wire, IMeshData_Wire)
 
 private:
index 7019e58c9b8924e99636706352d1daad8be5bf6c..ca2a329090e482d77c3b6cfdc1861a6061f4888a 100644 (file)
@@ -174,6 +174,29 @@ Standard_Real GCPnts_TangentialDeflection::ArcAngularStep(
   return Du;
 }
 
+//=======================================================================
+// Function: DumpJson
+// Purpose : 
+//=======================================================================
+void GCPnts_TangentialDeflection::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, GCPnts_TangentialDeflection)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, angularDeflection)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, curvatureDeflection)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, uTol)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, minNbPnts)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMinLen)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, lastu)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, firstu)
+
+  if (!points.IsEmpty())
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, points.Length())
+
+  if (!parameters.IsEmpty())
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, parameters.Length())
+}
+
 #include <Geom_BezierCurve.hxx>
 #include <Geom_BSplineCurve.hxx>
 #include <gp_Circ.hxx>
index 0e66213137e127397ff546864fb4dae7d9bfba15..1134e1f2b1a86f4490e3a057c38f279aa8cb68a8 100644 (file)
@@ -114,6 +114,10 @@ public:
   //! Computes angular step for the arc using the given parameters.
   Standard_EXPORT static Standard_Real ArcAngularStep (const Standard_Real theRadius, const Standard_Real theLinearDeflection, const Standard_Real theAngularDeflection, const Standard_Real theMinLength);
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
+
 private:
   
   Standard_EXPORT void PerformLinear (const Adaptor3d_Curve& C);
index 390673cc31b7e93c5bf1ca28c1f0ed66fa99d14a..5e4f2dce3e76fc89dab80d715219d446145df88e 100644 (file)
@@ -999,3 +999,24 @@ Handle(Geom_OffsetCurve) GeomAdaptor_Curve::OffsetCurve() const
     throw Standard_NoSuchObject("GeomAdaptor_Curve::OffsetCurve");
   return Handle(Geom_OffsetCurve)::DownCast(myCurve);
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void GeomAdaptor_Curve::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, GeomAdaptor_Curve)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Adaptor3d_Curve)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCurve.get())
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTypeCurve)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirst)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLast)
+
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBSplineCurve.get())
+  //mutable Handle(BSplCLib_Cache) myCurveCache; ///< Cached data for B-spline or Bezier curve
+  //Handle(GeomEvaluator_Curve) myNestedEvaluator; ///< Calculates value of offset curve
+}
index 6e138872a689a3b4b57744e7b5bc3210e94d24ef..2b993bd9a0167457edf5c01876cde40b00c8affc 100644 (file)
@@ -213,6 +213,9 @@ public:
 
   Standard_EXPORT Handle(Geom_OffsetCurve) OffsetCurve() const Standard_OVERRIDE;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
 friend class GeomAdaptor_Surface;
 
 
index 621220dae06657b08b1d00d2d08f3957f02ff9b6..ac2cdb909b4666306a940fc8de4ca3aa65439d89 100644 (file)
@@ -1439,3 +1439,30 @@ void GeomAdaptor_Surface::Span(const Standard_Integer Side,
     } 
   }
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void GeomAdaptor_Surface::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_CLASS_BEGIN (theOStream, GeomAdaptor_Surface)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Adaptor3d_Surface)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get())
+
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUFirst)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myULast)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVFirst)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVLast)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolU)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolV)
+
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBSplineSurface.get())
+  //mutable Handle(BSplSLib_Cache) mySurfaceCache; ///< Cached data for B-spline or Bezier surface
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySurfaceType)
+  //Handle(GeomEvaluator_Surface) myNestedEvaluator; ///< Calculates values of nested complex surfaces (offset surface, surface of extrusion or revolution)
+}
index 2f0d4838c3e49cad4beada9282aa7f0547888c62..7d1e0f4f7b9a611d21701846ca1c7b9ad36378d3 100644 (file)
@@ -239,7 +239,8 @@ public:
   
   Standard_EXPORT Standard_Real OffsetValue() const Standard_OVERRIDE;
 
-
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
 
 protected:
index 505efad26227ca534f719116d29df1acfcf5001d..f9b4f0ce017023f880fe0f788f386ea2ccb5111d 100644 (file)
@@ -17,6 +17,7 @@
 #define _IMeshData_Curve_HeaderFile
 
 #include <IMeshData_ParametersList.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 
 class gp_Pnt;
@@ -49,6 +50,14 @@ public:
   //! Removes point with the given index.
   Standard_EXPORT virtual void RemovePoint (const Standard_Integer theIndex) = 0;
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_ParametersList)
+  }
+
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshData_Curve, IMeshData_ParametersList)
 
 protected:
index 162d2a20fa908b7803131116dd2f810026110997..b51f75edb15d82df4285ffa51a96905a62b589c6 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <IMeshData_TessellatedShape.hxx>
 #include <IMeshData_StatusOwner.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS.hxx>
@@ -25,6 +26,8 @@
 #include <IMeshData_PCurve.hxx>
 #include <IMeshData_Types.hxx>
 #include <BRep_Tool.hxx>
+#include <Message_Level.hxx>
+#include <Message_Messenger.hxx>
 
 class IMeshData_Face;
 
@@ -140,6 +143,20 @@ public:
     myDegenerated = theValue;
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_TessellatedShape)
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySameParam)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySameRange)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDegenerated)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAngDeflection)
+
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCurve.get())
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshData_Edge, IMeshData_TessellatedShape)
 
 protected:
index 4db215de1ac92cfe94491d807142bea2dfa4c937..df490b2e239d2f7437613399b3ca9f5b605d065b 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <IMeshData_TessellatedShape.hxx>
 #include <IMeshData_StatusOwner.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopoDS.hxx>
@@ -72,6 +73,15 @@ public:
             IsEqual(IMeshData_UnorientedWire));
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_TessellatedShape)
+
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get())
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshData_Face, IMeshData_TessellatedShape)
 
 protected:
index 773ab6e9736d1f31f1a12d06191b916248794a68..89a96047a9a145a43fe2676a5206512dcd7806d4 100644 (file)
@@ -17,6 +17,7 @@
 #define _IMeshData_Model_HeaderFile
 
 #include <IMeshData_Shape.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 #include <TopoDS_Shape.hxx>
 #include <IMeshData_Types.hxx>
@@ -63,6 +64,13 @@ public: //! @name discrete edges
   //! Gets model's edge with the given index.
   Standard_EXPORT virtual const IMeshData::IEdgeHandle& GetEdge (const Standard_Integer theIndex) const = 0;
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_Shape)
+  }
+
 protected:
 
   //! Constructor.
index 4c6530cf0e1d13a619d83741029fc8f28c4987df..81959888266ae9cb44c7e155144d14f5fe2fc793 100644 (file)
@@ -17,6 +17,7 @@
 #define _IMeshData_PCurve_HeaderFile
 
 #include <IMeshData_ParametersList.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 #include <IMeshData_Face.hxx>
 
@@ -77,6 +78,16 @@ public:
     return myDFace;
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_ParametersList)
+
+    OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myDFace)
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOrientation)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshData_PCurve, IMeshData_ParametersList)
 
 protected:
index 8190fd2f320bd475067ae69751804b1f7997085d..7dad861787e4de925e98ef66ab597933cf3a2a07 100644 (file)
@@ -17,6 +17,7 @@
 #define _IMeshData_ParametersList_HeaderFile
 
 #include <Standard_Transient.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 
 //! Interface class representing list of parameters on curve.
@@ -38,6 +39,13 @@ public:
   //! Clears parameters list.
   Standard_EXPORT virtual void Clear(const Standard_Boolean isKeepEndPoints) = 0;
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    (void)theDepth;
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshData_ParametersList, Standard_Transient)
 
 protected:
index eb5100a42a72b107dbc8030abe31a960decaf679..fe11013e5ba4a494a83a20b7cf40245b4f4d06e0 100644 (file)
@@ -17,6 +17,7 @@
 #define _IMeshData_Shape_HeaderFile
 
 #include <Standard_Type.hxx>
+#include <Standard_Dump.hxx>
 #include <TopoDS_Shape.hxx>
 
 //! Interface class representing model with associated TopoDS_Shape.
@@ -43,6 +44,13 @@ public:
     return myShape;
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myShape)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshData_Shape, Standard_Transient)
 
 protected:
index 94001b032d85cb08591ea31d6acaade9b9c9271c..ab62fe63c2927b20a4c168bafd6805bbbcd6c04c 100644 (file)
@@ -17,6 +17,7 @@
 #define _IMeshData_TessellatedShape_HeaderFile
 
 #include <IMeshData_Shape.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 #include <TopoDS_Shape.hxx>
 
@@ -42,6 +43,16 @@ public:
     myDeflection = theValue;
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_Shape)
+
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDeflection)
+  }
+
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshData_TessellatedShape, IMeshData_Shape)
 
 protected:
index e2c2634f71a81e913e911b68c392e4672d3326a7..4e9314fccf93b1f7fd4b7aa7a5c839cfbd9ba334 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <IMeshData_TessellatedShape.hxx>
 #include <IMeshData_StatusOwner.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 #include <TopoDS_Wire.hxx>
 #include <TopoDS.hxx>
@@ -59,6 +60,13 @@ public:
   Standard_EXPORT virtual TopAbs_Orientation GetEdgeOrientation (
     const Standard_Integer theIndex) const = 0;
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_TessellatedShape)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshData_Wire, IMeshData_TessellatedShape)
 
 protected:
index e582bc1d1b462e41b1f5252a5d58d4e7af538bfc..579ebd6d0bf63239da25041b74bbff313b2e080a 100644 (file)
@@ -1,3 +1,4 @@
+IMeshTools_Context.cxx
 IMeshTools_Context.hxx
 IMeshTools_CurveTessellator.hxx
 IMeshTools_MeshAlgo.hxx
@@ -7,6 +8,7 @@ IMeshTools_MeshBuilder.cxx
 IMeshTools_ModelAlgo.hxx
 IMeshTools_ModelBuilder.hxx
 IMeshTools_Parameters.hxx
+IMeshTools_Parameters.cxx
 IMeshTools_ShapeExplorer.hxx
 IMeshTools_ShapeExplorer.cxx
 IMeshTools_ShapeVisitor.hxx
diff --git a/src/IMeshTools/IMeshTools_Context.cxx b/src/IMeshTools/IMeshTools_Context.cxx
new file mode 100644 (file)
index 0000000..803a862
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright (c) 2019 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <IMeshTools_Context.hxx>
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void IMeshTools_Context::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, IMeshData_Shape)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myModelBuilder.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myModel.get())
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myEdgeDiscret.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myModelHealer.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPreProcessor.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myFaceDiscret.get())
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPostProcessor.get())
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParameters)
+}
+
index fe77996c2e40e19cbacca0d5cc141d6fc9a584b5..401c5ef0b6ebd333c189d40d926800e37adeae61 100644 (file)
@@ -23,6 +23,9 @@
 #include <IMeshTools_Parameters.hxx>
 #include <IMeshTools_ModelAlgo.hxx>
 
+#include <Message_Level.hxx>
+#include <Message_Messenger.hxx>
+
 //! Interface class representing context of BRepMesh algorithm.
 //! Intended to cache discrete model and instances of tools for 
 //! its processing.
@@ -63,6 +66,9 @@ public:
       return Standard_False;
     }
 
+    OCCT_ADD_MESSAGE_LEVEL_SENTRY
+    OCCT_SEND_MESSAGE ("DiscretizeEdges")
+
     // Discretize edges of a model.
     return myEdgeDiscret->Perform(myModel, myParameters);
   }
@@ -77,6 +83,8 @@ public:
       return Standard_False;
     }
 
+    OCCT_ADD_MESSAGE_LEVEL_SENTRY
+    OCCT_SEND_MESSAGE ("HealModel")
     return myModelHealer.IsNull() ?
       Standard_True :
       myModelHealer->Perform(myModel, myParameters);
@@ -92,6 +100,8 @@ public:
       return Standard_False;
     }
 
+    OCCT_ADD_MESSAGE_LEVEL_SENTRY
+    OCCT_SEND_MESSAGE ("PreProcessModel")
     return myPreProcessor.IsNull() ? 
       Standard_True :
       myPreProcessor->Perform(myModel, myParameters);
@@ -106,6 +116,8 @@ public:
       return Standard_False;
     }
 
+    OCCT_ADD_MESSAGE_LEVEL_SENTRY
+    OCCT_SEND_MESSAGE ("DiscretizeFaces")
     // Discretize faces of a model.
     return myFaceDiscret->Perform(myModel, myParameters);
   }
@@ -119,6 +131,8 @@ public:
       return Standard_False;
     }
 
+    OCCT_ADD_MESSAGE_LEVEL_SENTRY
+    OCCT_SEND_MESSAGE ("PostProcessModel")
     return myPostProcessor.IsNull() ?
       Standard_True :
       myPostProcessor->Perform(myModel, myParameters);
@@ -223,6 +237,9 @@ public:
     return myModel;
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshTools_Context, IMeshData_Shape)
 
 private:
index 2cbd66bfd69841db28a991c5b66939df75368264..b112a3496a09f4dd849acbf8ac943f7b8589f25a 100644 (file)
@@ -17,6 +17,7 @@
 #define _IMeshTools_EdgeTessellator_HeaderFile
 
 #include <Standard_Transient.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 
 class gp_Pnt;
@@ -44,6 +45,13 @@ public:
     gp_Pnt&                thePoint,
     Standard_Real&         theParameter) const = 0;
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    (void)theDepth;
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshTools_CurveTessellator, Standard_Transient)
 
 protected:
index fb8e0b6d49f620d3dbaf4a9d8fe26d58e0c1f7de..dc171575236a033ef021c693c56fe5cdd4716788 100644 (file)
@@ -17,6 +17,7 @@
 #define _IMeshTools_MeshAlgo_HeaderFile
 
 #include <Standard_Transient.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 #include <IMeshData_Types.hxx>
 
@@ -37,6 +38,13 @@ public:
     const IMeshData::IFaceHandle& theDFace,
     const IMeshTools_Parameters&  theParameters) = 0;
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    (void)theDepth;
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshTools_MeshAlgo, Standard_Transient)
 
 protected:
index 3b67a6c7985f51da16e72f775c500914d325221e..4242aa639a2ef96d9f45cc9d8d4d9bd4daa291fa 100644 (file)
@@ -15,6 +15,8 @@
 
 #include <IMeshTools_MeshBuilder.hxx>
 #include <IMeshData_Face.hxx>
+#include <Message_Level.hxx>
+#include <Message_Messenger.hxx>
 #include <OSD_Parallel.hxx>
 
 //=======================================================================
@@ -58,6 +60,9 @@ void IMeshTools_MeshBuilder::Perform ()
     return;
   }
 
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("IMeshTools_MeshBuilder::Perform")
+
   if (aContext->BuildModel ())
   {
     if (aContext->DiscretizeEdges ())
@@ -116,3 +121,15 @@ void IMeshTools_MeshBuilder::Perform ()
 
   aContext->Clean ();
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void IMeshTools_MeshBuilder::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Message_Algorithm)
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myContext.get())
+}
index 8c0d314224fbf19432bcfe36a619b0be3a7f4f30..e94a4df41cf3adbab381a9f541146f216cc62b49 100644 (file)
@@ -64,6 +64,9 @@ public:
   //! Performs meshing ot the shape using current context.
   Standard_EXPORT virtual void Perform ();
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshTools_MeshBuilder, Message_Algorithm)
 
 private:
index 963c880c7559175cfb80228b9d4fdcbb306d6cbd..4dd99675f3144af6bb793ba36453bd22960c3f73 100644 (file)
@@ -20,6 +20,7 @@
 #include <Standard_Failure.hxx>
 #include <Standard_Transient.hxx>
 #include <Standard_Type.hxx>
+#include <Standard_Dump.hxx>
 
 class IMeshData_Model;
 struct IMeshTools_Parameters;
@@ -51,6 +52,13 @@ public:
     }
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+  {
+    (void)theDepth;
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshTools_ModelAlgo, Standard_Transient)
 
 protected:
index 5d6d4169325d65bf87e6fecc5b9eb068f3f96586..4146dfc13763677e9c927b0c5ff8eec8c27be2ca 100644 (file)
@@ -19,6 +19,7 @@
 #include <Message_Algorithm.hxx>
 #include <Standard_ErrorHandler.hxx>
 #include <Standard_Failure.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_Type.hxx>
 #include <TopoDS_Shape.hxx>
 
@@ -61,6 +62,13 @@ public:
     }
   }
 
+  //! Dumps the content of me into the stream
+  virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE
+  {
+    OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+    OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Message_Algorithm)
+  }
+
   DEFINE_STANDARD_RTTI_INLINE(IMeshTools_ModelBuilder, Message_Algorithm)
 
 protected:
diff --git a/src/IMeshTools/IMeshTools_Parameters.cxx b/src/IMeshTools/IMeshTools_Parameters.cxx
new file mode 100644 (file)
index 0000000..a6ee5ea
--- /dev/null
@@ -0,0 +1,38 @@
+// Created on: 2016-04-07
+// Copyright (c) 2016 OPEN CASCADE SAS
+// Created by: Oleg AGASHIN
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <IMeshTools_Parameters.hxx>
+#include <Standard_Dump.hxx>
+
+//=======================================================================
+// Function: Constructor
+// Purpose : 
+//=======================================================================
+void IMeshTools_Parameters::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Angle)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Deflection)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, AngleInterior)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, DeflectionInterior)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MinSize)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, InParallel)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Relative)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, InternalVerticesMode)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ControlSurfaceDeflection)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, CleanModel)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, AdjustMinSize)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ForceFaceDeflection)
+}
index 17c35911132ce71c8c72360be30b5328ed423b3c..4f47d56f4bc94244d9021df7ae17d6fe4af75a98 100644 (file)
@@ -47,6 +47,9 @@ struct IMeshTools_Parameters {
     return 0.1;
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
   //! Angular deflection used to tessellate the boundary edges
   Standard_Real                                    Angle;
 
index a6214ee7004ec2f1d1ab82dd69319f04c98416d2..dd6397ea90fc34c4956828bd8b98d92f54dad330 100644 (file)
@@ -24,6 +24,8 @@
 #include <BRep_Tool.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <Geom_Surface.hxx>
+#include <Message_Level.hxx>
+#include <Message_Messenger.hxx>
 
 namespace
 {
@@ -79,11 +81,16 @@ IMeshTools_ShapeExplorer::~IMeshTools_ShapeExplorer ()
 void IMeshTools_ShapeExplorer::Accept (
   const Handle (IMeshTools_ShapeVisitor)& theVisitor)
 {
+  OCCT_ADD_MESSAGE_LEVEL_SENTRY
+  OCCT_SEND_MESSAGE ("IMeshTools_ShapeExplorer::Accept")
+
   // Explore all free edges in shape.
+  OCCT_SEND_MESSAGE ("visit free edges")
   visitEdges (theVisitor, GetShape (), Standard_True, TopAbs_EDGE, TopAbs_FACE);
 
   // Explore all related to some face edges in shape.
   // make array of faces suitable for processing (excluding faces without surface)
+  OCCT_SEND_MESSAGE ("explore all related to some face edges in shape")
   TopTools_ListOfShape aFaceList;
   BRepLib::ReverseSortFaces (GetShape (), aFaceList);
   TopTools_MapOfShape aFaceMap;
index df663d35673a4c22d6100599494bcc6252909fab..898b560c1a66019d714bb0de73b9077e082d52da 100644 (file)
@@ -431,3 +431,22 @@ TCollection_ExtendedString Message_Algorithm::PrepareReport
   }
   return aNewReport;
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void Message_Algorithm::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myStatus)
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMessenger)
+
+  if (!myReportIntegers.IsNull())
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myReportIntegers->Length())
+  if (!myReportStrings.IsNull())
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myReportStrings->Length())
+  if (!myReportMessages.IsNull())
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myReportMessages->Length())
+}
index 8b8df3a378fafc7adb6932659cf935143524abaf..3637133821ac196771746c028aef1d2858241508 100644 (file)
@@ -197,6 +197,9 @@ public:
   //! in theReportSeq sequence, but not more than theMaxCount
   Standard_EXPORT static TCollection_ExtendedString PrepareReport (const TColStd_SequenceOfHExtendedString& theReportSeq, const Standard_Integer theMaxCount);
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
 
 
 
index dc447eabb92786a354d99cb9941651a05ce251ec..c02cff447b34e664c4c2774286d2c6f4c5014db5 100644 (file)
@@ -237,7 +237,7 @@ public: // work-around against obsolete SUN WorkShop 5.3 compiler
 #else
 protected:
 #endif
+  public:
   /**
    * Auxiliary class for storing points belonging to the cell as the list
    */
@@ -317,6 +317,8 @@ protected:
       return Standard_True;
     }
 
+    const NCollection_LocalArray<long, 10>& Index() const { return index; }
+
     //! Returns hash code for this cell, in the range [1, theUpperBound]
     //! @param theUpperBound the upper bound of the range a computing hash code must be within
     //! @return a computed hash code, in the range [1, theUpperBound]
@@ -340,6 +342,9 @@ protected:
     ListNode *Objects;
   };
   
+  const NCollection_Map<Cell>& Cells() const { return myCells; }
+  const NCollection_Array1<Standard_Real>& CellSize() const { return myCellSize; }
+
   //! Returns hash code for the given cell, in the range [1, theUpperBound]
   //! @param theCell the cell object which hash code is to be computed
   //! @param theUpperBound the upper bound of the range a computing hash code must be within
index 82489573d790f8d198c8b559f8b3244a2df6c6b3..555686d046a2468d79f6943d535bc9fee761e5cf 100644 (file)
@@ -29,7 +29,7 @@ void TopoDS_TShape::DumpJson (Standard_OStream& theOStream, Standard_Integer) co
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
-  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this)
+  //OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this)
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ShapeType())
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbChildren())
index bd859ac98a0f41eb1ef0bf1fe5fb409c6a464ddc..3d56c37924c82ef6f0963353d69d00194fffe199 100644 (file)
@@ -51,3 +51,8 @@ gp_Circ gp_Circ::Mirrored (const gp_Ax2& A2) const
   return C; 
 }
 
+void gp_Circ::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &pos)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, radius)
+}
index 13477551688ce4e639a6fb6c86231a087f4b8145..4de36c87df0293ebd65032c5afc41bde4e2e9e06 100644 (file)
@@ -207,6 +207,8 @@ public:
   //! Translates a circle from the point P1 to the point P2.
     Standard_NODISCARD gp_Circ Translated (const gp_Pnt& P1, const gp_Pnt& P2) const;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index b91d56cd5b655bf28a6a2ff75bd9925b2867ded7..5678894f8669466f27001ee37af57cff4177f27c 100644 (file)
@@ -69,3 +69,8 @@ gp_Lin gp_Lin::Mirrored (const gp_Ax2& A2) const
   return L;
 }
 
+void gp_Lin::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  pos.DumpJson (theOStream, theDepth);
+}
+
index 94de6a7bf4d3805bfb038ba4aee5c45272dcf0a3..7eb026882b0bf30f42db0cf0c8d4407d1f4d813e 100644 (file)
@@ -185,6 +185,8 @@ public:
   //! Translates a line from the point P1 to the point P2.
     Standard_NODISCARD gp_Lin Translated (const gp_Pnt& P1, const gp_Pnt& P2) const;
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
 
 
index 5b93d5805319310b87dec0fc77884aaa8876d5c4..78a2563a7d9e633d4c1e3c852480c375de08581b 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <gp_Mat2d.hxx>
 #include <gp_XY.hxx>
+#include <Standard_Dump.hxx>
 #include <Standard_ConstructionError.hxx>
 #include <Standard_OutOfRange.hxx>
 
@@ -31,3 +32,24 @@ Standard_Boolean gp_XY::IsEqual (const gp_XY& Other,
   return Standard_True;
 }
 
+//=======================================================================
+//function : DumpJson
+//purpose  : 
+//=======================================================================
+void gp_XY::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_VECTOR_CLASS (theOStream, "gp_XY", 2, x, y)
+}
+
+//=======================================================================
+//function : InitFromJson
+//purpose  : 
+//=======================================================================
+Standard_Boolean gp_XY::InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
+{
+  Standard_Integer aPos = theStreamPos;
+  OCCT_INIT_VECTOR_CLASS (theSStream, "gp_XY", aPos, 2, &x, &y)
+
+  theStreamPos = aPos;
+  return Standard_True;
+}
index 254fce65f9e16c2329c200368ed9cb76d807d2a2..9afaedc1259e9d9ce465e55d4ef47065a558a40b 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Real.hxx>
 #include <Standard_Integer.hxx>
 #include <Standard_Boolean.hxx>
+#include <Standard_OStream.hxx>
+#include <Standard_SStream.hxx>
 class Standard_ConstructionError;
 class Standard_OutOfRange;
 class gp_Mat2d;
@@ -268,6 +270,11 @@ public:
   return Subtracted(Right);
 }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
+  //! Inits the content of me into the stream
+  Standard_EXPORT Standard_Boolean InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos);