Dump/Init implementation in OCCT object and parsing it in VInspector (partially)
const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter);
if (!aPrs3d.IsNull())
{
- const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
+ const Handle(Graphic3d_Structure)& aStruct = aPrs3d;
if (!aStruct.IsNull())
{
const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups();
aGroup->SetGroupPrimitivesAspect (aTextAspect->Aspect());
}
}
+
+const TCollection_AsciiString AIS_InteractiveObject_ClassName = "AIS_InteractiveObject";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void AIS_InteractiveObject::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, AIS_InteractiveObject_ClassName);
+
+ {
+ Standard_SStream aTmpStream;
+ SelectMgr_SelectableObject::Dump (aTmpStream);
+ DUMP_VALUES (OS, "SelectMgr_SelectableObject", TCollection::ToDumpString (aTmpStream));
+ }
+
+ DUMP_VALUES (OS, "InteractiveContext", TCollection::GetPointerInfo (myCTXPtr));
+ DUMP_VALUES (OS, "Owner", TCollection::GetPointerInfo (myOwner));
+ DUMP_VALUES (OS, "CappingStyle", TCollection::GetPointerInfo (myCappingStyle));
+
+ DUMP_STOP_KEY (OS, AIS_InteractiveObject_ClassName);
+
+}
Standard_DEPRECATED("Deprecated method, results might be undefined")
Standard_EXPORT void SetAspect (const Handle(Prs3d_BasicAspect)& anAspect);
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
protected:
//! The TypeOfPresention3d means that the interactive object
DUMP_VALUES (OS, "IsValid", IsValid());
OS << "Bnd_Box" << TCollection::DumpSeparator();
- BVH::ToBndBox (CornerMin(), CornerMax()).Dump (OS, Standard_DumpMask_SingleValue);
+ BVH::ToBndBox (CornerMin(), CornerMax()).Dump (OS);
OS << TCollection::DumpSeparator();
}
DUMP_VALUES (OS, "NodeIndex", theNodeIndex);
OS << "Bnd_Box" << TCollection::DumpSeparator();
- BVH::ToBndBox (MinPoint (theNodeIndex), MaxPoint (theNodeIndex)).Dump (OS, Standard_DumpMask_SingleValue);
+ BVH::ToBndBox (MinPoint (theNodeIndex), MaxPoint (theNodeIndex)).Dump (OS);
OS << TCollection::DumpSeparator();
DUMP_VALUES (OS, "BegPrimitive", BegPrimitive (theNodeIndex));
//purpose :
//=======================================================================
-void Bnd_Box::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void Bnd_Box::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, Bnd_Box_ClassName);
//purpose :
//=======================================================================
-Standard_Boolean Bnd_Box::Init (const Standard_OStream& OS)
+Standard_Boolean Bnd_Box::Init (const Standard_SStream& OS)
{
NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aStreamValues;
- Standard_SStream aSStream (OS);
- TCollection::Split (aSStream, aStreamValues);
-
- TCollection_AsciiString anXYZValue;
- if (aStreamValues.Size() == 1)
- {
- TCollection_AsciiString aValueStr = aStreamValues.FindFromIndex (1);
- Standard_Integer aPosition = aValueStr.Search (Bnd_Box_ClassName + TCollection::ClassNameSeparator());
- if (aPosition < 1)
- return Standard_False;
- anXYZValue = aValueStr.Split (aPosition);
- }
-
- NCollection_Vector<Standard_Real> aValues;
- if (!TCollection::SplitReal (anXYZValue, TCollection::VectorSeparator(), aValues))
+ TCollection_AsciiString aKey;
+ TCollection::Split (OS, aStreamValues, aKey);
+
+ TCollection_AsciiString aXmin, anYmin, aZmin, aXmax, anYmax, aZmax, aGap, aFlags;
+ if (!aStreamValues.FindFromKey ("Xmin", aXmin) ||
+ !aStreamValues.FindFromKey ("Ymin", anYmin) ||
+ !aStreamValues.FindFromKey ("Zmin", aZmin) ||
+ !aStreamValues.FindFromKey ("Xmax", aXmax) ||
+ !aStreamValues.FindFromKey ("Ymax", anYmax) ||
+ !aStreamValues.FindFromKey ("Zmax", aZmax) ||
+ !aStreamValues.FindFromKey ("Gap", aGap) ||
+ !aStreamValues.FindFromKey ("Flags", aFlags))
return Standard_False;
- if (aValues.Size() != 8)
- return Standard_False;
+ Xmin = aXmin.RealValue();
+ Ymin = anYmin.RealValue();
+ Zmin = aZmin.RealValue();
+ Xmax = aXmax.RealValue();
+ Ymax = anYmax.RealValue();
+ Zmax = aZmax.RealValue();
- Update (aValues.Value (1), aValues.Value (2), aValues.Value (3), aValues.Value (4), aValues.Value (5), aValues.Value (6));
- Gap = aValues.Value (7);
- Flags = (Standard_Integer)aValues.Value (8);
+ Gap = aGap.RealValue();
+ Flags = aFlags.IntegerValue();
return Standard_True;
}
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
}
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT Standard_Boolean Init (const Standard_OStream& OS);
+ Standard_EXPORT Standard_Boolean Init (const Standard_SStream& OS);
+
+ //! Covers bounding box into string in format: (Xmin, Ymin, Zmin) - (Xmax, Ymax, Zmax)
+ //! \return the string value
+ Standard_EXPORT TCollection_AsciiString ToString() const { return ""; }
+
+ //! Converts text value into parameters if possible, the string format is: (Xmin, Ymin, Zmin) - (Xmax, Ymax, Zmax)
+ //! \return true if conversion is done
+ Standard_EXPORT Standard_Boolean FromString (const TCollection_AsciiString& theValue) { (void)theValue; return Standard_False; }
protected:
//purpose :
//=======================================================================
-void Bnd_OBB::Dump (Standard_OStream& OS, const Standard_Integer /*theMask*/) const
+void Bnd_OBB::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, Bnd_OBB_ClassName);
{
//purpose :
//=======================================================================
-Standard_Boolean Bnd_OBB::Init (const Standard_OStream& /*OS*/)
+Standard_Boolean Bnd_OBB::Init (const Standard_SStream& /*OS*/)
{
//NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString> aStreamValues;
- //Standard_SStream aSStream (OS);
- //TCollection::Split (aSStream, aStreamValues);
+ //TCollection::Split (OS, aStreamValues, aKey);
//TCollection_AsciiString anXYZValue;
//if (aStreamValues.Size() == 1)
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
Standard_EXPORT void Add(const gp_Pnt& theP);
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT Standard_Boolean Init (const Standard_OStream& OS);
+ Standard_EXPORT Standard_Boolean Init (const Standard_SStream& OS);
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
+
+ //! Covers bounding box into string in format: (Xmin, Ymin, Zmin) - (Xmax, Ymax, Zmax)
+ //! \return the string value
+ Standard_EXPORT TCollection_AsciiString ToString() const { return ""; }
+
+ //! Converts text value into parameters if possible, the string format is: (Xmin, Ymin, Zmin) - (Xmax, Ymax, Zmax)
+ //! \return true if conversion is done
+ Standard_EXPORT Standard_Boolean FromString (const TCollection_AsciiString& theValue) { (void)theValue; return Standard_False; }
protected:
Graphic3d_NameOfTextureEnv.hxx
Graphic3d_NameOfTexturePlane.hxx
Graphic3d_NMapOfTransient.hxx
+Graphic3d_PolygonOffset.cxx
Graphic3d_PolygonOffset.hxx
Graphic3d_PriorityDefinitionError.hxx
Graphic3d_RenderingMode.hxx
{
static Standard_CString Graphic3d_Table_PrintZLayerId[6] =
{
- "INKNOWN", "DEFAULT", "TOP", "TOPMOST", "TOP_OSD", "BOT_OSD"
+ "UNKNOWN", "DEFAULT", "TOP", "TOPMOST", "TOP_OSD", "BOT_OSD"
};
static Standard_CString Graphic3d_Table_PrintHorizontalTextAlignment[3] =
// commercial license or contractual agreement.
#include <Graphic3d_Aspects.hxx>
+#include <TCollection.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient)
myTextureSet = new Graphic3d_TextureSet (theTexture);
}
+
+const TCollection_AsciiString Graphic3d_Aspects_ClassName = "Graphic3d_Aspects";
+
+//=======================================================================
+//function : Dump
+//purpose :
+//=======================================================================
+
+void Graphic3d_Aspects::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Graphic3d_Aspects_ClassName);
+
+ /*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;
+
+ Quantity_ColorRGBA myInteriorColor;
+ Quantity_ColorRGBA myBackInteriorColor;
+ Quantity_ColorRGBA myEdgeColor;
+ */
+ {
+ Standard_SStream aTmpStream;
+ myPolygonOffset.Dump (aTmpStream);
+ DUMP_VALUES (OS, "PolygonOffset", TCollection::ToDumpString (aTmpStream));
+ }
+
+ /*Aspect_InteriorStyle myInteriorStyle;
+ Graphic3d_TypeOfShadingModel myShadingModel;
+ Graphic3d_AlphaMode myAlphaMode;
+ Standard_ShortReal myAlphaCutoff;
+
+ Aspect_TypeOfLine myLineType;
+ Standard_ShortReal myLineWidth;
+
+ Aspect_TypeOfMarker myMarkerType;
+ Standard_ShortReal myMarkerScale;
+
+ Aspect_TypeOfStyleText myTextStyle;
+ Aspect_TypeOfDisplayText myTextDisplayType;
+ Font_FontAspect myTextFontAspect;
+ Standard_ShortReal myTextAngle;
+ */
+
+ DUMP_VALUES (OS, "ToSkipFirstEdge", myToSkipFirstEdge);
+ DUMP_VALUES (OS, "ToDistinguishMaterials", myToDistinguishMaterials);
+ DUMP_VALUES (OS, "ToDrawEdges", myToDrawEdges);
+ DUMP_VALUES (OS, "ToDrawSilhouette", myToDrawSilhouette);
+ DUMP_VALUES (OS, "ToSuppressBackFaces", myToSuppressBackFaces);
+ DUMP_VALUES (OS, "ToMapTexture", myToMapTexture);
+ DUMP_VALUES (OS, "IsTextZoomable", myIsTextZoomable);
+
+
+ DUMP_STOP_KEY (OS, Graphic3d_Aspects_ClassName);
+}
&& myIsTextZoomable == theOther.myIsTextZoomable;
}
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
+
protected:
Handle(Graphic3d_ShaderProgram) myProgram;
--- /dev/null
+// Copyright (c) 2016 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_PolygonOffset.hxx>
+
+#include <Aspect.hxx>
+#include <TCollection.hxx>
+
+const TCollection_AsciiString Graphic3d_PolygonOffset_ClassName = "Graphic3d_PolygonOffset";
+
+//=======================================================================
+//function : Dump
+//purpose :
+//=======================================================================
+
+void Graphic3d_PolygonOffset::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Graphic3d_PolygonOffset_ClassName);
+
+ DUMP_VALUES (OS, "Mode", Aspect::PolygonOffsetModeToString (Mode));
+ DUMP_VALUES (OS, "Factor", Factor);
+ DUMP_VALUES (OS, "Units", Units);
+
+ DUMP_STOP_KEY (OS, Graphic3d_PolygonOffset_ClassName);
+}
#define _Graphic3d_PolygonOffset_HeaderFile
#include <Aspect_PolygonOffsetMode.hxx>
+#include <Standard_OStream.hxx>
//! Polygon offset parameters.
struct Graphic3d_PolygonOffset
&& Factor == theOther.Factor
&& Units == theOther.Units;
}
+
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
+
};
#endif // _Graphic3d_PolygonOffset_HeaderFile
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_InvalidAngle.hxx>
+#include <TCollection.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_ArrowAspect, Prs3d_BasicAspect)
|| theAngle >= M_PI / 2.0, "Prs3d_ArrowAspect::SetAngle() - angle out of range");
myAngle = theAngle;
}
+
+const TCollection_AsciiString Prs3d_ArrowAspect_ClassName = "Prs3d_ArrowAspect";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void Prs3d_ArrowAspect::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Prs3d_ArrowAspect_ClassName);
+ {
+ Standard_SStream aTmpStream;
+ myArrowAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "ArrowAspect", TCollection::ToDumpString (aTmpStream));
+ }
+
+ DUMP_VALUES (OS, "Angle", myAngle);
+ DUMP_VALUES (OS, "Length", myLength);
+
+ DUMP_STOP_KEY (OS, Prs3d_ArrowAspect_ClassName);
+}
void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myArrowAspect = theAspect; }
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
protected:
Handle(Graphic3d_AspectLine3d) myArrowAspect;
#define _Prs3d_BasicAspect_HeaderFile
#include <Standard.hxx>
+#include <Standard_OStream.hxx>
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>
class Prs3d_BasicAspect : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(Prs3d_BasicAspect, Standard_Transient)
+
+ //! Dumps the content of me on the stream <OS>.
+ virtual void Dump (Standard_OStream& OS) const = 0;
+
};
DEFINE_STANDARD_HANDLE(Prs3d_BasicAspect, Standard_Transient)
#include <Prs3d_DatumAspect.hxx>
+#include <Prs3d.hxx>
+#include <TCollection.hxx>
+
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_DatumAspect, Prs3d_BasicAspect)
// =======================================================================
}
return Prs3d_DP_None;
}
+
+const TCollection_AsciiString Prs3d_DatumAspect_ClassName = "Prs3d_DatumAspect";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void Prs3d_DatumAspect::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Prs3d_DatumAspect_ClassName);
+
+ DUMP_VALUES (OS, "Axes", Prs3d::DatumAxesToString (myAxes));
+ DUMP_VALUES (OS, "ToDrawLabels", myToDrawLabels);
+ DUMP_VALUES (OS, "ToDrawArrows", myToDrawArrows);
+
+ //NCollection_DataMap<Prs3d_DatumAttribute, Standard_Real> myAttributes;
+ //NCollection_DataMap<Prs3d_DatumParts, Handle(Prs3d_ShadingAspect)> myShadedAspects;
+ //NCollection_DataMap<Prs3d_DatumParts, Handle(Prs3d_LineAspect)> myLineAspects;
+
+ {
+ Standard_SStream aTmpStream;
+ myTextAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "TextAspect", TCollection::ToDumpString (aTmpStream));
+ }
+ {
+ Standard_SStream aTmpStream;
+ myPointAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "PointAspect", TCollection::ToDumpString (aTmpStream));
+ }
+ {
+ Standard_SStream aTmpStream;
+ myArrowAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "ArrowAspect", TCollection::ToDumpString (aTmpStream));
+ }
+ DUMP_STOP_KEY (OS, Prs3d_DatumAspect_ClassName);
+}
+
//! Returns type of arrow for a type of axis
Standard_EXPORT Prs3d_DatumParts ArrowPartForAxis (Prs3d_DatumParts thePart) const;
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
private:
Prs3d_DatumAxes myAxes;
Standard_Boolean myToDrawLabels;
#include <Aspect_TypeOfLine.hxx>
#include <Graphic3d_AspectText3d.hxx>
+#include <Prs3d.hxx>
+#include <TCollection.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_DimensionAspect, Prs3d_BasicAspect)
myTextAspect->SetColor (theColor);
myArrowAspect->SetColor (theColor);
}
+
+const TCollection_AsciiString Prs3d_DimensionAspect_ClassName = "Prs3d_DimensionAspect";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void Prs3d_DimensionAspect::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Prs3d_DimensionAspect_ClassName);
+ {
+ Standard_SStream aTmpStream;
+ myLineAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "LineAspect", TCollection::ToDumpString (aTmpStream));
+ }
+ {
+ Standard_SStream aTmpStream;
+ myTextAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "TextAspect", TCollection::ToDumpString (aTmpStream));
+ }
+ {
+ Standard_SStream aTmpStream;
+ myArrowAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "ArrowAspect", TCollection::ToDumpString (aTmpStream));
+ }
+ DUMP_VALUES (OS, "ValueStringFormat", myValueStringFormat);
+ DUMP_VALUES (OS, "ExtensionSize", myExtensionSize);
+ DUMP_VALUES (OS, "ArrowTailSize", myArrowTailSize);
+ DUMP_VALUES (OS, "ArrowOrientation", Prs3d::DimensionArrowOrientationToString (myArrowOrientation));
+ DUMP_VALUES (OS, "TextHPosition", Prs3d::DimensionTextHorizontalPositionToString (myTextHPosition));
+ DUMP_VALUES (OS, "TextVPosition", Prs3d::DimensionTextVerticalPositionToString (myTextVPosition));
+
+ DUMP_VALUES (OS, "ToDisplayUnits", myToDisplayUnits);
+ DUMP_VALUES (OS, "IsText3d", myIsText3d);
+ DUMP_VALUES (OS, "IsTextShaded", myIsTextShaded);
+ DUMP_VALUES (OS, "IsArrows3d", myIsArrows3d);
+
+ DUMP_STOP_KEY (OS, Prs3d_DimensionAspect_ClassName);
+}
+
//! Returns format.
const TCollection_AsciiString& ValueStringFormat() const { return myValueStringFormat; }
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
protected:
Handle(Prs3d_LineAspect) myLineAspect;
#include <Prs3d_LineAspect.hxx>
+#include <TCollection.hxx>
+
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_LineAspect, Prs3d_BasicAspect)
// =======================================================================
{
//
}
+
+const TCollection_AsciiString Prs3d_LineAspect_ClassName = "Prs3d_LineAspect";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void Prs3d_LineAspect::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Prs3d_LineAspect_ClassName);
+ {
+ Standard_SStream aTmpStream;
+ myAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "Aspect", TCollection::ToDumpString (aTmpStream));
+ }
+ DUMP_STOP_KEY (OS, Prs3d_LineAspect_ClassName);
+}
+
void SetAspect (const Handle(Graphic3d_AspectLine3d)& theAspect) { myAspect = theAspect; }
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
protected:
Handle(Graphic3d_AspectLine3d) myAspect;
#include <Prs3d_PlaneAspect.hxx>
+#include <TCollection.hxx>
+
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_PlaneAspect, Prs3d_BasicAspect)
// =======================================================================
{
//
}
+
+const TCollection_AsciiString Prs3d_PlaneAspect_ClassName = "Prs3d_PlaneAspect";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void Prs3d_PlaneAspect::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Prs3d_PlaneAspect_ClassName);
+ {
+ Standard_SStream aTmpStream;
+ myEdgesAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "EdgesAspect", TCollection::ToDumpString (aTmpStream));
+ }
+ {
+ Standard_SStream aTmpStream;
+ myIsoAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "IsoAspect", TCollection::ToDumpString (aTmpStream));
+ }
+ {
+ Standard_SStream aTmpStream;
+ myArrowAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "ArrowAspect", TCollection::ToDumpString (aTmpStream));
+ }
+
+ DUMP_VALUES (OS, "ArrowsLength", myArrowsLength);
+ DUMP_VALUES (OS, "ArrowsSize", myArrowsSize);
+ DUMP_VALUES (OS, "ArrowsAngle", myArrowsAngle);
+ DUMP_VALUES (OS, "PlaneXLength", myPlaneXLength);
+ DUMP_VALUES (OS, "PlaneYLength", myPlaneYLength);
+ DUMP_VALUES (OS, "IsoDistance", myIsoDistance);
+ DUMP_VALUES (OS, "DrawCenterArrow", myDrawCenterArrow);
+ DUMP_VALUES (OS, "DrawEdgesArrows", myDrawEdgesArrows);
+ DUMP_VALUES (OS, "DrawEdges", myDrawEdges);
+ DUMP_VALUES (OS, "DrawIso", myDrawIso);
+
+ DUMP_STOP_KEY (OS, Prs3d_PlaneAspect_ClassName);
+}
+
//! Returns the distance between isoparameters used in the display of planes.
Standard_Real IsoDistance() const { return myIsoDistance; }
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
protected:
Handle(Prs3d_LineAspect) myEdgesAspect;
#include <Prs3d_PointAspect.hxx>
+#include <TCollection.hxx>
+
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_PointAspect, Prs3d_BasicAspect)
// =======================================================================
{
//
}
+
+const TCollection_AsciiString Prs3d_PointAspect_ClassName = "Prs3d_PointAspect";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void Prs3d_PointAspect::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Prs3d_PointAspect_ClassName);
+ {
+ Standard_SStream aTmpStream;
+ myAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "Aspect", TCollection::ToDumpString (aTmpStream));
+ }
+
+ DUMP_STOP_KEY (OS, Prs3d_PointAspect_ClassName);
+}
+
//! Returns marker's texture.
const Handle(Graphic3d_MarkerImage)& GetTexture() const { return myAspect->GetMarkerImage(); }
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
protected:
Handle(Graphic3d_AspectMarker3d) myAspect;
#include <Graphic3d_MaterialAspect.hxx>
#include <Quantity_Color.hxx>
#include <Standard_Type.hxx>
+#include <TCollection.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_ShadingAspect, Prs3d_BasicAspect)
}
return 0.0;
}
+
+const TCollection_AsciiString Prs3d_ShadingAspect_ClassName = "Prs3d_ShadingAspect";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void Prs3d_ShadingAspect::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Prs3d_ShadingAspect_ClassName);
+ {
+ Standard_SStream aTmpStream;
+ myAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "Aspect", TCollection::ToDumpString (aTmpStream));
+ }
+
+ DUMP_STOP_KEY (OS, Prs3d_ShadingAspect_ClassName);
+}
+
void SetAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) { myAspect = theAspect; }
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
protected:
Handle(Graphic3d_AspectFillArea3d) myAspect;
#include <Prs3d_TextAspect.hxx>
#include <Font_NameOfFont.hxx>
+#include <Graphic3d.hxx>
+#include <TCollection.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_TextAspect, Prs3d_BasicAspect)
{
//
}
+
+const TCollection_AsciiString Prs3d_TextAspect_ClassName = "Prs3d_TextAspect";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void Prs3d_TextAspect::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, Prs3d_TextAspect_ClassName);
+ {
+ Standard_SStream aTmpStream;
+ myTextAspect->Dump (aTmpStream);
+ DUMP_VALUES (OS, "TextAspect", TCollection::ToDumpString (aTmpStream));
+ }
+
+ DUMP_VALUES (OS, "Height", myHeight);
+
+ DUMP_VALUES (OS, "HorizontalJustification", Graphic3d::HorizontalTextAlignmentToString (myHorizontalJustification));
+ DUMP_VALUES (OS, "VerticalJustification", Graphic3d::VerticalTextAlignmentToString (myVerticalJustification));
+ DUMP_VALUES (OS, "Orientation", Graphic3d::TextPathToString (myOrientation));
+
+ DUMP_STOP_KEY (OS, Prs3d_TextAspect_ClassName);
+}
+
void SetAspect (const Handle(Graphic3d_AspectText3d)& theAspect) { myTextAspect = theAspect; }
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
protected:
Handle(Graphic3d_AspectText3d) myTextAspect;
myDrawer->ShadingAspect()->Aspect()->PolygonOffsets (theMode, theFactor, theUnits);
}
}
+
+const TCollection_AsciiString PrsMgr_PresentableObject_ClassName = "PrsMgr_PresentableObject";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void PrsMgr_PresentableObject::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, PrsMgr_PresentableObject_ClassName);
+
+ DUMP_VALUES (OS, "Parent", TCollection::GetPointerInfo (myParent));
+
+ DUMP_VALUES (OS, "Width", myOwnWidth);
+ DUMP_VALUES (OS, "OwnColor", hasOwnColor);
+ DUMP_VALUES (OS, "OwnMaterial", hasOwnMaterial);
+
+ DUMP_VALUES (OS, "InfiniteState", myInfiniteState);
+ DUMP_VALUES (OS, "IsMutable", myIsMutable);
+ DUMP_VALUES (OS, "HasOwnPresentations", myHasOwnPresentations);
+
+ DUMP_STOP_KEY (OS, PrsMgr_PresentableObject_ClassName);
+
+/*
+ PrsMgr_Presentations myPresentations; //!< list of presentations
+ Handle(Graphic3d_SequenceOfHClipPlane) myClipPlanes; //!< sequence of object-specific clipping planes
+ Handle(Prs3d_Drawer) myDrawer; //!< main presentation attributes
+ Handle(Prs3d_Drawer) myHilightDrawer; //!< (optional) custom presentation attributes for highlighting selected object
+ Handle(Prs3d_Drawer) myDynHilightDrawer; //!< (optional) custom presentation attributes for highlighting detected object
+ Handle(Graphic3d_TransformPers) myTransformPersistence; //!< transformation persistence
+ Handle(Geom_Transformation) myLocalTransformation; //!< local transformation relative to parent object
+ Handle(Geom_Transformation) myTransformation; //!< absolute transformation of this object (combined parents + local transformations)
+ Handle(Geom_Transformation) myCombinedParentTransform; //!< transformation of parent object (combined for all parents)
+ PrsMgr_ListOfPresentableObjects myChildren; //!< list of children
+ gp_GTrsf myInvTransformation; //!< inversion of absolute transformation (combined parents + local transformations)
+ PrsMgr_TypeOfPresentation3d myTypeOfPresentation3d; //!< presentation type
+
+ Aspect_TypeOfFacingModel myCurrentFacingModel; //!< current facing model
+*/
+}
//! Clears settings provided by the drawing tool aDrawer.
Standard_EXPORT virtual void UnsetAttributes();
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const;
+
public: //! @name deprecated methods
//! gives the list of modes which are flagged "to be updated".
//purpose :
//=======================================================================
-void Quantity_Color::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void Quantity_Color::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, Quantity_Color_ClassName);
//purpose :
//=======================================================================
-Standard_Boolean Quantity_Color::Init (const Standard_OStream& OS)
+Standard_Boolean Quantity_Color::Init (const Standard_OStream& /*OS*/)
{
//NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aStreamValues;
//Standard_SStream aSStream (OS);
- //TCollection::Split (aSStream, aStreamValues);
+ //TCollection_AsciiString aKey;
+ //TCollection::Split (aSStream, aStreamValues, aKey);
//TCollection_AsciiString anXYZValue;
//if (!aStreamValues.FindFromKey (Quantity_Color_ClassName, anXYZValue))
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
#include <Standard_Handle.hxx>
#include <Standard_ShortReal.hxx>
Standard_EXPORT static void Test();
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
//! Dumps the content of me on the stream <OS>.
Standard_EXPORT Standard_Boolean Init (const Standard_OStream& OS);
//purpose :
//=======================================================================
-void Quantity_ColorRGBA::Dump (Standard_OStream& OS, const Standard_Integer /*theMask*/) const
+void Quantity_ColorRGBA::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, Quantity_ColorRGBA_ClassName);
const bool theAlphaComponentIsOff = false);
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
private:
mySelectable->HilightOwnerWithColor (thePM, theStyle, this);
}
}
+
+const TCollection_AsciiString SelectMgr_EntityOwner_ClassName = "SelectMgr_EntityOwner";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void SelectMgr_EntityOwner::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, SelectMgr_EntityOwner_ClassName);
+
+
+ DUMP_VALUES (OS, "Selectable", TCollection::GetPointerInfo (mySelectable));
+ DUMP_VALUES (OS, "Priority", mypriority);
+ DUMP_VALUES (OS, "IsSelected", myIsSelected);
+ DUMP_VALUES (OS, "ComesFromDecomposition", myFromDecomposition);
+
+ DUMP_STOP_KEY (OS, SelectMgr_EntityOwner_ClassName);
+}
//! Sets flag indicating this owner points to a part of object (TRUE) or to entire object (FALSE).
void SetComesFromDecomposition (const Standard_Boolean theIsFromDecomposition) { myFromDecomposition = theIsFromDecomposition; }
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const;
+
public:
//! Sets the selectable object.
{
return THE_NULL_ENTITYOWNER;
}
+
+const TCollection_AsciiString SelectMgr_SelectableObject_ClassName = "SelectMgr_SelectableObject";
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+void SelectMgr_SelectableObject::Dump (Standard_OStream& OS) const
+{
+ DUMP_START_KEY (OS, SelectMgr_SelectableObject_ClassName);
+
+ {
+ Standard_SStream aTmpStream;
+ PrsMgr_PresentableObject::Dump (aTmpStream);
+ DUMP_VALUES (OS, "PrsMgr_PresentableObject", TCollection::ToDumpString (aTmpStream));
+ }
+
+ DUMP_VALUES (OS, "GlobalSelectionMode", myGlobalSelMode);
+ //DUMP_VALUES (OS, "mycurrent", mycurrent);
+ DUMP_VALUES (OS, "IsAutoHilight", myAutoHilight);
+
+/*
+ SelectMgr_SequenceOfSelection myselections; //!< list of selections
+ Handle(Prs3d_Presentation) mySelectionPrs; //!< optional presentation for highlighting selected object
+ Handle(Prs3d_Presentation) myHilightPrs; //!< optional presentation for highlighting detected object
+*/
+
+ DUMP_STOP_KEY (OS, SelectMgr_SelectableObject_ClassName);
+}
//! Returns common entity owner if the object is an assembly
Standard_EXPORT virtual const Handle(SelectMgr_EntityOwner)& GetAssemblyOwner() const;
+ //! Dumps the content of me on the stream <OS>.
+ Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
public:
//! Begins the iteration scanning for sensitive primitives.
#include <algorithm>
-#define REPORT_SELECTION_BUILD
+//#define REPORT_SELECTION_BUILD
#ifdef REPORT_SELECTION_BUILD
#include <Message_Alerts.hxx>
#include <Message_PerfMeter.hxx>
}
}
+#ifdef REPORT_SELECTION_BUILD
MESSAGE_INFO ("SortResult", "", &aPerfMeter, aParentAlert);
+#endif
SortResult();
#ifdef REPORT_SELECTION_BUILD
Standard_SStream aStreamDone;
Standard_DimensionMismatch.hxx
Standard_DivideByZero.hxx
Standard_DomainError.hxx
-Standard_DumpMask.hxx
Standard_ErrorHandler.cxx
Standard_ErrorHandler.hxx
Standard_ExtCharacter.hxx
+++ /dev/null
-// Copyright (c) 2019 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 _Standard_DumpMask_HeaderFile
-#define _Standard_DumpMask_HeaderFile
-
-
-//! Sets how much information should be dumped in Dump of the object
-enum Standard_DumpMask
-{
- Standard_DumpMask_Empty = 0x0000, //! empty output
- Standard_DumpMask_Fields = 0x0001, //! only class fields value
- Standard_DumpMask_Methods = 0x0002, //! only methods result
- Standard_DumpMask_ClassName = 0x0004, //! the first row of Dump has class name
- Standard_DumpMask_SingleValue = 0x0008, //! dump is combined in one value
- Standard_DumpMask_Whole = Standard_DumpMask_Fields | Standard_DumpMask_Methods,
- Standard_DumpMask_WholeAndClassName = Standard_DumpMask_Whole | Standard_DumpMask_ClassName
-};
-
-#endif // _Standard_DumpMask_HeaderFile
// ----------------------------------------------------------------------------
void TCollection::Split (const Standard_SStream& theStream,
- NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& theValues)
+ NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& theValues,
+ TCollection_AsciiString& theKey)
{
TCollection_AsciiString aStreamStr (theStream.str().c_str());
+ TCollection_AsciiString aSplitValue, aTailValue, aKey;
+ if (SplitKey (aStreamStr, aSplitValue, aTailValue, aKey))
+ {
+ if (aTailValue.IsEmpty())
+ {
+ theKey = aKey;
+ aStreamStr = aSplitValue;
+ }
+ }
+
NCollection_List<TCollection_AsciiString> aValues;
- Split (aStreamStr, DumpSeparator(), aValues);
+ split (aStreamStr, DumpSeparator(), aValues);
for (NCollection_List<TCollection_AsciiString>::Iterator anIterator (aValues); anIterator.More(); anIterator.Next())
{
// ----------------------------------------------------------------------------
-// Split
+// split
// ----------------------------------------------------------------------------
-void TCollection::Split (const TCollection_AsciiString& theValue,
+void TCollection::split (const TCollection_AsciiString& theValue,
const TCollection_AsciiString& theSeparator,
NCollection_List<TCollection_AsciiString>& theValues)
{
aCurrentString = aCurrentString.Split (theSeparator.Length());
}
-
- if (theValues.Size() == 1)
- {
- TCollection_AsciiString aKey, aValue;
- if (!SplitKey (theValues.First(), aValue, aKey))
- return;
-
- theValues.Clear();
- Split (aValue, DumpSeparator(), theValues);
- }
}
// ----------------------------------------------------------------------------
Standard_Boolean TCollection::SplitKey (const TCollection_AsciiString& theSourceValue,
TCollection_AsciiString& theSplitValue,
+ TCollection_AsciiString& theTailValue,
TCollection_AsciiString& theKey)
{
Standard_Integer aBracketPosition = theSourceValue.Search (XMLBracketOpen());
aTailValue = aTailValue.SubString (2, aTailValue.Length()); // remove close bracket
TCollection_AsciiString aStopKey = StopKey (theKey);
- aBracketPosition = theSourceValue.Search (aStopKey);
- if (aBracketPosition <= 1 || aBracketPosition >= theSourceValue.Length())
+ aBracketPosition = aTailValue.Search (aStopKey);
+ if (aBracketPosition <= 1 || aBracketPosition >= aTailValue.Length())
return Standard_False;
theSplitValue = aTailValue;
aTailValue = theSplitValue.Split (aBracketPosition - 1);
+
+ if (aTailValue.Length() == aStopKey.Length())
+ theTailValue = "";
+ else
+ theTailValue = aTailValue.SubString (aStopKey.Length(), aTailValue.Length());
return Standard_True;
}
#include <TCollection_AsciiString.hxx>
#include <NCollection_IndexedDataMap.hxx>
+#include <NCollection_IndexedMap.hxx>
#include <NCollection_List.hxx>
#include <NCollection_Vector.hxx>
//! \param theStream stream value
//! \param theValues [out] container of split values
Standard_EXPORT static void Split (const Standard_SStream& theStream,
- NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& theValues);
+ NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& theValues,
+ TCollection_AsciiString& theKey);
+private:
//! Unites list of string into one string using the separator
- Standard_EXPORT static void Split (const TCollection_AsciiString& theValue,
+ Standard_EXPORT static void split (const TCollection_AsciiString& theValue,
const TCollection_AsciiString& theSeparator,
NCollection_List<TCollection_AsciiString>& theValues);
-
+public:
//! Unites list of string into one string using the separator
Standard_EXPORT static Standard_Boolean SplitReal (const TCollection_AsciiString& theValue,
const TCollection_AsciiString& theSeparator,
//! Splits a AsciiString into two sub-strings using Dump keys.
//! Example:
//! aString contains "<key>abc</key>defg"
- //! aString.SplitDumped() gives <me> = "abc" and returns "defg"
+ //! aString.SplitDumped() gives theSplitValue = "abc", theTailValue = "defg", theKey = "key"
Standard_EXPORT static Standard_Boolean SplitDumped (const TCollection_AsciiString& theSourceValue,
TCollection_AsciiString& theSplitValue,
TCollection_AsciiString& theTailValue,
//! theSplitValue = value, theKey = key.
Standard_EXPORT static Standard_Boolean SplitKey (const TCollection_AsciiString& theSourceValue,
TCollection_AsciiString& theSplitValue,
+ TCollection_AsciiString& theTailValue,
TCollection_AsciiString& theKey);
+ //! Returns true if the value has bracket key
+ static Standard_Boolean HasBracketKey (const TCollection_AsciiString& theSourceValue)
+ { return theSourceValue.Search (TCollection::XMLBracketOpen()) >= 0; }
+
protected:
static TCollection_AsciiString XMLBracketOpen() { return TCollection_AsciiString ("<"); }
static TCollection_AsciiString XMLBracketClose() { return TCollection_AsciiString (">"); }
//purpose :
//=======================================================================
-void TopLoc_Datum3D::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void TopLoc_Datum3D::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, TopLoc_Datum3D_ClassName);
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
//! Writes the contents of this Datum3D to the stream S.
Standard_EXPORT void ShallowDump (Standard_OStream& S) const;
//purpose :
//=======================================================================
-void TopLoc_ItemLocation::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void TopLoc_ItemLocation::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, TopLoc_ItemLocation_ClassName);
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
Standard_EXPORT TopLoc_ItemLocation(const Handle(TopLoc_Datum3D)& D, const Standard_Integer P);
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
friend class TopLoc_Location;
//purpose :
//=======================================================================
-void TopLoc_Location::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void TopLoc_Location::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, TopLoc_Location_ClassName);
TopLoc_SListOfItemLocation items = myItems;
if (!items.IsEmpty())
{
- DUMP_VALUES (OS, "Items", "");
while (items.More())
{
Standard_SStream aTmpStream;
#include <TopLoc_SListOfItemLocation.hxx>
#include <Standard_Boolean.hxx>
-#include <Standard_DumpMask.hxx>
#include <Standard_Integer.hxx>
#include <Standard_OStream.hxx>
}
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
//! Prints the contents of <me> on the stream <s>.
Standard_EXPORT void ShallowDump (Standard_OStream& S) const;
//purpose :
//=======================================================================
-void TopoDS_Shape::Dump (Standard_OStream& OS, const Standard_Integer /*theMask*/) const
+void TopoDS_Shape::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, TopoDS_Shape_ClassName);
void TShape (const Handle(TopoDS_TShape)& theTShape) { myTShape = theTShape; }
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
private:
Handle(Message_AttributeStream) aValuesArrayAlert = Handle(Message_AttributeStream)::DownCast (anAttribute);
// store values
NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aValues;
- TCollection::Split (aValuesArrayAlert->GetStream(), aValues);
+ TCollection_AsciiString aKey;
+ TCollection::Split (aValuesArrayAlert->GetStream(), aValues, aKey);
if (aValues.IsEmpty())
return;
int anArraySize = 2 * aValues.Size();
const TCollection_AsciiString gp_Map_ClassName = "gp_Mat";
-void gp_Mat::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void gp_Mat::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, gp_Map_ClassName);
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
Standard_NODISCARD gp_Mat Transposed() const;
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
friend class gp_XYZ;
//purpose :
//=======================================================================
-void gp_Trsf::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void gp_Trsf::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, gp_Trsf_ClassName);
#include <Standard.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_DefineAlloc.hxx>
-#include <Standard_DumpMask.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Handle.hxx>
#include <Standard_OStream.hxx>
}
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
friend class gp_GTrsf;
//purpose :
//=======================================================================
-void gp_XYZ::Dump (Standard_OStream& OS, const Standard_Integer theMask) const
+void gp_XYZ::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, gp_XYZ_ClassName);
//purpose :
//=======================================================================
-Standard_Boolean gp_XYZ::Init (const Standard_OStream& OS)
+Standard_Boolean gp_XYZ::Init (const Standard_OStream& /*OS*/)
{
/*NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aStreamValues;
Standard_SStream aSStream (OS);
- TCollection::Split (aSStream, aStreamValues);
+ TCollection_AsciiString aKey;
+ TCollection::Split (aSStream, aStreamValues, aKey);
TCollection_AsciiString anXYZValue;
if (aStreamValues.FindFromKey (gp_XYZ_ClassName, anXYZValue))
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
-#include <Standard_DumpMask.hxx>
#include <Standard_OStream.hxx>
class Standard_ConstructionError;
//! Dumps the content of me on the stream <OS>.
- Standard_EXPORT void Dump (Standard_OStream& OS, const Standard_Integer theMask = Standard_DumpMask_Whole) const;
+ Standard_EXPORT void Dump (Standard_OStream& OS) const;
//! Dumps the content of me on the stream <OS>.
Standard_EXPORT Standard_Boolean Init (const Standard_OStream& OS);
MessageModel_ItemAlert.hxx
MessageModel_ItemBase.cxx
MessageModel_ItemBase.hxx
-MessageModel_ItemPropertiesAttributeStream.cxx
-MessageModel_ItemPropertiesAttributeStream.hxx
MessageModel_ItemPropertiesReport.cxx
MessageModel_ItemPropertiesReport.hxx
MessageModel_ItemReport.cxx
{
gp_XYZ aCoords (1.3, 2.3, 3.4);
Standard_SStream aStream;
- aCoords.Dump (aStream, Standard_DumpMask_SingleValue);
+ aCoords.Dump (aStream);
MESSAGE_INFO_STREAM(aStream, "gp_XYZ", "", &aPerfMeter, NULL);
}
// Bnd_Box
{
Bnd_Box aBox(20., 15., 10., 25., 20., 15.);
Standard_SStream aStream;
- aBox.Dump (aStream, Standard_DumpMask_SingleValue);
+ aBox.Dump (aStream);
MESSAGE_INFO_STREAM(aStream, "Bnd_Box", "", &aPerfMeter, NULL);
}
// Bnd_OBB
Bnd_OBB anOBB (gp_Pnt (-10., -15., -10.), gp_Dir (1., 0., 0.), gp_Dir (0., 1., 0.), gp_Dir (0., 0., 1.),
5., 10., 5.);
Standard_SStream aStream;
- anOBB.Dump (aStream, Standard_DumpMask_SingleValue);
+ anOBB.Dump (aStream);
MESSAGE_INFO_STREAM(aStream, "Bnd_OBB", "", &aPerfMeter, NULL);
}
myTreeModel->UpdateTreeModel();
#include <inspector/MessageModel_ItemAlert.hxx>
-#include <inspector/MessageModel_ItemPropertiesAttributeStream.hxx>
#include <inspector/MessageModel_ItemRoot.hxx>
#include <inspector/MessageModel_ItemReport.hxx>
#include <inspector/MessageModel_Tools.hxx>
return aCurrentItem->myChildAlerts.Size();
}
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void MessageModel_ItemAlert::GetStream (Standard_OStream& OS) const
+{
+ Handle(Message_AlertExtended) anExtendedAlert = Handle(Message_AlertExtended)::DownCast (getAlert());
+ if (!anExtendedAlert.IsNull() && !anExtendedAlert->Attribute().IsNull())
+ {
+ Handle(Message_Attribute) anAttribute = anExtendedAlert->Attribute();
+ if (!anAttribute.IsNull())
+ {
+ if (!Handle(Message_AttributeStream)::DownCast(anAttribute).IsNull())
+ {
+ //if (GetProperties().IsNull())
+ //{
+ // TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
+ // SetProperties (new MessageModel_ItemPropertiesAttributeStream (anItem));
+ //}
+ Handle(Message_AttributeStream) anAttributeStream = Handle(Message_AttributeStream)::DownCast (anExtendedAlert->Attribute());
+ //Handle(MessageModel_ItemPropertiesAttributeStream) aProperties = Handle(MessageModel_ItemPropertiesAttributeStream)::DownCast (GetProperties());
+ OS << anAttributeStream->GetStream().str();
+ }
+ }
+ }
+}
+
// =======================================================================
// function : createChild
// purpose :
}
}
- Handle(Message_AlertExtended) anExtendedAlert = Handle(Message_AlertExtended)::DownCast(myAlert);
+ /*Handle(Message_AlertExtended) anExtendedAlert = Handle(Message_AlertExtended)::DownCast(myAlert);
if (!anExtendedAlert.IsNull() && !anExtendedAlert->Attribute().IsNull())
{
Handle(Message_Attribute) anAttribute = anExtendedAlert->Attribute();
-
if (!anAttribute.IsNull())
{
if (!Handle(Message_AttributeStream)::DownCast(anAttribute).IsNull())
{
- TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
- SetProperties (new MessageModel_ItemPropertiesAttributeStream (anItem));
+ if (GetProperties().IsNull())
+ {
+ TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
+ SetProperties (new MessageModel_ItemPropertiesAttributeStream (anItem));
+ }
+ Handle(Message_AttributeStream) anAttributeStream = Handle(Message_AttributeStream)::DownCast (anExtendedAlert->Attribute());
+ Handle(MessageModel_ItemPropertiesAttributeStream) aProperties = Handle(MessageModel_ItemPropertiesAttributeStream)::DownCast (GetProperties());
+ aProperties->Init (anAttributeStream->GetStream());
}
//if (anAttribute->IsKind (STANDARD_TYPE (Message_AttributeObject)))
// myPresentations.Append (Handle(Message_AttributeObject)::DownCast (anAttribute)->GetObject());
//Bnd_Box aBox;
//if (aBox.Init (Standard_SStream (aDescription.ToCString())))
// myPresentations.Append (new Convert_TransientShape (Convert_Tools::CreateShape (aBox)));
- }
+ }*/
MessageModel_ItemBase::Init();
}
//! \return number of children.
Standard_EXPORT virtual int initRowCount() 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& OS) const Standard_OVERRIDE;
+
//! Sets some shape to present the item
//! \param theShape shape instance
void SetCustomShape (const TopoDS_Shape& theShape) { myCustomShape = theShape; }
+++ /dev/null
-// Created on: 2019-02-25
-// Created by: Natalia ERMOLAEVA
-// Copyright (c) 2019 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/MessageModel_ItemPropertiesAttributeStream.hxx>
-#include <inspector/MessageModel_ItemAlert.hxx>
-
-#include <inspector/ShapeView_ItemShape.hxx>
-#include <inspector/ShapeView_Tools.hxx>
-
-#include <inspector/ViewControl_Tools.hxx>
-#include <BRep_Tool.hxx>
-#include <Message_AlertExtended.hxx>
-#include <TCollection.hxx>
-#include <TopoDS.hxx>
-
-#include <Standard_WarningsDisable.hxx>
-#include <QApplication>
-#include <QFont>
-#include <Standard_WarningsRestore.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(MessageModel_ItemPropertiesAttributeStream, TreeModel_ItemProperties)
-
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
-
-void MessageModel_ItemPropertiesAttributeStream::Init()
-{
- MessageModel_ItemAlertPtr anAlertItem = itemDynamicCast<MessageModel_ItemAlert>(getItem());
- if (!anAlertItem)
- return;
-
- Handle(Message_AlertExtended) anExtendedAlert = Handle(Message_AlertExtended)::DownCast(anAlertItem->GetAlert());
- if (anExtendedAlert.IsNull() || anExtendedAlert->Attribute().IsNull())
- return;
-
- Handle(Message_AttributeStream) anAttributeStream = Handle(Message_AttributeStream)::DownCast (anExtendedAlert->Attribute());
- if (anAttributeStream.IsNull())
- return;
-
- TCollection::Split (anAttributeStream->GetStream(), myValues);
-
- TreeModel_ItemProperties::Init();
-}
-
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
-
-void MessageModel_ItemPropertiesAttributeStream::Reset()
-{
- myValues.Clear();
-
- TreeModel_ItemProperties::Reset();
-}
-
-// =======================================================================
-// function : RowCount
-// purpose :
-// =======================================================================
-
-int MessageModel_ItemPropertiesAttributeStream::GetTableRowCount() const
-{
- const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& aValues = GetValues();
- return aValues.Size();
-}
-
-// =======================================================================
-// function : Data
-// purpose :
-// =======================================================================
-
-QVariant MessageModel_ItemPropertiesAttributeStream::GetTableData (const int theRow, const int theColumn, int theRole) const
-{
- const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& aValues = GetValues();
-
- if (theRole == Qt::DisplayRole)
- {
- if (theColumn == 0) return aValues.FindKey (theRow + 1).ToCString();
- else if (theColumn == 1) return aValues.FindFromIndex (theRow + 1).ToCString();
- }
- return QVariant();
-}
-
-// =======================================================================
-// function : GetTableEditType
-// purpose :
-// =======================================================================
-ViewControl_EditType MessageModel_ItemPropertiesAttributeStream::GetTableEditType (const int theRow, const int) const
-{
- //switch (theRow)
- //{
- // case 0: return ViewControl_EditType_Spin;
- // default: return ViewControl_EditType_None;
- //}
- return ViewControl_EditType_None;
-}
-
-// =======================================================================
-// function : SetTableData
-// purpose :
-// =======================================================================
-bool MessageModel_ItemPropertiesAttributeStream::SetTableData (const int theRow, const int theColumn, const QVariant& theValue)
-{
- //Handle(Message_Report) aReport = getItemReport();
- //switch (theRow)
- //{
- // case 0: aReport->SetLimit (theValue.toInt()); break;
- // default: break;
- //}
- return true;
-}
+++ /dev/null
-// Created on: 2019-02-25
-// Created by: Natalia ERMOLAEVA
-// Copyright (c) 2019 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 MessageModel_ItemReportProperties_H
-#define MessageModel_ItemReportProperties_H
-
-#include <Standard.hxx>
-#include <Message_AttributeStream.hxx>
-#include <NCollection_IndexedDataMap.hxx>
-#include <TCollection_AsciiString.hxx>
-
-
-#include <inspector/TreeModel_ItemProperties.hxx>
-#include <inspector/TreeModel_ItemBase.hxx>
-
-#include <Standard_WarningsDisable.hxx>
-#include <QAbstractTableModel>
-#include <QColor>
-#include <QList>
-#include <QModelIndexList>
-#include <QVariant>
-#include <Standard_WarningsRestore.hxx>
-
-class QItemDelegate;
-
-DEFINE_STANDARD_HANDLE (MessageModel_ItemPropertiesAttributeStream, TreeModel_ItemProperties)
-
-//! \class MessageModel_ItemPropertiesAttributeStream
-//! \brief This is an interace for ViewControl_TableModel to give real values of the model
-//! It should be filled or redefined.
-class MessageModel_ItemPropertiesAttributeStream : public TreeModel_ItemProperties
-{
-public:
-
- //! Constructor
- Standard_EXPORT MessageModel_ItemPropertiesAttributeStream (TreeModel_ItemBasePtr theItem)
- : TreeModel_ItemProperties (theItem) {}
-
- //! Destructor
- virtual ~MessageModel_ItemPropertiesAttributeStream() {}
-
- //! If me has internal values, it should be initialized here.
- Standard_EXPORT virtual void Init();
-
- //! If the item has internal values, there should be reseted here.
- Standard_EXPORT virtual void Reset();
-
- //! Returns number of rows, depending on orientation: myColumnCount or size of values container
- //! \param theParent an index of the parent item
- //! \return an integer value
- Standard_EXPORT virtual int GetTableRowCount() const Standard_OVERRIDE;
-
- //! Returns content of the model index for the given role, it is obtained from internal container of values
- //! It returns value only for DisplayRole.
- //! \param theRow a model index row
- //! \param theColumn a model index column
- //! \param theRole a view role
- //! \return value intepreted depending on the given role
- Standard_EXPORT virtual QVariant GetTableData (const int theRow, const int theColumn, const int theRole = Qt::DisplayRole) const Standard_OVERRIDE;
-
- //! Returns type of edit control for the model index. By default, it is an empty control
- //! \param theRow a model index row
- //! \param theColumn a model index column
- //! \return edit type
- Standard_EXPORT virtual ViewControl_EditType GetTableEditType (const int theRow, const int theColumn) const Standard_OVERRIDE;
-
- //! Sets the value into the table cell. Only 1st column value might be modified.
- //! \param theRow a model index row
- //! \param theColumn a model index column
- //! \param theValue a new cell value
- Standard_EXPORT virtual bool SetTableData (const int theRow, const int theColumn, const QVariant& theValue) Standard_OVERRIDE;
-
- DEFINE_STANDARD_RTTIEXT (MessageModel_ItemPropertiesAttributeStream, TreeModel_ItemProperties)
-
-protected:
- //! Returns attribute with stream value
- const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& GetValues() const
- {
- if (!IsInitialized())
- const_cast<MessageModel_ItemPropertiesAttributeStream*>(this)->Init();
- return myValues;
- }
-
-protected:
- NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> myValues;
-};
-
-#endif
if (!anItemBase)
continue;
+ Handle(TreeModel_ItemProperties) anItemProperties = anItemBase->GetProperties();
+ if (anItemProperties)
+ anItemProperties->GetPresentations (-1, -1, aPresentations);
+
MessageModel_ItemAlertPtr anAlertItem = itemDynamicCast<MessageModel_ItemAlert>(anItemBase);
if (!anAlertItem)
continue;
aReport->SetActive (Standard_True);//Standard_False);
aPlugins.insert("TKMessageView");
- //anActivatedPluginName = "TKVInspector";
- anActivatedPluginName = "TKMessageView";
+ anActivatedPluginName = "TKVInspector";
+ //anActivatedPluginName = "TKMessageView";
}
else
anActivatedPluginName = *aPlugins.rbegin();
TKMath
TKPrim
TKTopAlgo
+TKTInspectorAPI
CSF_QT
\ No newline at end of file
TreeModel_ItemProperties.hxx
TreeModel_ItemPropertiesCreator.cxx
TreeModel_ItemPropertiesCreator.hxx
+TreeModel_ItemPropertiesStream.cxx
+TreeModel_ItemPropertiesStream.hxx
TreeModel_ItemRole.hxx
+TreeModel_ItemStream.cxx
+TreeModel_ItemStream.hxx
TreeModel_ModelBase.cxx
TreeModel_ModelBase.hxx
TreeModel_Tools.cxx
#include <inspector/TreeModel_ItemBase.hxx>
#include <inspector/TreeModel_ItemProperties.hxx>
+#include <inspector/TreeModel_ItemPropertiesStream.hxx>
#include <inspector/TreeModel_ItemRole.hxx>
#include <Standard_WarningsDisable.hxx>
// =======================================================================
Handle(TreeModel_ItemProperties) TreeModel_ItemBase::GetProperties() const
{
+ if (myProperties.IsNull() && Parent())
+ {
+ TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
+ //TreeModel_ItemBase* anItem = (TreeModel_ItemBase*)this;
+ anItem->SetProperties (new TreeModel_ItemPropertiesStream (anItem));
+ }
+
+ if (!myProperties.IsNull() && !myProperties->IsInitialized())
+ {
+ Handle(TreeModel_ItemPropertiesStream) aPropertiesStream = Handle(TreeModel_ItemPropertiesStream)::DownCast (myProperties);
+ if (!aPropertiesStream.IsNull())
+ {
+ Standard_SStream aStream;
+ GetStream (aStream);
+ aPropertiesStream->Init (aStream);
+ }
+ }
+
return myProperties;
}
TreeModel_ItemBasePtr anItem;
if (isToCreate) {
int aRowCount = rowCount();
- if (myProperties.IsNull() || theRow < aRowCount - myProperties->ChildItemCount())
- anItem = createChild (theRow, theColumn);
- else if (!myProperties.IsNull())
- anItem = myProperties->CreateChildItem (theRow, theColumn);
+ Handle(TreeModel_ItemProperties) aProperties = GetProperties();
+ int aChildOffset = aProperties.IsNull() ? 0 : aProperties->ChildItemCount();
+ if (!aProperties.IsNull() && theRow < aChildOffset)
+ anItem = aProperties->CreateChildItem (theRow, theColumn);
+ else
+ anItem = createChild (theRow - aChildOffset, theColumn);
+ //if (aProperties.IsNull() || theRow < aRowCount - aProperties->ChildItemCount())
+ // anItem = createChild (theRow, theColumn);
+ //else if (!aProperties.IsNull())
+ // anItem = aProperties->CreateChildItem (theRow, theColumn);
if (anItem)
m_ChildItems[aPos] = anItem;
QVariant aValueToCache;
if (theItemRole == TreeModel_ItemRole_RowCountRole)
{
- aValueToCache = myProperties.IsNull() ? initRowCount() : (initRowCount() + myProperties->ChildItemCount());
+ int aRowCount = initRowCount();
+ Handle(TreeModel_ItemProperties) aProperties = GetProperties();
+ int aChildOffset = aProperties.IsNull() ? 0 : aProperties->ChildItemCount();
+ aValueToCache = aRowCount + aChildOffset;
}
else
aValueToCache = initValue (theItemRole);
return myCachedValues.contains (theItemRole) ? myCachedValues[theItemRole] : QVariant();
}
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void TreeModel_ItemBase::Init()
+{
+ //if (myProperties.IsNull() && Parent())
+ //{
+ // TreeModel_ItemBasePtr anItem = Parent()->Child (Row(), Column(), false);
+ // SetProperties (new TreeModel_ItemPropertiesStream (anItem));
+ //}
+
+ m_bInitialized = true;
+}
+
// =======================================================================
// function : initValue
// purpose :
//! Sets the item internal initialized state to the true. If the item has internal values,
//! there should be initialized here.
- virtual void Init() { m_bInitialized = true; }
+ Standard_EXPORT virtual void Init();
//! Returns data object of the item.
//! \return object
//! \param theRole an item role
Standard_EXPORT virtual void Reset(int theRole);
+ //! Returns stream value of the item to fulfill property panel.
+ //! \return stream value or dummy
+ virtual void GetStream (Standard_OStream& OS) const { (void)OS; }
+
//! Gets the parent of the item, or TreeModel_ItemBasePtr() if it has no parent.
//! \return pointer to the item
TreeModel_ItemBasePtr Parent() const { return m_pParent; };
public:
//! Constructor
- TreeModel_ItemProperties (const TreeModel_ItemBasePtr& theItem) : myItem (theItem) {}
+ TreeModel_ItemProperties (const TreeModel_ItemBasePtr& theItem) : myItem (theItem), m_bInitialized (Standard_False) {}
//! Destructor
~TreeModel_ItemProperties() {}
--- /dev/null
+// Created on: 2019-02-25
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2019 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/TreeModel_ItemPropertiesStream.hxx>
+#include <inspector/TreeModel_ItemStream.hxx>
+
+#include <inspector/Convert_TransientShape.hxx>
+#include <inspector/Convert_Tools.hxx>
+
+#include <Bnd_Box.hxx>
+#include <gp_XYZ.hxx>
+#include <TCollection.hxx>
+
+#include <Standard_WarningsDisable.hxx>
+#include <QApplication>
+#include <QFont>
+#include <Standard_WarningsRestore.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(TreeModel_ItemPropertiesStream, TreeModel_ItemProperties)
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+
+void TreeModel_ItemPropertiesStream::Init (const Standard_SStream& theStream)
+{
+ myStream << theStream.str();
+
+ NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> aValues;
+ TCollection::Split (theStream, aValues, myKey);
+
+ TreeModel_ItemStreamPtr aStreamParent = itemDynamicCast<TreeModel_ItemStream>(getItem());
+ if (!aStreamParent)
+ myKey = "Dump";
+
+ for (Standard_Integer anIndex = 1; anIndex <= aValues.Size(); anIndex++)
+ {
+ TCollection_AsciiString aValue = aValues.FindFromIndex (anIndex);
+ if (TCollection::HasBracketKey (aValue))
+ myChildren.Add (aValues.FindKey (anIndex), aValue);
+ else
+ myValues.Add (aValues.FindKey (anIndex), aValue);
+ }
+ TreeModel_ItemProperties::Init();
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+
+void TreeModel_ItemPropertiesStream::Reset()
+{
+ myStream.str (std::string());
+ myKey = "";
+ myValues.Clear();
+ myChildren.Clear();
+
+ TreeModel_ItemProperties::Reset();
+}
+
+// =======================================================================
+// function : GetChildKey
+// purpose :
+// =======================================================================
+TCollection_AsciiString TreeModel_ItemPropertiesStream::GetChildKey (const Standard_Integer theRow) const
+{
+ return GetChildrenValues().FindKey (theRow + 1).ToCString();
+}
+
+// =======================================================================
+// function : GetChildStream
+// purpose :
+// =======================================================================
+
+void TreeModel_ItemPropertiesStream::GetChildStream (const Standard_Integer theRow, Standard_OStream& OS) const
+{
+ TreeModel_ItemStreamPtr aStreamParent = itemDynamicCast<TreeModel_ItemStream>(getItem());
+ if (!aStreamParent)
+ OS << myStream.str();
+ else
+ OS << GetChildrenValues().FindFromIndex (theRow + 1);
+}
+
+// =======================================================================
+// function : RowCount
+// purpose :
+// =======================================================================
+
+int TreeModel_ItemPropertiesStream::GetTableRowCount() const
+{
+ const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& aValues = GetValues();
+ return aValues.Size();
+}
+
+// =======================================================================
+// function : Data
+// purpose :
+// =======================================================================
+
+QVariant TreeModel_ItemPropertiesStream::GetTableData (const int theRow, const int theColumn, int theRole) const
+{
+ const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& aValues = GetValues();
+
+ if (theRole == Qt::DisplayRole || theRole == Qt::ToolTipRole)
+ {
+ if (theColumn == 0) return aValues.FindKey (theRow + 1).ToCString();
+ else if (theColumn == 1) return aValues.FindFromIndex (theRow + 1).ToCString();
+ }
+ return QVariant();
+}
+
+// =======================================================================
+// function : GetTableEditType
+// purpose :
+// =======================================================================
+ViewControl_EditType TreeModel_ItemPropertiesStream::GetTableEditType (const int /*theRow*/, const int) const
+{
+ //switch (theRow)
+ //{
+ // case 0: return ViewControl_EditType_Spin;
+ // default: return ViewControl_EditType_None;
+ //}
+ return ViewControl_EditType_None;
+}
+
+// =======================================================================
+// function : SetTableData
+// purpose :
+// =======================================================================
+bool TreeModel_ItemPropertiesStream::SetTableData (const int /*theRow*/, const int /*theColumn*/, const QVariant& /*theValue*/)
+{
+ //Handle(Message_Report) aReport = getItemReport();
+ //switch (theRow)
+ //{
+ // case 0: aReport->SetLimit (theValue.toInt()); break;
+ // default: break;
+ //}
+ return true;
+}
+
+// =======================================================================
+// function : GetPresentations
+// purpose :
+// =======================================================================
+
+void TreeModel_ItemPropertiesStream::GetPresentations (const int theRow, const int theColumn,
+ NCollection_List<Handle(Standard_Transient)>& thePresentations)
+{
+ if (theColumn == 0)
+ return;
+
+ if (theRow < 0) // full presentation
+ {
+ Bnd_Box aBox;
+ if (aBox.Init (myStream))
+ thePresentations.Append (new Convert_TransientShape (Convert_Tools::CreateShape (aBox)));
+ }
+
+
+ //QVariant aValue = GetTableData (theRow, theColumn, Qt::DisplayRole);
+ //TCollection_AsciiString aStrValue = aValue.toString().toStdString().c_str();
+
+ //gp_XYZ aPoint;
+ //if (!aPoint.Init (Standard_SStream (aStrValue.ToCString())))
+ // return;
+
+ //thePresentations.Append (new Convert_TransientShape (BRepBuilderAPI_MakeVertex (aPoint)));
+}
+
+// =======================================================================
+// function : ChildItemCount
+// purpose :
+// =======================================================================
+int TreeModel_ItemPropertiesStream::ChildItemCount() const
+{
+ TreeModel_ItemStreamPtr aStreamParent = itemDynamicCast<TreeModel_ItemStream>(getItem());
+ if (!aStreamParent && (GetChildrenValues().Size() || GetValues().Size()))
+ return 1; // "Dump" item
+
+ return GetChildrenValues().Size();
+}
+
+// =======================================================================
+// function : CreateChildItem
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr TreeModel_ItemPropertiesStream::CreateChildItem (int theRow, int theColumn) const
+{
+ return TreeModel_ItemStream::CreateItem (getItem(), theRow, theColumn);
+}
--- /dev/null
+// Created on: 2019-02-25
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2019 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 MessageModel_ItemReportProperties_H
+#define MessageModel_ItemReportProperties_H
+
+#include <Standard.hxx>
+#include <Message_AttributeStream.hxx>
+#include <NCollection_IndexedDataMap.hxx>
+#include <TCollection_AsciiString.hxx>
+
+
+#include <inspector/TreeModel_ItemProperties.hxx>
+#include <inspector/TreeModel_ItemBase.hxx>
+
+#include <Standard_WarningsDisable.hxx>
+#include <QAbstractTableModel>
+#include <QColor>
+#include <QList>
+#include <QModelIndexList>
+#include <QVariant>
+#include <Standard_WarningsRestore.hxx>
+
+class QItemDelegate;
+
+DEFINE_STANDARD_HANDLE (TreeModel_ItemPropertiesStream, TreeModel_ItemProperties)
+
+//! \class TreeModel_ItemPropertiesStream
+//! \brief This is an interace for ViewControl_TableModel to give real values of the model
+//! It should be filled or redefined.
+class TreeModel_ItemPropertiesStream : public TreeModel_ItemProperties
+{
+public:
+
+ //! Constructor
+ Standard_EXPORT TreeModel_ItemPropertiesStream (TreeModel_ItemBasePtr theItem)
+ : TreeModel_ItemProperties (theItem) {}
+
+ //! Destructor
+ virtual ~TreeModel_ItemPropertiesStream() {}
+
+ //! Returns Key of the current stream
+ const TCollection_AsciiString& GetKey() const { return myKey; }
+
+ //! Returns Key of the current stream
+ Standard_EXPORT TCollection_AsciiString GetChildKey (const Standard_Integer theRow) const;
+
+ //! Returns sub stream inside the current stream
+ Standard_EXPORT void GetChildStream (const Standard_Integer theRow, Standard_OStream& OS) const;
+
+ //! If me has internal values, it should be initialized here.
+ Standard_EXPORT virtual void Init (const Standard_SStream& theStream);
+
+ //! If the item has internal values, there should be reseted here.
+ Standard_EXPORT virtual void Reset();
+
+ //! Returns number of rows, depending on orientation: myColumnCount or size of values container
+ //! \param theParent an index of the parent item
+ //! \return an integer value
+ Standard_EXPORT virtual int GetTableRowCount() const Standard_OVERRIDE;
+
+ //! Returns content of the model index for the given role, it is obtained from internal container of values
+ //! It returns value only for DisplayRole.
+ //! \param theRow a model index row
+ //! \param theColumn a model index column
+ //! \param theRole a view role
+ //! \return value intepreted depending on the given role
+ Standard_EXPORT virtual QVariant GetTableData (const int theRow, const int theColumn, const int theRole = Qt::DisplayRole) const Standard_OVERRIDE;
+
+ //! Returns type of edit control for the model index. By default, it is an empty control
+ //! \param theRow a model index row
+ //! \param theColumn a model index column
+ //! \return edit type
+ Standard_EXPORT virtual ViewControl_EditType GetTableEditType (const int theRow, const int theColumn) const Standard_OVERRIDE;
+
+ //! Sets the value into the table cell. Only 1st column value might be modified.
+ //! \param theRow a model index row
+ //! \param theColumn a model index column
+ //! \param theValue a new cell value
+ Standard_EXPORT virtual bool SetTableData (const int theRow, const int theColumn, const QVariant& theValue) Standard_OVERRIDE;
+
+ //! Returns presentation of the attribute to be visualized in the view
+ //! \param theRow a model index row
+ //! \param theColumn a model index column
+ //! \thePresentations [out] container of presentation handles to be visualized
+ Standard_EXPORT virtual void GetPresentations (const int theRow, const int theColumn,
+ NCollection_List<Handle(Standard_Transient)>& thePresentations) Standard_OVERRIDE;
+
+ //! Returns number of item children
+ //! \return an integer value, ZERO by default
+ Standard_EXPORT virtual int ChildItemCount() 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
+ Standard_EXPORT virtual TreeModel_ItemBasePtr CreateChildItem (int theRow, int theColumn) const;
+
+ DEFINE_STANDARD_RTTIEXT (TreeModel_ItemPropertiesStream, TreeModel_ItemProperties)
+
+protected:
+ //! Returns attribute with stream value
+ const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& GetChildrenValues() const
+ {
+ return myChildren;
+ }
+
+ //! Returns attribute with stream value
+ const NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString>& GetValues() const
+ {
+ return myValues;
+ }
+
+protected:
+ TCollection_AsciiString myKey;
+ Standard_SStream myStream;
+ NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> myValues;
+ NCollection_IndexedDataMap<TCollection_AsciiString, TCollection_AsciiString> myChildren;
+};
+
+#endif
--- /dev/null
+// Created on: 2019-02-25
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2019 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/TreeModel_ItemStream.hxx>
+
+#include <inspector/TreeModel_ItemPropertiesStream.hxx>
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant TreeModel_ItemStream::initValue (const int theItemRole) const
+{
+ QVariant aParentValue = TreeModel_ItemBase::initValue (theItemRole);
+ if (aParentValue.isValid())
+ return aParentValue;
+
+ if (Column() != 0)
+ return QVariant();
+
+ if (theItemRole != Qt::DisplayRole && theItemRole != Qt::EditRole && theItemRole != Qt::ToolTipRole)
+ return QVariant();
+
+ TreeModel_ItemBasePtr aParentItem = Parent();
+ if (!aParentItem)
+ return QVariant();
+
+ TreeModel_ItemStreamPtr aStreamParent = itemDynamicCast<TreeModel_ItemStream>(aParentItem);
+ if (!aStreamParent)
+ return "Dump";
+
+ Handle(TreeModel_ItemPropertiesStream) aStreamProperties = Handle(TreeModel_ItemPropertiesStream)::DownCast (aParentItem->GetProperties());
+ if (aStreamProperties.IsNull())
+ return QVariant();
+
+ return aStreamProperties->GetChildKey (Row()).ToCString();
+}
+
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void TreeModel_ItemStream::GetStream (Standard_OStream& OS) const
+{
+ TreeModel_ItemBasePtr aParentItem = Parent();
+ if (!aParentItem)
+ return;
+
+ Handle(TreeModel_ItemPropertiesStream) aStreamProperties = Handle(TreeModel_ItemPropertiesStream)::DownCast (aParentItem->GetProperties());
+ if (aStreamProperties.IsNull())
+ return;
+
+ aStreamProperties->GetChildStream (Row(), OS);
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr TreeModel_ItemStream::createChild (int, int)
+{
+ return TreeModel_ItemBasePtr();
+}
--- /dev/null
+// Created on: 2019-02-25
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2019 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 TreeModel_ItemStream_H
+#define TreeModel_ItemStream_H
+
+#include <Standard.hxx>
+#include <inspector/TreeModel_ItemBase.hxx>
+
+class TreeModel_ItemStream;
+typedef QExplicitlySharedDataPointer<TreeModel_ItemStream> TreeModel_ItemStreamPtr;
+
+//! \class TreeModel_ItemStream
+//! Parent item, that corresponds to AIS_InteractiveContext
+//! Children of the item are:
+//! - "Property" item to show context attributes such as selection filters and drawer properties
+//! - presentation items to show all interactive elements displayed/erased in the context
+class TreeModel_ItemStream : public TreeModel_ItemBase
+{
+public:
+
+ //! Creates an item wrapped by a shared pointer
+ static TreeModel_ItemStreamPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+ { return TreeModel_ItemStreamPtr (new TreeModel_ItemStream (theParent, theRow, theColumn)); }
+
+ //! Destructor
+ virtual ~TreeModel_ItemStream() Standard_OVERRIDE {};
+
+ //! Returns number of displayed presentations
+ //! \return rows count
+ virtual int initRowCount() const Standard_OVERRIDE { return 0; }
+
+ //! 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 GetStream (Standard_OStream& OS) const 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 {}
+
+protected:
+
+ //! 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
+ //! \param theRow the item row positition in the parent item
+ //! \param theColumn the item column positition in the parent item
+ TreeModel_ItemStream(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+ : TreeModel_ItemBase(theParent, theRow, theColumn) {}
+};
+
+#endif
if (aProperties)
break;
}
+ // TODO: dump properties should be united with properties created by the creator
+ aParentItem->SetProperties (aProperties);
}
- aParentItem->SetProperties (aProperties);
}
return aParentItem ? aParentItem->rowCount() : 0;
// =======================================================================
TopoDS_Shape VInspector_ItemBVHTree::buildPresentationShape()
{
- opencascade::handle<BVH_Tree<Standard_Real, 3> > aBVHTree = myTree;
+ return TopoDS_Shape();
+ /*opencascade::handle<BVH_Tree<Standard_Real, 3> > aBVHTree = myTree;
if (aBVHTree.IsNull())
return TopoDS_Shape();
aBuilder.Add (aCompound, aShape);
}
}
- return aCompound;
+ return aCompound;*/
}
#include <inspector/VInspector_ItemBase.hxx>
#include <AIS_InteractiveObject.hxx>
-#include <NCollection_List.hxx>
#include <TCollection_AsciiString.hxx>
class Prs3d_Drawer;
+++ /dev/null
-// Created on: 2019-03-15
-// Created by: Natalia ERMOLAEVA
-// Copyright (c) 2019 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_ItemOpenGlLayer.hxx>
-
-#include <inspector/VInspector_ItemOpenGlLayerList.hxx>
-#include <inspector/VInspector_Tools.hxx>
-#include <inspector/ViewControl_Tools.hxx>
-
-#include <AIS.hxx>
-#include <AIS_ListOfInteractive.hxx>
-#include <Aspect.hxx>
-#include <Graphic3d.hxx>
-#include <OpenGl_Layer.hxx>
-#include <OpenGl_Group.hxx>
-#include <OpenGl_PrimitiveArray.hxx>
-#include <OpenGl_Text.hxx>
-#include <SelectMgr.hxx>
-#include <SelectMgr_EntityOwner.hxx>
-
-#include <Standard_WarningsDisable.hxx>
-#include <QStringList>
-#include <Standard_WarningsRestore.hxx>
-
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
-void VInspector_ItemOpenGlLayer::Init()
-{
- VInspector_ItemOpenGlLayerListPtr aParentItem = itemDynamicCast<VInspector_ItemOpenGlLayerList>(Parent());
- myLayer = aParentItem->GetLayer (Row(), myLayerId);
-
- TreeModel_ItemBase::Init();
-}
-
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
-void VInspector_ItemOpenGlLayer::Reset()
-{
- VInspector_ItemBase::Reset();
- myLayer = NULL;
-}
-
-// =======================================================================
-// function : initItem
-// purpose :
-// =======================================================================
-void VInspector_ItemOpenGlLayer::initItem() const
-{
- if (IsInitialized())
- return;
- const_cast<VInspector_ItemOpenGlLayer*>(this)->Init();
-}
-
-// =======================================================================
-// function : initRowCount
-// purpose :
-// =======================================================================
-int VInspector_ItemOpenGlLayer::initRowCount() const
-{
- if (Column() != 0)
- return 0;
-
- return 0;
-}
-
-// =======================================================================
-// function : initValue
-// purpose :
-// =======================================================================
-QVariant VInspector_ItemOpenGlLayer::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();
-
- Handle(OpenGl_Layer) aLayer = GetLayer();
- if (aLayer.IsNull())
- return Column() == 0 ? "Empty element" : "";
-
- switch (Column())
- {
- case 0:
- {
- TCollection_AsciiString aLayerId = Graphic3d::ZLayerIdToString (myLayerId);
- if (aLayerId.IsEmpty())
- aLayerId = TCollection_AsciiString (myLayerId);
- return theItemRole == Qt::ToolTipRole ? QVariant ("")
- : QVariant (QString("%1 (%2)")
- .arg(aLayer->DynamicType()->Name())
- .arg (aLayerId.ToCString()));
- }
- default:
- break;
- }
- return QVariant();
-}
-
-// =======================================================================
-// function : GetTableRowCount
-// purpose :
-// =======================================================================
-int VInspector_ItemOpenGlLayer::GetTableRowCount() const
-{
- return 40;
-}
-
-// =======================================================================
-// function : GetTableData
-// purpose :
-// =======================================================================
-QVariant VInspector_ItemOpenGlLayer::GetTableData (const int theRow, const int theColumn, const int theRole) const
-{
- if (theRole != Qt::DisplayRole)
- return QVariant();
-
- Handle(OpenGl_Layer) aLayer = GetLayer();
- if (aLayer.IsNull())
- return QVariant();
-
- bool isFirstColumn = theColumn == 0;
-
- switch (theRow)
- {
- case 0: return isFirstColumn ? QVariant ("NbStructures") : QVariant (aLayer->NbStructures());
- case 1: return isFirstColumn ? QVariant ("NbStructuresNotCulled") : QVariant (aLayer->NbStructuresNotCulled());
- case 2: return isFirstColumn ? QVariant ("NbPriorities") : QVariant (aLayer->NbPriorities());
-
- case 3: return isFirstColumn ? QVariant ("ArrayOfStructures") : QVariant (aLayer->ArrayOfStructures().Size());
- case 4: return isFirstColumn ? QVariant ("IsCulled") : QVariant (aLayer->IsCulled());
- case 5: return isFirstColumn ? QVariant ("NbOfTransformPersistenceObjects") : QVariant (aLayer->NbOfTransformPersistenceObjects());
-
- case 6: return isFirstColumn ? QVariant ("CullableStructuresBVH") : QVariant (aLayer->CullableStructuresBVH().Size());
- case 7: return isFirstColumn ? QVariant ("CullableTrsfPersStructuresBVH") : QVariant (aLayer->CullableTrsfPersStructuresBVH().Size());
- case 8: return isFirstColumn ? QVariant ("NonCullableStructures") : QVariant (aLayer->NonCullableStructures().Size());
-
- default:
- break;
- }
-
- Standard_Integer aRow = theRow - 9;
- return getLayerSettingsTableData (aRow, theColumn, theRole, aLayer->LayerSettings());
-}
-
-// =======================================================================
-// function : getLayerSettingsTableData
-// purpose :
-// =======================================================================
-QVariant VInspector_ItemOpenGlLayer::getLayerSettingsTableData (const int theRow, const int theColumn, const int theRole,
- const Graphic3d_ZLayerSettings& theSettings) const
-{
- bool isFirstColumn = theColumn == 0;
-
- switch (theRow)
- {
- case 0: return isFirstColumn ? QVariant ("LayerSettings:") : QVariant();
- case 1: return isFirstColumn ? QVariant ("Name") : QVariant (theSettings.Name().ToCString());
- case 2: return isFirstColumn ? QVariant ("Lights") : QVariant (ViewControl_Tools::GetPointerInfo (theSettings.Lights()).ToCString());
-
- case 3: return isFirstColumn ? QVariant ("Origin") : QVariant (ViewControl_Tools::ToString (theSettings.Origin()).ToCString());
- case 4: return isFirstColumn ? QVariant ("OriginTransformation")
- : QVariant (ViewControl_Tools::ToString (theSettings.OriginTransformation()).ToCString());
-
- case 5: return isFirstColumn ? QVariant ("HasCullingDistance") : QVariant (theSettings.HasCullingDistance());
- case 6: return isFirstColumn ? QVariant ("CullingDistance")
- : QVariant (theSettings.HasCullingDistance() ? theSettings.CullingDistance() : 0);
-
- case 7: return isFirstColumn ? QVariant ("HasCullingSize") : QVariant (theSettings.HasCullingSize());
- case 8: return isFirstColumn ? QVariant ("CullingSize")
- : QVariant (theSettings.HasCullingSize() ? theSettings.CullingSize() : 0);
-
- case 9: return isFirstColumn ? QVariant ("IsImmediate") : QVariant (theSettings.IsImmediate());
- case 10: return isFirstColumn ? QVariant ("UseEnvironmentTexture") : QVariant (theSettings.UseEnvironmentTexture());
- case 11: return isFirstColumn ? QVariant ("ToEnableDepthTest") : QVariant (theSettings.ToEnableDepthTest());
- case 12: return isFirstColumn ? QVariant ("ToEnableDepthWrite") : QVariant (theSettings.ToEnableDepthWrite());
- case 13: return isFirstColumn ? QVariant ("ToClearDepth") : QVariant (theSettings.ToClearDepth());
- case 14: return isFirstColumn ? QVariant ("ToRenderInDepthPrepass") : QVariant (theSettings.ToRenderInDepthPrepass());
-
- case 15: return isFirstColumn ? QVariant ("PolygonOffset: Mode")
- : QVariant (Aspect::PolygonOffsetModeToString (theSettings.PolygonOffset().Mode));
- case 16: return isFirstColumn ? QVariant ("PolygonOffset: Factor") : QVariant (theSettings.PolygonOffset().Factor);
- case 17: return isFirstColumn ? QVariant ("PolygonOffset: Units") : QVariant (theSettings.PolygonOffset().Units);
-
- default: break;
- }
- return QVariant();
-}
-
-// =======================================================================
-// function : createChild
-// purpose :
-// =======================================================================
-TreeModel_ItemBasePtr VInspector_ItemOpenGlLayer::createChild (int theRow, int theColumn)
-{
- (void)theRow;
- (void)theColumn;
-
- return TreeModel_ItemBasePtr();
-}
+++ /dev/null
-// Created on: 2019-03-15
-// Created by: Natalia ERMOLAEVA
-// Copyright (c) 2019 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_ItemOpenGlLayer_H
-#define VInspector_ItemOpenGlLayer_H
-
-#include <Standard.hxx>
-#include <inspector/VInspector_ItemBase.hxx>
-
-#include <Graphic3d_ZLayerSettings.hxx>
-#include <OpenGl_Layer.hxx>
-
-class Graphic3d_Group;
-
-class VInspector_ItemOpenGlLayer;
-typedef QExplicitlySharedDataPointer<VInspector_ItemOpenGlLayer> VInspector_ItemOpenGlLayerPtr;
-
-//! \class VInspector_ItemOpenGlLayer
-//! Parent item, that corresponds to AIS_InteractiveContext
-//! Children of the item are:
-//! - "Property" item to show context attributes such as selection filters and drawer properties
-//! - presentation items to show all interactive elements displayed/erased in the context
-class VInspector_ItemOpenGlLayer : public VInspector_ItemBase
-{
-public:
-
- //! Creates an item wrapped by a shared pointer
- static VInspector_ItemOpenGlLayerPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
- { return VInspector_ItemOpenGlLayerPtr (new VInspector_ItemOpenGlLayer (theParent, theRow, theColumn)); }
-
- //! Destructor
- virtual ~VInspector_ItemOpenGlLayer() Standard_OVERRIDE {};
-
- //! Returns data object of the item.
- //! \return object
- virtual Handle(Standard_Transient) GetObject() const { initItem(); return myLayer; }
-
- //! Returns the current graphic3d group, init item if it was not initialized yet
- //! \return graphic group
- Standard_EXPORT Handle(OpenGl_Layer) GetLayer() const
- { return Handle(OpenGl_Layer)::DownCast (GetObject());}
-
- //! Inits the item, fills internal containers
- Standard_EXPORT virtual void Init() Standard_OVERRIDE;
-
- //! Resets cached values
- Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
-
- //! Returns number of table rows
- //! \return an integer value
- virtual int GetTableRowCount() const Standard_OVERRIDE;
-
- //! Returns table value for the row in form: <function name> <function value>
- //! \param theRow a model index row
- //! \param theColumn a model index column
- virtual QVariant GetTableData (const int theRow, const int theColumn, const int theRole) const 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;
-
- //! 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;
-
-protected:
- //! Returns table presentation of layer settings
- QVariant getLayerSettingsTableData (const int theRow, const int theColumn, const int theRole,
- const Graphic3d_ZLayerSettings& theSettings) const;
-
- //! 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
- //! \param theRow the item row positition in the parent item
- //! \param theColumn the item column positition in the parent item
- VInspector_ItemOpenGlLayer(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
- : VInspector_ItemBase(theParent, theRow, theColumn) {}
-
-private:
- Handle(OpenGl_Layer) myLayer; //! current layer
- Graphic3d_ZLayerId myLayerId; //! current Z layer index in OpenGl_View
-};
-
-#endif
thePresentations.Append (GetInteractiveObject());
}
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void VInspector_ItemPresentableObject::GetStream (Standard_OStream& OS) const
+{
+ Handle(AIS_InteractiveObject) anIO = GetInteractiveObject();
+ if (anIO.IsNull())
+ return;
+
+ anIO->Dump (OS);
+}
+
// =======================================================================
// function : GetTableRowCount
// purpose :
//! \thePresentations [out] container of presentation handles to be visualized
Standard_EXPORT virtual void GetPresentations (NCollection_List<Handle(Standard_Transient)>& thePresentations);
+ //! Returns stream value of the item to fulfill property panel.
+ //! \return stream value or dummy
+ Standard_EXPORT virtual void GetStream (Standard_OStream& OS) const Standard_OVERRIDE;
+
//! Returns number of table rows
//! \return an integer value
virtual int GetTableRowCount() const Standard_OVERRIDE;
continue;
if (theRowId - aNextPresentationIndex == aCurrentIndex)
{
- theName = "";//QString ("Prs3d_Presentation (mode = %1)").arg (aPrsIter.ChangeValue().Mode()).toStdString().c_str();
+ theName = "Prs3d_Presentation";
return aPrs3d;
}
aCurrentIndex++;
return 0;
}
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void VInspector_ItemPrs3dAspect::GetStream (Standard_OStream& OS) const
+{
+ Handle(Prs3d_BasicAspect) anAspect = GetAspect();
+ if (anAspect.IsNull())
+ return;
+
+ anAspect->Dump (OS);
+}
+
// =======================================================================
// function : createChild
// purpose :
//! \return the value
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& OS) const Standard_OVERRIDE;
+
//! Creates a child item in the given position.
//! \param theRow the child row position
//! \param theColumn the child column position
const_cast<VInspector_ItemSelectBasicsEntityOwner*>(this)->Init();
}
+// =======================================================================
+// function : GetStream
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectBasicsEntityOwner::GetStream (Standard_OStream& OS) const
+{
+ Handle(SelectMgr_EntityOwner) anEntityOwner = Handle(SelectMgr_EntityOwner)::DownCast (getEntityOwner());
+ if (anEntityOwner.IsNull())
+ return;
+
+ anEntityOwner->Dump (OS);
+}
+
// =======================================================================
// function : GetTableRowCount
// purpose :
//! Returns the current entity owner
Handle(SelectBasics_EntityOwner) EntityOwner() const { return myOwner; }
+ //! Returns stream value of the item to fulfill property panel.
+ //! \return stream value or dummy
+ Standard_EXPORT virtual void GetStream (Standard_OStream& OS) const Standard_OVERRIDE;
+
//! Returns number of table rows
//! \return an integer value
virtual int GetTableRowCount() const Standard_OVERRIDE;
#include <inspector/VInspector_ItemSelectBasicsEntityOwner.hxx>
#include <inspector/VInspector_ItemFolderObject.hxx>
#include <inspector/VInspector_ItemPresentableObject.hxx>
-#include <inspector/VInspector_PropertiesCreator.hxx>
+//#include <inspector/VInspector_PropertiesCreator.hxx>
#include <inspector/VInspector_TableModelValues.hxx>
#include <inspector/VInspector_ToolBar.hxx>
#include <inspector/VInspector_Tools.hxx>
//((ViewControl_TreeView*)myTreeView)->SetPredefinedSize (QSize (VINSPECTOR_DEFAULT_TREE_VIEW_WIDTH,
// VINSPECTOR_DEFAULT_TREE_VIEW_HEIGHT));
VInspector_ViewModel* aTreeModel = new VInspector_ViewModel (myTreeView);
- aTreeModel-> AddPropertiesCreator(new VInspector_PropertiesCreator());
+ //aTreeModel->AddPropertiesCreator(new VInspector_PropertiesCreator());
myTreeView->setModel (aTreeModel);
// hide Visibility column
TreeModel_HeaderSection anItem = aTreeModel->GetHeaderItem ((int)TreeModel_ColumnType_Visibility);
// property view
myPaneCreators.Append (new VInspectorPaneAIS_PaneCreator());
- aTreeModel->AddPropertiesCreator (new VInspectorPaneAIS_PropertiesCreator());
+ //aTreeModel->AddPropertiesCreator (new VInspectorPaneAIS_PropertiesCreator());
myPropertyView = new ViewControl_PropertyView (myMainWindow,
QSize(VINSPECTOR_DEFAULT_PROPERTY_VIEW_WIDTH, VINSPECTOR_DEFAULT_PROPERTY_VIEW_HEIGHT));
if (!aTreeItemSelected)
return;
- Handle(TreeModel_ItemProperties) anItemProperties = aTreeItemSelected->GetProperties();
NCollection_List<Handle(Standard_Transient)> aSelPresentations;
+ Handle(TreeModel_ItemProperties) anItemProperties = aTreeItemSelected->GetProperties();
if (anItemProperties)
anItemProperties->GetPresentations (-1, -1, aSelPresentations);
- else
- GetSelectedShapes (aSelPresentations);
+ //else
+ GetSelectedShapes (aSelPresentations);
myDisplayPreview->UpdatePreview (View_DisplayActionType_DisplayId, aSelPresentations);
//Handle(Graphic3d_TransformPers) aSelectedPersistent = GetSelectedTransformPers();