1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

...

1 Commits

Author SHA1 Message Date
nds
77242088bc 0031494: Mesh - Dump improvement for BRepMesh classes 2020-04-11 11:28:46 +03:00
116 changed files with 1321 additions and 9 deletions

View 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)
}

View 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;

View 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)
};

View 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)
}

View 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)
}

View 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;

View 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)
}

View 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;

View 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)

View 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)
}

View 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;

View File

@@ -40,3 +40,14 @@
#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)
}

View 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;

View 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)
}

View 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)
}

View 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;

View 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)
}

View 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:

View 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)
}

View 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;

View 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;

View File

@@ -40,3 +40,14 @@
#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)
}

View 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;

View File

@@ -40,3 +40,14 @@
#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)
}

View 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)
}

View 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;

View 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)
}
}
}

View 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:

View 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;

View 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;

View 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)
}

View 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.

View 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:

View 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)
}

View 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)
};

View 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])
}

View 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:

View 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:

View 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)
}
}

View 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:

View File

@@ -32,6 +32,11 @@
#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)
}

View File

@@ -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

View 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();

View 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:

View 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)
}

View 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)

View 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;

View 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)
}

View 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:

View 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)
}

View 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:

View 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)

View 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:

View 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)
}

View 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:

View 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)
}

View 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:

View 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;
}

View 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:

View File

@@ -309,6 +309,7 @@ Standard_Boolean BRepMesh_ModelPreProcessor::performInternal(
}
}
}
OCCT_SEND_DUMPJSON (theModel.get())
return Standard_True;
}

View 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:

View 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;

View 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];
};

View 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);

View 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;

View 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;

View 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;

View 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)
}
}

View 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:

View 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)
}
}

View 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:

View 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;
}

View 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:

View 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())
}
}

View 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:

View 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())
}
}
}

View 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;

View 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)
}
}

View 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:

View 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>

View 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);

View 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
}

View 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;

View 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)
}

View 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:

View 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:

View 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:

View 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:

View 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.

View 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:

View 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:

View 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:

View 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:

View 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:

View 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

View File

@@ -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)
}

View 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:

View 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:

View 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:

View 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())
}

Some files were not shown because too many files have changed in this diff Show More