1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0030268: Inspectors - improvements in VInspector plugin

# Dump for OCCT objects
This commit is contained in:
nds
2019-11-01 08:06:34 +03:00
parent 98d49da76f
commit 5a60253c55
43 changed files with 418 additions and 24 deletions

View File

@@ -1242,6 +1242,9 @@ public: //! @name sub-intensity management (deprecated)
//! @param theSelection an instance of the selection
void SetSelection (const Handle(AIS_Selection)& theSelection) { mySelection = theSelection; }
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
protected: //! @name internal methods
Standard_EXPORT void GetDefModes (const Handle(AIS_InteractiveObject)& anIobj, Standard_Integer& Dmode, Standard_Integer& HiMod, Standard_Integer& SelMode) const;

View File

@@ -86,3 +86,42 @@ void AIS_InteractiveContext::PolygonOffsets(
anObj->PolygonOffsets( aMode, aFactor, aUnits );
}
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void AIS_InteractiveContext::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, AIS_InteractiveContext);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myObjects.Size());
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, mgrSelector.get());
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMainPM.get());
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMainVwr.get());
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMainSel.get());
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myLastActiveView);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myLastPicked.get());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToHilightSelected);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, mySelection.get());
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myFilters.get());
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myDefaultDrawer.get());
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_Selected]);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_Dynamic]);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_LocalSelected]);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_LocalDynamic]);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStyles[Prs3d_TypeOfHighlight_SubIntensity]);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDetectedSeq.Size());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurDetected);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurHighlighted);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPickingStrategy);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAutoHilight);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsAutoActivateSelMode);
}

View File

@@ -108,3 +108,27 @@ void Graphic3d_AspectFillCapping::SetHatchRotationPeristent (const Standard_Bool
setFlag (theToSet, Flags_HatchRotationPersistent);
myHatchingState++;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_AspectFillCapping::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_AspectFillCapping);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Graphic3d_Aspects);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMaterial);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMaterial);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myTexture);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myShader);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStippleHatch);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myTextureHatch);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myHatchMaterial);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFlags);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHatchingState);
}

View File

@@ -121,6 +121,9 @@ public:
//! Returns modification counter for hatching state.
Standard_Size HatchingState() const { return myHatchingState; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
private:
enum Flags

View File

@@ -70,6 +70,14 @@ void Graphic3d_Aspects::DumpJson (Standard_OStream& theOStream, const Standard_I
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Aspects);
/*Handle(Graphic3d_ShaderProgram) myProgram;
Handle(Graphic3d_TextureSet) myTextureSet;
Handle(Graphic3d_MarkerImage) myMarkerImage;
Handle(Graphic3d_HatchStyle) myHatchStyle;
Handle(TCollection_HAsciiString) myTextFont;
Graphic3d_MaterialAspect myFrontMaterial;
Graphic3d_MaterialAspect myBackMaterial;*/
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInteriorColor);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBackInteriorColor);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdgeColor);
@@ -82,4 +90,23 @@ void Graphic3d_Aspects::DumpJson (Standard_OStream& theOStream, const Standard_I
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSuppressBackFaces);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToMapTexture);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextZoomable);
/*Aspect_InteriorStyle myInteriorStyle;
Graphic3d_TypeOfShadingModel myShadingModel;
Graphic3d_AlphaMode myAlphaMode;
Standard_ShortReal myAlphaCutoff;
Aspect_TypeOfLine myLineType;
Standard_ShortReal myLineWidth;
Aspect_TypeOfMarker myMarkerType;
Standard_ShortReal myMarkerScale;*/
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

@@ -58,6 +58,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, const 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 :
@@ -189,4 +201,23 @@ Graphic3d_BSDF Graphic3d_BSDF::CreateGlass (const Graphic3d_Vec3& theWeight,
theAbsorptionCoeff);
return aBSDF;
}
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_BSDF::DumpJson (Standard_OStream& theOStream, const 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

@@ -87,6 +87,9 @@ public:
return myFresnelType;
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
protected:
//! Creates new Fresnel reflectance factor.
@@ -180,6 +183,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, const Standard_Integer theDepth = -1) const;
};
#endif // _Graphic3d_BSDF_HeaderFile

View File

