1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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:
nds
2019-09-19 15:13:42 +03:00
committed by bugmaster
parent c42ef16585
commit 0904aa6395
83 changed files with 1420 additions and 4 deletions

View File

@@ -26,6 +26,7 @@
#include <gp_XYZ.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_Dump.hxx>
#define M00 ((Standard_Real*)M)[0]
#define M01 ((Standard_Real*)M)[1]
@@ -268,3 +269,11 @@ void gp_Mat::Power (const Standard_Integer N)
}
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
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);
}

View File

@@ -255,6 +255,9 @@ public:
//! Transposes the matrix. A(j, i) -> A (i, j)
Standard_NODISCARD gp_Mat Transposed() const;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
friend class gp_XYZ;
friend class gp_Trsf;

View File

@@ -34,6 +34,7 @@
#include <gp_XYZ.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_Dump.hxx>
//=======================================================================
//function : gp_Trsf
@@ -849,3 +850,18 @@ void gp_Trsf::Orthogonalize()
matrix = aTM;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void gp_Trsf::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
DUMP_CLASS_BEGIN (theOStream, gp_Trsf);
DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &loc);
DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &matrix);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, shape);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, scale);
}

View File

@@ -24,6 +24,7 @@
#include <Standard_DefineAlloc.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Handle.hxx>
#include <Standard_OStream.hxx>
#include <Standard_Real.hxx>
class Standard_ConstructionError;
@@ -349,6 +350,9 @@ void operator *= (const gp_Trsf& T)
theMat.SetValue (3, 3, static_cast<T> (1));
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
friend class gp_GTrsf;
protected:

View File

@@ -17,6 +17,7 @@
#include <gp_XYZ.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_Dump.hxx>
Standard_Boolean gp_XYZ::IsEqual (const gp_XYZ& Other,
const Standard_Real Tolerance) const {
@@ -33,3 +34,11 @@ Standard_Boolean gp_XYZ::IsEqual (const gp_XYZ& Other,
return Standard_True;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void gp_XYZ::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
DUMP_VECTOR_CLASS (theOStream, gp_XYZ, 3, x, y, z)
}

View File

@@ -22,6 +22,9 @@
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_OStream.hxx>
class Standard_ConstructionError;
class Standard_OutOfRange;
class gp_Mat;
@@ -324,6 +327,8 @@ public:
void SetLinearForm (const gp_XYZ& XYZ1, const gp_XYZ& XYZ2);
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
protected: