1
0
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:
nds
2020-01-28 12:03:38 +03:00
committed by bugmaster
parent 00ea7f2676
commit bc73b00672
532 changed files with 5237 additions and 419 deletions

View File

@@ -67,20 +67,33 @@ void Graphic3d_Aspects::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTe
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_Aspects::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
void Graphic3d_Aspects::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Aspects);
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
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);
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)
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);
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)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlphaMode)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlphaCutoff)
if (!myTextFont.IsNull())
{
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myTextFont->String())
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextStyle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextDisplayType)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextFontAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextAngle)
}

View File

@@ -523,7 +523,8 @@ public:
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:

View File

@@ -60,6 +60,18 @@ Graphic3d_Fresnel Graphic3d_Fresnel::CreateConductor (const Graphic3d_Vec3& theR
return Graphic3d_Fresnel (Graphic3d_FM_SCHLICK, aFresnel);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_Fresnel::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Fresnel)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFresnelType)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myFresnelData)
}
// =======================================================================
// function : Graphic3d_BSDF
// purpose :
@@ -226,3 +238,22 @@ Graphic3d_BSDF Graphic3d_BSDF::CreateMetallicRoughness (const Graphic3d_PBRMater
return aBsdf;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_BSDF::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_BSDF)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Kc)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Kd)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Ks)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Kt)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Le)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Absorption)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &FresnelCoat)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &FresnelBase)
}

View File

@@ -89,6 +89,9 @@ public:
return myFresnelType;
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
//! Creates new Fresnel reflectance factor.
@@ -185,6 +188,9 @@ public:
//! Performs comparison of two BSDFs.
Standard_EXPORT bool operator== (const Graphic3d_BSDF& theOther) const;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
};
#endif // _Graphic3d_BSDF_HeaderFile

View File

@@ -61,6 +61,19 @@ public:
return true;
}
//! 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, NCollection_Buffer)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, Colors)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, Bounds)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbBounds)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbMaxBounds)
}
public:
Graphic3d_Vec4* Colors; //!< pointer to facet color values

View File

@@ -19,3 +19,17 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Buffer, NCollection_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_IndexBuffer, Graphic3d_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_BoundBuffer, NCollection_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_MutableIndexBuffer, Graphic3d_IndexBuffer)
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_Buffer::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, NCollection_Buffer)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Stride)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbElements)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbAttributes)
}

View File

@@ -315,6 +315,9 @@ public:
//! Invalidate entire buffer.
virtual void Invalidate() {}
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
public:
Standard_Integer Stride; //!< the distance to the attributes of the next vertex within interleaved array

View File

@@ -18,6 +18,7 @@
#include <Graphic3d_StructureManager.hxx>
#include <Graphic3d_TransModeFlags.hxx>
#include <Graphic3d_GraphicDriver.hxx>
#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CStructure,Standard_Transient)
@@ -44,3 +45,44 @@ Graphic3d_CStructure::Graphic3d_CStructure (const Handle(Graphic3d_StructureMana
{
Id = myGraphicDriver->NewIdentification();
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_CStructure::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
for (Graphic3d_SequenceOfGroup::Iterator anIterator (myGroups); anIterator.More(); anIterator.Next())
{
const Handle(Graphic3d_Group)& aGroup = anIterator.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aGroup.get())
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Id)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZLayer)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Priority)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PreviousPriority)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ContainsFacet)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsInfinite)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, stick)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, highlight)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, visible)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, HLRValidation)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsForHighlight)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsMutable)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Is2dText)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTrsf.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTrsfPers.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myClipPlanes.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myHighlightStyle.get())
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsCulled)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myBndBoxClipCheck)
}

View File

@@ -194,6 +194,9 @@ public:
//! Update render transformation matrix.
virtual void updateLayerTransformation() {}
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
public:
int Id;

View File

@@ -1546,3 +1546,18 @@ void Graphic3d_Camera::FrustumPoints (NCollection_Array1<Graphic3d_Vec3d>& thePo
aTmpPnt = anInvWorldView * aLeftBottomFar;
thePoints.SetValue (FrustumVert_LeftBottomFar, aTmpPnt.xyz() / aTmpPnt.w());
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_Camera::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myUp)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDirection)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEye)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDistance)
}

View File

@@ -552,6 +552,9 @@ public:
//! The matrix will be updated on request.
Standard_EXPORT void InvalidateOrientation();
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
//! @name Managing projection and orientation cache
private:

View File