@@ -281,6 +281,8 @@ void Graphic3d_ClipPlane::SetChainNextPlane (const Handle(Graphic3d_ClipPlane)&
// =======================================================================
void Graphic3d_ClipPlane::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_ClipPlane);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySectionStyle.get());
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myEntityUID);

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, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_HatchStyle);
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, const Standard_Integer theDepth = -1) const;
private:
Handle(NCollection_Buffer) myPattern; //!< Image bitmap with custom hatch pattern

View File

@@ -702,3 +702,28 @@ 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, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_MaterialAspect);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBSDF);
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

@@ -227,6 +227,9 @@ public:
}
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
private:
//! Initialize the standard material.

View File

@@ -58,6 +58,8 @@ Handle(Graphic3d_TransformPers) Graphic3d_TransformPers::FromDeprecatedParams (G
// =======================================================================
void Graphic3d_TransformPers::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_TransformPers);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMode)
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "Params3d", 3, myParams.Params3d.PntX, myParams.Params3d.PntY, myParams.Params3d.PntZ)

View File

@@ -17,6 +17,7 @@
#define _NCollection_Buffer_HeaderFile
#include <NCollection_BaseAllocator.hxx>
#include <Standard_Dump.hxx>
#include <Standard_Transient.hxx>
//! Low-level buffer object.
@@ -122,6 +123,15 @@ public:
mySize = 0;
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
{
(void)theDepth;
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myData);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySize);
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myAllocator.get());
}
protected:
Standard_Byte* myData; //!< data pointer

View File

@@ -18,6 +18,7 @@
#include <cstring>
#include <cmath>
#include <NCollection_Vec2.hxx>
#include <Standard_Dump.hxx>
//! Auxiliary macros to define couple of similar access components as vector methods
#define NCOLLECTION_VEC_COMPONENTS_3D(theX, theY, theZ) \
@@ -403,6 +404,13 @@ public:
return NCollection_Vec3 (Element_t(0), Element_t(0), Element_t(1));
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
{
(void)theDepth;
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "Vec3", 3, v[0], v[1], v[2]);
}
private:
Element_t v[3]; //!< define the vector as array to avoid structure alignment issues

View File

@@ -16,6 +16,7 @@
#define _NCollection_Vec4_H__
#include <NCollection_Vec3.hxx>
#include <Standard_Dump.hxx>
//! Generic 4-components vector.
//! To be used as RGBA color vector or XYZW 3D-point with special W-component
@@ -375,6 +376,13 @@ public:
return aResult /= theRight;
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
{
(void)theDepth;
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "Vec4", 4, v[0], v[1], v[2], v[3]);
}
private:
Element_t v[4]; //!< define the vector as array to avoid structure alignment issues

View File

@@ -341,9 +341,14 @@ namespace
// function : RenderCapping
// purpose :
// =======================================================================
#include <Message_Alerts.hxx>
#include <Message_PerfMeter.hxx>
void OpenGl_CappingAlgo::RenderCapping (const Handle(OpenGl_Workspace)& theWorkspace,
const OpenGl_Structure& theStructure)
{
Message_PerfMeter aPerfMeter;
MESSAGE_INFO ("RenderCapping", "", &aPerfMeter, NULL);
const Handle(OpenGl_Context)& aContext = theWorkspace->GetGlContext();
if (!aContext->Clipping().IsCappingOn())
{
@@ -380,12 +385,17 @@ void OpenGl_CappingAlgo::RenderCapping (const Handle(OpenGl_Workspace)& theWorks
{
// get plane being rendered
const Handle(Graphic3d_ClipPlane)& aClipChain = aCappingIt.Value();
if (!aClipChain->IsCapping()
|| aCappingIt.IsDisabled())
{
continue;
}
Standard_SStream aStream;
aClipChain->DumpJson (aStream);
MESSAGE_INFO_STREAM(aStream, "ClipChain", "", &aPerfMeter, NULL);
Standard_Integer aSubPlaneIndex = 1;
for (const Graphic3d_ClipPlane* aSubPlaneIter = aClipChain.get(); aSubPlaneIter != NULL; aSubPlaneIter = aSubPlaneIter->ChainNextPlane().get(), ++aSubPlaneIndex)
{

View File

@@ -1443,4 +1443,102 @@ void Prs3d_Drawer::DumpJson (Standard_OStream& theOStream, const Standard_Intege
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Prs3d_Drawer);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myShadingAspect.get());
//Handle(Prs3d_Drawer) myLink;
/*
Standard_Boolean myHasOwnNbPoints;
Standard_Real myMaximalParameterValue;
Standard_Boolean myHasOwnMaximalParameterValue;
Standard_Real myChordialDeviation;
Standard_Boolean myHasOwnChordialDeviation;
Aspect_TypeOfDeflection myTypeOfDeflection;
Standard_Boolean myHasOwnTypeOfDeflection;
Prs3d_TypeOfHLR myTypeOfHLR;
Standard_Real myDeviationCoefficient;
Standard_Real myPreviousDeviationCoefficient;
Standard_Boolean myHasOwnDeviationCoefficient;
Standard_Real myHLRDeviationCoefficient;
Standard_Boolean myHasOwnHLRDeviationCoefficient;
Standard_Real myPreviousHLRDeviationCoefficient;
Standard_Real myDeviationAngle;
Standard_Boolean myHasOwnDeviationAngle;
Standard_Real myPreviousDeviationAngle;
Standard_Real myHLRAngle;
Standard_Boolean myHasOwnHLRDeviationAngle;
Standard_Real myPreviousHLRDeviationAngle;
Standard_Boolean myIsoOnPlane;
Standard_Boolean myHasOwnIsoOnPlane;
Standard_Boolean myIsoOnTriangulation;
Standard_Boolean myHasOwnIsoOnTriangulation;
Standard_Boolean myIsAutoTriangulated;
Standard_Boolean myHasOwnIsAutoTriangulated;*/
/*Handle(Prs3d_IsoAspect) myUIsoAspect;
Standard_Boolean myHasOwnUIsoAspect;
Handle(Prs3d_IsoAspect) myVIsoAspect;
Standard_Boolean myHasOwnVIsoAspect;
Handle(Prs3d_LineAspect) myWireAspect;
Standard_Boolean myHasOwnWireAspect;
Standard_Boolean myWireDraw;
Standard_Boolean myHasOwnWireDraw;
Handle(Prs3d_PointAspect) myPointAspect;
Standard_Boolean myHasOwnPointAspect;
Handle(Prs3d_LineAspect) myLineAspect;
Standard_Boolean myHasOwnLineAspect;
*/
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnTextAspect);
if (!myTextAspect.IsNull())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get());
//Handle(Prs3d_ShadingAspect) myShadingAspect;
//Standard_Boolean myHasOwnShadingAspect;
/*Handle(Prs3d_PlaneAspect) myPlaneAspect;
Standard_Boolean myHasOwnPlaneAspect;
Handle(Prs3d_LineAspect) mySeenLineAspect;
Standard_Boolean myHasOwnSeenLineAspect;
Handle(Prs3d_ArrowAspect) myArrowAspect;
Standard_Boolean myHasOwnArrowAspect;
Standard_Boolean myLineArrowDraw;
Standard_Boolean myHasOwnLineArrowDraw;
Handle(Prs3d_LineAspect) myHiddenLineAspect;
Standard_Boolean myHasOwnHiddenLineAspect;
Standard_Boolean myDrawHiddenLine;
Standard_Boolean myHasOwnDrawHiddenLine;
Handle(Prs3d_LineAspect) myVectorAspect;
Standard_Boolean myHasOwnVectorAspect;
Prs3d_VertexDrawMode myVertexDrawMode;
Handle(Prs3d_DatumAspect) myDatumAspect;
Standard_Boolean myHasOwnDatumAspect;
Handle(Prs3d_LineAspect) mySectionAspect;
Standard_Boolean myHasOwnSectionAspect;
Handle(Prs3d_LineAspect) myFreeBoundaryAspect;
Standard_Boolean myHasOwnFreeBoundaryAspect;
Standard_Boolean myFreeBoundaryDraw;
Standard_Boolean myHasOwnFreeBoundaryDraw;
Handle(Prs3d_LineAspect) myUnFreeBoundaryAspect;
Standard_Boolean myHasOwnUnFreeBoundaryAspect;
Standard_Boolean myUnFreeBoundaryDraw;
Standard_Boolean myHasOwnUnFreeBoundaryDraw;
Handle(Prs3d_LineAspect) myFaceBoundaryAspect;
Standard_Integer myFaceBoundaryUpperContinuity; //!< the most edge continuity class (GeomAbs_Shape) to be included to face boundaries presentation, or -1 if undefined
Standard_Boolean myHasOwnFaceBoundaryAspect;
Standard_Boolean myFaceBoundaryDraw;
Standard_Boolean myHasOwnFaceBoundaryDraw;
Handle(Prs3d_DimensionAspect) myDimensionAspect;
Standard_Boolean myHasOwnDimensionAspect;
Prs3d_DimensionUnits myDimensionModelUnits;
Standard_Boolean myHasOwnDimLengthModelUnits;
Standard_Boolean myHasOwnDimAngleModelUnits;
Prs3d_DimensionUnits myDimensionDisplayUnits;
Standard_Boolean myHasOwnDimLengthDisplayUnits;
Standard_Boolean myHasOwnDimAngleDisplayUnits;
*/
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnFillCappingAspect);
if (!myFillCappingAspect.IsNull())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myFillCappingAspect.get());
}

View File

@@ -71,7 +71,7 @@ public:
Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Select3D_InteriorSensitivePointSet,Select3D_SensitiveSet)

View File

@@ -128,6 +128,7 @@ Select3D_BndBox3d Select3D_SensitiveBox::BoundingBox()
void Select3D_SensitiveBox::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitiveBox);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBox);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCenter3d);

View File

@@ -71,7 +71,7 @@ public:
Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -151,6 +151,7 @@ Standard_Integer Select3D_SensitiveFace::NbSubElements()
void Select3D_SensitiveFace::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitiveFace);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySensType);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myFacePoints.get());

View File

@@ -74,7 +74,7 @@ public:
Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -369,7 +369,6 @@ Standard_Real Select3D_SensitiveGroup::distanceToCOG (SelectBasics_SelectingVolu
void Select3D_SensitiveGroup::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitiveGroup);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveSet);
for (Select3D_IndexedMapOfEntity::Iterator anIterator (myEntities); anIterator.More(); anIterator.Next())

View File

@@ -144,7 +144,7 @@ public:
Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:

View File

@@ -93,6 +93,7 @@ Standard_Integer Select3D_SensitivePoint::NbSubElements()
void Select3D_SensitivePoint::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitivePoint);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPoint);
}

View File

@@ -51,7 +51,7 @@ public:
Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -318,7 +318,6 @@ gp_Pnt Select3D_SensitivePoly::CenterOfGeometry() const
void Select3D_SensitivePoly::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitivePoly);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveSet);
//Select3D_PointData myPolyg; //!< Points of the poly

View File

@@ -93,7 +93,7 @@ public:
const Standard_Integer theIdx2) Standard_OVERRIDE;
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:

View File

@@ -1226,7 +1226,6 @@ Standard_Boolean Select3D_SensitivePrimitiveArray::elementIsInside (SelectBasics
void Select3D_SensitivePrimitiveArray::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitivePrimitiveArray);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveSet);
//Handle(Select3D_PrimArraySubGroupArray) myGroups; //!< sub-groups of sensitive entities

View File

@@ -198,7 +198,7 @@ public:
Standard_Integer LastDetectedEdgeNode2() const { return myDetectedEdgeNode2; }
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
public:

View File

@@ -110,6 +110,7 @@ Standard_Integer Select3D_SensitiveSegment::NbSubElements()
void Select3D_SensitiveSegment::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitiveSegment);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myStart);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEnd);

View File

@@ -71,7 +71,7 @@ public:
void EndPoint (const gp_Pnt& thePnt) { myEnd = thePnt; }
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -237,9 +237,10 @@ void Select3D_SensitiveSet::Clear()
//function : DumpJson
//purpose :
//=======================================================================
void Select3D_SensitiveSet::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
void Select3D_SensitiveSet::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitiveSet);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDetectedIdx);
}

View File

@@ -97,7 +97,7 @@ public:
Standard_Integer GetLeafNodeSize() const { return myContent.Builder()->LeafNodeSize(); }
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:

View File

@@ -101,6 +101,7 @@ Select3D_BndBox3d Select3D_SensitiveTriangle::BoundingBox()
void Select3D_SensitiveTriangle::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitiveTriangle);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveEntity);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySensType);

View File

@@ -68,7 +68,7 @@ public:
virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE { return myCentroid; }
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
public:

View File

@@ -451,7 +451,6 @@ gp_GTrsf Select3D_SensitiveTriangulation::InvInitLocation() const
void Select3D_SensitiveTriangulation::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Select3D_SensitiveTriangulation);
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Select3D_SensitiveSet);
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTriangul.get());

View File

