From: nds Date: Fri, 1 Nov 2019 05:06:34 +0000 (+0300) Subject: 0030268: Inspectors - improvements in VInspector plugin X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=5a60253c55b3a56993876ac98db11eaa674df0bb;p=occt-copy.git 0030268: Inspectors - improvements in VInspector plugin # Dump for OCCT objects --- diff --git a/src/AIS/AIS_InteractiveContext.hxx b/src/AIS/AIS_InteractiveContext.hxx index eb0438553e..f405b19a27 100644 --- a/src/AIS/AIS_InteractiveContext.hxx +++ b/src/AIS/AIS_InteractiveContext.hxx @@ -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; diff --git a/src/AIS/AIS_InteractiveContext_3.cxx b/src/AIS/AIS_InteractiveContext_3.cxx index 6f7840e5fd..aca027cff5 100644 --- a/src/AIS/AIS_InteractiveContext_3.cxx +++ b/src/AIS/AIS_InteractiveContext_3.cxx @@ -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); +} diff --git a/src/Graphic3d/Graphic3d_AspectFillCapping.cxx b/src/Graphic3d/Graphic3d_AspectFillCapping.cxx index 3f6bff8042..153f5e0552 100644 --- a/src/Graphic3d/Graphic3d_AspectFillCapping.cxx +++ b/src/Graphic3d/Graphic3d_AspectFillCapping.cxx @@ -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); +} diff --git a/src/Graphic3d/Graphic3d_AspectFillCapping.hxx b/src/Graphic3d/Graphic3d_AspectFillCapping.hxx index 7df72d60a6..d37088dfb1 100644 --- a/src/Graphic3d/Graphic3d_AspectFillCapping.hxx +++ b/src/Graphic3d/Graphic3d_AspectFillCapping.hxx @@ -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 diff --git a/src/Graphic3d/Graphic3d_Aspects.cxx b/src/Graphic3d/Graphic3d_Aspects.cxx index 667b7732e0..00f86b95f6 100644 --- a/src/Graphic3d/Graphic3d_Aspects.cxx +++ b/src/Graphic3d/Graphic3d_Aspects.cxx @@ -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); } diff --git a/src/Graphic3d/Graphic3d_BSDF.cxx b/src/Graphic3d/Graphic3d_BSDF.cxx index 4421e9c2d5..3958bec309 100644 --- a/src/Graphic3d/Graphic3d_BSDF.cxx +++ b/src/Graphic3d/Graphic3d_BSDF.cxx @@ -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; -} \ No newline at end of file +} + +//======================================================================= +//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); +} diff --git a/src/Graphic3d/Graphic3d_BSDF.hxx b/src/Graphic3d/Graphic3d_BSDF.hxx index 7919089dd9..6e750209ea 100644 --- a/src/Graphic3d/Graphic3d_BSDF.hxx +++ b/src/Graphic3d/Graphic3d_BSDF.hxx @@ -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 diff --git a/src/Graphic3d/Graphic3d_ClipPlane.cxx b/src/Graphic3d/Graphic3d_ClipPlane.cxx index 68201177a2..6c13e479a0 100755 --- a/src/Graphic3d/Graphic3d_ClipPlane.cxx +++ b/src/Graphic3d/Graphic3d_ClipPlane.cxx @@ -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); diff --git a/src/Graphic3d/Graphic3d_HatchStyle.cxx b/src/Graphic3d/Graphic3d_HatchStyle.cxx index ebf108cfe2..5990a189a1 100644 --- a/src/Graphic3d/Graphic3d_HatchStyle.cxx +++ b/src/Graphic3d/Graphic3d_HatchStyle.cxx @@ -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); +} diff --git a/src/Graphic3d/Graphic3d_HatchStyle.hxx b/src/Graphic3d/Graphic3d_HatchStyle.hxx index c29a3ab03d..b79b03e89e 100644 --- a/src/Graphic3d/Graphic3d_HatchStyle.hxx +++ b/src/Graphic3d/Graphic3d_HatchStyle.hxx @@ -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 diff --git a/src/Graphic3d/Graphic3d_MaterialAspect.cxx b/src/Graphic3d/Graphic3d_MaterialAspect.cxx index 9e9624be2d..54c7f0a354 100644 --- a/src/Graphic3d/Graphic3d_MaterialAspect.cxx +++ b/src/Graphic3d/Graphic3d_MaterialAspect.cxx @@ -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); +} diff --git a/src/Graphic3d/Graphic3d_MaterialAspect.hxx b/src/Graphic3d/Graphic3d_MaterialAspect.hxx index 99d25eac7d..5ed2436ac9 100644 --- a/src/Graphic3d/Graphic3d_MaterialAspect.hxx +++ b/src/Graphic3d/Graphic3d_MaterialAspect.hxx @@ -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. diff --git a/src/Graphic3d/Graphic3d_TransformPers.cxx b/src/Graphic3d/Graphic3d_TransformPers.cxx index 4fe9e7cac6..87e18d494d 100644 --- a/src/Graphic3d/Graphic3d_TransformPers.cxx +++ b/src/Graphic3d/Graphic3d_TransformPers.cxx @@ -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) diff --git a/src/NCollection/NCollection_Buffer.hxx b/src/NCollection/NCollection_Buffer.hxx index b51e514a4e..aca2b7d1b0 100644 --- a/src/NCollection/NCollection_Buffer.hxx +++ b/src/NCollection/NCollection_Buffer.hxx @@ -17,6 +17,7 @@ #define _NCollection_Buffer_HeaderFile #include +#include #include //! 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 diff --git a/src/NCollection/NCollection_Vec3.hxx b/src/NCollection/NCollection_Vec3.hxx index fc2b48155b..c9230c582e 100644 --- a/src/NCollection/NCollection_Vec3.hxx +++ b/src/NCollection/NCollection_Vec3.hxx @@ -18,6 +18,7 @@ #include #include #include +#include //! 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 diff --git a/src/NCollection/NCollection_Vec4.hxx b/src/NCollection/NCollection_Vec4.hxx index b3c84aea9a..1be616fa31 100644 --- a/src/NCollection/NCollection_Vec4.hxx +++ b/src/NCollection/NCollection_Vec4.hxx @@ -16,6 +16,7 @@ #define _NCollection_Vec4_H__ #include +#include //! 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 diff --git a/src/OpenGl/OpenGl_CappingAlgo.cxx b/src/OpenGl/OpenGl_CappingAlgo.cxx index 1d77c45ca5..377f870235 100755 --- a/src/OpenGl/OpenGl_CappingAlgo.cxx +++ b/src/OpenGl/OpenGl_CappingAlgo.cxx @@ -341,9 +341,14 @@ namespace // function : RenderCapping // purpose : // ======================================================================= +#include +#include 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) { diff --git a/src/Prs3d/Prs3d_Drawer.cxx b/src/Prs3d/Prs3d_Drawer.cxx index a03fa3d36f..8af632626e 100644 --- a/src/Prs3d/Prs3d_Drawer.cxx +++ b/src/Prs3d/Prs3d_Drawer.cxx @@ -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()); } diff --git a/src/Select3D/Select3D_InteriorSensitivePointSet.hxx b/src/Select3D/Select3D_InteriorSensitivePointSet.hxx index 0cb2fe615a..6f9d7ebd5b 100644 --- a/src/Select3D/Select3D_InteriorSensitivePointSet.hxx +++ b/src/Select3D/Select3D_InteriorSensitivePointSet.hxx @@ -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) diff --git a/src/Select3D/Select3D_SensitiveBox.cxx b/src/Select3D/Select3D_SensitiveBox.cxx index 81f0bdb085..bef2dd1b84 100644 --- a/src/Select3D/Select3D_SensitiveBox.cxx +++ b/src/Select3D/Select3D_SensitiveBox.cxx @@ -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); diff --git a/src/Select3D/Select3D_SensitiveBox.hxx b/src/Select3D/Select3D_SensitiveBox.hxx index 36515f2b41..cb735264c2 100644 --- a/src/Select3D/Select3D_SensitiveBox.hxx +++ b/src/Select3D/Select3D_SensitiveBox.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitiveFace.cxx b/src/Select3D/Select3D_SensitiveFace.cxx index 4ad62a1044..6feff18373 100644 --- a/src/Select3D/Select3D_SensitiveFace.cxx +++ b/src/Select3D/Select3D_SensitiveFace.cxx @@ -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()); diff --git a/src/Select3D/Select3D_SensitiveFace.hxx b/src/Select3D/Select3D_SensitiveFace.hxx index 5fdf9f27b5..2a0af16113 100644 --- a/src/Select3D/Select3D_SensitiveFace.hxx +++ b/src/Select3D/Select3D_SensitiveFace.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitiveGroup.cxx b/src/Select3D/Select3D_SensitiveGroup.cxx index b3571adcbf..89c5e12cbf 100644 --- a/src/Select3D/Select3D_SensitiveGroup.cxx +++ b/src/Select3D/Select3D_SensitiveGroup.cxx @@ -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()) diff --git a/src/Select3D/Select3D_SensitiveGroup.hxx b/src/Select3D/Select3D_SensitiveGroup.hxx index 3b6f28a239..307d6a6c58 100644 --- a/src/Select3D/Select3D_SensitiveGroup.hxx +++ b/src/Select3D/Select3D_SensitiveGroup.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitivePoint.cxx b/src/Select3D/Select3D_SensitivePoint.cxx index a995296a88..72facedce0 100644 --- a/src/Select3D/Select3D_SensitivePoint.cxx +++ b/src/Select3D/Select3D_SensitivePoint.cxx @@ -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); } diff --git a/src/Select3D/Select3D_SensitivePoint.hxx b/src/Select3D/Select3D_SensitivePoint.hxx index c45c129ddb..5906c5181d 100644 --- a/src/Select3D/Select3D_SensitivePoint.hxx +++ b/src/Select3D/Select3D_SensitivePoint.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitivePoly.cxx b/src/Select3D/Select3D_SensitivePoly.cxx index 37c79bcde6..80d6ab4086 100644 --- a/src/Select3D/Select3D_SensitivePoly.cxx +++ b/src/Select3D/Select3D_SensitivePoly.cxx @@ -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 diff --git a/src/Select3D/Select3D_SensitivePoly.hxx b/src/Select3D/Select3D_SensitivePoly.hxx index 120db6a2d2..7b71d10920 100644 --- a/src/Select3D/Select3D_SensitivePoly.hxx +++ b/src/Select3D/Select3D_SensitivePoly.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitivePrimitiveArray.cxx b/src/Select3D/Select3D_SensitivePrimitiveArray.cxx index 220c9a429f..897035ad2f 100644 --- a/src/Select3D/Select3D_SensitivePrimitiveArray.cxx +++ b/src/Select3D/Select3D_SensitivePrimitiveArray.cxx @@ -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 diff --git a/src/Select3D/Select3D_SensitivePrimitiveArray.hxx b/src/Select3D/Select3D_SensitivePrimitiveArray.hxx index a78ac80337..b06a1a269a 100644 --- a/src/Select3D/Select3D_SensitivePrimitiveArray.hxx +++ b/src/Select3D/Select3D_SensitivePrimitiveArray.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitiveSegment.cxx b/src/Select3D/Select3D_SensitiveSegment.cxx index 24b19e4d0a..7d707139cc 100644 --- a/src/Select3D/Select3D_SensitiveSegment.cxx +++ b/src/Select3D/Select3D_SensitiveSegment.cxx @@ -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); diff --git a/src/Select3D/Select3D_SensitiveSegment.hxx b/src/Select3D/Select3D_SensitiveSegment.hxx index e4bf0a7990..17ff4c3b96 100644 --- a/src/Select3D/Select3D_SensitiveSegment.hxx +++ b/src/Select3D/Select3D_SensitiveSegment.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitiveSet.cxx b/src/Select3D/Select3D_SensitiveSet.cxx index f9ff7ff171..bb1f80ab2d 100644 --- a/src/Select3D/Select3D_SensitiveSet.cxx +++ b/src/Select3D/Select3D_SensitiveSet.cxx @@ -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); } diff --git a/src/Select3D/Select3D_SensitiveSet.hxx b/src/Select3D/Select3D_SensitiveSet.hxx index 6cf1b03ec1..261c4cb315 100644 --- a/src/Select3D/Select3D_SensitiveSet.hxx +++ b/src/Select3D/Select3D_SensitiveSet.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitiveTriangle.cxx b/src/Select3D/Select3D_SensitiveTriangle.cxx index 6eaa8243b1..c3d0002e2d 100644 --- a/src/Select3D/Select3D_SensitiveTriangle.cxx +++ b/src/Select3D/Select3D_SensitiveTriangle.cxx @@ -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); diff --git a/src/Select3D/Select3D_SensitiveTriangle.hxx b/src/Select3D/Select3D_SensitiveTriangle.hxx index e6ad159dcf..6e0b789769 100644 --- a/src/Select3D/Select3D_SensitiveTriangle.hxx +++ b/src/Select3D/Select3D_SensitiveTriangle.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitiveTriangulation.cxx b/src/Select3D/Select3D_SensitiveTriangulation.cxx index 4f9ed23327..9bc774af08 100644 --- a/src/Select3D/Select3D_SensitiveTriangulation.cxx +++ b/src/Select3D/Select3D_SensitiveTriangulation.cxx @@ -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()); diff --git a/src/Select3D/Select3D_SensitiveTriangulation.hxx b/src/Select3D/Select3D_SensitiveTriangulation.hxx index 752504a318..92ef699d55 100644 --- a/src/Select3D/Select3D_SensitiveTriangulation.hxx +++ b/src/Select3D/Select3D_SensitiveTriangulation.hxx @@ -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: diff --git a/src/Select3D/Select3D_SensitiveWire.hxx b/src/Select3D/Select3D_SensitiveWire.hxx index 55463188ab..eca3ac58e7 100644 --- a/src/Select3D/Select3D_SensitiveWire.hxx +++ b/src/Select3D/Select3D_SensitiveWire.hxx @@ -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) diff --git a/src/TopoDS/TopoDS_TShape.cxx b/src/TopoDS/TopoDS_TShape.cxx index 3ae9e1f6b2..5451b96622 100644 --- a/src/TopoDS/TopoDS_TShape.cxx +++ b/src/TopoDS/TopoDS_TShape.cxx @@ -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); + //} } diff --git a/tools/VInspector/VInspector_ItemContext.cxx b/tools/VInspector/VInspector_ItemContext.cxx index decdc4b162..bf93214995 100644 --- a/tools/VInspector/VInspector_ItemContext.cxx +++ b/tools/VInspector/VInspector_ItemContext.cxx @@ -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(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); +} diff --git a/tools/VInspector/VInspector_ItemContext.hxx b/tools/VInspector/VInspector_ItemContext.hxx index aa693d39c4..1d3fe7a264 100644 --- a/tools/VInspector/VInspector_ItemContext.hxx +++ b/tools/VInspector/VInspector_ItemContext.hxx @@ -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: