Steps to prepare dump of the object into json:
-1. Create method <b>DumpJson</b>. The method should accept the output steam and the depth for the fields dump.
+1. Create method <b>DumpJson</b>. The method should accept the output stream and the depth for the fields dump.
Depth, equal to zero means that only fields of this class should be dumped. Default value -1 means that whole tree of dump will be built recursively calling dump of all fields.
-2. Put into the first row of the method <b>DUMP_CLASS_BEGIN</b>. This macro creates a local variable, that will open Json structure on start, and close on exit from this method.
+2. Put into the first row of the method <b>OCCT_DUMP_CLASS_BEGIN</b>. This macro creates a local variable, that will open Json structure on start, and close on exit from this method.
3. Add several macro to store field values.
| Name | Result in json |
| :-------------------------- | :--------|
-| DUMP_FIELD_VALUE_NUMERICAL | "field": value |
-| DUMP_FIELD_VALUE_STRING | "field": "value" |
-| DUMP_FIELD_VALUE_POINTER | "field": "pointer address" |
-| DUMP_FIELD_VALUES_DUMPED | "field": { fesult of field->DumpJson(...) } |
-| DUMP_FIELD_VALUES_NUMERICAL | "field": [value_1, ..., value_n]
-| DUMP_FIELD_VALUES_STRING | "field": ["value_1", ..., "value_n"]
-| DUMP_FIELD_VALUES_BY_KIND | "kind": { result of kind::DumpJson(...) } |
+| OCCT_DUMP_FIELD_VALUE_NUMERICAL | "field": value |
+| OCCT_DUMP_FIELD_VALUE_STRING | "field": "value" |
+| OCCT_DUMP_FIELD_VALUE_POINTER | "field": "pointer address" |
+| OCCT_DUMP_FIELD_VALUES_DUMPED | "field": { result of field->DumpJson(...) } |
+| OCCT_DUMP_FIELD_VALUES_NUMERICAL | "field": [value_1, ..., value_n]
+| OCCT_DUMP_FIELD_VALUES_STRING | "field": ["value_1", ..., "value_n"]
+| OCCT_DUMP_BASE_CLASS | "kind": { result of kind::DumpJson(...) } |
@subsection occt_debug_dump_json_draw Using in DRAW
//=======================================================================
void AIS_InteractiveObject::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, AIS_InteractiveObject);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, AIS_InteractiveObject);
- DUMP_FIELD_VALUES_BY_KIND (theOStream, theDepth, SelectMgr_SelectableObject);
- DUMP_FIELD_VALUE_POINTER (theOStream, myCTXPtr);
- DUMP_FIELD_VALUE_POINTER (theOStream, myOwner);
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_SelectableObject);
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCTXPtr);
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOwner);
}
void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
{
(void)theDepth;
- DUMP_CLASS_BEGIN (theOStream, BVH_Box);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsValid());
+ OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_Box);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsValid());
}
public:
//! Dumps the content of me into the stream
virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE
{
- DUMP_CLASS_BEGIN (theOStream, BVH_TreeBase);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDepth);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, Length());
+ OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_TreeBase);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDepth);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Length());
for (Standard_Integer aNodeIdx = 0; aNodeIdx < Length(); ++aNodeIdx)
{
//! Dumps the content of node into the stream
virtual void DumpNode (const int theNodeIndex, Standard_OStream& theOStream, const Standard_Integer theDepth) const Standard_OVERRIDE
{
- DUMP_CLASS_BEGIN (theOStream, BVH_TreeNode);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, BVH_TreeNode);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, theNodeIndex);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, theNodeIndex);
Bnd_Box aBndBox = BVH::ToBndBox (MinPoint (theNodeIndex), MaxPoint (theNodeIndex));
Bnd_Box* aPointer = &aBndBox;
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aPointer);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aPointer);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, BegPrimitive (theNodeIndex));
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, EndPrimitive (theNodeIndex));
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, Level (theNodeIndex));
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsOuter (theNodeIndex));
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, BegPrimitive (theNodeIndex));
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, EndPrimitive (theNodeIndex));
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Level (theNodeIndex));
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsOuter (theNodeIndex));
}
public: //! @name protected fields
//=======================================================================
void Bnd_Box::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, Bnd_Box);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_Box);
- DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMin", 3, Xmin, Ymin, Zmin)
- DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMax", 3, Xmax, Ymax, Zmax)
+ OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMin", 3, Xmin, Ymin, Zmin)
+ OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "CornerMax", 3, Xmax, Ymax, Zmax)
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags);
}
//=======================================================================
void Bnd_OBB::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Bnd_OBB);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_OBB);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[0]);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[1]);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[2]);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[0]);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[1]);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxes[2]);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[0]);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[1]);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[2]);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsAABox);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[0]);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[1]);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHDims[2]);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsAABox);
}
// =======================================================================
void Bnd_Range::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, Bnd_Range);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Bnd_Range);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirst);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLast);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirst);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLast);
}
//=======================================================================
void Graphic3d_Aspects::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Graphic3d_Aspects);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Aspects);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInteriorColor);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBackInteriorColor);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdgeColor);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPolygonOffset);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInteriorColor);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBackInteriorColor);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdgeColor);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPolygonOffset);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSkipFirstEdge);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDistinguishMaterials);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawEdges);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawSilhouette);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSuppressBackFaces);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToMapTexture);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextZoomable);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSkipFirstEdge);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDistinguishMaterials);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawEdges);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawSilhouette);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSuppressBackFaces);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToMapTexture);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextZoomable);
}
// =======================================================================
void Graphic3d_Group::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, Graphic3d_Group);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Group);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet);
}
//=======================================================================
void Graphic3d_PolygonOffset::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, Graphic3d_PolygonOffset);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_PolygonOffset);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, Mode);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, Factor);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, Units);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Mode);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Factor);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Units);
}
// =======================================================================
void OpenGl_Aspects::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, OpenGl_Aspects);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, OpenGl_Aspects);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShadingModel);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get());
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShadingModel);
}
// =======================================================================
void OpenGl_Group::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, OpenGl_Group);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, OpenGl_Group);
- DUMP_FIELD_VALUES_BY_KIND (theOStream, theDepth, Graphic3d_Group);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspects);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRaytracable);
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Graphic3d_Group);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspects);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRaytracable);
}
// =======================================================================
void Prs3d_ArrowAspect::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Prs3d_ArrowAspect);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_ArrowAspect);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myArrowAspect.get());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAngle);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLength);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myArrowAspect.get());
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAngle);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLength);
}
// =======================================================================
void Prs3d_DatumAspect::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Prs3d_DatumAspect);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_DatumAspect);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get());
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPointAspect.get());
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myArrowAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPointAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myArrowAspect.get());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAxes);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawLabels);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawArrows);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAxes);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawLabels);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawArrows);
}
// =======================================================================
void Prs3d_DimensionAspect::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Prs3d_DimensionAspect);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_DimensionAspect);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myLineAspect.get());
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get());
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myArrowAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myLineAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myArrowAspect.get());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValueStringFormat);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myExtensionSize);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowTailSize);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowOrientation);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextHPosition);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextVPosition);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDisplayUnits);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsText3d);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextShaded);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsArrows3d);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValueStringFormat);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myExtensionSize);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowTailSize);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowOrientation);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextHPosition);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextVPosition);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDisplayUnits);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsText3d);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextShaded);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsArrows3d);
}
// =======================================================================
void Prs3d_Drawer::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Prs3d_Drawer);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myShadingAspect.get());
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_Drawer);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myShadingAspect.get());
}
// =======================================================================
void Prs3d_LineAspect::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Prs3d_LineAspect);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get());
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_LineAspect);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get());
}
// =======================================================================
void Prs3d_PlaneAspect::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Prs3d_PlaneAspect);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_PlaneAspect);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myEdgesAspect.get());
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myIsoAspect.get());
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myArrowAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myEdgesAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myIsoAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myArrowAspect.get());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowsLength);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowsSize);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowsAngle);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPlaneXLength);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPlaneYLength);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsoDistance);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawCenterArrow);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawEdgesArrows);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawEdges);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawIso);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowsLength);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowsSize);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myArrowsAngle);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPlaneXLength);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPlaneYLength);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsoDistance);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawCenterArrow);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawEdgesArrows);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawEdges);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawIso);
}
// =======================================================================
void Prs3d_PointAspect::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Prs3d_PointAspect);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get());
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_PointAspect);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get());
}
// =======================================================================
void Prs3d_ShadingAspect::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Prs3d_ShadingAspect);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get());
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_ShadingAspect);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get());
}
// =======================================================================
void Prs3d_TextAspect::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Prs3d_TextAspect);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_TextAspect);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHeight);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHorizontalJustification);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVerticalJustification);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOrientation);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHeight);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHorizontalJustification);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVerticalJustification);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOrientation);
}
// =======================================================================
void PrsMgr_PresentableObject::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, PrsMgr_PresentableObject);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, PrsMgr_PresentableObject);
- DUMP_FIELD_VALUE_POINTER (theOStream, myParent);
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myParent);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOwnWidth);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, hasOwnColor);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, hasOwnMaterial);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOwnWidth);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, hasOwnColor);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, hasOwnMaterial);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myInfiniteState);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsMutable);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnPresentations);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myInfiniteState);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsMutable);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnPresentations);
}
//=======================================================================
void Quantity_Color::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, Quantity_Color);
- DUMP_FIELD_VALUES_NUMERICAL (theOStream, "RGB", 3, MyRed, MyGreen, MyBlue)
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Quantity_Color);
+ OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "RGB", 3, MyRed, MyGreen, MyBlue)
}
//=======================================================================
void Quantity_ColorRGBA::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, Quantity_ColorRGBA);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Quantity_ColorRGBA);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myRgb);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlpha);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myRgb);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlpha);
}
//=======================================================================
void SelectMgr_BaseFrustum::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, SelectMgr_BaseFrustum);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_BaseFrustum);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPixelTolerance);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsOrthographic);
- DUMP_FIELD_VALUE_POINTER (theOStream, myBuilder);
- DUMP_FIELD_VALUE_POINTER (theOStream, myCamera);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPixelTolerance);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsOrthographic);
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myBuilder);
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCamera);
}
// =======================================================================
void SelectMgr_EntityOwner::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, SelectMgr_EntityOwner);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_EntityOwner);
- DUMP_FIELD_VALUE_POINTER (theOStream, mySelectable);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, mypriority);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsSelected);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFromDecomposition);
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, mySelectable);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mypriority);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsSelected);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFromDecomposition);
}
// =======================================================================
void SelectMgr_SelectableObject::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, SelectMgr_SelectableObject);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_SelectableObject);
- DUMP_FIELD_VALUES_BY_KIND (theOStream, theDepth, PrsMgr_PresentableObject);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myGlobalSelMode);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAutoHilight);
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, PrsMgr_PresentableObject);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myGlobalSelMode);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAutoHilight);
}
// =======================================================================
void SelectMgr_ViewClipRange::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, SelectMgr_ViewClipRange);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_ViewClipRange);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myUnclipRange);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myUnclipRange);
for (size_t aRangeIter = 0; aRangeIter < myClipRanges.size(); ++aRangeIter)
{
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myClipRanges[aRangeIter]);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myClipRanges[aRangeIter]);
}
}
//=======================================================================
void SelectMgr_ViewerSelector::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, SelectMgr_ViewerSelector);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_ViewerSelector);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, preferclosest);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToUpdateTolerance);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, mystored.Extent());
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, preferclosest);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToUpdateTolerance);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mystored.Extent());
Standard_Integer aNbOfSelected = 0;
for (SelectMgr_SelectableObjectSet::Iterator aSelectableIt (mySelectableObjects); aSelectableIt.More(); aSelectableIt.Next())
{
aNbOfSelected++;
}
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, aNbOfSelected);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerances.Tolerance());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerances.CustomTolerance());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZLayerOrderMap.Size());
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aNbOfSelected);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerances.Tolerance());
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerances.CustomTolerance());
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZLayerOrderMap.Size());
}
}
// =======================================================================
-// function : EndsWith
+// function : AddValuesSeparator
// purpose :
// =======================================================================
-Standard_Boolean Standard_Dump::EndsWith (const Standard_OStream& theOStream,
- const TCollection_AsciiString& theEndString)
+void Standard_Dump::AddValuesSeparator (Standard_OStream& theOStream)
{
Standard_SStream aStream;
aStream << theOStream.rdbuf();
TCollection_AsciiString aStreamStr = Standard_Dump::Text (aStream);
- return aStreamStr.EndsWith (theEndString);
+ if (!aStreamStr.EndsWith ("{"))
+ theOStream << ", ";
}
//=======================================================================
const char* theKey,
const TCollection_AsciiString& theField)
{
- if (!Standard_Dump::EndsWith (theOStream, "{"))
- theOStream << ", ";
+ AddValuesSeparator (theOStream);
theOStream << "\"" << theKey << "\": {" << theField << "}";
}
// =======================================================================
// DumpFieldToName
// =======================================================================
-void Standard_Dump::DumpFieldToName (const char* theField, const char*& theName)
+const char* Standard_Dump::DumpFieldToName (const char* theField)
{
- theName = theField;
+ const char* aName = theField;
- if (theName[0] == '&')
+ if (aName[0] == '&')
{
- theName = theName + 1;
+ aName = aName + 1;
}
- if (::LowerCase (theName[0]) == 'm' && theName[1] == 'y')
+ if (::LowerCase (aName[0]) == 'm' && aName[1] == 'y')
{
- theName = theName + 2;
+ aName = aName + 2;
}
+ return aName;
}
// =======================================================================
class Standard_DumpSentry;
//! The file contains interface to prepare dump output for OCCT objects. Format of the dump is JSON.
-//! To prepare this output, implement method Dump in the object and use macro functions from this file.
+//! To prepare this output, implement method DumpJson in the object and use macro functions from this file.
//! Macros have one parameter for both, key and the value. It is a field of the current class. Macro has internal analyzer that
//! uses the variable name to generate key. If the parameter has prefix symbols "&", "*" and "my", it is cut.
//!
-//! - DUMP_FIELD_VALUE_NUMERICAL. Use it for fields of numerical C++ types, like int, float, double. It creates a pair "key", "value",
-//! - DUMP_FIELD_VALUE_STRING. Use it for char* type. It creates a pair "key", "value",
-//! - DUMP_FIELD_VALUE_POINTER. Use it for pointer fields. It creates a pair "key", "value", where the value is the pointer address,
-//! - DUMP_FIELD_VALUES_DUMPED. Use it for fields that has own Dump implementation. It expects the pointer to the class instance.
+//! - OCCT_DUMP_FIELD_VALUE_NUMERICAL. Use it for fields of numerical C++ types, like int, float, double. It creates a pair "key", "value",
+//! - OCCT_DUMP_FIELD_VALUE_STRING. Use it for char* type. It creates a pair "key", "value",
+//! - OCCT_DUMP_FIELD_VALUE_POINTER. Use it for pointer fields. It creates a pair "key", "value", where the value is the pointer address,
+//! - OCCT_DUMP_FIELD_VALUES_DUMPED. Use it for fields that has own Dump implementation. It expects the pointer to the class instance.
//! It creates "key": { result of dump of the field }
-//! - DUMP_FIELD_VALUES_NUMERICAL. Use it for unlimited list of fields of C++ double type.
+//! - OCCT_DUMP_FIELD_VALUES_NUMERICAL. Use it for unlimited list of fields of C++ double type.
//! It creates massive of values [value_1, value_2, ...]
-//! - DUMP_FIELD_VALUES_STRING. Use it for unlimited list of fields of TCollection_AsciiString types.
+//! - OCCT_DUMP_FIELD_VALUES_STRING. Use it for unlimited list of fields of TCollection_AsciiString types.
//! It creates massive of values ["value_1", "value_2", ...]
-//! - DUMP_FIELD_VALUES_BY_KIND. Use if Dump implementation of the class is virtual, to perform ClassName::Dump() of the parent class,
+//! - OCCT_DUMP_BASE_CLASS. Use if Dump implementation of the class is virtual, to perform ClassName::Dump() of the parent class,
//! expected parameter is the parent class name.
//! It creates "key": { result of dump of the field }
-//! - DUMP_VECTOR_CLASS. Use it as a single row in some object dump to have one row in output.
-//! It's possible to use it without necessity of DUMP_CLASS_BEGIN call.
+//! - OCCT_DUMP_VECTOR_CLASS. Use it as a single row in some object dump to have one row in output.
+//! It's possible to use it without necessity of OCCT_DUMP_CLASS_BEGIN call.
//! It creates massive of values [value_1, value_2, ...]
//!
//! The Dump result prepared by these macros is an output stream, it is not arranged with spaces and line feed.
//! To have output in a more readable way, use ConvertToAlignedString method for obtained stream.
//! Converts the class type into a string value
-#define CLASS_NAME(theClass) #theClass
+#define OCCT_CLASS_NAME(theClass) #theClass
-//! @def DUMP_CLASS_BEGIN
+//! @def OCCT_DUMP_CLASS_BEGIN
//! Creates an instance of Sentry to cover the current Dump implementation with keys of start and end.
//! This row should be inserted before other macros. The end key will be added by the sentry remove,
//! (exit of the method).
-#define DUMP_CLASS_BEGIN(theOStream, theName) \
- Standard_DumpSentry aSentry (theOStream, CLASS_NAME(theName)); \
+#define OCCT_DUMP_CLASS_BEGIN(theOStream, theName) \
+ Standard_DumpSentry aSentry (theOStream, OCCT_CLASS_NAME(theName));
-//! @def DUMP_FIELD_VALUE_NUMERICAL
+//! @def OCCT_DUMP_FIELD_VALUE_NUMERICAL
//! Append into output value: "Name": Field
-#define DUMP_FIELD_VALUE_NUMERICAL(theOStream, theField) \
+#define OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, theField) \
{ \
- const char* aName = NULL; \
- Standard_Dump::DumpFieldToName (#theField, aName); \
- if (!Standard_Dump::EndsWith (theOStream, "{")) \
- theOStream << ", "; \
+ const char* aName = Standard_Dump::DumpFieldToName (#theField); \
+ Standard_Dump::AddValuesSeparator (theOStream); \
theOStream << "\"" << aName << "\": " << theField; \
}
-//! @def DUMP_FIELD_VALUE_STRING
+//! @def OCCT_DUMP_FIELD_VALUE_STRING
//! Append into output value: "Name": "Field"
-#define DUMP_FIELD_VALUE_STRING(theOStream, theField) \
+#define OCCT_DUMP_FIELD_VALUE_STRING(theOStream, theField) \
{ \
- const char* aName = NULL; \
- Standard_Dump::DumpFieldToName (#theField, aName); \
- if (!Standard_Dump::EndsWith (theOStream, "{")) \
- theOStream << ", "; \
+ const char* aName = Standard_Dump::DumpFieldToName (#theField); \
+ Standard_Dump::AddValuesSeparator (theOStream); \
theOStream << "\"" << aName << "\": \"" << theField << "\""; \
}
-//! @def DUMP_FIELD_VALUE_POINTER
+//! @def OCCT_DUMP_FIELD_VALUE_POINTER
//! Append into output value: "Name": "address of the pointer"
-#define DUMP_FIELD_VALUE_POINTER(theOStream, theField) \
+#define OCCT_DUMP_FIELD_VALUE_POINTER(theOStream, theField) \
{ \
- const char* aName = NULL; \
- Standard_Dump::DumpFieldToName (#theField, aName); \
- if (!Standard_Dump::EndsWith (theOStream, "{")) \
- theOStream << ", "; \
+ const char* aName = Standard_Dump::DumpFieldToName (#theField); \
+ Standard_Dump::AddValuesSeparator (theOStream); \
theOStream << "\"" << aName << "\": \"" << Standard_Dump::GetPointerInfo (theField) << "\""; \
}
-//! @def DUMP_FIELD_VALUES_DUMPED
+//! @def OCCT_DUMP_FIELD_VALUES_DUMPED
//! Append into output value: "Name": { field dumped values }
//! It computes Dump of the fields. The expected field is a pointer.
//! Use this macro for fields of the dumped class which has own Dump implementation.
//! The macros is recursive. Recursion is stopped when the depth value becomes equal to zero.
//! Depth = -1 is the default value, dump here is unlimited.
-#define DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, theField) \
+#define OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, theField) \
{ \
if (theDepth != 0) \
{ \
Standard_SStream aFieldStream; \
if ((theField) != NULL) \
(theField)->DumpJson (aFieldStream, theDepth - 1); \
- const char* aName = NULL; \
- Standard_Dump::DumpFieldToName (#theField, aName); \
+ const char* aName = Standard_Dump::DumpFieldToName (#theField); \
Standard_Dump::DumpKeyToClass (theOStream, aName, Standard_Dump::Text (aFieldStream)); \
} \
}
-//! @def DUMP_FIELD_VALUES_NUMERICAL
+//! @def OCCT_DUMP_FIELD_VALUES_NUMERICAL
//! Append real values into output values in an order: [value_1, value_2, ...]
//! It computes Dump of the parent. The expected field is a parent class name to call ClassName::Dump.
-#define DUMP_FIELD_VALUES_NUMERICAL(theOStream, theName, theCount, ...) \
+#define OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, theName, theCount, ...) \
{ \
- if (!Standard_Dump::EndsWith (theOStream, "{")) \
- theOStream << ", "; \
+ Standard_Dump::AddValuesSeparator (theOStream); \
theOStream << "\"" << theName << "\": ["; \
Standard_Dump::DumpRealValues (theOStream, theCount, __VA_ARGS__);\
theOStream << "]"; \
}
-//! @def DUMP_FIELD_VALUES_STRING
+//! @def OCCT_DUMP_FIELD_VALUES_STRING
//! Append real values into output values in an order: ["value_1", "value_2", ...]
//! It computes Dump of the parent. The expected field is a parent class name to call ClassName::Dump.
-#define DUMP_FIELD_VALUES_STRING(theOStream, theName, theCount, ...) \
+#define OCCT_DUMP_FIELD_VALUES_STRING(theOStream, theName, theCount, ...) \
{ \
- if (!Standard_Dump::EndsWith (theOStream, "{")) \
- theOStream << ", "; \
+ Standard_Dump::AddValuesSeparator (theOStream); \
theOStream << "\"" << theName << "\": ["; \
Standard_Dump::DumpCharacterValues (theOStream, theCount, __VA_ARGS__);\
theOStream << "]"; \
}
-//! @def DUMP_FIELD_VALUES_BY_KIND
+//! @def OCCT_DUMP_BASE_CLASS
//! Append into output value: "Name": { field dumped values }
//! It computes Dump of the parent. The expected field is a parent class name to call ClassName::Dump.
//! Use this macro for parent of the current class.
//! The macros is recursive. Recursive is stoped when the depth value becomes equal to zero.
//! Depth = -1 is the default value, dump here is unlimited.
-#define DUMP_FIELD_VALUES_BY_KIND(theOStream, theDepth, theField) \
+#define OCCT_DUMP_BASE_CLASS(theOStream, theDepth, theField) \
{ \
if (theDepth != 0) \
{ \
Standard_SStream aFieldStream; \
theField::DumpJson (aFieldStream, theDepth - 1); \
- const char* aName = NULL; \
- Standard_Dump::DumpFieldToName (#theField, aName); \
+ const char* aName = Standard_Dump::DumpFieldToName (#theField); \
Standard_Dump::DumpKeyToClass (theOStream, aName, Standard_Dump::Text (aFieldStream)); \
} \
}
-//! @def DUMP_VECTOR_CLASS
+//! @def OCCT_DUMP_VECTOR_CLASS
//! Append vector values into output value: "Name": [value_1, value_2, ...]
//! This macro is intended to have only one row for dumped object in Json.
-//! It's possible to use it without necessity of DUMP_CLASS_BEGIN call, but pay attention that it should be only one row in the object dump.
-#define DUMP_VECTOR_CLASS(theOStream, theName, theCount, ...) \
+//! It's possible to use it without necessity of OCCT_DUMP_CLASS_BEGIN call, but pay attention that it should be only one row in the object dump.
+#define OCCT_DUMP_VECTOR_CLASS(theOStream, theName, theCount, ...) \
{ \
- theOStream << "\"" << CLASS_NAME(theName) << "\": ["; \
+ theOStream << "\"" << OCCT_CLASS_NAME(theName) << "\": ["; \
Standard_Dump::DumpRealValues (theOStream, theCount, __VA_ARGS__);\
theOStream << "]"; \
}
//! @return text presentation
Standard_EXPORT static TCollection_AsciiString FormatJson (const Standard_SStream& theStream, const Standard_Integer theIndent = 3);
- //! Determines whether the end of this stream matches the specified string.
+ //! Add Json values separator if the stream last symbol is not an open brace.
//! @param theStream source value
- //! @param theEndString text value to find
- //! @return true if matches
- static Standard_EXPORT Standard_Boolean EndsWith (const Standard_OStream& theOStream,
- const TCollection_AsciiString& theEndString);
+ static Standard_EXPORT void AddValuesSeparator (Standard_OStream& theOStream);
//! Returns default prefix added for each pointer info string if short presentation of pointer used
Standard_EXPORT static TCollection_AsciiString GetPointerPrefix() { return "0x"; }
//! An example, for field myValue, theName is Value, for &myCLass, the name is Class
//! @param theField a source value
//! @param theName [out] an updated name
- Standard_EXPORT static void DumpFieldToName (const char* theField, const char*& theName);
+ Standard_EXPORT static const char* DumpFieldToName (const char* theField);
};
#endif // _Standard_Dump_HeaderFile
//=======================================================================
void TopLoc_Datum3D::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, TopLoc_Datum3D);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTrsf);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, TopLoc_Datum3D);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTrsf);
}
//=======================================================================
//=======================================================================
void TopLoc_ItemLocation::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, TopLoc_ItemLocation);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, TopLoc_ItemLocation);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTrsf);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDatum.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTrsf);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDatum.get());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPower);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPower);
}
//=======================================================================
void TopLoc_Location::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, TopLoc_Location);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, TopLoc_Location);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Transformation());
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsIdentity());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Transformation());
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsIdentity());
}
//=======================================================================
//=======================================================================
void TopoDS_Shape::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, TopoDS_Shape);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, TopoDS_Shape);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTShape.get());
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLocation);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTShape.get());
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLocation);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOrient);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOrient);
}
//=======================================================================
void TopoDS_TShape::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_CLASS_BEGIN (theOStream, TopoDS_TShape);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFlags);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, TopoDS_TShape);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFlags);
}
//=======================================================================
void XCAFPrs_Style::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, XCAFPrs_Style);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, XCAFPrs_Style);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColorSurf);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColorCurv);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColorSurf);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColorCurv);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasColorSurf);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasColorCurv);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsVisible);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasColorSurf);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasColorCurv);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsVisible);
}
//=======================================================================
void gp_Mat::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_VECTOR_CLASS (theOStream, gp_Mat, 9, Mat00, Mat01, Mat02, Mat10, Mat11, Mat12, Mat20, Mat21, Mat22);
+ OCCT_DUMP_VECTOR_CLASS (theOStream, gp_Mat, 9, Mat00, Mat01, Mat02, Mat10, Mat11, Mat12, Mat20, Mat21, Mat22);
}
//=======================================================================
void gp_Trsf::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
- DUMP_CLASS_BEGIN (theOStream, gp_Trsf);
+ OCCT_DUMP_CLASS_BEGIN (theOStream, gp_Trsf);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &loc);
- DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &matrix);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &loc);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &matrix);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, shape);
- DUMP_FIELD_VALUE_NUMERICAL (theOStream, scale);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, shape);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, scale);
}
//=======================================================================
void gp_XYZ::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
- DUMP_VECTOR_CLASS (theOStream, gp_XYZ, 3, x, y, z)
+ OCCT_DUMP_VECTOR_CLASS (theOStream, gp_XYZ, 3, x, y, z)
}