#include <Aspect_Background.hxx>
#include <Quantity_Color.hxx>
+#include <Standard_Dump.hxx>
//-Aliases
//-Global data definitions
return (MyColor);
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void Aspect_Background::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Aspect_Background)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor)
+}
//! Returns the colour of the window background <me>.
Standard_EXPORT Quantity_Color Color() const;
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
myAlpha = M_PI / Standard_Real(myDivisionNumber);
myA1 = Cos(myAlpha); myB1=Sin(myAlpha);
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Aspect_CircularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRadiusStep)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDivisionNumber)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlpha)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myA1)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myB1)
+}
Standard_EXPORT Standard_Integer DivisionNumber() const;
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:
#include <Aspect_GenId.hxx>
#include <Aspect_IdentDefinitionError.hxx>
+#include <Standard_Dump.hxx>
+
// =======================================================================
// function : Aspect_GenId
// purpose :
theId = myLowerBound + myLength - myFreeCount - 1;
return Standard_True;
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void Aspect_GenId::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFreeCount)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLength)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLowerBound)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUpperBound)
+
+ for (TColStd_ListOfInteger::Iterator anIter (myFreeIds); anIter.More(); anIter.Next())
+ {
+ Standard_Integer aFreeId = anIter.Value();
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aFreeId)
+ }
+}
//! Returns the upper identifier in range.
Standard_Integer Upper() const { return myUpperBound; }
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:
{
return MyGradientMethod;
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void Aspect_GradientBackground::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Aspect_GradientBackground)
+
+ Quantity_Color aColor = Color();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aColor)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor2)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyGradientMethod)
+}
//! Returns the current gradient background fill mode.
Standard_EXPORT Aspect_GradientFillMethod BgGradientFillMethod() const;
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
myDrawMode = theDrawMode;
UpdateDisplay();
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Aspect_Grid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRotationAngle)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXOrigin)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYOrigin)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTenthColor)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawMode)
+}
Standard_EXPORT virtual Standard_Boolean IsDisplayed() const = 0;
Standard_EXPORT virtual void Init() = 0;
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
const Standard_Real beta) const {
return (Abs( Sin(alpha) * Cos(beta + M_PI / 2.) - Cos(alpha) * Sin(beta + M_PI / 2.)) != 0) ;
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Aspect_RectangularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXStep)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYStep)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirstAngle)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySecondAngle)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a1)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b1)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c1)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a2)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b2)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c2)
+}
Standard_EXPORT Standard_Real SecondAngle() const;
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:
{
MyGradientBackground.SetColors (theFirstColor, theSecondColor, theFillMethod);
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Aspect_Window::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyBackground)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyGradientBackground)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyBackgroundFillMethod)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyIsVirtual)
+}
//! on platforms implementing thread-unsafe connections to display.
//! NULL can be passed instead otherwise.
virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
Graphic3d_BvhCStructureSetTrsfPers.hxx
Graphic3d_Camera.cxx
Graphic3d_Camera.hxx
+Graphic3d_CameraTile.cxx
Graphic3d_CameraTile.hxx
Graphic3d_CappingFlags.hxx
Graphic3d_CLight.cxx
Graphic3d_PolygonOffset.hxx
Graphic3d_PriorityDefinitionError.hxx
Graphic3d_RenderingMode.hxx
+Graphic3d_RenderingParams.cxx
Graphic3d_RenderingParams.hxx
Graphic3d_RenderTransparentMethod.hxx
Graphic3d_SequenceOfGroup.hxx
myTextFont = new TCollection_HAsciiString (theFont);
}
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void Graphic3d_AspectText3d::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+ OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Graphic3d_Aspects)
+}
//! Returns text FontAspect
Font_FontAspect GetTextFontAspect() const { return myTextFontAspect; }
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
};
}
//! Dumps the content of me into the stream
- Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
Standard_OutOfRange_Raise_if (theValue < 0.0, "Graphic3d_CLight::SetRange(), Bad value for falloff range");
updateRevisionIf (Abs (Range() - theValue) > ShortRealEpsilon());
myDirection.w() = theValue;
-};
\ No newline at end of file
+};
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Graphic3d_CLight::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_STRING (theOStream, myId)
+ OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)
+
+ if (myType == Graphic3d_TOLS_SPOT || myType == Graphic3d_TOLS_POSITIONAL)
+ {
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPosition)
+ }
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIntensity)
+
+ if (myType == Graphic3d_TOLS_SPOT || myType == Graphic3d_TOLS_DIRECTIONAL)
+ {
+ gp_Dir aDirection = Direction();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aDirection)
+ }
+ if (myType == Graphic3d_TOLS_POSITIONAL || myType == Graphic3d_TOLS_SPOT)
+ {
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ConstAttenuation())
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, LinearAttenuation())
+ }
+ if (myType == Graphic3d_TOLS_SPOT)
+ {
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Angle())
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Concentration())
+ }
+ if (myType == Graphic3d_TOLS_POSITIONAL || myType == Graphic3d_TOLS_SPOT)
+ {
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Range())
+ }
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySmoothness)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myType)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRevision)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsHeadlight)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsEnabled)
+}
//! @return modification counter
Standard_Size Revision() const { return myRevision; }
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:
theDict.ChangeFromIndex (theDict.Add ("VRserial", aSerial)) = aSerial;
}
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Graphic3d_CView::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Graphic3d_DataStructureManager);
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myId)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myRenderParams)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBgColor)
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStructureManager)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCamera.get())
+
+ for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsToCompute); anIter.More(); anIter.Next())
+ {
+ const Handle(Graphic3d_Structure)& aStructToCompute = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructToCompute.get())
+ }
+
+ for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsComputed); anIter.More(); anIter.Next())
+ {
+ const Handle(Graphic3d_Structure)& aStructComputed = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructComputed.get())
+ }
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInComputedMode)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRemoved)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShadingModel)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisualization)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBackXRCamera.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBaseXRCamera.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPosedXRCamera.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPosedXRCameraCopy.get())
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUnitFactor)
+}
(void )theMin;
(void )theMax;
}
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEye)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDistance)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxialScale)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myProjType)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFOVy)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZNear)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZFar)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAspect)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myScale)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZFocus)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZFocusType)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIOD)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIODType)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTile)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMatricesD)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMatricesF)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myWorldViewProjState)
}
//! Return true if Projection was not invalidated.
Standard_Boolean IsProjectionValid() const { return myIsProjectionValid; }
+
+ //! Dumps the content of me into the stream
+ void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+ {
+ if (IsOrientationValid())
+ {
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Orientation)
+ }
+ if (IsProjectionValid())
+ {
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MProjection)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &LProjection)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &RProjection)
+ }
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsOrientationValid)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsProjectionValid)
+ }
public:
--- /dev/null
+// Created on: 2020-02-06
+// Created by: Svetlana SHUTINA
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <Graphic3d_CameraTile.hxx>
+
+#include <Standard_Dump.hxx>
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Graphic3d_CameraTile::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &TotalSize)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &TileSize)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Offset)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsTopDown)
+}
#include <Graphic3d_Vec2.hxx>
#include <Standard_Integer.hxx>
+#include <Standard_OStream.hxx>
#include <Standard_TypeDef.hxx>
//! Class defines the area (Tile) inside a view.
&& anOffset1.x() == anOffset2.x()
&& anOffset1.y() == anOffset2.y();
}
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
};
// for the class
#include <Graphic3d_DataStructureManager.hxx>
+#include <Standard_Dump.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,Standard_Transient)
//-Constructors
Graphic3d_DataStructureManager::Graphic3d_DataStructureManager () {
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Graphic3d_DataStructureManager::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+}
//! It defines the global attributes.
class Graphic3d_DataStructureManager : public Standard_Transient
{
+
DEFINE_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,Standard_Transient)
protected:
//! Returns camera object of the view.
virtual const Handle(Graphic3d_Camera)& Camera() const = 0;
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
};
#endif // _Graphic3d_DataStructureManager_HeaderFile
"Graphic3d_GraphicDriver::SetZLayerSettings, Layer with theLayerId does not exist");
aLayerDef->SetLayerSettings (theSettings);
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void Graphic3d_GraphicDriver::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myStructGenId)
+
+ for (NCollection_List<Handle(Graphic3d_Layer)>::Iterator anIter (myLayers); anIter.More(); anIter.Next())
+ {
+ const Handle(Graphic3d_Layer)& aLayer = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aLayer.get())
+ }
+}
//! Frees the identifier of a structure.
Standard_EXPORT void RemoveIdentification(const Standard_Integer theId);
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
// function : DumpJson
// purpose :
// =======================================================================
-void Graphic3d_Group::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+void Graphic3d_Group::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_POINTER (theOStream, myStructure)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBounds)
+
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet)
}
--- /dev/null
+// Created on: 2020-02-06
+// Created by: Svetlana SHUTINA
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <Graphic3d_RenderingParams.hxx>
+
+#include <Standard_Dump.hxx>
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Graphic3d_RenderingParams::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Method)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, TransparencyMethod)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, LineFeather)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvPow2Size)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvSpecMapNbLevels)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvBakingDiffNbSamples)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvBakingSpecNbSamples)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, PbrEnvBakingProbability)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, OitDepthFactor)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbMsaaSamples)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RenderResolutionScale)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToEnableDepthPrepass)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToEnableAlphaToCoverage)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsGlobalIlluminationEnabled)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, SamplesPerPixel)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RaytracingDepth)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsShadowEnabled)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsReflectionEnabled)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsAntialiasingEnabled)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsTransparentShadowEnabled)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, UseEnvironmentMapBackground)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToIgnoreNormalMapInRayTracing)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, CoherentPathTracingMode)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, AdaptiveScreenSampling)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, AdaptiveScreenSamplingAtomic)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ShowSamplingTiles)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, TwoSidedBsdfModels)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RadianceClampingValue)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RebuildRayTracingShaders)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, RayTracingTileSize)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, NbRayTracingTiles)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, CameraApertureRadius)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, CameraFocalPlaneDist)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, FrustumCullingState)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToneMappingMethod)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Exposure)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, WhitePoint)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StereoMode)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, AnaglyphFilter)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &AnaglyphLeft)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &AnaglyphRight)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToReverseStereo)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, StatsPosition.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, ChartPosition.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &ChartSize)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, StatsTextAspect.get())
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StatsUpdateInterval)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StatsTextHeight)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StatsNbFrames)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, StatsMaxChartTime)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, CollectedStats)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ToShowStats)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Resolution)
+}
{
return Resolution / static_cast<Standard_ShortReal> (THE_DEFAULT_RESOLUTION);
}
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
public:
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStructureManager)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCStructure.get())
+ for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myAncestors); anIter.More(); anIter.Next())
+ {
+ Graphic3d_Structure* anAncestor = anIter.Value();
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, anAncestor)
+ }
+
+ for (NCollection_IndexedMap<Graphic3d_Structure*>::Iterator anIter (myDescendants); anIter.More(); anIter.Next())
+ {
+ Graphic3d_Structure* aDescendant = anIter.Value();
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, aDescendant)
+ }
+
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOwner)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisual)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComputeVisual)
}
aViewIt.Value()->ChangeZLayer (theStructure, theLayerId);
}
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void Graphic3d_StructureManager::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ for (Graphic3d_MapOfStructure::Iterator anIter (myDisplayedStructure); anIter.More(); anIter.Next())
+ {
+ const Handle(Graphic3d_Structure)& aDisplayedStructure = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aDisplayedStructure.get())
+ }
+ for (Graphic3d_MapOfStructure::Iterator anIter (myHighlightedStructure); anIter.More(); anIter.Next())
+ {
+ const Handle(Graphic3d_Structure)& aHighlightedStructure = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aHighlightedStructure.get())
+ }
+ for (Graphic3d_MapOfObject::Iterator anIter (myRegisteredObjects); anIter.More(); anIter.Next())
+ {
+ const Handle(Graphic3d_ViewAffinity)& aRegisteredObject = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aRegisteredObject.get())
+ }
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGraphicDriver.get())
+ for (Graphic3d_IndexedMapOfView::Iterator anIter (myDefinedViews); anIter.More(); anIter.Next())
+ {
+ Graphic3d_CView* aDefinedView = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aDefinedView)
+ }
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDeviceLostFlag)
+}
//! Sets Device Lost flag.
void SetDeviceLost() { myDeviceLostFlag = Standard_True; }
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
#include <Graphic3d_Vertex.hxx>
+#include <gp_XYZ.hxx>
+#include <Standard_Dump.hxx>
+
Standard_ShortReal Graphic3d_Vertex::Distance(const Graphic3d_Vertex& AOther) const
{
return sqrt( (X() - AOther.X()) * (X() - AOther.X())
+ (Y() - AOther.Y()) * (Y() - AOther.Y())
+ (Z() - AOther.Z()) * (Z() - AOther.Z()) );
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void Graphic3d_Vertex::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ gp_XYZ aCoord (xyz[0], xyz[1], xyz[2]);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aCoord)
+}
//! Returns the distance between two points.
Standard_EXPORT Standard_ShortReal Distance (const Graphic3d_Vertex& theOther) const;
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
float xyz[3];
&& myWorldViewState == theOther.myWorldViewState;
}
+ //! Dumps the content of me into the stream
+ void DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+ {
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsValid)
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCamera)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myProjectionState)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myWorldViewState)
+ }
+
private:
Standard_Boolean myIsValid;
#include <cmath> // std::sqrt()
+#include <Standard_Dump.hxx>
+
//! Auxiliary macros to define couple of similar access components as vector methods.
//! @return 2 components by their names in specified order
#define NCOLLECTION_VEC_COMPONENTS_2D(theX, theY) \
return NCollection_Vec2 (Element_t(0), Element_t(1));
}
+ //! Dumps the content of me into the stream
+ void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
+ {
+ (void)theDepth;
+ OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "Vec2", 2, v[0], v[1])
+ }
+
private:
Element_t v[2];
#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) \
#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
memset (myMinVertsProjections, 0, sizeof (myMinVertsProjections));
}
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
protected:
// SAT Tests for different objects
return Standard_True;
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+template <int N>
+void SelectMgr_Frustum<N>::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ const Standard_Integer anIncFactor = (myIsOrthographic && N == 4) ? 2 : 1;
+ for (Standard_Integer aPlaneIdx = 0; aPlaneIdx < N + 1; aPlaneIdx += anIncFactor)
+ {
+ const gp_Vec& aPlane = myPlanes[aPlaneIdx];
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aPlane)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxVertsProjections[aPlaneIdx])
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMinVertsProjections[aPlaneIdx])
+ }
+
+ for (Standard_Integer aVertIdx = 0; aVertIdx < N * 2; ++aVertIdx)
+ {
+ const gp_Pnt& aVertex = myVertices[aVertIdx];
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aVertex)
+ }
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPixelTolerance)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsOrthographic)
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myBuilder)
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myCamera)
+
+ for (Standard_Integer anIndex = 0; anIndex < 3; anIndex++)
+ {
+ Standard_Real aMaxOrthoVertsProjections = myMaxOrthoVertsProjections[anIndex];
+ Standard_Real aMinOrthoVertsProjections = myMinOrthoVertsProjections[anIndex];
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aMaxOrthoVertsProjections)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aMinOrthoVertsProjections)
+ }
+
+ for (Standard_Integer anIndex = 0; anIndex < 6; anIndex++)
+ {
+ const gp_Vec& anEdgeDir = myEdgeDirs[anIndex];
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &anEdgeDir)
+ }
+}
thePlaneEquations.Append (anEquation);
}
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void SelectMgr_RectangularFrustum::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_RectangularFrustum)
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_Frustum)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myNearPickedPnt)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myFarPickedPnt)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myViewRayDir)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMousePos)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myScale)
+}
//! Ax + By + Cz + D = 0) to the given vector
Standard_EXPORT virtual void GetPlanes (NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const Standard_OVERRIDE;
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
protected:
Standard_EXPORT void segmentSegmentDistance (const gp_Pnt& theSegPnt1,
for (Standard_Integer anIdx = 0; anIdx < VolumeTypesNb; ++anIdx)
{
const Handle(SelectMgr_BaseFrustum)& aSelectingVolume = mySelectingVolumes[anIdx];
- OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, aSelectingVolume.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aSelectingVolume.get())
}
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myViewClipPlanes.get())
//! Return the Selector.
const Handle(SelectMgr_ViewerSelector)& Selector() const { return mySelector; }
-
+
//! Returns true if the manager contains the selectable object theObject.
Standard_EXPORT Standard_Boolean Contains (const Handle(SelectMgr_SelectableObject)& theObject) const;
thePlaneEquations.Append (aPlaneEquation);
}
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void SelectMgr_TriangularFrustum::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_TriangularFrustum)
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_Frustum)
+}
\ No newline at end of file
//! Ax + By + Cz + D = 0) to the given vector
Standard_EXPORT virtual void GetPlanes (NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const Standard_OVERRIDE;
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
private:
void cacheVertexProjections (SelectMgr_TriangularFrustum* theFrustum) const;
return Standard_True;
}
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void SelectMgr_TriangularFrustumSet::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_CLASS_BEGIN (theOStream, SelectMgr_TriangularFrustumSet)
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, SelectMgr_BaseFrustum)
+
+ for (SelectMgr_TriangFrustumsIter anIter (myFrustums); anIter.More(); anIter.Next())
+ {
+ const Handle(SelectMgr_TriangularFrustum)& aFrustum = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aFrustum.get())
+ }
+}
+
#undef MEMORY_BLOCK_SIZE
//! mark both included and overlapped entities as matched
Standard_EXPORT virtual void SetAllowOverlapDetection (const Standard_Boolean theIsToAllow);
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
private:
//! Checks whether the segment intersects with the boundary of the current volume selection
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToUpdateTolerance)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mystored.Extent())
- OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, &mySelectingVolumeMgr)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &mySelectingVolumeMgr)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, &mySelectableObjects)
Standard_Integer aNbOfSelectableObjects = 0;
}
if( !myCurAreDefined ) UpdateDisplay();
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void V3d_CircularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+ OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_CircularGrid)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructure.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGroup.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCurViewPlane)
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myViewer)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurAreDefined)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToComputePrs)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurDrawMode)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurXo)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurYo)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurAngle)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurStep)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurDivi)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRadius)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOffSet)
+}
Standard_EXPORT void GraphicValues (Standard_Real& Radius, Standard_Real& OffSet) const;
Standard_EXPORT void SetGraphicValues (const Standard_Real Radius, const Standard_Real OffSet);
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:
}
if( !myCurAreDefined ) UpdateDisplay();
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void V3d_RectangularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+ OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_RectangularGrid)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructure.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGroup.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCurViewPlane)
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myViewer)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurAreDefined)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToComputePrs)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurDrawMode)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurXo)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurYo)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurAngle)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurXStep)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myCurYStep)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXSize)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYSize)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOffSet)
+}
Standard_EXPORT void GraphicValues (Standard_Real& XSize, Standard_Real& YSize, Standard_Real& OffSet) const;
Standard_EXPORT void SetGraphicValues (const Standard_Real XSize, const Standard_Real YSize, const Standard_Real OffSet);
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:
}
}
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void V3d_Trihedron::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySphereShadingAspect.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySphereLineAspect.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTextAspect.get())
+
+ for (Standard_Integer anIter = 0; anIter < 3; anIter++)
+ {
+ const Handle(Prs3d_ShadingAspect)& anArrowShadinAspect = myArrowShadingAspects[anIter];
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anArrowShadinAspect.get())
+ }
+ for (Standard_Integer anIter = 0; anIter < 3; anIter++)
+ {
+ const Handle(Prs3d_LineAspect)& anArrowLineAspect = myArrowLineAspects[anIter];
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anArrowLineAspect.get())
+ }
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructure.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTransformPers.get())
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myScale)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRatio)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDiameter)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNbFacettes)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsWireframe)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToCompute)
+}
//! Erase trihedron.
Standard_EXPORT void Erase();
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:
{
return myView->ChangeRenderingParams();
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void V3d_View::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOldMouseX)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myOldMouseY)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCamStartOpUp)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCamStartOpDir)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCamStartOpEye)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myCamStartOpCenter)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDefaultCamera.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myView.get())
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myImmediateUpdate)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInvalidatedImmediate)
+
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, MyViewer)
+ for (V3d_ListOfLight::Iterator anIterator (myActiveLights); anIterator.More(); anIterator.Next())
+ {
+ class Handle(Graphic3d_CLight)& anActiveLight = anIterator.Value();
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, anActiveLight)
+ }
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDefaultViewAxis)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDefaultViewPoint)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, MyWindow.get())
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, sx)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, sy)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, rx)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ry)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myRotateGravity)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComputedMode)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, SwitchSetFront)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZRotation)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyZoomAtPointX)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyZoomAtPointY)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTrihedron.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, MyGrid.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyPlane)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, MyGridEchoStructure.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, MyGridEchoGroup.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myXscreenAxis)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myYscreenAxis)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myZscreenAxis)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myViewAxis)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myGravityReferencePoint)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAutoZFitIsOn)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAutoZFitScaleFactor)
+}
//! Returns the Objects number and the gravity center of ALL viewable points in the view
Standard_EXPORT gp_Pnt GravityPoint() const;
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
DEFINE_STANDARD_RTTIEXT(V3d_View,Standard_Transient)
public: //! @name deprecated methods
gp_Dir myCamStartOpUp;
gp_Dir myCamStartOpDir;
gp_Pnt myCamStartOpEye;
- Standard_Real myCamStartOpBnd[6];
gp_Pnt myCamStartOpCenter;
Handle(Graphic3d_Camera) myDefaultCamera;
Handle(Graphic3d_CView) myView;
void V3d_Viewer::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDriver.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myStructureManager.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myZLayerGenId)
+
+ for (V3d_ListOfView::Iterator anIter (myDefinedViews); anIter.More(); anIter.Next())
+ {
+ const Handle(V3d_View)& aDefinedView = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aDefinedView.get())
+ }
+
+ for (V3d_ListOfView::Iterator anIter (myActiveViews); anIter.More(); anIter.Next())
+ {
+ const Handle(V3d_View)& anActiveView = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anActiveView.get())
+ }
+
+ for (V3d_ListOfLight::Iterator anIter (myDefinedLights); anIter.More(); anIter.Next())
+ {
+ const Handle(Graphic3d_CLight)& aDefinedLight = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aDefinedLight.get())
+ }
+
+ for (V3d_ListOfLight::Iterator anIter (myActiveLights); anIter.More(); anIter.Next())
+ {
+ const Handle(Graphic3d_CLight)& anActiveLight = anIter.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anActiveLight.get())
+ }
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBackground)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myGradientBackground)
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myViewSize)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myViewProj)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisualization)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShadingModel)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDefaultTypeOfView)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDefaultRenderingParams)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComputedMode)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDefaultComputedMode)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPrivilegedPlane)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myPlaneStructure.get())
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDisplayPlane)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDisplayPlaneLength)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myRGrid.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCGrid.get())
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myGridType)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myGridEcho)
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGridEchoStructure.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGridEchoGroup.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myGridEchoAspect.get())
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myGridEchoLastVert)
}
#include <gp_XYZ.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_DomainError.hxx>
+#include <Standard_Dump.hxx>
#include <Standard_OutOfRange.hxx>
Standard_Boolean gp_Vec::IsEqual
Vres.Mirror (A2);
return Vres;
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void gp_Vec::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+ OCCT_DUMP_VECTOR_CLASS (theOStream, "gp_Vec", 3, coord.X(), coord.Y(), coord.Z())
+}
//! Transforms a vector with the transformation T.
Standard_NODISCARD gp_Vec Transformed (const gp_Trsf& T) const;
+
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
VInspector_ItemBase.hxx
VInspector_ItemContext.cxx
VInspector_ItemContext.hxx
+VInspector_ItemContextProperties.cxx
+VInspector_ItemContextProperties.hxx
VInspector_ItemHistoryElement.cxx
VInspector_ItemHistoryElement.hxx
VInspector_ItemHistoryRoot.cxx
VInspector_ItemHistoryTypeInfo.hxx
VInspector_ItemPresentableObject.cxx
VInspector_ItemPresentableObject.hxx
+VInspector_ItemSelectMgrViewerSelector.cxx
+VInspector_ItemSelectMgrViewerSelector.hxx
+VInspector_ItemV3dViewer.cxx
+VInspector_ItemV3dViewer.hxx
VInspector_ToolActionType.hxx
VInspector_ToolBar.cxx
VInspector_ToolBar.hxx
#include <AIS.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <SelectMgr_EntityOwner.hxx>
+#include <inspector/VInspector_ItemContextProperties.hxx>
#include <inspector/VInspector_ItemPresentableObject.hxx>
#include <inspector/VInspector_Tools.hxx>
if (Column() != 0)
return 0;
+ int aNbProperties = 1; // item to visualize Viewer information of context
+
Handle(AIS_InteractiveContext) aContext = Handle(AIS_InteractiveContext)::DownCast (Object());
if (aContext.IsNull())
return 0;
aNbPresentations++;
}
- return aNbPresentations;
+ return aNbProperties + aNbPresentations;
}
// =======================================================================
// =======================================================================
TreeModel_ItemBasePtr VInspector_ItemContext::createChild (int theRow, int theColumn)
{
- return VInspector_ItemPresentableObject::CreateItem (currentItem(), theRow, theColumn);
+ if (theRow == 0)
+ return VInspector_ItemContextProperties::CreateItem (currentItem(), theRow, theColumn);
+ else
+ return VInspector_ItemPresentableObject::CreateItem (currentItem(), theRow, theColumn);
}
// =======================================================================
--- /dev/null
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <inspector/VInspector_ItemContextProperties.hxx>
+
+#include <inspector/VInspector_ItemContext.hxx>
+#include <inspector/VInspector_ItemV3dViewer.hxx>
+#include <inspector/VInspector_ItemSelectMgrViewerSelector.hxx>
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemContextProperties::initValue (int theItemRole) const
+{
+ QVariant aParentValue = VInspector_ItemBase::initValue (theItemRole);
+ if (aParentValue.isValid())
+ return aParentValue;
+
+ if (Column() != 0 || (theItemRole != Qt::DisplayRole && theItemRole != Qt::ToolTipRole))
+ return QVariant();
+
+ return "Properties";
+}
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemContextProperties::initRowCount() const
+{
+ return 2; // V3d_Viewer, SelectMgr_ViewerSelector
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr VInspector_ItemContextProperties::createChild (int theRow, int theColumn)
+{
+ if (theRow == 0)
+ return VInspector_ItemV3dViewer::CreateItem (currentItem(), theRow, theColumn);
+
+ return VInspector_ItemSelectMgrViewerSelector::CreateItem (currentItem(), theRow, theColumn);
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+void VInspector_ItemContextProperties::initItem() const
+{
+ if (IsInitialized())
+ return;
+ const_cast<VInspector_ItemContextProperties*> (this)->Init();
+}
--- /dev/null
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef VInspector_ItemContextProperties_H
+#define VInspector_ItemContextProperties_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+#include <AIS_InteractiveObject.hxx>
+#include <TCollection_AsciiString.hxx>
+
+class VInspector_ItemContextProperties;
+typedef QExplicitlySharedDataPointer<VInspector_ItemContextProperties> VInspector_ItemContextPropertiesPtr;
+
+//! \class VInspector_ItemContextProperties
+//! Item presents additional level of information in the tree model.
+//! Parent is item context, child is v3d viewer item.
+class VInspector_ItemContextProperties : public VInspector_ItemBase
+{
+public:
+
+ //! Creates an item wrapped by a shared pointer
+ static VInspector_ItemContextPropertiesPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+ { return VInspector_ItemContextPropertiesPtr (new VInspector_ItemContextProperties (theParent, theRow, theColumn)); }
+
+ //! Destructor
+ virtual ~VInspector_ItemContextProperties() Standard_OVERRIDE {};
+
+protected:
+ //! Initializes the current item. It is empty because Reset() is also empty.
+ virtual void initItem() const Standard_OVERRIDE;
+
+ //! Returns number of item selected
+ //! \return rows count
+ virtual int initRowCount() const Standard_OVERRIDE;
+
+ //! Returns item information for the given role. Fills internal container if it was not filled yet
+ //! \param theItemRole a value role
+ //! \return the value
+ virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
+
+ //! Creates a child item in the given position.
+ //! \param theRow the child row position
+ //! \param theColumn the child column position
+ //! \return the created item
+ virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE;
+
+private:
+
+ //! Constructor
+ //! param theParent a parent item
+ VInspector_ItemContextProperties (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+ : VInspector_ItemBase (theParent, theRow, theColumn) {}
+
+};
+
+#endif
--- /dev/null
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <inspector/VInspector_ItemSelectMgrViewerSelector.hxx>
+
+#include <AIS.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <inspector/VInspector_ItemContext.hxx>
+#include <inspector/VInspector_ItemContextProperties.hxx>
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemSelectMgrViewerSelector::initRowCount() const
+{
+ return 0;
+}
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemSelectMgrViewerSelector::initValue (const int theItemRole) const
+{
+ QVariant aParentValue = VInspector_ItemBase::initValue (theItemRole);
+ if (aParentValue.isValid())
+ return aParentValue;
+
+ if (theItemRole != Qt::DisplayRole && theItemRole != Qt::EditRole && theItemRole != Qt::ToolTipRole)
+ return QVariant();
+
+ if (GetViewerSelector().IsNull())
+ return Column() == 0 ? "Empty viewer selector" : "";
+
+ return Column() == 0 ? GetViewerSelector()->DynamicType()->Name() : QVariant();
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrViewerSelector::Init()
+{
+ VInspector_ItemContextPropertiesPtr aParentItem = itemDynamicCast<VInspector_ItemContextProperties>(Parent());
+ Handle(SelectMgr_ViewerSelector) aViewerSelector;
+ if (aParentItem)
+ {
+ VInspector_ItemContextPtr aParentContextItem = itemDynamicCast<VInspector_ItemContext>(aParentItem->Parent());
+ if (aParentContextItem)
+ {
+ Handle(AIS_InteractiveContext) aContext = aParentContextItem->GetContext();
+ aViewerSelector = aContext->MainSelector();
+ }
+ }
+ myViewerSelector = aViewerSelector;
+ TreeModel_ItemBase::Init();
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrViewerSelector::Reset()
+{
+ VInspector_ItemBase::Reset();
+
+ myViewerSelector = NULL;
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrViewerSelector::initItem() const
+{
+ if (IsInitialized())
+ return;
+ const_cast<VInspector_ItemSelectMgrViewerSelector*>(this)->Init();
+}
+
+// =======================================================================
+// function : initStream
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrViewerSelector::initStream (Standard_OStream& theOStream) const
+{
+ Handle(SelectMgr_ViewerSelector) aViewerSelector = GetViewerSelector();
+ if (aViewerSelector.IsNull())
+ return;
+
+ aViewerSelector->DumpJson (theOStream);
+}
--- /dev/null
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef VInspector_ItemSelectMgrViewerSelector_H
+#define VInspector_ItemSelectMgrViewerSelector_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+#include <SelectMgr_ViewerSelector.hxx>
+
+class VInspector_ItemSelectMgrViewerSelector;
+typedef QExplicitlySharedDataPointer<VInspector_ItemSelectMgrViewerSelector> VInspector_ItemSelectMgrViewerSelectorPtr;
+
+//! \class VInspector_ItemSelectMgrViewerSelector
+//! Parent item is context properties, that corresponds to SelectMgr_ViewerSelector
+class VInspector_ItemSelectMgrViewerSelector : public VInspector_ItemBase
+{
+public:
+
+ //! Creates an item wrapped by a shared pointer
+ static VInspector_ItemSelectMgrViewerSelectorPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+ { return VInspector_ItemSelectMgrViewerSelectorPtr (new VInspector_ItemSelectMgrViewerSelector (theParent, theRow, theColumn)); }
+
+ //! Destructor
+ virtual ~VInspector_ItemSelectMgrViewerSelector() 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;
+
+ //! Returns data object of the item.
+ //! \return object
+ virtual const Handle(Standard_Transient)& Object() const { initItem(); return myViewerSelector; }
+
+ //! Returns the current viewer, init item if it was not initialized yet
+ //! \return interactive object
+ Handle(SelectMgr_ViewerSelector) GetViewerSelector() const { return Handle(SelectMgr_ViewerSelector)::DownCast (Object()); }
+
+protected:
+ //! Initializes the current item. It is empty because Reset() is also empty.
+ virtual void initItem() const Standard_OVERRIDE;
+
+ //! Returns number of displayed presentations
+ //! \return rows count
+ Standard_EXPORT virtual int initRowCount() const Standard_OVERRIDE;
+
+ //! Returns item information for the given role. Fills internal container if it was not filled yet
+ //! \param theItemRole a value role
+ //! \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 initStream (Standard_OStream& theOStream) const Standard_OVERRIDE;
+
+private:
+
+ //! Constructor
+ //! param theParent a parent item
+ //! \param theRow the item row positition in the parent item
+ //! \param theColumn the item column positition in the parent item
+ VInspector_ItemSelectMgrViewerSelector (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+ : VInspector_ItemBase(theParent, theRow, theColumn) {}
+
+protected:
+
+ Handle(SelectMgr_ViewerSelector) myViewerSelector; //!< the current viewer selector
+};
+
+#endif
--- /dev/null
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <inspector/VInspector_ItemV3dViewer.hxx>
+
+#include <AIS.hxx>
+#include <AIS_InteractiveContext.hxx>
+#include <inspector/VInspector_ItemContext.hxx>
+#include <inspector/VInspector_ItemContextProperties.hxx>
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemV3dViewer::initRowCount() const
+{
+ return 0;
+}
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemV3dViewer::initValue (const int theItemRole) const
+{
+ QVariant aParentValue = VInspector_ItemBase::initValue (theItemRole);
+ if (aParentValue.isValid())
+ return aParentValue;
+
+ if (theItemRole != Qt::DisplayRole && theItemRole != Qt::EditRole && theItemRole != Qt::ToolTipRole)
+ return QVariant();
+
+ if (GetViewer().IsNull())
+ return Column() == 0 ? "Empty viewer" : "";
+
+ return Column() == 0 ? GetViewer()->DynamicType()->Name() : QVariant();
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void VInspector_ItemV3dViewer::Init()
+{
+ VInspector_ItemContextPropertiesPtr aParentItem = itemDynamicCast<VInspector_ItemContextProperties>(Parent());
+ Handle(V3d_Viewer) aViewer;
+ if (aParentItem)
+ {
+ VInspector_ItemContextPtr aParentContextItem = itemDynamicCast<VInspector_ItemContext>(aParentItem->Parent());
+ if (aParentContextItem)
+ {
+ Handle(AIS_InteractiveContext) aContext = aParentContextItem->GetContext();
+ aViewer = aContext->CurrentViewer();
+ }
+ }
+ myViewer = aViewer;
+ TreeModel_ItemBase::Init();
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+void VInspector_ItemV3dViewer::Reset()
+{
+ VInspector_ItemBase::Reset();
+
+ myViewer = NULL;
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+void VInspector_ItemV3dViewer::initItem() const
+{
+ if (IsInitialized())
+ return;
+ const_cast<VInspector_ItemV3dViewer*>(this)->Init();
+}
+
+// =======================================================================
+// function : initStream
+// purpose :
+// =======================================================================
+void VInspector_ItemV3dViewer::initStream (Standard_OStream& theOStream) const
+{
+ Handle(V3d_Viewer) aViewer = GetViewer();
+ if (aViewer.IsNull())
+ return;
+
+ aViewer->DumpJson (theOStream);
+}
--- /dev/null
+// Created on: 2020-02-10
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2020 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef VInspector_ItemV3dViewer_H
+#define VInspector_ItemV3dViewer_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+#include <V3d_Viewer.hxx>
+
+class VInspector_ItemV3dViewer;
+typedef QExplicitlySharedDataPointer<VInspector_ItemV3dViewer> VInspector_ItemV3dViewerPtr;
+
+//! \class VInspector_ItemV3dViewer
+//! Parent item is context properties, that corresponds to AIS_InteractiveContext
+class VInspector_ItemV3dViewer : public VInspector_ItemBase
+{
+public:
+
+ //! Creates an item wrapped by a shared pointer
+ static VInspector_ItemV3dViewerPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+ { return VInspector_ItemV3dViewerPtr (new VInspector_ItemV3dViewer (theParent, theRow, theColumn)); }
+
+ //! Destructor
+ virtual ~VInspector_ItemV3dViewer() 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;
+
+ //! Returns data object of the item.
+ //! \return object
+ virtual const Handle(Standard_Transient)& Object() const { initItem(); return myViewer; }
+
+ //! Returns the current viewer, init item if it was not initialized yet
+ //! \return interactive object
+ Handle(V3d_Viewer) GetViewer() const { return Handle(V3d_Viewer)::DownCast (Object()); }
+
+protected:
+ //! Initializes the current item. It is empty because Reset() is also empty.
+ virtual void initItem() const Standard_OVERRIDE;
+
+ //! Returns number of displayed presentations
+ //! \return rows count
+ Standard_EXPORT virtual int initRowCount() const Standard_OVERRIDE;
+
+ //! Returns item information for the given role. Fills internal container if it was not filled yet
+ //! \param theItemRole a value role
+ //! \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 initStream (Standard_OStream& theOStream) const Standard_OVERRIDE;
+
+private:
+
+ //! Constructor
+ //! param theParent a parent item
+ //! \param theRow the item row positition in the parent item
+ //! \param theColumn the item column positition in the parent item
+ VInspector_ItemV3dViewer(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+ : VInspector_ItemBase(theParent, theRow, theColumn) {}
+
+protected:
+
+ Handle(V3d_Viewer) myViewer; //!< the current viewer
+};
+
+#endif