From de110cb5d60eacbb4ff1a2e13b3392d6fa97d9b4 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 17 Jan 2020 09:45:11 +0300 Subject: [PATCH] 0030268: Inspectors - improvements in VInspector plugin # dump for curve/surface 2d brep structures --- src/BRep/BRep_PointOnCurveOnSurface.cxx | 2 +- src/BRep/BRep_PointOnCurveOnSurface.hxx | 2 ++ src/BRep/BRep_PointsOnSurface.cxx | 14 +++++++++++ src/BRep/BRep_TVertex.cxx | 14 +---------- src/Geom2d/Geom2d_BSplineCurve.cxx | 32 +++++++++++++++++++++++++ src/Geom2d/Geom2d_BSplineCurve.hxx | 2 ++ src/Geom2d/Geom2d_BezierCurve.cxx | 21 ++++++++++++++++ src/Geom2d/Geom2d_BezierCurve.hxx | 2 ++ src/Geom2d/Geom2d_BoundedCurve.cxx | 14 ++++++++++- src/Geom2d/Geom2d_BoundedCurve.hxx | 2 ++ src/Geom2d/Geom2d_CartesianPoint.cxx | 8 +++++++ src/Geom2d/Geom2d_CartesianPoint.hxx | 2 ++ src/Geom2d/Geom2d_Circle.cxx | 13 ++++++++++ src/Geom2d/Geom2d_Circle.hxx | 2 ++ src/Geom2d/Geom2d_Conic.cxx | 14 +++++++++++ src/Geom2d/Geom2d_Conic.hxx | 2 ++ src/Geom2d/Geom2d_Curve.cxx | 12 ++++++++++ src/Geom2d/Geom2d_Curve.hxx | 2 ++ src/Geom2d/Geom2d_Ellipse.cxx | 15 ++++++++++++ src/Geom2d/Geom2d_Ellipse.hxx | 2 ++ src/Geom2d/Geom2d_Hyperbola.cxx | 15 ++++++++++++ src/Geom2d/Geom2d_Hyperbola.hxx | 2 ++ src/Geom2d/Geom2d_Line.cxx | 12 ++++++++++ src/Geom2d/Geom2d_Line.hxx | 2 ++ src/Geom2d/Geom2d_OffsetCurve.cxx | 18 ++++++++++++++ src/Geom2d/Geom2d_OffsetCurve.hxx | 2 ++ src/Geom2d/Geom2d_Parabola.cxx | 12 ++++++++++ src/Geom2d/Geom2d_Parabola.hxx | 2 ++ src/Geom2d/Geom2d_Point.cxx | 12 ++++++++++ src/Geom2d/Geom2d_Point.hxx | 2 ++ src/Geom2d/Geom2d_TrimmedCurve.cxx | 15 ++++++++++++ src/Geom2d/Geom2d_TrimmedCurve.hxx | 2 ++ src/gp/gp_Ax22d.cxx | 8 +++++++ src/gp/gp_Ax22d.hxx | 2 ++ 34 files changed, 268 insertions(+), 15 deletions(-) diff --git a/src/BRep/BRep_PointOnCurveOnSurface.cxx b/src/BRep/BRep_PointOnCurveOnSurface.cxx index 63d609a365..5372b18b2a 100644 --- a/src/BRep/BRep_PointOnCurveOnSurface.cxx +++ b/src/BRep/BRep_PointOnCurveOnSurface.cxx @@ -95,6 +95,6 @@ void BRep_PointOnCurveOnSurface::DumpJson (Standard_OStream& theOStream, const S OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_PointRepresentation); - OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySurface.get()); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPCurve.get()); } diff --git a/src/BRep/BRep_PointOnCurveOnSurface.hxx b/src/BRep/BRep_PointOnCurveOnSurface.hxx index 73eeec8361..c833658177 100644 --- a/src/BRep/BRep_PointOnCurveOnSurface.hxx +++ b/src/BRep/BRep_PointOnCurveOnSurface.hxx @@ -50,6 +50,8 @@ public: Standard_EXPORT virtual void PCurve (const Handle(Geom2d_Curve)& C) Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/BRep/BRep_PointsOnSurface.cxx b/src/BRep/BRep_PointsOnSurface.cxx index 740a09abc6..c2189a424b 100644 --- a/src/BRep/BRep_PointsOnSurface.cxx +++ b/src/BRep/BRep_PointsOnSurface.cxx @@ -56,4 +56,18 @@ void BRep_PointsOnSurface::Surface(const Handle(Geom_Surface)& S) mySurface = S; } +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void BRep_PointsOnSurface::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, BRep_PointsOnSurface); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, BRep_PointRepresentation); + + OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get()); +} + diff --git a/src/BRep/BRep_TVertex.cxx b/src/BRep/BRep_TVertex.cxx index ff5fb6a523..73e59fd1d3 100644 --- a/src/BRep/BRep_TVertex.cxx +++ b/src/BRep/BRep_TVertex.cxx @@ -56,19 +56,7 @@ void BRep_TVertex::DumpJson (Standard_OStream& theOStream, const Standard_Intege { OCCT_DUMP_CLASS_BEGIN (theOStream, BRep_TVertex); - OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TopoDS_TEdge); - - OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance); - OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFlags); - - BRep_ListIteratorOfListOfCurveRepresentation itr(myCurves); - while (itr.More()) - { - Handle(BRep_CurveRepresentation) aCurveRepresentation = itr.Value(); - OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aCurveRepresentation.get()); - - itr.Next(); - } + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TopoDS_TVertex); OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPnt); OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance); diff --git a/src/Geom2d/Geom2d_BSplineCurve.cxx b/src/Geom2d/Geom2d_BSplineCurve.cxx index 1cca78c900..bc8ca8f30a 100644 --- a/src/Geom2d/Geom2d_BSplineCurve.cxx +++ b/src/Geom2d/Geom2d_BSplineCurve.cxx @@ -1238,3 +1238,35 @@ void Geom2d_BSplineCurve::PeriodicNormalization(Standard_Real& Parameter) const } } +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_BSplineCurve::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_BSplineCurve); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_BoundedCurve); + + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, rational); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, periodic); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, knotSet); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, smooth); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, deg); + if (!poles.IsNull()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, poles->Size()); + + if (!weights.IsNull()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, weights->Size()); + if (!flatknots.IsNull()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, flatknots->Size()); + if (!knots.IsNull()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, knots->Size()); + if (!mults.IsNull()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mults->Size()); + + + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, maxderivinv); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, maxderivinvok); +} diff --git a/src/Geom2d/Geom2d_BSplineCurve.hxx b/src/Geom2d/Geom2d_BSplineCurve.hxx index 822ded7de1..f6d023fdf9 100644 --- a/src/Geom2d/Geom2d_BSplineCurve.hxx +++ b/src/Geom2d/Geom2d_BSplineCurve.hxx @@ -817,6 +817,8 @@ public: //! Creates a new object which is a copy of this BSpline curve. Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_BezierCurve.cxx b/src/Geom2d/Geom2d_BezierCurve.cxx index 38250afe44..9d8841ca1a 100644 --- a/src/Geom2d/Geom2d_BezierCurve.cxx +++ b/src/Geom2d/Geom2d_BezierCurve.cxx @@ -822,3 +822,24 @@ void Geom2d_BezierCurve::Init weights.Nullify(); } +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_BezierCurve::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_BezierCurve); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_BoundedCurve); + + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, rational); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, closed); + if (!poles.IsNull()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, poles->Size()); + if (!weights.IsNull()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, weights->Size()); + + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, maxderivinv); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, maxderivinvok); +} diff --git a/src/Geom2d/Geom2d_BezierCurve.hxx b/src/Geom2d/Geom2d_BezierCurve.hxx index 0d61dc4b45..162bd87638 100644 --- a/src/Geom2d/Geom2d_BezierCurve.hxx +++ b/src/Geom2d/Geom2d_BezierCurve.hxx @@ -320,6 +320,8 @@ public: //! Creates a new object which is a copy of this Bezier curve. Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_BoundedCurve.cxx b/src/Geom2d/Geom2d_BoundedCurve.cxx index eebd15e9a2..2bc706663a 100644 --- a/src/Geom2d/Geom2d_BoundedCurve.cxx +++ b/src/Geom2d/Geom2d_BoundedCurve.cxx @@ -19,4 +19,16 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(Geom2d_BoundedCurve,Geom2d_Curve) \ No newline at end of file +IMPLEMENT_STANDARD_RTTIEXT(Geom2d_BoundedCurve,Geom2d_Curve) + +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_BoundedCurve::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_BoundedCurve); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Curve); +} diff --git a/src/Geom2d/Geom2d_BoundedCurve.hxx b/src/Geom2d/Geom2d_BoundedCurve.hxx index fae7b0ea01..43029d698a 100644 --- a/src/Geom2d/Geom2d_BoundedCurve.hxx +++ b/src/Geom2d/Geom2d_BoundedCurve.hxx @@ -61,6 +61,8 @@ public: //! "FirstParameter" of the curve. Standard_EXPORT virtual gp_Pnt2d StartPoint() const = 0; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_CartesianPoint.cxx b/src/Geom2d/Geom2d_CartesianPoint.cxx index f643c7f2ff..da9f87eeee 100644 --- a/src/Geom2d/Geom2d_CartesianPoint.cxx +++ b/src/Geom2d/Geom2d_CartesianPoint.cxx @@ -72,3 +72,11 @@ void Geom2d_CartesianPoint::Transform (const Trsf2d& T) { gpPnt2d.Transform (T); } + +void Geom2d_CartesianPoint::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_CartesianPoint); + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Point); + + OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &gpPnt2d); +} diff --git a/src/Geom2d/Geom2d_CartesianPoint.hxx b/src/Geom2d/Geom2d_CartesianPoint.hxx index c4929f6103..4164289fd4 100644 --- a/src/Geom2d/Geom2d_CartesianPoint.hxx +++ b/src/Geom2d/Geom2d_CartesianPoint.hxx @@ -76,6 +76,8 @@ public: Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_Circle.cxx b/src/Geom2d/Geom2d_Circle.cxx index 3bac3eb3ec..ea6b13c915 100644 --- a/src/Geom2d/Geom2d_Circle.cxx +++ b/src/Geom2d/Geom2d_Circle.cxx @@ -263,3 +263,16 @@ void Geom2d_Circle::Transform (const Trsf2d& T) radius = radius * Abs(T.ScaleFactor()); pos.Transform (T); } + +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_Circle::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_Circle); + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Conic); + + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, radius); +} diff --git a/src/Geom2d/Geom2d_Circle.hxx b/src/Geom2d/Geom2d_Circle.hxx index 76e55766e4..c1c69b9a4b 100644 --- a/src/Geom2d/Geom2d_Circle.hxx +++ b/src/Geom2d/Geom2d_Circle.hxx @@ -155,6 +155,8 @@ public: //! Creates a new object which is a copy of this circle. Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_Conic.cxx b/src/Geom2d/Geom2d_Conic.cxx index 51eeea6c38..424e7a7fb8 100644 --- a/src/Geom2d/Geom2d_Conic.cxx +++ b/src/Geom2d/Geom2d_Conic.cxx @@ -145,3 +145,17 @@ Standard_Boolean Geom2d_Conic::IsCN (const Standard_Integer ) const { return Standard_True; } + +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_Conic::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_Conic); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Curve); + + OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &pos); +} diff --git a/src/Geom2d/Geom2d_Conic.hxx b/src/Geom2d/Geom2d_Conic.hxx index d37eb9a841..048e9edcde 100644 --- a/src/Geom2d/Geom2d_Conic.hxx +++ b/src/Geom2d/Geom2d_Conic.hxx @@ -124,6 +124,8 @@ public: //! Returns True, the order of continuity of a conic is infinite. Standard_EXPORT Standard_Boolean IsCN (const Standard_Integer N) const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_Curve.cxx b/src/Geom2d/Geom2d_Curve.cxx index 59ed0848eb..21e629c83b 100644 --- a/src/Geom2d/Geom2d_Curve.cxx +++ b/src/Geom2d/Geom2d_Curve.cxx @@ -88,3 +88,15 @@ gp_Pnt2d Geom2d_Curve::Value(const Standard_Real U)const D0(U,P); return P; } + +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_Curve::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_Curve); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Geometry); +} diff --git a/src/Geom2d/Geom2d_Curve.hxx b/src/Geom2d/Geom2d_Curve.hxx index f12036a659..19bba62151 100644 --- a/src/Geom2d/Geom2d_Curve.hxx +++ b/src/Geom2d/Geom2d_Curve.hxx @@ -224,6 +224,8 @@ public: //! are parallel. Standard_EXPORT gp_Pnt2d Value (const Standard_Real U) const; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_Ellipse.cxx b/src/Geom2d/Geom2d_Ellipse.cxx index e9dbbbc6fb..19158cf159 100644 --- a/src/Geom2d/Geom2d_Ellipse.cxx +++ b/src/Geom2d/Geom2d_Ellipse.cxx @@ -383,3 +383,18 @@ void Geom2d_Ellipse::Transform (const Trsf2d& T) minorRadius = minorRadius * Abs(T.ScaleFactor()); pos.Transform(T); } + +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_Ellipse::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_Ellipse); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Conic); + + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, majorRadius); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, minorRadius); +} diff --git a/src/Geom2d/Geom2d_Ellipse.hxx b/src/Geom2d/Geom2d_Ellipse.hxx index 78ff674e61..f6eef1f934 100644 --- a/src/Geom2d/Geom2d_Ellipse.hxx +++ b/src/Geom2d/Geom2d_Ellipse.hxx @@ -241,6 +241,8 @@ public: //! Creates a new object which is a copy of this ellipse. Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_Hyperbola.cxx b/src/Geom2d/Geom2d_Hyperbola.cxx index ef357a88c1..9d6a7b6c30 100644 --- a/src/Geom2d/Geom2d_Hyperbola.cxx +++ b/src/Geom2d/Geom2d_Hyperbola.cxx @@ -436,3 +436,18 @@ void Geom2d_Hyperbola::Transform (const Trsf2d& T) minorRadius = minorRadius * Abs (T.ScaleFactor()); pos.Transform(T); } + +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_Hyperbola::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_Hyperbola); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Conic); + + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, majorRadius); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, minorRadius); +} diff --git a/src/Geom2d/Geom2d_Hyperbola.hxx b/src/Geom2d/Geom2d_Hyperbola.hxx index 02e341d9a7..f1d431afe6 100644 --- a/src/Geom2d/Geom2d_Hyperbola.hxx +++ b/src/Geom2d/Geom2d_Hyperbola.hxx @@ -294,6 +294,8 @@ public: //! Creates a new object which is a copy of this hyperbola. Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_Line.cxx b/src/Geom2d/Geom2d_Line.cxx index 6ac9b7b774..4062c13b78 100644 --- a/src/Geom2d/Geom2d_Line.cxx +++ b/src/Geom2d/Geom2d_Line.cxx @@ -293,3 +293,15 @@ Standard_Real Geom2d_Line::Distance (const gp_Pnt2d& P) const { return L.Distance (P); } +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_Line::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_Line); + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Curve); + + OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &pos); +} diff --git a/src/Geom2d/Geom2d_Line.hxx b/src/Geom2d/Geom2d_Line.hxx index ed74a20522..be79fa2190 100644 --- a/src/Geom2d/Geom2d_Line.hxx +++ b/src/Geom2d/Geom2d_Line.hxx @@ -181,6 +181,8 @@ public: //! Creates a new object, which is a copy of this line. Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_OffsetCurve.cxx b/src/Geom2d/Geom2d_OffsetCurve.cxx index 2c4ea9536c..1ab6ad5f6e 100644 --- a/src/Geom2d/Geom2d_OffsetCurve.cxx +++ b/src/Geom2d/Geom2d_OffsetCurve.cxx @@ -388,3 +388,21 @@ GeomAbs_Shape Geom2d_OffsetCurve::GetBasisCurveContinuity() const { return myBasisCurveContinuity; } + +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_OffsetCurve::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_OffsetCurve); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Curve); + + OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, basisCurve.get()); + //OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myEvaluator.get()); + + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, offsetValue); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myBasisCurveContinuity); +} diff --git a/src/Geom2d/Geom2d_OffsetCurve.hxx b/src/Geom2d/Geom2d_OffsetCurve.hxx index 0886f46baa..99cf1a3d42 100644 --- a/src/Geom2d/Geom2d_OffsetCurve.hxx +++ b/src/Geom2d/Geom2d_OffsetCurve.hxx @@ -285,6 +285,8 @@ public: //! Returns continuity of the basis curve. Standard_EXPORT GeomAbs_Shape GetBasisCurveContinuity() const; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_Parabola.cxx b/src/Geom2d/Geom2d_Parabola.cxx index f7bfd21d64..2b002253a2 100644 --- a/src/Geom2d/Geom2d_Parabola.cxx +++ b/src/Geom2d/Geom2d_Parabola.cxx @@ -335,4 +335,16 @@ Standard_Real Geom2d_Parabola::ParametricTransformation(const gp_Trsf2d& T) cons return Abs(T.ScaleFactor()); } +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_Parabola::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_Parabola); + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Conic); + + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, focalLength); +} diff --git a/src/Geom2d/Geom2d_Parabola.hxx b/src/Geom2d/Geom2d_Parabola.hxx index fa5f2a76c6..4486945f0a 100644 --- a/src/Geom2d/Geom2d_Parabola.hxx +++ b/src/Geom2d/Geom2d_Parabola.hxx @@ -205,6 +205,8 @@ public: //! Creates a new object, which is a copy of this parabola. Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_Point.cxx b/src/Geom2d/Geom2d_Point.cxx index e3dacd91a3..c5da2acc99 100644 --- a/src/Geom2d/Geom2d_Point.cxx +++ b/src/Geom2d/Geom2d_Point.cxx @@ -37,3 +37,15 @@ Standard_Real Geom2d_Point::SquareDistance (const Handle(Geom2d_Point)& Other) c gp_Pnt2d P2 = Other->Pnt2d (); return P1.SquareDistance (P2); } + +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_Point::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_Point); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_Geometry); +} diff --git a/src/Geom2d/Geom2d_Point.hxx b/src/Geom2d/Geom2d_Point.hxx index ea3e9d1a56..324087ec6c 100644 --- a/src/Geom2d/Geom2d_Point.hxx +++ b/src/Geom2d/Geom2d_Point.hxx @@ -56,6 +56,8 @@ public: //! computes the square distance between and . Standard_EXPORT Standard_Real SquareDistance (const Handle(Geom2d_Point)& Other) const; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/Geom2d/Geom2d_TrimmedCurve.cxx b/src/Geom2d/Geom2d_TrimmedCurve.cxx index 9cbfa69858..c1061b8f38 100644 --- a/src/Geom2d/Geom2d_TrimmedCurve.cxx +++ b/src/Geom2d/Geom2d_TrimmedCurve.cxx @@ -345,3 +345,18 @@ Standard_Real Geom2d_TrimmedCurve::ParametricTransformation(const gp_Trsf2d& T) return basisCurve->ParametricTransformation(T); } +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= + +void Geom2d_TrimmedCurve::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const +{ + OCCT_DUMP_CLASS_BEGIN (theOStream, Geom2d_TrimmedCurve); + + OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Geom2d_BoundedCurve); + + OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, basisCurve.get()); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, uTrim1); + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, uTrim2); +} diff --git a/src/Geom2d/Geom2d_TrimmedCurve.hxx b/src/Geom2d/Geom2d_TrimmedCurve.hxx index 57e905fb25..8a835dc6aa 100644 --- a/src/Geom2d/Geom2d_TrimmedCurve.hxx +++ b/src/Geom2d/Geom2d_TrimmedCurve.hxx @@ -256,6 +256,8 @@ public: //! Creates a new object, which is a copy of this trimmed curve. Standard_EXPORT Handle(Geom2d_Geometry) Copy() const Standard_OVERRIDE; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; diff --git a/src/gp/gp_Ax22d.cxx b/src/gp/gp_Ax22d.cxx index 40ea9ac5cb..35007cc238 100644 --- a/src/gp/gp_Ax22d.cxx +++ b/src/gp/gp_Ax22d.cxx @@ -24,6 +24,7 @@ #include #include #include +#include void gp_Ax22d::Mirror (const gp_Pnt2d& P) { @@ -57,3 +58,10 @@ gp_Ax22d gp_Ax22d::Mirrored(const gp_Ax2d& A1) const return Temp; } +void gp_Ax22d::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const +{ + OCCT_DUMP_VECTOR_CLASS (theOStream, "Location", 2, point.X(), point.Y()) + + OCCT_DUMP_VECTOR_CLASS (theOStream, "XAxis", 2, vxdir.X(), vxdir.Y()) + OCCT_DUMP_VECTOR_CLASS (theOStream, "YAxis", 2, vydir.X(), vydir.Y()) +} diff --git a/src/gp/gp_Ax22d.hxx b/src/gp/gp_Ax22d.hxx index b837199853..0ae5bada7f 100644 --- a/src/gp/gp_Ax22d.hxx +++ b/src/gp/gp_Ax22d.hxx @@ -210,6 +210,8 @@ public: //! point . Standard_NODISCARD gp_Ax22d Translated (const gp_Pnt2d& P1, const gp_Pnt2d& P2) const; + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const; -- 2.39.5