mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0031313: Foundation Classes - Dump improvement for classes
- Provide DumpJson for geometrical, ocaf and visualization classes; - Change depth parameter of DumpJson (constant is not obligate here) - Introduce a new macro for transient objects to be called as the first row in DumpJson: OCCT_DUMP_TRANSIENT_CLASS_BEGIN. We need not put the class name in the macro, using get_type_name of Standard_Transient for it. - change implementation of OCCT_DUMP_CLASS_BEGIN and OCCT_DUMP_TRANSIENT_CLASS_BEGIN. It is not an sentry more and it does not create a new hierarchy level. It appends a new row into the output stream: "className": <className> - OCCT_DUMP_* does not require semicolon - class header is included first in source files of TDataStd, TDocStd, TCAFDoc
This commit is contained in:
@@ -182,3 +182,17 @@ void StdSelect_BRepOwner::UpdateHighlightTrsf (const Handle(V3d_Viewer)& theView
|
||||
|
||||
theManager->UpdateHighlightTrsf (theViewer, Selectable(), theDispMode, myPrsSh);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : DumpJson
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void StdSelect_BRepOwner::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_VALUES_DUMPED (theOStream, theDepth, myPrsSh.get())
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurMode)
|
||||
}
|
||||
|
@@ -117,6 +117,9 @@ public:
|
||||
const Handle(PrsMgr_PresentationManager3d)& theManager,
|
||||
const Standard_Integer theDispMode) 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:
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
|
@@ -71,3 +71,12 @@ void StdSelect_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
|
||||
{
|
||||
PrsMgr_PresentableObject::Compute(aProjector,aPresentation);
|
||||
}
|
||||
|
||||
void StdSelect_Shape::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
|
||||
{
|
||||
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
|
||||
|
||||
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, PrsMgr_PresentableObject)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &mysh)
|
||||
}
|
||||
|
@@ -46,6 +46,9 @@ public:
|
||||
|
||||
void Shape (const TopoDS_Shape& theShape) { mysh = theShape; }
|
||||
|
||||
//! 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_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
@@ -1086,3 +1086,19 @@ Standard_Boolean StdSelect_ViewerSelector3d::ToPixMap (Image_PixMap&
|
||||
aFiller->Flush();
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdSelect_ViewerSelector3d::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
|
||||
{
|
||||
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
|
||||
|
||||
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myStructs.Length())
|
||||
for (Graphic3d_SequenceOfStructure::Iterator aStructsIt (myStructs); aStructsIt.More(); aStructsIt.Next())
|
||||
{
|
||||
const Handle(Graphic3d_Structure)& aStructure = aStructsIt.Value();
|
||||
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, aStructure)
|
||||
}
|
||||
}
|
||||
|
@@ -93,6 +93,9 @@ public:
|
||||
const Handle(V3d_View)& theView,
|
||||
const Standard_Boolean theToClearOthers = Standard_True);
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(StdSelect_ViewerSelector3d,SelectMgr_ViewerSelector)
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user