@@ -94,7 +94,7 @@ public:
const TopLoc_Location& GetInitLocation() const { return myInitLocation; }
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:

View File

@@ -69,7 +69,7 @@ public:
const Standard_Integer theIdx2) Standard_OVERRIDE;
//! 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, const Standard_Integer theDepth = -1) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveWire,Select3D_SensitiveSet)

View File

@@ -29,4 +29,25 @@ void TopoDS_TShape::DumpJson (Standard_OStream& theOStream, const Standard_Integ
{
OCCT_DUMP_CLASS_BEGIN (theOStream, TopoDS_TShape);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFlags);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ShapeType());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbChildren());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Free());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Free());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Locked());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Modified());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Checked());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Orientable());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Closed());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Infinite());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Convex());
//for (TopoDS_ListIteratorOfListOfShape anIterator (myShapes); anIterator.More(); anIterator.Next())
//{
// const TopoDS_Shape& subShape = anIterator.Value();
// OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &subShape);
//}
}

View File

@@ -40,7 +40,7 @@ int VInspector_ItemContext::initRowCount() const
int aNbProperties = 1; // item to visualize Filters/Drawer information of context
int aNbPresentations = 0;
Handle(AIS_InteractiveContext) aContext = GetContext();
Handle(AIS_InteractiveContext) aContext = Handle(AIS_InteractiveContext)::DownCast (GetObject());
if (aContext.IsNull())
return 0;
@@ -94,25 +94,59 @@ QVariant VInspector_ItemContext::initValue (const int theItemRole) const
if (theItemRole != Qt::DisplayRole && theItemRole != Qt::EditRole && theItemRole != Qt::ToolTipRole)
return QVariant();
if (GetContext().IsNull())
Handle(AIS_InteractiveContext) aContext = Handle(AIS_InteractiveContext)::DownCast (GetObject());
if (aContext.IsNull())
return Column() == 0 ? "Empty context" : "";
switch (Column())
{
case 0: return GetContext()->DynamicType()->Name();
case 0: return aContext->DynamicType()->Name();
case 4:
{
Handle(AIS_InteractiveObject) anEmptyIO;
int aSelectedCount = VInspector_Tools::SelectedOwners (GetContext(), anEmptyIO, false);
int aSelectedCount = VInspector_Tools::SelectedOwners (aContext, anEmptyIO, false);
return aSelectedCount > 0 ? QString::number (aSelectedCount) : "";
}
case 6: return GetContext()->DeviationCoefficient();
case 6: return aContext->DeviationCoefficient();
default:
break;
}
return QVariant();
}
// =======================================================================
// function : Init
// purpose :
// =======================================================================
void VInspector_ItemContext::Init()
{
Handle(AIS_InteractiveContext) aContext = GetContext();
if (aContext.IsNull())
return;
TreeModel_ItemBase::Init();
}
// =======================================================================
// function : Reset
// purpose :
// =======================================================================
void VInspector_ItemContext::Reset()
{
VInspector_ItemBase::Reset();
}
// =======================================================================
// function : initItem
// purpose :
// =======================================================================
void VInspector_ItemContext::initItem() const
{
if (IsInitialized())
return;
const_cast<VInspector_ItemContext*>(this)->Init();
}
// =======================================================================
// function : createChild
// purpose :
@@ -124,3 +158,16 @@ TreeModel_ItemBasePtr VInspector_ItemContext::createChild (int theRow, int theCo
else
return VInspector_ItemPresentableObject::CreateItem (currentItem(), theRow, theColumn);
}
// =======================================================================
// function : GetStream
// purpose :
// =======================================================================
void VInspector_ItemContext::GetStream (Standard_OStream& theOStream) const
{
Handle(AIS_InteractiveContext) aContext = GetContext();
if (aContext.IsNull())
return;
aContext->DumpJson (theOStream);
}

View File

@@ -51,11 +51,21 @@ public:
//! \return the value
Standard_EXPORT virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
//! Returns stream value of the item to fulfill property panel.
//! \return stream value or dummy
Standard_EXPORT virtual void GetStream (Standard_OStream& theOStream) const Standard_OVERRIDE;
//! Inits the item, fills internal containers
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
//! Resets cached values
Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
protected:
//! Initialize the current item. It creates a backup of the specific item information
//! Do nothing as context has been already set into item
virtual void initItem() const Standard_OVERRIDE {}
virtual void initItem() const Standard_OVERRIDE;
protected: