From: nds Date: Sat, 22 Feb 2020 04:34:48 +0000 (+0300) Subject: 0031378: Modeling algorithms - brep incremental mesh is frozen during STEP file loading X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=3ed6632bcb4b238f7b92d0dddba6fcecd7e55eba;p=occt-copy.git 0031378: Modeling algorithms - brep incremental mesh is frozen during STEP file loading DumpJson --- diff --git a/src/AIS/AIS_InteractiveObject.hxx b/src/AIS/AIS_InteractiveObject.hxx index e461140b0a..b5d00b31c3 100644 --- a/src/AIS/AIS_InteractiveObject.hxx +++ b/src/AIS/AIS_InteractiveObject.hxx @@ -125,6 +125,7 @@ public: //! Dumps the content of me into the stream Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; + protected: //! The TypeOfPresention3d means that the interactive object diff --git a/src/BRepMesh/BRepMesh_Context.cxx b/src/BRepMesh/BRepMesh_Context.cxx index e48d038467..cbb0592aa7 100644 --- a/src/BRepMesh/BRepMesh_Context.cxx +++ b/src/BRepMesh/BRepMesh_Context.cxx @@ -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) +} diff --git a/src/BRepMesh/BRepMesh_Context.hxx b/src/BRepMesh/BRepMesh_Context.hxx index a802a6b44b..d4e3a2ffb3 100644 --- a/src/BRepMesh/BRepMesh_Context.hxx +++ b/src/BRepMesh/BRepMesh_Context.hxx @@ -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) }; diff --git a/src/BRepMesh/BRepMesh_DiscretRoot.cxx b/src/BRepMesh/BRepMesh_DiscretRoot.cxx index e6d0978e63..753e536043 100644 --- a/src/BRepMesh/BRepMesh_DiscretRoot.cxx +++ b/src/BRepMesh/BRepMesh_DiscretRoot.cxx @@ -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) +} diff --git a/src/BRepMesh/BRepMesh_DiscretRoot.hxx b/src/BRepMesh/BRepMesh_DiscretRoot.hxx index 361cf0e242..543bee6018 100644 --- a/src/BRepMesh/BRepMesh_DiscretRoot.hxx +++ b/src/BRepMesh/BRepMesh_DiscretRoot.hxx @@ -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); DEFINE_STANDARD_RTTIEXT(BRepMesh_DiscretRoot,Standard_Transient) diff --git a/src/BRepMesh/BRepMesh_EdgeDiscret.cxx b/src/BRepMesh/BRepMesh_EdgeDiscret.cxx index d9e575af43..4b9774ba75 100644 --- a/src/BRepMesh/BRepMesh_EdgeDiscret.cxx +++ b/src/BRepMesh/BRepMesh_EdgeDiscret.cxx @@ -331,3 +331,13 @@ 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) +} diff --git a/src/BRepMesh/BRepMesh_EdgeDiscret.hxx b/src/BRepMesh/BRepMesh_EdgeDiscret.hxx index 82ac8e48d2..334cf9ebb6 100644 --- a/src/BRepMesh/BRepMesh_EdgeDiscret.hxx +++ b/src/BRepMesh/BRepMesh_EdgeDiscret.hxx @@ -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: diff --git a/src/BRepMesh/BRepMesh_FaceDiscret.cxx b/src/BRepMesh/BRepMesh_FaceDiscret.cxx index ce6db2102e..413da8c32e 100644 --- a/src/BRepMesh/BRepMesh_FaceDiscret.cxx +++ b/src/BRepMesh/BRepMesh_FaceDiscret.cxx @@ -93,3 +93,13 @@ 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) +} diff --git a/src/BRepMesh/BRepMesh_FaceDiscret.hxx b/src/BRepMesh/BRepMesh_FaceDiscret.hxx index 9ca86800b6..45b06e632a 100644 --- a/src/BRepMesh/BRepMesh_FaceDiscret.hxx +++ b/src/BRepMesh/BRepMesh_FaceDiscret.hxx @@ -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: diff --git a/src/BRepMesh/BRepMesh_IncrementalMesh.cxx b/src/BRepMesh/BRepMesh_IncrementalMesh.cxx index 25627edc83..ea157d7a38 100644 --- a/src/BRepMesh/BRepMesh_IncrementalMesh.cxx +++ b/src/BRepMesh/BRepMesh_IncrementalMesh.cxx @@ -164,5 +164,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) diff --git a/src/BRepMesh/BRepMesh_IncrementalMesh.hxx b/src/BRepMesh/BRepMesh_IncrementalMesh.hxx index 4831ffa434..317d22b2c3 100644 --- a/src/BRepMesh/BRepMesh_IncrementalMesh.hxx +++ b/src/BRepMesh/BRepMesh_IncrementalMesh.hxx @@ -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: diff --git a/src/BRepMesh/BRepMesh_ModelBuilder.cxx b/src/BRepMesh/BRepMesh_ModelBuilder.cxx index 1a15482cdf..8400d8bf39 100644 --- a/src/BRepMesh/BRepMesh_ModelBuilder.cxx +++ b/src/BRepMesh/BRepMesh_ModelBuilder.cxx @@ -46,6 +46,10 @@ Handle (IMeshData_Model) BRepMesh_ModelBuilder::performInternal ( const TopoDS_Shape& theShape, const IMeshTools_Parameters& theParameters) { + MESSAGE_ADD_LEVEL_SENTRY + Handle(Message_Messenger) sout = aContext->GetModelBuilder()->GetMessenger(); + sout << "BRepMesh_ModelBuilder::performInternal" << "" << Message_EndLine; + Handle (BRepMeshData_Model) aModel; Bnd_Box aBox; @@ -82,3 +86,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) +} diff --git a/src/BRepMesh/BRepMesh_ModelBuilder.hxx b/src/BRepMesh/BRepMesh_ModelBuilder.hxx index 56898a1eeb..218fed2f7f 100644 --- a/src/BRepMesh/BRepMesh_ModelBuilder.hxx +++ b/src/BRepMesh/BRepMesh_ModelBuilder.hxx @@ -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: diff --git a/src/BRepMesh/BRepMesh_ModelHealer.cxx b/src/BRepMesh/BRepMesh_ModelHealer.cxx index 6ad9b83f56..c23eb0b5e1 100644 --- a/src/BRepMesh/BRepMesh_ModelHealer.cxx +++ b/src/BRepMesh/BRepMesh_ModelHealer.cxx @@ -497,3 +497,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) +} diff --git a/src/BRepMesh/BRepMesh_ModelHealer.hxx b/src/BRepMesh/BRepMesh_ModelHealer.hxx index 2e95c02da4..80da43f168 100644 --- a/src/BRepMesh/BRepMesh_ModelHealer.hxx +++ b/src/BRepMesh/BRepMesh_ModelHealer.hxx @@ -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: diff --git a/src/BRepMesh/BRepMesh_ModelPostProcessor.hxx b/src/BRepMesh/BRepMesh_ModelPostProcessor.hxx index 129ba74b9e..46c1717b4d 100644 --- a/src/BRepMesh/BRepMesh_ModelPostProcessor.hxx +++ b/src/BRepMesh/BRepMesh_ModelPostProcessor.hxx @@ -32,7 +32,15 @@ public: //! Destructor. Standard_EXPORT virtual ~BRepMesh_ModelPostProcessor(); - DEFINE_STANDARD_RTTI_INLINE(BRepMesh_ModelPostProcessor, IMeshTools_ModelAlgo) + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; + + //! 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: diff --git a/src/BRepMesh/BRepMesh_ModelPreProcessor.hxx b/src/BRepMesh/BRepMesh_ModelPreProcessor.hxx index 031053aa38..488f61a504 100644 --- a/src/BRepMesh/BRepMesh_ModelPreProcessor.hxx +++ b/src/BRepMesh/BRepMesh_ModelPreProcessor.hxx @@ -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: diff --git a/src/BRepMeshData/BRepMeshData_Model.cxx b/src/BRepMeshData/BRepMeshData_Model.cxx index 08c07f8c96..bd261179c0 100644 --- a/src/BRepMeshData/BRepMeshData_Model.cxx +++ b/src/BRepMeshData/BRepMeshData_Model.cxx @@ -100,3 +100,19 @@ 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.IsNull()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDFaces.Size()) + if (!myDEdges.IsNull()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDEdges.Size()) +} diff --git a/src/BRepMeshData/BRepMeshData_Model.hxx b/src/BRepMeshData/BRepMeshData_Model.hxx index 2b19684a73..1bd2f541a1 100644 --- a/src/BRepMeshData/BRepMeshData_Model.hxx +++ b/src/BRepMeshData/BRepMeshData_Model.hxx @@ -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; diff --git a/src/IMeshData/IMeshData_Curve.hxx b/src/IMeshData/IMeshData_Curve.hxx index 505efad262..d0aae97f33 100644 --- a/src/IMeshData/IMeshData_Curve.hxx +++ b/src/IMeshData/IMeshData_Curve.hxx @@ -49,6 +49,9 @@ 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 + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTI_INLINE(IMeshData_Curve, IMeshData_ParametersList) protected: diff --git a/src/IMeshData/IMeshData_Edge.hxx b/src/IMeshData/IMeshData_Edge.hxx index 162d2a20fa..fe7ea6c335 100644 --- a/src/IMeshData/IMeshData_Edge.hxx +++ b/src/IMeshData/IMeshData_Edge.hxx @@ -140,6 +140,9 @@ public: myDegenerated = theValue; } + //! 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(IMeshData_Edge, IMeshData_TessellatedShape) protected: diff --git a/src/IMeshData/IMeshData_Model.hxx b/src/IMeshData/IMeshData_Model.hxx index 773ab6e973..2f51ccda24 100644 --- a/src/IMeshData/IMeshData_Model.hxx +++ b/src/IMeshData/IMeshData_Model.hxx @@ -63,6 +63,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. diff --git a/src/IMeshData/IMeshData_PCurve.hxx b/src/IMeshData/IMeshData_PCurve.hxx index 4c6530cf0e..d4a492625a 100644 --- a/src/IMeshData/IMeshData_PCurve.hxx +++ b/src/IMeshData/IMeshData_PCurve.hxx @@ -77,6 +77,9 @@ public: return myDFace; } + //! 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(IMeshData_PCurve, IMeshData_ParametersList) protected: diff --git a/src/IMeshData/IMeshData_ParametersList.hxx b/src/IMeshData/IMeshData_ParametersList.hxx index 8190fd2f32..9779110931 100644 --- a/src/IMeshData/IMeshData_ParametersList.hxx +++ b/src/IMeshData/IMeshData_ParametersList.hxx @@ -38,6 +38,9 @@ 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 {} + DEFINE_STANDARD_RTTI_INLINE(IMeshData_ParametersList, Standard_Transient) protected: diff --git a/src/IMeshData/IMeshData_Shape.hxx b/src/IMeshData/IMeshData_Shape.hxx index eb5100a42a..02d9c54f1a 100644 --- a/src/IMeshData/IMeshData_Shape.hxx +++ b/src/IMeshData/IMeshData_Shape.hxx @@ -17,6 +17,7 @@ #define _IMeshData_Shape_HeaderFile #include +#include #include //! 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: diff --git a/src/IMeshData/IMeshData_TessellatedShape.hxx b/src/IMeshData/IMeshData_TessellatedShape.hxx index 94001b032d..f57e44e521 100644 --- a/src/IMeshData/IMeshData_TessellatedShape.hxx +++ b/src/IMeshData/IMeshData_TessellatedShape.hxx @@ -42,6 +42,19 @@ public: myDeflection = theValue; } + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; + + //! 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: diff --git a/src/IMeshTools/FILES b/src/IMeshTools/FILES index e582bc1d1b..66b4f92699 100644 --- a/src/IMeshTools/FILES +++ b/src/IMeshTools/FILES @@ -1,3 +1,4 @@ +IMeshTools_Context.cxx IMeshTools_Context.hxx IMeshTools_CurveTessellator.hxx IMeshTools_MeshAlgo.hxx diff --git a/src/IMeshTools/IMeshTools_Context.cxx b/src/IMeshTools/IMeshTools_Context.cxx new file mode 100644 index 0000000000..803a862764 --- /dev/null +++ b/src/IMeshTools/IMeshTools_Context.cxx @@ -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 + +//======================================================================= +//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) +} + diff --git a/src/IMeshTools/IMeshTools_Context.hxx b/src/IMeshTools/IMeshTools_Context.hxx index fe77996c2e..443b2848b5 100644 --- a/src/IMeshTools/IMeshTools_Context.hxx +++ b/src/IMeshTools/IMeshTools_Context.hxx @@ -63,6 +63,10 @@ public: return Standard_False; } + MESSAGE_ADD_LEVEL_SENTRY + Handle(Message_Messenger) sout = GetModelBuilder()->GetMessenger(); + sout << "DiscretizeEdges" << "" << Message_EndLine; + // Discretize edges of a model. return myEdgeDiscret->Perform(myModel, myParameters); } @@ -77,6 +81,9 @@ public: return Standard_False; } + MESSAGE_ADD_LEVEL_SENTRY + Handle(Message_Messenger) sout = GetModelBuilder()->GetMessenger(); + sout << "HealModel" << "" << Message_EndLine; return myModelHealer.IsNull() ? Standard_True : myModelHealer->Perform(myModel, myParameters); @@ -92,6 +99,9 @@ public: return Standard_False; } + MESSAGE_ADD_LEVEL_SENTRY + Handle(Message_Messenger) sout = GetModelBuilder()->GetMessenger(); + sout << "PreProcessModel" << "" << Message_EndLine; return myPreProcessor.IsNull() ? Standard_True : myPreProcessor->Perform(myModel, myParameters); @@ -106,6 +116,9 @@ public: return Standard_False; } + MESSAGE_ADD_LEVEL_SENTRY + Handle(Message_Messenger) sout = GetModelBuilder()->GetMessenger(); + sout << "DiscretizeFaces" << "" << Message_EndLine; // Discretize faces of a model. return myFaceDiscret->Perform(myModel, myParameters); } @@ -119,6 +132,9 @@ public: return Standard_False; } + MESSAGE_ADD_LEVEL_SENTRY + Handle(Message_Messenger) sout = GetModelBuilder()->GetMessenger(); + sout << "PostProcessModel" << "" << Message_EndLine; return myPostProcessor.IsNull() ? Standard_True : myPostProcessor->Perform(myModel, myParameters); @@ -223,6 +239,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: diff --git a/src/IMeshTools/IMeshTools_MeshBuilder.cxx b/src/IMeshTools/IMeshTools_MeshBuilder.cxx index 3b67a6c798..fab7f3f7f9 100644 --- a/src/IMeshTools/IMeshTools_MeshBuilder.cxx +++ b/src/IMeshTools/IMeshTools_MeshBuilder.cxx @@ -58,6 +58,10 @@ void IMeshTools_MeshBuilder::Perform () return; } + MESSAGE_ADD_LEVEL_SENTRY + Handle(Message_Messenger) sout = aContext->GetModelBuilder()->GetMessenger(); + sout << "IMeshTools_MeshBuilder::Perform" << "" << Message_EndLine; + if (aContext->BuildModel ()) { if (aContext->DiscretizeEdges ()) @@ -116,3 +120,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()) +} diff --git a/src/IMeshTools/IMeshTools_MeshBuilder.hxx b/src/IMeshTools/IMeshTools_MeshBuilder.hxx index 8c0d314224..e94a4df41c 100644 --- a/src/IMeshTools/IMeshTools_MeshBuilder.hxx +++ b/src/IMeshTools/IMeshTools_MeshBuilder.hxx @@ -64,6 +64,9 @@ public: //! Performs meshing ot the shape using current context. Standard_EXPORT virtual void Perform (); + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTI_INLINE(IMeshTools_MeshBuilder, Message_Algorithm) private: diff --git a/src/IMeshTools/IMeshTools_ModelAlgo.hxx b/src/IMeshTools/IMeshTools_ModelAlgo.hxx index 963c880c75..f9a5740ae2 100644 --- a/src/IMeshTools/IMeshTools_ModelAlgo.hxx +++ b/src/IMeshTools/IMeshTools_ModelAlgo.hxx @@ -51,6 +51,13 @@ public: } } + //! Dumps the content of me into the stream + virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const + { + (void)theDepth; + OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream) + } + DEFINE_STANDARD_RTTI_INLINE(IMeshTools_ModelAlgo, Standard_Transient) protected: diff --git a/src/IMeshTools/IMeshTools_ModelBuilder.hxx b/src/IMeshTools/IMeshTools_ModelBuilder.hxx index 5d6d416932..c6ad0ed3e3 100644 --- a/src/IMeshTools/IMeshTools_ModelBuilder.hxx +++ b/src/IMeshTools/IMeshTools_ModelBuilder.hxx @@ -61,6 +61,9 @@ public: } } + //! 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_ModelBuilder, Message_Algorithm) protected: diff --git a/src/Message/Message_Algorithm.cxx b/src/Message/Message_Algorithm.cxx index df663d3567..e790e156be 100644 --- a/src/Message/Message_Algorithm.cxx +++ b/src/Message/Message_Algorithm.cxx @@ -431,3 +431,22 @@ TCollection_ExtendedString Message_Algorithm::PrepareReport } return aNewReport; } + +//======================================================================= +//function : DumpJson +//purpose : +//======================================================================= +void Message_Algorithm::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const +{ + OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream) + + OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStatus) + OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMessenger) + + if (!myReportIntegers.IsEmpty()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myReportIntegers.Length()) + if (!myReportStrings.IsEmpty()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myReportStrings.Length()) + if (!myReportMessages.IsEmpty()) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myReportMessages.Length()) +} diff --git a/src/Message/Message_Algorithm.hxx b/src/Message/Message_Algorithm.hxx index 8b8df3a378..3637133821 100644 --- a/src/Message/Message_Algorithm.hxx +++ b/src/Message/Message_Algorithm.hxx @@ -197,6 +197,9 @@ public: //! in theReportSeq sequence, but not more than theMaxCount Standard_EXPORT static TCollection_ExtendedString PrepareReport (const TColStd_SequenceOfHExtendedString& theReportSeq, const Standard_Integer theMaxCount); + //! Dumps the content of me into the stream + Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const; + diff --git a/src/Message/Message_ExecStatus.hxx b/src/Message/Message_ExecStatus.hxx index 42eb19c6b9..06d06b8df0 100644 --- a/src/Message/Message_ExecStatus.hxx +++ b/src/Message/Message_ExecStatus.hxx @@ -21,6 +21,8 @@ #include #include +#include + /** * Tiny class for extended handling of error / execution * status of algorithm in universal way. @@ -162,6 +164,16 @@ class Message_ExecStatus const Message_ExecStatus& operator &= ( const Message_ExecStatus& theOther ) { And ( theOther ); return *this; } + //! 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, myDone) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myWarn) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlarm) + OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFail) + } + //@} public: diff --git a/src/XmlDrivers/XmlDrivers_MessageReportStorage.cxx b/src/XmlDrivers/XmlDrivers_MessageReportStorage.cxx index c0d1088e2a..2abde38808 100644 --- a/src/XmlDrivers/XmlDrivers_MessageReportStorage.cxx +++ b/src/XmlDrivers/XmlDrivers_MessageReportStorage.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -35,6 +36,8 @@ #include #include +#include + #include // ======================================================================= @@ -259,13 +262,21 @@ void XmlDrivers_MessageReportStorage::exportAlertParameters (const Handle(Messag TDataStd_AsciiString::Set (theAlertLabel, anAttribute->GetName()); Standard_CString aDynamicTypeName = anAttribute->DynamicType()->Name(); + TCollection_AsciiString aStreamText; if (aDynamicTypeName == STANDARD_TYPE (Message_AttributeStream)->Name()) { Handle(Message_AttributeStream) aValuesArrayAlert = Handle(Message_AttributeStream)::DownCast (anAttribute); - // store values - TCollection_AsciiString aStreamText = Standard_Dump::Text (aValuesArrayAlert->Stream()); - if (aStreamText.IsEmpty()) - return; + aStreamText = Standard_Dump::Text (aValuesArrayAlert->Stream()); + } + else if (aDynamicTypeName == STANDARD_TYPE (TopoDS_AlertWithShape)->Name()) + { + Handle(TopoDS_AlertWithShape) aShapeAttribute = Handle(TopoDS_AlertWithShape)::DownCast (anAttribute); + Standard_SStream aStream; + if (BinTools::Write (aShapeAttribute->GetShape(), aStream)) + aStreamText = Standard_Dump::Text (aStream); + } + if (!aStreamText.IsEmpty()) + { Handle(TDataStd_ExtStringArray) aListAttribute = TDataStd_ExtStringArray::Set (theAlertLabel, 0, 0); aListAttribute->SetValue (0, aStreamText); } @@ -290,7 +301,8 @@ Handle(Message_Alert) XmlDrivers_MessageReportStorage::importAlertParameters (co Handle(Message_Attribute) aMessageAttribute; if (aDynamicTypeName == STANDARD_TYPE (Message_Attribute)->Name()) aMessageAttribute = new Message_Attribute(); - else if (aDynamicTypeName == STANDARD_TYPE (Message_AttributeStream)->Name()) + else if (aDynamicTypeName == STANDARD_TYPE (Message_AttributeStream)->Name() || + aDynamicTypeName == STANDARD_TYPE (TopoDS_AlertWithShape)->Name()) { // values NCollection_Vector anArrayValues; @@ -306,7 +318,17 @@ Handle(Message_Alert) XmlDrivers_MessageReportStorage::importAlertParameters (co { aStream << aValuesAttribute->Value (aValueId); } - aMessageAttribute = new Message_AttributeStream (aStream); + + if (aDynamicTypeName == STANDARD_TYPE (Message_AttributeStream)->Name()) + { + aMessageAttribute = new Message_AttributeStream (aStream); + } + else if (aDynamicTypeName == STANDARD_TYPE (TopoDS_AlertWithShape)->Name()) + { + TopoDS_Shape aShape; + if (BinTools::Read (aShape, aStream)) + aMessageAttribute = new TopoDS_AlertWithShape (aShape); + } } if (!aMessageAttribute.IsNull())