mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0030949: Foundation Classes - Dump improvement for OCCT classes
1. new file Standard_Dump to prepare and parse Dump in JSON format for OCCT objects 2. some presentations cover the proposed dump functionality. 3. 'bounding', 'vaspects' has '-dumpJson' field to see the DumpJson result 4. Bnd_Box constructor with min/max points is implemented to use Dump of this class in Dump BVH_Box 5. Limitation (some classes of Graphic3d, Prs3d has not full filling for DumpJson)
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_Dump.hxx>
|
||||
|
||||
// set the flag to one
|
||||
#define ClearVoidFlag() ( Flags &= ~VoidMask )
|
||||
@@ -43,6 +44,18 @@ Bnd_Box::Bnd_Box()
|
||||
SetVoid();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Bnd_Box
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Bnd_Box::Bnd_Box (const gp_Pnt theMin, const gp_Pnt theMax)
|
||||
: Gap (0.0)
|
||||
{
|
||||
SetVoid();
|
||||
Update (theMin.X(), theMin.Y(), theMin.Z(), theMax.X(), theMax.Y(), theMax.Z());
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
@@ -957,3 +970,18 @@ void Bnd_Box::Dump () const
|
||||
std::cout << "\n Gap : " << Gap;
|
||||
std::cout << "\n";
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DumpJson
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Bnd_Box::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
|
||||
{
|
||||
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)
|
||||
|
||||
DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap);
|
||||
DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags);
|
||||
}
|
||||
|
Reference in New Issue
Block a user