@@ -338,3 +338,32 @@ void Graphic3d_ClipPlane::SetChainNextPlane (const Handle(Graphic3d_ClipPlane)&
}
updateChainLen();
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myNextInChain.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myPrevInChain)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myId)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPlane)
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "Equation", 4, myEquation.x(), myEquation.y(), myEquation.z(), myEquation.w())
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "EquationRev", 4, myEquationRev.x(), myEquationRev.y(), myEquationRev.z(), myEquationRev.w())
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myChainLenFwd)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFlags)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myEquationMod)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAspectMod)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsOn)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsCapping)
}

View File

@@ -377,6 +377,9 @@ public:
return !IsPointOutHalfspace (aMinPnt);
}
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
public: // @name modification counters
//! @return modification counter for equation.

View File

@@ -452,10 +452,11 @@ void Graphic3d_Group::AddText (const Handle(Graphic3d_Text)& theTextParams,
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_Group::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
void Graphic3d_Group::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Group);
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet)
}

View File

@@ -277,7 +277,7 @@ public:
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:

View File

@@ -516,3 +516,15 @@ const Standard_Byte* Graphic3d_HatchStyle::Pattern() const
? (const Standard_Byte*)myPredefinedPatterns[myHatchType]
: NULL);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_HatchStyle::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPattern.get())
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHatchType)
}

View File

@@ -49,6 +49,9 @@ public:
return myHatchType;
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:
Handle(NCollection_Buffer) myPattern; //!< Image bitmap with custom hatch pattern

View File

@@ -77,6 +77,12 @@ public:
}
}
//! 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, Graphic3d_Buffer)
}
};

View File

@@ -626,3 +626,38 @@ void Graphic3d_Layer::SetLayerSettings (const Graphic3d_ZLayerSettings& theSetti
}
}
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_Layer::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLayerId)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNbStructures)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNbStructuresNotCulled)
const Standard_Integer aNbPriorities = myArray.Length();
for (Standard_Integer aPriorityIter = 0; aPriorityIter < aNbPriorities; ++aPriorityIter)
{
const Graphic3d_IndexedMapOfStructure& aStructures = myArray (aPriorityIter);
for (Graphic3d_IndexedMapOfStructure::Iterator aStructIter (aStructures); aStructIter.More(); aStructIter.Next())
{
const Graphic3d_CStructure* aStructure = aStructIter.Value();
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, aStructure)
}
}
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLayerSettings)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myBVHIsLeftChildQueuedFirst)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsBVHPrimitivesNeedsReset)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsBoundingBoxNeedsReset[0])
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsBoundingBoxNeedsReset[1])
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBoundingBox[0])
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBoundingBox[1])
}

View File

@@ -144,6 +144,9 @@ public:
//! Returns indexed map of always rendered structures.
const NCollection_IndexedMap<const Graphic3d_CStructure*>& NonCullableStructures() const { return myAlwaysRenderedMap; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
//! Updates BVH trees if their state has been invalidated.

View File

@@ -712,3 +712,29 @@ Graphic3d_TypeOfMaterial Graphic3d_MaterialAspect::MaterialType (const Standard_
const RawMaterial& aMat = THE_MATERIALS[theRank - 1];
return aMat.MaterialType;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_MaterialAspect::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_MaterialAspect)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBSDF)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPBRMaterial)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myStringName)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColors[Graphic3d_TOR_AMBIENT])
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColors[Graphic3d_TOR_DIFFUSE])
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColors[Graphic3d_TOR_SPECULAR])
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColors[Graphic3d_TOR_EMISSION])
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTransparencyCoef)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRefractionIndex)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShininess)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaterialType)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaterialName)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRequestedMaterialName)
}

View File

@@ -215,6 +215,9 @@ public:
//! Returns TRUE if this material is identical to specified one.
Standard_Boolean operator== (const Graphic3d_MaterialAspect& theOther) const { return IsEqual (theOther); }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
public:
//! Deactivates the reflective properties of the surface with specified reflection type.

View File

@@ -349,3 +349,19 @@ Graphic3d_Vec3 Graphic3d_PBRMaterial::lutGenReflect (const Graphic3d_Vec3 &theVe
{
return theAxis * theAxis.Dot(theVector) * 2.f - theVector;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_PBRMaterial::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_PBRMaterial)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMetallic)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRoughness)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEmission)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIOR)
}

View File

@@ -152,6 +152,9 @@ public:
Standard_EXPORT static Standard_ShortReal SpecIBLMapSamplesFactor (Standard_ShortReal theProbability,
Standard_ShortReal theRoughness);
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:
//! Calculates geometry factor of Cook-Torrance BRDF using Smith formula.

View File

@@ -19,11 +19,11 @@
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_PolygonOffset::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
void Graphic3d_PolygonOffset::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_PolygonOffset);
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_PolygonOffset)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Mode);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Factor);
OCCT_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)
}

View File

@@ -36,7 +36,7 @@ struct Graphic3d_PolygonOffset
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
};

View File

@@ -15,4 +15,21 @@
#include <Graphic3d_PresentationAttributes.hxx>
#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT (Graphic3d_PresentationAttributes, Standard_Transient)
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_PresentationAttributes::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBasicFillAreaAspect.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBasicColor)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHiMethod)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZLayer)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDispMode)
}

View File

@@ -90,6 +90,9 @@ public:
//! Sets basic presentation fill area aspect.
virtual void SetBasicFillAreaAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) { myBasicFillAreaAspect = theAspect; }
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
Handle(Graphic3d_AspectFillArea3d) myBasicFillAreaAspect; //!< presentation fill area aspect

View File

@@ -58,3 +58,18 @@ bool Graphic3d_SequenceOfHClipPlane::Remove (const Handle(Graphic3d_ClipPlane)&
}
return false;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_SequenceOfHClipPlane::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToOverrideGlobal)
for (NCollection_Sequence<Handle(Graphic3d_ClipPlane)>::Iterator anIterator (myItems); anIterator.More(); anIterator.Next())
{
const Handle(Graphic3d_ClipPlane)& aClipPlane = anIterator.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aClipPlane.get())
}
}

View File

@@ -94,6 +94,9 @@ public:
//! Return the first item in sequence.
const Handle(Graphic3d_ClipPlane)& First() const { return myItems.First(); }
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
NCollection_Sequence<Handle(Graphic3d_ClipPlane)> myItems;

View File

@@ -30,6 +30,8 @@
#include "Graphic3d_Structure.pxx"
#include <Standard_Dump.hxx>
#include <stdio.h>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Structure,Standard_Transient)
@@ -1027,3 +1029,17 @@ void Graphic3d_Structure::SetZLayer (const Graphic3d_ZLayerId theLayerId)
myStructureManager->ChangeZLayer (this, theLayerId);
myCStructure->SetZLayer (theLayerId);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_Structure::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCStructure.get())
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisual)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComputeVisual)
}

View File

@@ -432,6 +432,9 @@ public:
//! Returns the low-level structure
const Handle(Graphic3d_CStructure)& CStructure() const { return myCStructure; }
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
//! Transforms boundaries with <theTrsf> transformation.

View File

@@ -51,3 +51,38 @@ Handle(Graphic3d_TransformPers) Graphic3d_TransformPers::FromDeprecatedParams (G
}
return aTrsfPers;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_TransformPers::PersParams3d::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
gp_Pnt anAttachPoint (PntX, PntY, PntZ);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &anAttachPoint)
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_TransformPers::PersParams2d::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, OffsetX)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, OffsetY)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Corner)
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_TransformPers::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMode)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParams.Params3d)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParams.Params2d)
}

View File

@@ -283,6 +283,9 @@ public:
const Standard_Integer theViewportWidth,
const Standard_Integer theViewportHeight) const;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:
//! 3D anchor point for zoom/rotate transformation persistence.
@@ -291,6 +294,9 @@ private:
Standard_Real PntX;
Standard_Real PntY;
Standard_Real PntZ;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
};
//! 2d/trihedron transformation persistence parameters.
@@ -299,6 +305,9 @@ private:
Standard_Integer OffsetX;
Standard_Integer OffsetY;
Aspect_TypeOfTriedronPosition Corner;
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
};
private:

View File

@@ -15,6 +15,17 @@
#include <Graphic3d_ViewAffinity.hxx>
#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ViewAffinity,Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ViewAffinity,Standard_Transient)
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_ViewAffinity::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMask)
}

View File

@@ -59,6 +59,9 @@ public:
}
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:
unsigned int myMask; //!< affinity mask

View File

@@ -19,6 +19,7 @@
#include <Graphic3d_LightSet.hxx>
#include <Graphic3d_PolygonOffset.hxx>
#include <Precision.hxx>
#include <Standard_Dump.hxx>
#include <TCollection_AsciiString.hxx>
enum Graphic3d_ZLayerSetting
@@ -208,6 +209,29 @@ struct Graphic3d_ZLayerSettings
myPolygonOffset.Units =-1.0f;
}
//! Dumps the content of me into the stream
void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_ZLayerSettings)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myOriginTrsf.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myOrigin)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCullingDistance)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCullingSize)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPolygonOffset)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsImmediate)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToRaytrace)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUseEnvironmentTexture)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToEnableDepthTest)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToEnableDepthWrite)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToClearDepth)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToRenderInDepthPrepass)
}
protected:
TCollection_AsciiString myName; //!< user-provided name