]> OCCT Git - occt-copy.git/commitdiff
0030268: Inspectors - improvements in VInspector plugin
authornds <nds@opencascade.com>
Tue, 30 Apr 2019 09:02:26 +0000 (12:02 +0300)
committernds <nds@opencascade.com>
Tue, 30 Apr 2019 09:02:26 +0000 (12:02 +0300)
- some of selection components covering

63 files changed:
src/Bnd/Bnd_Range.cxx
src/Bnd/Bnd_Range.hxx
src/Message/Message_Report.cxx
src/Message/Message_Report.hxx
src/SelectMgr/SelectMgr.cxx
src/SelectMgr/SelectMgr.hxx
src/SelectMgr/SelectMgr_BaseFrustum.cxx
src/SelectMgr/SelectMgr_BaseFrustum.hxx
src/SelectMgr/SelectMgr_Frustum.hxx
src/SelectMgr/SelectMgr_Frustum.lxx
src/SelectMgr/SelectMgr_RectangularFrustum.cxx
src/SelectMgr/SelectMgr_RectangularFrustum.hxx
src/SelectMgr/SelectMgr_SelectableObjectSet.cxx
src/SelectMgr/SelectMgr_SelectingVolumeManager.cxx
src/SelectMgr/SelectMgr_SelectingVolumeManager.hxx
src/SelectMgr/SelectMgr_ViewClipRange.hxx
src/SelectMgr/SelectMgr_ViewerSelector.cxx
src/SelectMgr/SelectMgr_ViewerSelector.hxx
src/StdSelect/StdSelect_ViewerSelector3d.cxx
src/TopoDS/TopoDS_AlertAttribute.hxx
src/gp/gp_XY.hxx
src/gp/gp_XY.lxx
src/gp/gp_XYZ.hxx
src/gp/gp_XYZ.lxx
tools/MessageModel/MessageModel_ActionType.hxx
tools/MessageModel/MessageModel_Actions.cxx
tools/MessageModel/MessageModel_Actions.hxx
tools/MessageModel/MessageModel_ItemReport.cxx
tools/MessageModel/MessageModel_ItemReport.hxx
tools/MessageView/MessageView_Window.cxx
tools/TKTreeModel/EXTERNLIB
tools/TreeModel/TreeModel_ItemBase.cxx
tools/TreeModel/TreeModel_ItemBase.hxx
tools/TreeModel/TreeModel_ItemProperties.hxx
tools/VInspector/FILES
tools/VInspector/VInspector_ItemBVHTree.cxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemBVHTree.hxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemBVHTreeNode.cxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemBVHTreeNode.hxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemContainer.cxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemContainer.hxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemContainerAPI.hxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemSelectMgrBaseFrustum.cxx
tools/VInspector/VInspector_ItemSelectMgrBaseFrustum.hxx
tools/VInspector/VInspector_ItemSelectMgrSelectableObjectSet.cxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemSelectMgrSelectableObjectSet.hxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemSelectMgrSelectingVolumeManager.cxx
tools/VInspector/VInspector_ItemSelectMgrSelectingVolumeManager.hxx
tools/VInspector/VInspector_ItemSelectMgrSensitiveEntitySet.cxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemSelectMgrSensitiveEntitySet.hxx [new file with mode: 0644]
tools/VInspector/VInspector_ItemSelectMgrViewerSelector.cxx
tools/VInspector/VInspector_ItemSelectMgrViewerSelector.hxx
tools/VInspector/VInspector_PropertiesCreator.cxx [new file with mode: 0644]
tools/VInspector/VInspector_PropertiesCreator.hxx [new file with mode: 0644]
tools/VInspector/VInspector_Tools.cxx
tools/VInspector/VInspector_Tools.hxx
tools/VInspector/VInspector_Window.cxx
tools/VInspectorPaneAIS/VInspectorPaneAIS_PropertiesCreator.hxx
tools/View/View_Displayer.cxx
tools/View/View_Viewer.cxx
tools/ViewControl/FILES
tools/ViewControl/ViewControl_PropertiesStream.cxx [new file with mode: 0644]
tools/ViewControl/ViewControl_PropertiesStream.hxx [new file with mode: 0644]

index 63d0961343971e3b10963f5bfbe4020547473493..6edacda7683fba64c9be7affadccd38889a3a5a4 100644 (file)
@@ -174,4 +174,13 @@ void Bnd_Range::Split(const Standard_Real theVal,
   {
     theList.Append(Bnd_Range(aValPrev, myLast));
   }
-}
\ No newline at end of file
+}
+
+//=======================================================================
+//function : ToString
+//purpose  : 
+//=======================================================================
+TCollection_AsciiString Bnd_Range::ToString() const
+{
+  return TCollection_AsciiString ("[") + myFirst + ", " + myLast + "]";
+}
index 0c006d27d9ca771c26c7727098ed68b26e5a1c9f..a478e2f0a23d88c72ef37e6378f91f95f214464d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <Standard_Real.hxx>
 #include <Standard_ConstructionError.hxx>
+#include <TCollection_AsciiString.hxx>
 
 #include <NCollection_List.hxx>
 
@@ -256,6 +257,10 @@ public:
     return ((myFirst == theOther.myFirst) && (myLast == theOther.myLast));
   }
 
+  //! Covers point into string in format: [myFirst, myLast]
+  //! \return the string value
+  Standard_EXPORT TCollection_AsciiString ToString() const;
+
 private:
 
   Standard_Real myFirst; //!< Start of range
index c56de714e0733da8c123cc5792a2d21f4bd7e3df..9f753c09f61ffc79ccfd61589bea72b481a9008d 100644 (file)
@@ -293,6 +293,25 @@ void Message_Report::Clear (const Handle(Standard_Type)& theType)
   }
 }
 
+//=======================================================================
+//function : Delete
+//purpose  :
+//=======================================================================
+
+void Message_Report::Delete (Message_Gravity theGravity, const Message_ListOfAlert& theAlerts)
+{
+  if (theAlerts.IsEmpty())
+    return;
+
+  Message_ListOfAlert anAlerts = myAlerts[theGravity];
+
+  for (Message_ListOfAlert::Iterator anIt (theAlerts); anIt.More(); anIt.Next())
+  {
+    if (myAlerts[theGravity].Contains (anIt.Value()))
+      myAlerts[theGravity].Remove (anIt.Value());
+  }
+}
+
 //=======================================================================
 //function : Dump
 //purpose  :
index d19c81aae891aecea6596704a8400fa6c15e0f09..cf30842e403178ede7eb25fa8e66564ffabde2df 100644 (file)
@@ -92,6 +92,9 @@ public:
   //! Clears collected alerts with specified type
   Standard_EXPORT void Clear (const Handle(Standard_Type)& theType);
 
+  //! Returns list of collected alerts with specified gravity
+  Standard_EXPORT void Delete (Message_Gravity theGravity, const Message_ListOfAlert& theAlerts);
+
   //! Dumps all collected alerts to stream
   Standard_EXPORT void Dump (Standard_OStream& theOS);
 
index 4e5c63bfa22997993489d239013486e388e153d1..2c33d07efd7dd1565a3bff8dc1ef08ec53f4142a 100644 (file)
@@ -21,6 +21,11 @@ namespace
   {
     "FIRST_ACCEPTABLE", "ONLY_TOPMOST"
   };
+
+  static Standard_CString SelectMgr_Table_PrintBVHSubset[4] =
+  {
+    "3d", "3dPersistent", "2dPersistent", "Nb"
+  };
 }
 
 //=======================================================================
@@ -52,3 +57,33 @@ Standard_Boolean SelectMgr::PickingStrategyFromString (Standard_CString theTypeS
   }
   return Standard_False;
 }
+
+//=======================================================================
+//function : BVHSubsetToString
+//purpose  :
+//=======================================================================
+Standard_CString SelectMgr::BVHSubsetToString (SelectMgr_SelectableObjectSet::BVHSubset theType)
+{
+  return SelectMgr_Table_PrintBVHSubset[theType];
+}
+
+//=======================================================================
+//function : BVHSubsetFromString
+//purpose  :
+//=======================================================================
+Standard_Boolean SelectMgr::BVHSubsetFromString (Standard_CString theTypeString,
+                                                 SelectMgr_SelectableObjectSet::BVHSubset& theType)
+{
+  TCollection_AsciiString aName (theTypeString);
+  aName.UpperCase();
+  for (Standard_Integer aTypeIter = 0; aTypeIter <= SelectMgr_SelectableObjectSet::BVHSubsetNb; ++aTypeIter)
+  {
+    Standard_CString aTypeName = SelectMgr_Table_PrintBVHSubset[aTypeIter];
+    if (aName == aTypeName)
+    {
+      theType = SelectMgr_SelectableObjectSet::BVHSubset (aTypeIter);
+      return Standard_True;
+    }
+  }
+  return Standard_False;
+}
index 9b96b59a34e465b65fb3375a75c1fe2d8231a275..a8cdcb1178ff125533eaa8ff9c6d1d85d3876e51 100644 (file)
@@ -15,6 +15,7 @@
 #define _SelectMgr_HeaderFile
 
 #include <SelectMgr_PickingStrategy.hxx>
+#include <SelectMgr_SelectableObjectSet.hxx>
 #include <SelectMgr_StateOfSelection.hxx>
 #include <SelectMgr_TypeOfBVHUpdate.hxx>
 #include <SelectMgr_TypeOfUpdate.hxx>
@@ -52,6 +53,30 @@ public:
   Standard_EXPORT static Standard_Boolean PickingStrategyFromString (const Standard_CString theTypeString,
                                                                      SelectMgr_PickingStrategy& theType);
 
+
+
+  //! Returns the string name for a given orientation type.
+  //! @param theType orientation type
+  //! @return string identifier from the list Xpos, Ypos, Zpos and others
+  Standard_EXPORT static Standard_CString BVHSubsetToString (SelectMgr_SelectableObjectSet::BVHSubset theType);
+
+  //! Returns the orientation type from the given string identifier (using case-insensitive comparison).
+  //! @param theTypeString string identifier
+  //! @return orientation type or BVHSubset_3d if string identifier is invalid
+  static SelectMgr_SelectableObjectSet::BVHSubset BVHSubsetFromString (Standard_CString theTypeString)
+  {
+    SelectMgr_SelectableObjectSet::BVHSubset aType = SelectMgr_SelectableObjectSet::BVHSubset_3d;
+    BVHSubsetFromString (theTypeString, aType);
+    return aType;
+  }
+
+  //! Determines the shape type from the given string identifier (using case-insensitive comparison).
+  //! @param theTypeString string identifier
+  //! @param theType detected shape type
+  //! @return TRUE if string identifier is known
+  Standard_EXPORT static Standard_Boolean BVHSubsetFromString (const Standard_CString theTypeString,
+                                                               SelectMgr_SelectableObjectSet::BVHSubset& theType);
+
 };
 
 #endif // _SelectMgr_HeaderFile
index bf9f43a39557839b734e504b2d6976db5794e2ad..a78cceb3e64c95e37c4e4f4d17e1142b0f578920 100644 (file)
@@ -15,6 +15,9 @@
 
 #include <SelectMgr_BaseFrustum.hxx>
 
+#include <Message.hxx>
+#include <Message_Alerts.hxx>
+
 IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_BaseFrustum,Standard_Transient)
 
 //=======================================================================
@@ -251,3 +254,17 @@ Standard_Boolean SelectMgr_BaseFrustum::IsClipped (const Graphic3d_SequenceOfHCl
 {
   return Standard_True;
 }
+
+//=======================================================================
+//function : Dump
+//purpose  : 
+//=======================================================================
+void SelectMgr_BaseFrustum::Dump(Standard_OStream& OS)const 
+{
+  DUMP_VALUES (OS, "SelectMgr_BaseFrustum", 2);
+
+  DUMP_VALUES (OS, "myPixelTolerance", myPixelTolerance);
+  DUMP_VALUES (OS, "myIsOrthographic", myIsOrthographic);
+  DUMP_VALUES (OS, "myBuilder", Message::TransientToString (myBuilder));
+  DUMP_VALUES (OS, "myCamera", Message::TransientToString (myCamera));
+}
index 6e4852ce11b48612c0abb50abf0d138c522f69e2..d402ac371bd725bdc6b88b89554fd15fdac161a2 100644 (file)
@@ -35,6 +35,8 @@
 
 #include <SelectBasics_PickResult.hxx>
 
+#include <Standard_OStream.hxx>
+
 //! This class is an interface for different types of selecting frustums,
 //! defining different selection types, like point, box or polyline
 //! selection. It contains signatures of functions for detection of
@@ -186,6 +188,9 @@ public:
     return;
   }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const;
+
   DEFINE_STANDARD_RTTIEXT(SelectMgr_BaseFrustum,Standard_Transient)
 
 protected:
index d758bb5e9f0fd1b5f1bfb4cb9e722c3f974b8011..54bb7c7da06df35a0b24a2cc8dd983215ca522ca 100644 (file)
@@ -23,6 +23,7 @@
 #include <SelectMgr_BaseFrustum.hxx>
 #include <TColgp_HArray1OfPnt.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
+#include <Standard_OStream.hxx>
 
 //! This is an internal class containing representation of rectangular selecting frustum, created in case
 //! of point and box selection, and algorithms for overlap detection between selecting
@@ -58,6 +59,9 @@ public:
 
   SelectMgr_Frustum() : SelectMgr_BaseFrustum() {};
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   // SAT Tests for different objects
index b923f0186465cd7cf9f3e66c59b517d2ea11aaeb..9905d15c662414c975a2c8060129370f9b8d6304 100644 (file)
 // commercial license or contractual agreement.
 
 #include <NCollection_Vector.hxx>
+
+#include <Message_Alerts.hxx>
 #include <Poly_Array1OfTriangle.hxx>
 #include <Standard_Assert.hxx>
 
+//IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_Frustum, SelectMgr_BaseFrustum)
+
 // =======================================================================
 // function : isSeparated
 // purpose  : Checks if AABB and frustum are separated along the given axis.
@@ -461,3 +465,43 @@ Standard_Boolean SelectMgr_Frustum<N>::hasOverlap (const gp_Pnt& thePnt1,
 
   return Standard_True;
 }
+
+//=======================================================================
+//function : Dump
+//purpose  : 
+//=======================================================================
+template <int N>
+void SelectMgr_Frustum<N>::Dump(Standard_OStream& OS)const 
+{
+  DUMP_VALUES (OS, "SelectMgr_Frustum<N>", 2);
+
+  DUMP_VALUES (OS, "myPlanes", N + 2);
+  for (int anIndex = 0; anIndex < N + 2; anIndex++)
+    DUMP_VALUES (OS, anIndex, myPlanes[anIndex].XYZ().ToString());
+
+  DUMP_VALUES (OS, "myVertices", N * 2);
+  for (int anIndex = 0; anIndex < N * 2; anIndex++)
+    DUMP_VALUES (OS, anIndex, myVertices[anIndex].XYZ().ToString());
+
+  DUMP_VALUES (OS, "myMaxVertsProjections", N + 2);
+  for (int anIndex = 0; anIndex < N + 2; anIndex++)
+    DUMP_VALUES (OS, anIndex, myMaxVertsProjections[anIndex]);
+
+  DUMP_VALUES (OS, "myMinVertsProjections", N + 2);
+  for (int anIndex = 0; anIndex < N + 2; anIndex++)
+    DUMP_VALUES (OS, anIndex, myMinVertsProjections[anIndex]);
+
+  DUMP_VALUES (OS, "myMaxOrthoVertsProjections", 3);
+  for (int anIndex = 0; anIndex < 3; anIndex++)
+    DUMP_VALUES (OS, anIndex, myMaxOrthoVertsProjections[anIndex]);
+
+  DUMP_VALUES (OS, "myMinOrthoVertsProjections", 3);
+  for (int anIndex = 0; anIndex < 3; anIndex++)
+    DUMP_VALUES (OS, anIndex, myMinOrthoVertsProjections[anIndex]);
+
+  DUMP_VALUES (OS, "myEdgeDirs", 6);
+  for (int anIndex = 0; anIndex < 6; anIndex++)
+    DUMP_VALUES (OS, anIndex, myEdgeDirs[anIndex].XYZ().ToString());
+
+  SelectMgr_BaseFrustum::Dump (OS);
+}
index d972e19f2d961bbe41b75f00b6630de0a40a4400..81f939f7c1fc86a1c48a4b4d24ec8dcdfd966500 100644 (file)
 
 #include <NCollection_Vector.hxx>
 #include <Poly_Array1OfTriangle.hxx>
-
+#include <Message_Alerts.hxx>
+#include <Message_PerfMeter.hxx>
 #include <SelectMgr_RectangularFrustum.hxx>
 
+IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_RectangularFrustum, SelectMgr_Frustum<4> )
+
 // =======================================================================
 // function : segmentSegmentDistance
 // purpose  :
@@ -138,6 +141,8 @@ namespace
                        const Handle(SelectMgr_FrustumBuilder)& theBuilder,
                        gp_Pnt* theVertices, gp_Vec* theEdges)
   {
+    Message_PerfMeter aPerfMeter; 
+    MESSAGE_INFO ("SelectMgr_RectangularFrustum::computeFrustum", "", &aPerfMeter, NULL);
     // LeftTopNear
     theVertices[0] = theBuilder->ProjectPntOnViewPlane (theMinPnt.X(),
                                                         theMaxPnt.Y(),
@@ -272,6 +277,8 @@ void SelectMgr_RectangularFrustum::cacheVertexProjections (SelectMgr_Rectangular
 // =======================================================================
 void SelectMgr_RectangularFrustum::Build (const gp_Pnt2d &thePoint)
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::Build_1", "", &aPerfMeter, NULL);
   myNearPickedPnt = myBuilder->ProjectPntOnViewPlane (thePoint.X(), thePoint.Y(), 0.0);
   myFarPickedPnt = myBuilder->ProjectPntOnViewPlane (thePoint.X(), thePoint.Y(), 1.0);
   myViewRayDir = myFarPickedPnt.XYZ() - myNearPickedPnt.XYZ();
@@ -304,6 +311,8 @@ void SelectMgr_RectangularFrustum::Build (const gp_Pnt2d &thePoint)
 void SelectMgr_RectangularFrustum::Build (const gp_Pnt2d& theMinPnt,
                                           const gp_Pnt2d& theMaxPnt)
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::Build_2", "", &aPerfMeter, NULL);
   myNearPickedPnt = myBuilder->ProjectPntOnViewPlane ((theMinPnt.X() + theMaxPnt.X()) * 0.5,
                                                       (theMinPnt.Y() + theMaxPnt.Y()) * 0.5,
                                                       0.0);
@@ -431,6 +440,8 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& t
                                                          const SelectMgr_Vec3& theBoxMax,
                                                          Standard_Boolean*     theInside) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::Overlaps_vvb", "", &aPerfMeter, NULL);
   return hasOverlap (theBoxMin, theBoxMax, theInside);
 }
 
@@ -443,6 +454,8 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& t
                                                          const SelectMgr_Vec3& theBoxMax,
                                                          SelectBasics_PickResult& thePickResult) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::Overlaps_vv", "", &aPerfMeter, NULL);
   if (!hasOverlap (theBoxMin, theBoxMax))
     return Standard_False;
 
@@ -463,6 +476,8 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const SelectMgr_Vec3& t
 Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt,
                                                          SelectBasics_PickResult& thePickResult) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::Overlaps_1p", "", &aPerfMeter, NULL);
   if (!hasOverlap (thePnt))
     return Standard_False;
 
@@ -482,6 +497,8 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt,
 // =======================================================================
 Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::Overlaps_1", "", &aPerfMeter, NULL);
   return hasOverlap (thePnt);
 }
 
@@ -493,6 +510,9 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
                                                          const gp_Pnt& thePnt2,
                                                          SelectBasics_PickResult& thePickResult) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::Overlaps_2", "", &aPerfMeter, NULL);
+
   if (!hasOverlap (thePnt1, thePnt2))
     return Standard_False;
 
@@ -512,6 +532,8 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const TColgp_Array1OfPn
                                                          Select3D_TypeOfSensitivity theSensType,
                                                          SelectBasics_PickResult& thePickResult) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::Overlaps_n", "", &aPerfMeter, NULL);
   if (theSensType == Select3D_TOS_BOUNDARY)
   {
     Standard_Integer aMatchingSegmentsNb = -1;
@@ -562,6 +584,9 @@ Standard_Boolean SelectMgr_RectangularFrustum::Overlaps (const gp_Pnt& thePnt1,
                                                          Select3D_TypeOfSensitivity theSensType,
                                                          SelectBasics_PickResult& thePickResult) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::Overlaps_3", "", &aPerfMeter, NULL);
+
   if (theSensType == Select3D_TOS_BOUNDARY)
   {
     const gp_Pnt aPntsArrayBuf[4] = { thePnt1, thePnt2, thePnt3, thePnt1 };
@@ -651,6 +676,9 @@ Standard_Real SelectMgr_RectangularFrustum::DistToGeometryCenter (const gp_Pnt&
 // =======================================================================
 gp_Pnt SelectMgr_RectangularFrustum::DetectedPoint (const Standard_Real theDepth) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::DetectedPoint", "", &aPerfMeter, NULL);
+
   return myNearPickedPnt.XYZ() + myViewRayDir.Normalized().XYZ() * theDepth / myScale;
 }
 
@@ -661,6 +689,9 @@ gp_Pnt SelectMgr_RectangularFrustum::DetectedPoint (const Standard_Real theDepth
 void SelectMgr_RectangularFrustum::computeClippingRange (const Graphic3d_SequenceOfHClipPlane& thePlanes,
                                                          SelectMgr_ViewClipRange& theRange) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("SelectMgr_RectangularFrustum::computeClippingRange", "", &aPerfMeter, NULL);
+
   Standard_Real aPlaneA, aPlaneB, aPlaneC, aPlaneD;
   for (Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (thePlanes); aPlaneIt.More(); aPlaneIt.Next())
   {
@@ -746,6 +777,9 @@ void SelectMgr_RectangularFrustum::computeClippingRange (const Graphic3d_Sequenc
 Standard_Boolean SelectMgr_RectangularFrustum::IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
                                                           const Standard_Real theDepth) const
 {
+  Message_PerfMeter aPerfMeter; 
+  MESSAGE_INFO ("IsClipped", "", &aPerfMeter, NULL);
+
   SelectMgr_ViewClipRange aRange;
   computeClippingRange (thePlanes, aRange);
   return aRange.IsClipped (theDepth);
@@ -797,3 +831,23 @@ void SelectMgr_RectangularFrustum::GetPlanes (NCollection_Vector<SelectMgr_Vec4>
     thePlaneEquations.Append (anEquation);
   }
 }
+
+//=======================================================================
+//function : Dump
+//purpose  : 
+//=======================================================================
+void SelectMgr_RectangularFrustum::Dump(Standard_OStream& OS)const 
+{
+  DUMP_VALUES (OS, "SelectMgr_RectangularFrustum", 2);
+  DUMP_VALUES (OS, "myNearPickedPnt", myNearPickedPnt.XYZ().ToString());
+  DUMP_VALUES (OS, "myFarPickedPnt", myFarPickedPnt.XYZ().ToString());
+  DUMP_VALUES (OS, "myViewRayDir", myViewRayDir.XYZ().ToString());
+  DUMP_VALUES (OS, "myMousePos", myMousePos.XY().ToString());
+  DUMP_VALUES (OS, "myScale", myScale);
+  DUMP_VALUES (OS, "myIsViewClipEnabled", myIsViewClipEnabled);
+
+  DUMP_VALUES (OS, "myViewClipRange", "");
+  myViewClipRange.Dump (OS);
+
+  SelectMgr_Frustum<4>::Dump (OS);
+}
index 1fae9f4f0ae2e6bc48feb08141b62dec70aa9452..d48132d61cecc5cef09de423f3a275b4bd47f6fd 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <SelectMgr_Frustum.hxx>
 #include <SelectMgr_ViewClipRange.hxx>
+#include <Standard_OStream.hxx>
 
 //! This class contains representation of rectangular selecting frustum, created in case
 //! of point and box selection, and algorithms for overlap detection between selecting
@@ -137,6 +138,9 @@ public:
   //! Ax + By + Cz + D = 0) to the given vector
   Standard_EXPORT virtual void GetPlanes (NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const Standard_OVERRIDE;
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
+
 protected:
 
   Standard_EXPORT void segmentSegmentDistance (const gp_Pnt& theSegPnt1,
@@ -164,6 +168,9 @@ private:
          RightTopNear, RightTopFar,
          RightBottomNear, RightBottomFar };
 
+public:
+  DEFINE_STANDARD_RTTIEXT(SelectMgr_RectangularFrustum, SelectMgr_Frustum<4>)
+
 private:
 
   gp_Pnt                  myNearPickedPnt;             //!< 3d projection of user-picked selection point onto near view plane
index 8fc2e178651b213f30ca17f7c13907e5c88069ad..c75c8fe300a61265ee7ba46697f781fa2bb8349b 100644 (file)
@@ -360,11 +360,17 @@ void SelectMgr_SelectableObjectSet::UpdateBVH (const Handle(Graphic3d_Camera)& t
                                                const Standard_Integer theViewportWidth,
                                                const Standard_Integer theViewportHeight)
 {
+#ifdef REPORT_SELECTION_BUILD
+  Message_PerfMeter aPerfMeter;
+  MESSAGE_INFO ("UpdateBVH", "", &aPerfMeter, NULL);
+#endif
+
   // -----------------------------------------
   // check and update 3D BVH tree if necessary
   // -----------------------------------------
   if (!IsEmpty (BVHSubset_3d) && myIsDirty[BVHSubset_3d])
   {
+    MESSAGE_INFO ("Check and update 3D BVH", "", &aPerfMeter, NULL);
     // construct adaptor over private fields to provide direct access for the BVH builder
     BVHBuilderAdaptorRegular anAdaptor (myObjects[BVHSubset_3d], myDisabledZLayers);
 
@@ -386,6 +392,7 @@ void SelectMgr_SelectableObjectSet::UpdateBVH (const Handle(Graphic3d_Camera)& t
     if (!IsEmpty (BVHSubset_3dPersistent) &&
          (myIsDirty[BVHSubset_3dPersistent] || myLastViewState.IsChanged (theViewState) || isWindowSizeChanged))
     {
+      MESSAGE_INFO ("Check and update 3D persistence BVH tree", "", &aPerfMeter, NULL);
       // construct adaptor over private fields to provide direct access for the BVH builder
       BVHBuilderAdaptorPersistent anAdaptor (myObjects[BVHSubset_3dPersistent], myDisabledZLayers,
         theCamera, theProjectionMat, theWorldViewMat, theViewportWidth, theViewportHeight);
@@ -400,6 +407,7 @@ void SelectMgr_SelectableObjectSet::UpdateBVH (const Handle(Graphic3d_Camera)& t
     if (!IsEmpty (BVHSubset_2dPersistent) &&
          (myIsDirty[BVHSubset_2dPersistent] || myLastViewState.IsProjectionChanged (theViewState) || isWindowSizeChanged))
     {
+      MESSAGE_INFO ("Check and update 2D persistence BVH tree", "", &aPerfMeter, NULL);
       // construct adaptor over private fields to provide direct access for the BVH builder
       BVHBuilderAdaptorPersistent anAdaptor (myObjects[BVHSubset_2dPersistent], myDisabledZLayers,
         theCamera, theProjectionMat, SelectMgr_SelectableObjectSet_THE_IDENTITY_MAT, theViewportWidth, theViewportHeight);
index 7073a002bab68ec80a0ad0f314636e1cd485ea6a..8d923d02461acbff84bbe2f832289c6190bafe0f 100644 (file)
@@ -14,6 +14,8 @@
 // commercial license or contractual agreement.
 
 #include <SelectMgr_SelectingVolumeManager.hxx>
+#include <Message_Alerts.hxx>
+#include <Message_PerfMeter.hxx>
 
 //=======================================================================
 // function : SelectMgr_SelectingVolumeManager
@@ -396,6 +398,9 @@ gp_Pnt SelectMgr_SelectingVolumeManager::DetectedPoint (const Standard_Real theD
 Standard_Boolean SelectMgr_SelectingVolumeManager::IsClipped (const Graphic3d_SequenceOfHClipPlane& thePlanes,
                                                               const Standard_Real& theDepth) const
 {
+  Message_PerfMeter aPerfMeter;
+  MESSAGE_INFO ("SelectMgr_SelectingVolumeManager::IsClipped", "", &aPerfMeter, NULL);
+
   if (myActiveSelectionType != Point)
     return Standard_False;
 
index 92715faabee952011835d66195c877833980b145..3cb694e4322a595ae96e640e84102d2a2646c308 100644 (file)
@@ -206,6 +206,19 @@ public:
     return mySelectingVolumes[myActiveSelectionType / 2];
   }
 
+  //! Returns active selecting volume that was built during last
+  //! run of OCCT selection mechanism
+  Handle(SelectMgr_BaseFrustum) GetVolume (const SelectionType& theType) const
+  {
+    switch (theType)
+    {
+      case Point:
+      case Box:      return mySelectingVolumes[Frustum];
+      case Polyline: return mySelectingVolumes[FrustumSet];
+      default:       return NULL;
+    }
+  }
+
   //! Stores plane equation coefficients (in the following form:
   //! Ax + By + Cz + D = 0) to the given vector
   virtual void GetPlanes (NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const Standard_OVERRIDE
index 97deae09c9750677bcb94f4c202cccf70ccfc83e..ad5f8931310eef9eee4c2c5cc46e9281200d2817 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <Bnd_Range.hxx>
 #include <Standard_TypeDef.hxx>
+#include <Standard_OStream.hxx>
 
 //! Class for handling depth clipping range.
 //! It is used to perform checks in case if global (for the whole view)
@@ -62,6 +63,16 @@ public:
   //! Adds a clipping sub-range (for clipping chains).
   void AddClipSubRange (const Bnd_Range& theRange) { myClipRanges.push_back (theRange); }
 
+  //! Dumps the content of me on the stream <OS>.
+  Standard_EXPORT void Dump (Standard_OStream& OS) const
+  {
+    DUMP_VALUES (OS, "SelectMgr_ViewClipRange", 2);
+    DUMP_VALUES (OS, "myUnclipRange", myUnclipRange.ToString());
+    DUMP_VALUES (OS, "myClipRanges", myClipRanges.size());
+    for (size_t aRangeIter = 0; aRangeIter < myClipRanges.size(); ++aRangeIter)
+      DUMP_VALUES (OS, aRangeIter, myClipRanges[aRangeIter].ToString());
+  }
+
 private:
 
   std::vector<Bnd_Range> myClipRanges;
index 8e1644e46d3a55b157160db2d8ae8d3af8b8e74b..38a446416cd40c6fc8566771d7b07361ceddd078 100644 (file)
@@ -564,6 +564,7 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
   Standard_Integer aWidth;
   Standard_Integer aHeight;
   mySelectingVolumeMgr.WindowSize (aWidth, aHeight);
+  MESSAGE_INFO ("UpdateBVH", "", &aPerfMeter, aParentAlert);
   mySelectableObjects.UpdateBVH (mySelectingVolumeMgr.Camera(),
                                  mySelectingVolumeMgr.ProjectionMatrix(),
                                  mySelectingVolumeMgr.WorldViewMatrix(),
@@ -583,14 +584,14 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
 
   for (Standard_Integer aBVHSetIt = 0; aBVHSetIt < SelectMgr_SelectableObjectSet::BVHSubsetNb; ++aBVHSetIt)
   {
+    SelectMgr_SelectableObjectSet::BVHSubset aBVHSubset =
+      static_cast<SelectMgr_SelectableObjectSet::BVHSubset> (aBVHSetIt);
+
     #ifdef REPORT_SELECTION_BUILD
-    MESSAGE_INFO (TCollection_AsciiString ("aBVHSetIt") + aBVHSetIt, "", &aPerfMeter, aParentAlert);
+    MESSAGE_INFO (TCollection_AsciiString ("aBVHSetIt"), SelectMgr::BVHSubsetToString (aBVHSubset), &aPerfMeter, aParentAlert);
     Handle(Message_Alert) aParentAlertLevel1 = OCCT_Message_Alert;
     #endif
 
-    SelectMgr_SelectableObjectSet::BVHSubset aBVHSubset =
-      static_cast<SelectMgr_SelectableObjectSet::BVHSubset> (aBVHSetIt);
-
     if (mySelectableObjects.IsEmpty (aBVHSubset))
     {
       continue;
@@ -702,6 +703,7 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
     }
   }
 
+  MESSAGE_INFO ("SortResult", "", &aPerfMeter, aParentAlert);
   SortResult();
 #ifdef REPORT_SELECTION_BUILD
   Standard_SStream aStreamDone;
index 753d3f9e5a0c68959ab5240f50e410ccb12da604..7fc5d34690dcee86eb67d15a2d5b157d9fd5058b 100644 (file)
@@ -205,6 +205,12 @@ public:
   //! Returns instance of selecting volume manager of the viewer selector
   SelectMgr_SelectingVolumeManager& GetManager() { return mySelectingVolumeMgr; }
 
+  //! Returns container of selectable objects
+  const SelectMgr_SelectableObjectSet& GetSelectableObjects() const { return mySelectableObjects; }
+
+  //! Returns container of sensitives
+  const SelectMgr_MapOfObjectSensitives&  GetObjectSensitives() const { return myMapOfObjectSensitives; }
+
   //! Marks all added sensitive entities of all objects as non-selectable
   Standard_EXPORT void ResetSelectionActivationStatus();
 
index a22fbf89621618edf0dc1c2ce42614871fdcb970..ffa6f21abb1776ebcbcffd3aee9b032e9427bab0 100644 (file)
@@ -162,6 +162,15 @@ void StdSelect_ViewerSelector3d::Pick (const Standard_Integer theXPMin,
                                        const Standard_Integer theYPMax,
                                        const Handle(V3d_View)& theView)
 {
+#ifdef REPORT_SELECTION_BUILD
+  Message_PerfMeter aPerfMeter;
+  MESSAGE_INFO ("Pick", TCollection_AsciiString ("min/max:  (") +
+                        theXPMin + ", " + theYPMin + ") / (" +
+                        theXPMax + ", " + theYPMax + ") "
+                        , &aPerfMeter, NULL);
+  Handle(Message_Alert) aParentAlert = OCCT_Message_Alert;
+#endif
+
   updateZLayers (theView);
   mySelectingVolumeMgr.SetCamera (theView->Camera());
   mySelectingVolumeMgr.SetActiveSelectionType (SelectMgr_SelectingVolumeManager::Box);
index 115a9ec28e86c6ca0a3d250d67d007be92b21bd9..f0708407cd8821b2ec0ba664e3da4f62011a885e 100644 (file)
@@ -24,9 +24,10 @@ class TopoDS_AlertAttribute : public Message_Attribute
 {
 public:
   //! Constructor with shape argument
-  Standard_EXPORT TopoDS_AlertAttribute (const TopoDS_Shape& theShape,
-                                         const TCollection_AsciiString& theName = TCollection_AsciiString(),
-                                         const TCollection_AsciiString& theDescription = TCollection_AsciiString());
+  TopoDS_AlertAttribute (const TopoDS_Shape& theShape,
+                         const TCollection_AsciiString& theName = TCollection_AsciiString(),
+                         const TCollection_AsciiString& theDescription = TCollection_AsciiString())
+  : Message_Attribute (theName, theDescription), myShape (theShape) {}
 
   //! Returns contained shape
   const TopoDS_Shape& GetShape() const { return myShape; }
index 70ffa21f58563531e5227fc1c44d0145ea184fa3..cb451b135eddedd5563be3849f8897535b294d16 100644 (file)
@@ -22,6 +22,9 @@
 #include <Standard_Real.hxx>
 #include <Standard_Integer.hxx>
 #include <Standard_Boolean.hxx>
+
+#include <TCollection_AsciiString.hxx>
+
 class Standard_ConstructionError;
 class Standard_OutOfRange;
 class gp_Mat2d;
@@ -269,6 +272,15 @@ public:
 }
 
 
+  //! Covers point into string in format: (X, Y)
+  //! \return the string value
+  Standard_EXPORT TCollection_AsciiString ToString() const;
+
+
+  //! Converts text value into parameters if possible, the string format is: (X, Y)
+  //! \return true if conversion is done
+  Standard_EXPORT Standard_Boolean FromString (const TCollection_AsciiString& theValue);
+
 
 
 protected:
index ecd0605719c57e89c51d1a9386cdc3f8bfbcad70..12fc78c19e8293cc6c73230703fa7e6115b5cdba 100644 (file)
@@ -227,3 +227,37 @@ inline gp_XY operator* (const Standard_Real Scalar,
   return Coord1.Multiplied(Scalar);
 }
 
+inline TCollection_AsciiString gp_XY::ToString() const
+{
+  return TCollection_AsciiString ("(") + x + ", " + y + ")";
+}
+
+inline Standard_Boolean gp_XY::FromString (const TCollection_AsciiString& theValue)
+{
+  TCollection_AsciiString aCurrentString = theValue, aValueString;
+
+  Standard_Integer aPosition = aCurrentString.Search ("(");
+  if (aPosition != 1)
+    return Standard_False;
+
+  aCurrentString = aCurrentString.Split (aPosition);
+  Standard_Real aX, anY;
+  // x value
+  aPosition = aCurrentString.Search (", ");
+  if (aPosition < 0)
+    return Standard_False;
+  aCurrentString = aValueString.Split (aPosition);
+  aX = aValueString.RealValue();
+  aCurrentString = aCurrentString.Split (2);
+
+  // y value
+  aPosition = aCurrentString.Search (")");
+  if (aPosition < 0)
+    return Standard_False;
+  aCurrentString = aValueString.Split (aPosition);
+  anY = aValueString.RealValue();
+
+  x = aX;
+  y = anY;
+  return Standard_True;
+}
index ccb0373c09430193614306de5d474071cfdf51f8..34572eaa405cc824ad61c45c0590f7ac194ccb1e 100644 (file)
@@ -22,6 +22,9 @@
 #include <Standard_Real.hxx>
 #include <Standard_Integer.hxx>
 #include <Standard_Boolean.hxx>
+
+#include <TCollection_AsciiString.hxx>
+
 class Standard_ConstructionError;
 class Standard_OutOfRange;
 class gp_Mat;
@@ -324,6 +327,14 @@ public:
     void SetLinearForm (const gp_XYZ& XYZ1, const gp_XYZ& XYZ2);
 
 
+  //! Covers point into string in format: (X, Y, Z)
+  //! \return the string value
+  Standard_EXPORT TCollection_AsciiString ToString() const;
+
+
+  //! Converts text value into parameters if possible, the string format is: (X, Y, Z)
+  //! \return true if conversion is done
+  Standard_EXPORT Standard_Boolean FromString (const TCollection_AsciiString& theValue);
 
 
 protected:
index f97590738cd8583c7fc7f28cf257d5ff64093d50..c4dde68a65809b53af2065cee65903d0aa0934dc 100644 (file)
@@ -307,7 +307,50 @@ inline gp_XYZ operator* (const Standard_Real Scalar, const gp_XYZ& Coord1) {
 }
 
 
+inline TCollection_AsciiString gp_XYZ::ToString() const
+{
+  return TCollection_AsciiString ("(") + x + ", " + y + ", " + z + ")";
+}
 
-
-
+inline Standard_Boolean gp_XYZ::FromString (const TCollection_AsciiString& theValue)
+{
+  TCollection_AsciiString aCurrentString = theValue, aValueString;
+
+  Standard_Integer aPosition = aCurrentString.Search ("(");
+  if (aPosition != 1)
+    return Standard_False;
+
+  aCurrentString = aCurrentString.Split (aPosition);
+  Standard_Real aX, anY, aZ;
+  // x value
+  aPosition = aCurrentString.Search (", ");
+  if (aPosition < 0)
+    return Standard_False;
+  aValueString = aCurrentString;
+  aCurrentString = aValueString.Split (aPosition - 1);
+  aX = aValueString.RealValue();
+  aCurrentString = aCurrentString.Split (2);
+
+  // y value
+  aPosition = aCurrentString.Search (", ");
+  if (aPosition < 0)
+    return Standard_False;
+  aValueString = aCurrentString;
+  aCurrentString = aValueString.Split (aPosition - 1);
+  anY = aValueString.RealValue();
+  aCurrentString = aCurrentString.Split (2);
+
+  // z value
+  aPosition = aCurrentString.Search (")");
+  if (aPosition < 0)
+    return Standard_False;
+  aValueString = aCurrentString;
+  aCurrentString = aValueString.Split (aPosition);
+  aZ = aValueString.RealValue();
+
+  x = aX;
+  y = anY;
+  z = aZ;
+  return Standard_True;
+}
 
index de036fefd4c69ccb2b9e5a3d7499b0a595a12d7a..5c03cff8ebc1e3fb136cd3c79771948199564ddc 100644 (file)
@@ -22,6 +22,7 @@ enum MessageModel_ActionType
   MessageModel_ActionType_Activate, //!< set Message_Report active
   MessageModel_ActionType_Deactivate, //!< set Message_Report not active
   MessageModel_ActionType_Clear, //!< clear Message_Report alerts
+  MessageModel_ActionType_Delete, //!< deletes Message_Report alerts
   MessageModel_ActionType_ExportToShapeView, //!< export TopoDS_Shape of selected item into TKShapeView plugin
   MessageModel_ActionType_Test //!< test alerts
 };
index 4a587b55910e4acbb74627bf1145dacc05e5c39a..9dc2ac340e39557261c124676a632642127ffc61 100644 (file)
@@ -59,6 +59,8 @@ MessageModel_Actions::MessageModel_Actions (QWidget* theParent,
                     ViewControl_Tools::CreateAction ("Activate", SLOT (OnActivateReport()), parent(), this));
   myActions.insert (MessageModel_ActionType_Clear,
                     ViewControl_Tools::CreateAction ("Clear", SLOT (OnClearReport()), parent(), this));
+  myActions.insert (MessageModel_ActionType_Delete,
+                    ViewControl_Tools::CreateAction ("Delete", SLOT (OnDeleteAlerts()), parent(), this));
   myActions.insert (MessageModel_ActionType_ExportToShapeView,
                     ViewControl_Tools::CreateAction (tr ("Export to ShapeView"), SLOT (OnExportToShapeView()), parent(), this));
 #ifdef DEBUG_ALERTS
@@ -121,7 +123,10 @@ void MessageModel_Actions::AddMenuActions (const QModelIndexList& theSelectedInd
 #endif
   }
   else if (anAlertItem)
+  {
     theMenu->addAction (myActions[MessageModel_ActionType_ExportToShapeView]);
+    theMenu->addAction (myActions[MessageModel_ActionType_Delete]);
+  }
 
   theMenu->addSeparator();
 }
@@ -200,6 +205,42 @@ void MessageModel_Actions::OnClearReport()
   ((MessageModel_TreeModel*)mySelectionModel->model())->EmitDataChanged (aReportIndex, aReportIndex);
 }
 
+// =======================================================================
+// function : OnDeleteAlerts
+// purpose :
+// =======================================================================
+void MessageModel_Actions::OnDeleteAlerts()
+{
+  Handle(Message_Report) aReport;
+  Message_ListOfAlert anAlerts;
+
+  QModelIndexList aSelectedIndices = mySelectionModel->selectedIndexes();
+  QStringList anExportedPointers;
+  for (QModelIndexList::const_iterator aSelIt = aSelectedIndices.begin(); aSelIt != aSelectedIndices.end(); aSelIt++)
+  {
+    QModelIndex anIndex = *aSelIt;
+    if (anIndex.column() != 0)
+      continue;
+
+    TreeModel_ItemBasePtr anItemBase = TreeModel_ModelBase::GetItemByIndex (anIndex);
+    if (!anItemBase)
+      continue;
+
+    MessageModel_ItemAlertPtr anItem = itemDynamicCast<MessageModel_ItemAlert> (anItemBase);
+    if (!anItem)
+      break;
+
+    if (aReport.IsNull())
+      MessageModel_ItemReport::FindReport (anItem);
+    anAlerts.Append(anItem->GetAlert());
+  }
+
+  if (aReport.IsNull())
+    return;
+
+  aReport->Delete (Message_Info, anAlerts);
+}
+
 // =======================================================================
 // function : OnExportToShapeView
 // purpose :
index 71da2a093560b810661ade00ca209ba16569e041..423989c53426746c3daacd54a70d5dee312d9f35 100644 (file)
@@ -79,6 +79,9 @@ public slots:
   //! Clears container of alerts of selected report
   void OnClearReport();
 
+  //! Deletes container of alerts of selected reports
+  void OnDeleteAlerts();
+
   //! Exports the first selected shape into ShapeViewer plugin.
   void OnExportToShapeView();
 
index bc4c4877e44a8701cad3b416dc79e0862ac9bf80..a2af8df74ebd5617b146ce7835bb5ea573b3bd02 100644 (file)
@@ -204,3 +204,24 @@ double MessageModel_ItemReport::AmountElapsedTime (const Handle(Message_Report)&
   }
   return anAmountTime;
 }
+
+// =======================================================================
+// function : FindReport
+// purpose :
+// =======================================================================
+Handle(Message_Report) MessageModel_ItemReport::FindReport (const MessageModel_ItemBasePtr& theItem)
+{
+  Handle(Message_Report) aReport;
+
+  MessageModel_ItemBasePtr anItem = theItem;
+  while (anItem)
+  {
+    MessageModel_ItemReportPtr aReportItem = itemDynamicCast<MessageModel_ItemReport>(anItem);
+
+    if (aReportItem)
+      return aReportItem->GetReport();
+
+    anItem = itemDynamicCast<MessageModel_ItemBase>(anItem->Parent());
+  }
+  return NULL;
+}
index c6ce246fc2eb2c47b4ddc7870d56cb630c4f888d..d76b56b466a416c1585f9bc447422c6556cb2094 100644 (file)
@@ -80,6 +80,9 @@ public:
   //! \return double value
   Standard_EXPORT static double AmountElapsedTime (const Handle(Message_Report)& theReport);
 
+  //! Returns report of the item
+  static Handle(Message_Report) FindReport (const MessageModel_ItemBasePtr& thetItem);
+
 protected:
 
   //! Initialize the current item. It is empty because Reset() is also empty.
index c0c0aebf39afc4350ced56094bd35ba139832e60..575ca8445d7f8889e5c6836bdfa4af19bee5e154 100644 (file)
 #include <inspector/ViewControl_TreeView.hxx>
 
 #include <inspector/View_Tools.hxx>
+#include <inspector/View_Viewer.hxx>
+#include <inspector/View_Widget.hxx>
 
 #include <AIS_Shape.hxx>
-
+#include <Graphic3d_Camera.hxx>
 #include <OSD_Environment.hxx>
 
 #include <OSD_Directory.hxx>
@@ -294,6 +296,7 @@ void MessageView_Window::Init (NCollection_List<Handle(Standard_Transient)>& the
   NCollection_List<Handle(Standard_Transient)> aParameters;
 
   Handle(Message_ReportCallBack) aReportCallBack;
+  Handle(Graphic3d_Camera) aViewCamera;
 
   for (NCollection_List<Handle(Standard_Transient)>::Iterator aParamsIt (theParameters);
        aParamsIt.More(); aParamsIt.Next())
@@ -305,24 +308,29 @@ void MessageView_Window::Init (NCollection_List<Handle(Standard_Transient)>& the
       aMessageReport->SetCallBack (myCallBack);
       addReport (aMessageReport);
     }
-    else
+    else if (!Handle(AIS_InteractiveContext)::DownCast (anObject).IsNull())
     {
       aParameters.Append (anObject);
       if (aContext.IsNull())
         aContext = Handle(AIS_InteractiveContext)::DownCast (anObject);
     }
+    else if (!Handle(Graphic3d_Camera)::DownCast (anObject).IsNull())
+    {
+      aViewCamera = Handle(Graphic3d_Camera)::DownCast (anObject);
+    }
   }
-  QAbstractItemModel* aModel = myTreeView->model();
-  if (!aModel)
-    return;
-  MessageModel_TreeModel* aTreeModel = dynamic_cast<MessageModel_TreeModel*> (aModel);
+  MessageModel_TreeModel* aTreeModel = dynamic_cast<MessageModel_TreeModel*> (myTreeView->model());
   if (!aTreeModel)
     return;
+
   aTreeModel->EmitLayoutChanged();
 
   if (!aContext.IsNull())
     myViewWindow->SetContext (View_ContextType_External, aContext);
 
+  if (!aViewCamera.IsNull())
+    myViewWindow->GetView()->GetViewer()->GetView()->Camera()->Copy (aViewCamera);
+
   theParameters = aParameters;
 }
 
index 100866c7f355eaeb7b7e72237694eec566386d88..37f0830243e80ebd23c0ab72e3cad43fae80a818 100644 (file)
@@ -1,3 +1,4 @@
 TKernel
 TKMath
+TKTopAlgo
 CSF_QT
\ No newline at end of file
index 703414f403266a409092a5895c0fd2058e0762d7..3efee94260e6d5b464796524c60a65efa76e83b7 100644 (file)
@@ -65,6 +65,9 @@ void TreeModel_ItemBase::Reset()
   }
   m_bInitialized = false;
   myCachedValues.clear();
+
+  if (!GetProperties().IsNull())
+    GetProperties()->Reset();
 }
 
 // =======================================================================
index b7f3f7b634557bcd6b5c282ec414e0e323f73b65..45da4d78055d6260fbf74a6850978bebb543f453 100644 (file)
@@ -19,6 +19,8 @@
 #include <Standard.hxx>
 #include <Standard_Macro.hxx>
 #include <Standard_Handle.hxx>
+#include <Standard_OStream.hxx>
+
 #include <inspector/TreeModel_ItemRole.hxx>
 
 #include <Standard_WarningsDisable.hxx>
@@ -139,9 +141,13 @@ public:
   //! Returns item table properties builder
   Standard_EXPORT Handle(TreeModel_ItemProperties) GetProperties() const;
 
+  //! Dumps the content of me on the stream <OS>.
+  virtual Standard_Boolean Dump (Standard_OStream& OS) const { (void)OS; return Standard_False; }
+
   //! Returns number of item rows only
   static Standard_EXPORT int RowCountWithoutProperties (const TreeModel_ItemBasePtr& theItem);
 
+
 protected:
 
   //! \param theParent the parent item
index d096f71394b2280c7fae62043a53d59e12ba0b7f..a7a41282c6ed161a2734a098234bb6b3d0ef8b8e 100644 (file)
@@ -48,6 +48,12 @@ public:
   //! Destructor
   ~TreeModel_ItemProperties() {}
 
+  //! If me has internal values, it should be initialized here.
+  virtual void Init() {}
+
+  //! If the item has internal values, there should be reseted here.
+  Standard_EXPORT virtual void Reset() {}
+
   //! Returns number of item children
   //! \return an integer value, ZERO by default
   virtual int ChildItemCount() const { return 0; }
@@ -59,7 +65,7 @@ public:
   virtual TreeModel_ItemBasePtr CreateChildItem (int theRow, int theColumn) const
   { (void)theRow; (void)theColumn; return TreeModel_ItemBasePtr(); }
 
-  //! Returns number of table rows
+  //! Returns number of table columns. Default value is two columns: title to value
   //! \return an integer value
   virtual int GetTableColumnCount() const { return 2; }
 
index b0e3e015208c723262e902feaa4e1da5817112dc..0609ab6810d566761d9b2ef2ea8deb62283830d1 100644 (file)
@@ -9,6 +9,13 @@ VInspector_ItemAspectWindow.cxx
 VInspector_ItemAspectWindow.hxx
 VInspector_ItemBase.cxx
 VInspector_ItemBase.hxx
+VInspector_ItemBVHTree.cxx
+VInspector_ItemBVHTree.hxx
+VInspector_ItemBVHTreeNode.cxx
+VInspector_ItemBVHTreeNode.hxx
+VInspector_ItemContainer.cxx
+VInspector_ItemContainer.hxx
+VInspector_ItemContainerAPI.hxx
 VInspector_ItemContext.cxx
 VInspector_ItemContext.hxx
 VInspector_ItemFolderObject.cxx
@@ -66,16 +73,22 @@ VInspector_ItemSelectMgrBaseFrustum.cxx
 VInspector_ItemSelectMgrBaseFrustum.hxx
 VInspector_ItemSelectMgrFilter.cxx
 VInspector_ItemSelectMgrFilter.hxx
+VInspector_ItemSelectMgrSelectableObjectSet.cxx
+VInspector_ItemSelectMgrSelectableObjectSet.hxx
 VInspector_ItemSelectMgrSelectingVolumeManager.cxx
 VInspector_ItemSelectMgrSelectingVolumeManager.hxx
 VInspector_ItemSelectMgrSelection.cxx
 VInspector_ItemSelectMgrSelection.hxx
 VInspector_ItemSelectMgrSensitiveEntity.cxx
 VInspector_ItemSelectMgrSensitiveEntity.hxx
+VInspector_ItemSelectMgrSensitiveEntitySet.cxx
+VInspector_ItemSelectMgrSensitiveEntitySet.hxx
 VInspector_ItemV3dView.cxx
 VInspector_ItemV3dView.hxx
 VInspector_ItemV3dViewer.cxx
 VInspector_ItemV3dViewer.hxx
+VInspector_PropertiesCreator.cxx
+VInspector_PropertiesCreator.hxx
 VInspector_PrsOpenGlElement.cxx
 VInspector_PrsOpenGlElement.hxx
 VInspector_SelectionType.hxx
diff --git a/tools/VInspector/VInspector_ItemBVHTree.cxx b/tools/VInspector/VInspector_ItemBVHTree.cxx
new file mode 100644 (file)
index 0000000..5a13706
--- /dev/null
@@ -0,0 +1,259 @@
+// Created on: 2019-04-29
+// 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_ItemBVHTree.hxx>
+
+#include <inspector/VInspector_ItemSelectMgrSelectableObjectSet.hxx>
+#include <inspector/VInspector_ItemBVHTreeNode.hxx>
+
+// =======================================================================
+// function : Constructor
+// purpose :
+// =======================================================================
+VInspector_ItemBVHTree::VInspector_ItemBVHTree (TreeModel_ItemBasePtr theParent,
+                                                const int theRow, const int theColumn)
+: VInspector_ItemBase(theParent, theRow, theColumn)
+{
+}
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemBVHTree::initRowCount() const
+{
+  if (Column() != 0)
+    return  0;
+
+  opencascade::handle<BVH_Tree<Standard_Real, 3> > aTree =  GetTree();
+  if (aTree.IsNull())
+    return 0;
+
+  return aTree->Length();
+}
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemBVHTree::initValue (const int theItemRole) const
+{
+  QVariant aParentValue = VInspector_ItemBase::initValue (theItemRole);
+  if (aParentValue.isValid())
+    return aParentValue;
+
+  if (theItemRole != Qt::DisplayRole && theItemRole != Qt::EditRole && theItemRole != Qt::ToolTipRole)
+    return QVariant();
+
+  if (GetTree().IsNull())
+    return Column() == 0 ? "Empty BVH tree" : "";
+
+  switch (Column())
+  {
+    case 0:
+    {
+      TCollection_AsciiString aName = TCollection_AsciiString (GetTree()->DynamicType()->Name()) +
+                                      TCollection_AsciiString (" (") + myName.ToCString() + ")";
+      return aName.ToCString();
+    }
+    default:
+      break;
+  }
+  return QVariant();
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+
+void VInspector_ItemBVHTree::Init()
+{
+  VInspector_ItemSelectMgrSelectableObjectSetPtr aParentItem = itemDynamicCast<VInspector_ItemSelectMgrSelectableObjectSet>(Parent());
+
+  //! Returns child BVH tree of the row
+  setTree (aParentItem->GetBVHTree (Row(), myName));
+
+  //Handle(SelectMgr_ViewerSelector) aViewerSelector;
+  //if (aParentItem)
+  //{
+  //  VInspector_ItemContextPtr aParentContextItem = itemDynamicCast<VInspector_ItemContext>(aParentItem->Parent());
+  //  if (aParentContextItem)
+  //  {
+  //    Handle(AIS_InteractiveContext) aContext = aParentContextItem->GetContext();
+  //    aViewerSelector = aContext->MainSelector();
+  //  }
+  //}
+  //setViewerSelector (aViewerSelector);
+
+  //UpdatePresentationShape();
+  TreeModel_ItemBase::Init(); // to use getIO() without circling initialization
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+
+void VInspector_ItemBVHTree::Reset()
+{
+  VInspector_ItemBase::Reset();
+
+  setTree (NULL);
+  myName = TCollection_AsciiString();
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+
+void VInspector_ItemBVHTree::initItem() const
+{
+  if (IsInitialized())
+    return;
+  const_cast<VInspector_ItemBVHTree*>(this)->Init();
+}
+
+// =======================================================================
+// function : GetTableRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemBVHTree::GetTableRowCount() const
+{
+  return 60;
+}
+
+// =======================================================================
+// function : GetTableData
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemBVHTree::GetTableData (const int theRow, const int theColumn, const int theRole) const
+{
+  //if (theRole != Qt::DisplayRole)
+  //  return QVariant();
+
+  //Handle(SelectMgr_ViewerSelector) aViewerSelector = GetViewerSelector();
+  //if (aViewerSelector.IsNull())
+  //  return QVariant();
+
+  //bool isFirstColumn = theColumn == 0;
+  //switch (theRow)
+  //{
+  //  case 0: return isFirstColumn ? QVariant ("Sensitivity") : QVariant (aViewerSelector->Sensitivity());
+  //  case 1: return isFirstColumn ? QVariant ("IsPickClosest") : QVariant (aViewerSelector->IsPickClosest());
+  //  case 2: return isFirstColumn ? QVariant ("NbPicked") : QVariant (aViewerSelector->NbPicked());
+
+  //  case 3: return ViewControl_Table::SeparatorData();
+  //  case 4: return isFirstColumn ? QVariant ("ClearPicked") : QVariant ("DO");
+
+  //  case 5: return ViewControl_Table::SeparatorData();
+  //  case 6: return isFirstColumn ? QVariant ("X (pixel)") : QVariant (myXPix);
+  //  case 7: return isFirstColumn ? QVariant ("Y (pixel)") : QVariant (myYPix);
+  //  case 8: return isFirstColumn ? QVariant ("Pick") : QVariant ("DO");
+
+  //  case 9: return ViewControl_Table::SeparatorData();
+  //  case 10: return isFirstColumn ? QVariant ("X Min (pixel)") : QVariant (myXMinPix);
+  //  case 11: return isFirstColumn ? QVariant ("Y Min (pixel)") : QVariant (myXMinPix);
+  //  case 12: return isFirstColumn ? QVariant ("X Max (pixel)") : QVariant (myXMaxPix);
+  //  case 13: return isFirstColumn ? QVariant ("Y Max (pixel)") : QVariant (myYMaxPix);
+  //  case 14: return isFirstColumn ? QVariant ("Pick") : QVariant ("DO");
+
+  //  default: break;
+  //}
+  return QVariant();
+}
+
+// =======================================================================
+// function : GetTableEditType
+// purpose :
+// =======================================================================
+ViewControl_EditType VInspector_ItemBVHTree::GetTableEditType (const int theRow, const int) const
+{
+  switch (theRow)
+  {
+    //case 4: return ViewControl_EditType_DoAction;
+    //case 6: return ViewControl_EditType_Spin;
+    //case 7: return ViewControl_EditType_Spin;
+    //case 8: return ViewControl_EditType_DoAction;
+    //case 10: return ViewControl_EditType_Spin;
+    //case 11: return ViewControl_EditType_Spin;
+    //case 12: return ViewControl_EditType_Spin;
+    //case 13: return ViewControl_EditType_Spin;
+    //case 14: return ViewControl_EditType_DoAction;
+    default: return ViewControl_EditType_None;
+  }
+}
+
+// =======================================================================
+// function : SetTableData
+// purpose :
+// =======================================================================
+bool VInspector_ItemBVHTree::SetTableData (const int theRow, const int, const QVariant& theValue)
+{
+  //Handle(SelectMgr_ViewerSelector) aViewerSelector = GetViewerSelector();
+  //if (aViewerSelector.IsNull())
+  //  return Standard_False;
+
+  //switch (theRow)
+  //{
+  //  case 4: aViewerSelector->ClearPicked(); break;
+  //  case 6: myXPix = theValue.toInt();
+  //  case 7: myYPix = theValue.toInt();
+  //  case 8:
+  //  {
+  //    Handle(StdSelect_ViewerSelector3d) aSelector3d = Handle(StdSelect_ViewerSelector3d)::DownCast(aViewerSelector);
+  //    if (!aSelector3d.IsNull())
+  //      aSelector3d->Pick (myXPix, myYPix, View_Tools::FindActiveView (GetContext()));
+  //    break;
+  //  }
+  //  case 10: myXMinPix = theValue.toInt();
+  //  case 11: myXMinPix = theValue.toInt();
+  //  case 12: myXMaxPix = theValue.toInt();
+  //  case 13: myYMaxPix = theValue.toInt();
+  //  case 14:
+  //  {
+  //    Handle(StdSelect_ViewerSelector3d) aSelector3d = Handle(StdSelect_ViewerSelector3d)::DownCast(aViewerSelector);
+  //    if (!aSelector3d.IsNull())
+  //      aSelector3d->Pick (myXMinPix, myYMinPix, myXMaxPix, myYMaxPix, View_Tools::FindActiveView (GetContext()));
+  //    break;
+  //  }
+  //  default: break;
+  //}
+  return Standard_True;
+}
+
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+Standard_Boolean VInspector_ItemBVHTree::Dump (Standard_OStream& OS) const
+{
+  //Handle(SelectMgr_ViewerSelector) aViewerSelector = GetViewerSelector();
+  //if (aViewerSelector.IsNull())
+  //  return Standard_False;
+
+  //aViewerSelector->Dump (OS);
+  return Standard_True;
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr VInspector_ItemBVHTree::createChild (int theRow, int theColumn)
+{
+  return VInspector_ItemBVHTreeNode::CreateItem (currentItem(), theRow, theColumn);
+}
diff --git a/tools/VInspector/VInspector_ItemBVHTree.hxx b/tools/VInspector/VInspector_ItemBVHTree.hxx
new file mode 100644 (file)
index 0000000..651145e
--- /dev/null
@@ -0,0 +1,125 @@
+// Created on: 2019-04-29
+// 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_ItemBVHTree_H
+#define VInspector_ItemBVHTree_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+#include <TopoDS_Shape.hxx>
+#include <BVH_Tree.hxx>
+#include <Standard_OStream.hxx>
+
+class VInspector_ItemBVHTree;
+typedef QExplicitlySharedDataPointer<VInspector_ItemBVHTree> VInspector_ItemBVHTreePtr;
+
+//! \class VInspector_ItemBVHTree
+//! Parent item, that corresponds Folder under the AIS_InteractiveContext
+//! Children of the item are: none
+class VInspector_ItemBVHTree : public VInspector_ItemBase
+{
+public:
+
+  //! Creates an item wrapped by a shared pointer
+  static VInspector_ItemBVHTreePtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  { return VInspector_ItemBVHTreePtr (new VInspector_ItemBVHTree (theParent, theRow, theColumn)); }
+
+  //! Destructor
+  virtual ~VInspector_ItemBVHTree() Standard_OVERRIDE {};
+
+  //! Inits the item, fills internal containers
+  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+
+  //! Resets cached values
+  Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
+
+  //! Returns data object of the item.
+  //! \return object
+  virtual Handle(Standard_Transient) GetObject() const { initItem(); return myTree; }
+
+  //! Returns current drawer, initialize the drawer if it was not initialized yet
+  Standard_EXPORT opencascade::handle<BVH_Tree<Standard_Real, 3> > GetTree() const
+  { return opencascade::handle<BVH_Tree<Standard_Real, 3> >::DownCast (GetObject()); }
+
+  //! Returns the span from the 0 row to the first item corresponded to the picked item
+  //! the 0 item is SelectMgr_SelectingVolumeManager
+  Standard_Integer GetFirstChildOfPicked() const { return 1; }
+protected:
+  //! Initialize the current item. It is empty because Reset() is also empty.
+  virtual void initItem() const Standard_OVERRIDE;
+
+  //! Returns number of displayed presentations
+  //! \return rows count
+  Standard_EXPORT virtual int initRowCount() const Standard_OVERRIDE;
+
+  //! Returns item information for the given role. Fills internal container if it was not filled yet
+  //! \param theItemRole a value role
+  //! \return the value
+  Standard_EXPORT virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
+
+  //! Returns 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;
+
+  //! 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
+  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
+  virtual bool SetTableData (const int theRow, const int theColumn, const QVariant& theValue) Standard_OVERRIDE;
+
+  //! Dumps the content of me on the stream <OS>.
+  virtual Standard_Boolean Dump (Standard_OStream& OS) const;
+
+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:
+
+  //! Set V3d viewer selector into the current field
+  //! \param theTree a viewer selector
+  void setTree (const opencascade::handle<BVH_Tree<Standard_Real, 3> >& theTree) { myTree = theTree; }
+
+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_ItemBVHTree(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn);
+
+private:
+
+  opencascade::handle<BVH_Tree<Standard_Real, 3> > myTree; //!< the current tree
+  TCollection_AsciiString myName; //!< the name
+};
+
+#endif
diff --git a/tools/VInspector/VInspector_ItemBVHTreeNode.cxx b/tools/VInspector/VInspector_ItemBVHTreeNode.cxx
new file mode 100644 (file)
index 0000000..99a45f5
--- /dev/null
@@ -0,0 +1,96 @@
+// Created on: 2019-04-29
+// 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_ItemBVHTreeNode.hxx>
+
+//#include <inspector/VInspector_ItemSelectMgrViewerSelector.hxx>
+//#include <inspector/VInspector_ItemSelectMgrBaseFrustum.hxx>
+//
+//#include <inspector/ViewControl_Tools.hxx>
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemBVHTreeNode::initRowCount() const
+{
+  if (Column() != 0)
+    return 0;
+
+  return 2;
+}
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemBVHTreeNode::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();
+
+  switch (Column())
+  {
+    case 0: return QString ("TreeNode_" + Row()); break;
+    default:
+      break;
+  }
+  return QVariant();
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+
+void VInspector_ItemBVHTreeNode::Init()
+{
+  TreeModel_ItemBase::Init(); // to use getIO() without circling initialization
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+
+void VInspector_ItemBVHTreeNode::Reset()
+{
+  VInspector_ItemBase::Reset();
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+
+void VInspector_ItemBVHTreeNode::initItem() const
+{
+  if (IsInitialized())
+    return;
+  const_cast<VInspector_ItemBVHTreeNode*>(this)->Init();
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr VInspector_ItemBVHTreeNode::createChild (int theRow, int theColumn)
+{
+  return TreeModel_ItemBasePtr();
+}
diff --git a/tools/VInspector/VInspector_ItemBVHTreeNode.hxx b/tools/VInspector/VInspector_ItemBVHTreeNode.hxx
new file mode 100644 (file)
index 0000000..ea09d07
--- /dev/null
@@ -0,0 +1,86 @@
+// Created on: 2019-04-29
+// 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_ItemBVHTreeNode_H
+#define VInspector_ItemBVHTreeNode_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+//#include <TopoDS_Shape.hxx>
+//#include <SelectMgr_SelectingVolumeManager.hxx>
+
+class SelectMgr_BaseFrustum;
+
+class VInspector_ItemBVHTreeNode;
+typedef QExplicitlySharedDataPointer<VInspector_ItemBVHTreeNode> VInspector_ItemBVHTreeNodePtr;
+
+//! \class VInspector_ItemBVHTreeNode
+//! Parent item, that corresponds Folder under the AIS_InteractiveContext
+//! Children of the item are: none
+class VInspector_ItemBVHTreeNode : public VInspector_ItemBase
+{
+public:
+
+  //! Creates an item wrapped by a shared pointer
+  static VInspector_ItemBVHTreeNodePtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  { return VInspector_ItemBVHTreeNodePtr (new VInspector_ItemBVHTreeNode (theParent, theRow, theColumn)); }
+
+  //! Destructor
+  virtual ~VInspector_ItemBVHTreeNode() Standard_OVERRIDE {};
+
+  //! Inits the item, fills internal containers
+  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+
+  //! Resets cached values
+  Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
+
+  //! Returns data object of the item.
+  //! \return object
+  virtual Handle(Standard_Transient) GetObject() const { initItem(); return NULL; }
+
+protected:
+  //! Initialize the current item. It is empty because Reset() is also empty.
+  virtual void initItem() const Standard_OVERRIDE;
+
+  //! Returns number of displayed presentations
+  //! \return rows count
+  Standard_EXPORT virtual int initRowCount() const Standard_OVERRIDE;
+
+  //! Returns item information for the given role. Fills internal container if it was not filled yet
+  //! \param theItemRole a value role
+  //! \return the value
+  Standard_EXPORT virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
+
+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
+  VInspector_ItemBVHTreeNode(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+    : VInspector_ItemBase(theParent, theRow, theColumn) {}
+
+};
+
+#endif
diff --git a/tools/VInspector/VInspector_ItemContainer.cxx b/tools/VInspector/VInspector_ItemContainer.cxx
new file mode 100644 (file)
index 0000000..a72c474
--- /dev/null
@@ -0,0 +1,96 @@
+// Created on: 2017-06-16
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2017 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_ItemContainer.hxx>
+
+#include <inspector/VInspector_ItemContainerAPI.hxx>
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemContainer::initValue (int theItemRole) const
+{
+  QVariant aParentValue = VInspector_ItemBase::initValue (theItemRole);
+  if (aParentValue.isValid())
+    return aParentValue;
+
+  if (Column() != 0 || (theItemRole != Qt::DisplayRole && theItemRole != Qt::ToolTipRole))
+    return QVariant();
+
+  VInspector_ItemContainerAPI* aContainerItem = dynamic_cast<VInspector_ItemContainerAPI*>(Parent().data());
+
+  if (!aContainerItem)
+    return "Empty item container";
+
+  return aContainerItem->GetContainerValue (Row(), theItemRole);
+}
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemContainer::initRowCount() const
+{
+  VInspector_ItemContainerAPI* aContainerItem = dynamic_cast<VInspector_ItemContainerAPI*>(Parent().data());
+
+  if (!aContainerItem)
+    return 0;
+
+  return aContainerItem->GetContainerRowCount (Row());
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr VInspector_ItemContainer::createChild (int theRow, int theColumn)
+{
+  VInspector_ItemContainerAPI* aContainerItem = dynamic_cast<VInspector_ItemContainerAPI*>(Parent().data());
+
+  if (!aContainerItem)
+    return TreeModel_ItemBasePtr();
+
+  return aContainerItem->CreateContainerChild (currentItem(), Row(), theRow, theColumn);
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void VInspector_ItemContainer::Init()
+{
+  TreeModel_ItemBase::Init(); // to use getIO() without circling initialization
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+void VInspector_ItemContainer::Reset()
+{
+  VInspector_ItemBase::Reset();
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+void VInspector_ItemContainer::initItem() const
+{
+  if (IsInitialized())
+    return;
+  const_cast<VInspector_ItemContainer*> (this)->Init();
+}
diff --git a/tools/VInspector/VInspector_ItemContainer.hxx b/tools/VInspector/VInspector_ItemContainer.hxx
new file mode 100644 (file)
index 0000000..f71949b
--- /dev/null
@@ -0,0 +1,87 @@
+// Created on: 2017-06-16
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2017 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_ItemContainer_H
+#define VInspector_ItemContainer_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+#include <AIS_InteractiveObject.hxx>
+#include <NCollection_List.hxx>
+#include <TCollection_AsciiString.hxx>
+
+class Prs3d_Drawer;
+
+class QItemSelectionModel;
+
+class VInspector_ItemContainer;
+typedef QExplicitlySharedDataPointer<VInspector_ItemContainer> VInspector_ItemContainerPtr;
+
+//! \class VInspector_ItemContainer
+//! Item presents additional level of information in the tree model.
+//! Parent is item context, children are either folder item or Selection filter item.
+class VInspector_ItemContainer : public VInspector_ItemBase
+{
+
+public:
+
+  //! Creates an item wrapped by a shared pointer
+  static VInspector_ItemContainerPtr CreateItem (TreeModel_ItemBasePtr theParent,
+    const int theRow, const int theColumn)
+  { return VInspector_ItemContainerPtr (new VInspector_ItemContainer (theParent, theRow, theColumn)); }
+  //! Destructor
+  virtual ~VInspector_ItemContainer() Standard_OVERRIDE {};
+
+  //! Returns data object of the item.
+  //! \return object
+  virtual Handle(Standard_Transient) GetObject() const { return NULL; }
+
+  //! Inits the item, fills internal containers
+  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+
+  //! Resets cached values
+  Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
+
+protected:
+
+  //! Initialize the current item. It is empty because Reset() is also empty.
+  virtual void initItem() const Standard_OVERRIDE;
+
+  //! Returns number of item selected
+  //! \return rows count
+  virtual int initRowCount() const Standard_OVERRIDE;
+
+  //! Returns item information for the given role. Fills internal container if it was not filled yet
+  //! \param theItemRole a value role
+  //! \return the value
+  virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
+
+  //! Creates a child item in the given position.
+  //! \param theRow the child row position
+  //! \param theColumn the child column position
+  //! \return the created item
+  virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE;
+
+private:
+
+  //! Constructor
+  //! param theParent a parent item
+  VInspector_ItemContainer (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  : VInspector_ItemBase (theParent, theRow, theColumn) {}
+
+};
+
+#endif
diff --git a/tools/VInspector/VInspector_ItemContainerAPI.hxx b/tools/VInspector/VInspector_ItemContainerAPI.hxx
new file mode 100644 (file)
index 0000000..c986433
--- /dev/null
@@ -0,0 +1,50 @@
+// Created on: 2017-06-16
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2017 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_ItemContainerAPI_H
+#define VInspector_ItemContainerAPI_H
+
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+//! \class VInspector_ItemContainerAPI
+class VInspector_ItemContainerAPI
+{
+
+public:
+  //! Constructor
+  VInspector_ItemContainerAPI () {}
+
+  //! Destructor
+  virtual ~VInspector_ItemContainerAPI() {};
+
+  //! Returns number of item selected
+  //! \return rows count
+  virtual int GetContainerRowCount (const int theContainerRow) const = 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
+  virtual QVariant GetContainerValue (const int theContainerRow, const int theItemRole) const = 0;
+
+  //! 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 CreateContainerChild (const TreeModel_ItemBasePtr& theParent, const int theContainerRow, int theRow, int theColumn) = 0;
+
+};
+
+#endif
index e602f2b7334ca2a2595c38308747cb73152431cf..73e7dc02dba6274138bfd0191ae7149110cde8d9 100644 (file)
@@ -103,6 +103,21 @@ void VInspector_ItemSelectMgrBaseFrustum::initItem() const
   const_cast<VInspector_ItemSelectMgrBaseFrustum*>(this)->Init();
 }
 
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+Standard_Boolean VInspector_ItemSelectMgrBaseFrustum::Dump (Standard_OStream& OS) const
+{
+  Handle(SelectMgr_BaseFrustum) aFrustum = GetFrustum();
+
+  if (aFrustum.IsNull())
+    return Standard_False;
+
+  aFrustum->Dump (OS);
+  return Standard_True;
+}
+
 // =======================================================================
 // function : GetTableRowCount
 // purpose :
index 39079ddccf6176738c3440fca188b2214517ab73..37393debee9d75ca02f26d997ee15802fa16594e 100644 (file)
@@ -53,6 +53,9 @@ public:
   Standard_EXPORT Handle(SelectMgr_BaseFrustum) GetFrustum() const
   { return Handle(SelectMgr_BaseFrustum)::DownCast (GetObject()); }
 
+  //! Dumps the content of me on the stream <OS>.
+  virtual Standard_Boolean Dump (Standard_OStream& OS) const;
+
 protected:
   //! Initialize the current item. It is empty because Reset() is also empty.
   virtual void initItem() const Standard_OVERRIDE;
diff --git a/tools/VInspector/VInspector_ItemSelectMgrSelectableObjectSet.cxx b/tools/VInspector/VInspector_ItemSelectMgrSelectableObjectSet.cxx
new file mode 100644 (file)
index 0000000..b2f61e3
--- /dev/null
@@ -0,0 +1,188 @@
+// Created on: 2019-04-29
+// 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_ItemSelectMgrSelectableObjectSet.hxx>
+
+#include <inspector/VInspector_ItemBVHTree.hxx>
+#include <inspector/VInspector_ItemSelectMgrViewerSelector.hxx>
+#include <inspector/VInspector_ItemSelectMgrBaseFrustum.hxx>
+
+#include <inspector/ViewControl_Tools.hxx>
+
+#include <SelectMgr.hxx>
+
+// =======================================================================
+// function : initRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemSelectMgrSelectableObjectSet::initRowCount() const
+{
+  if (Column() != 0)
+    return 0;
+
+  return SelectMgr_SelectableObjectSet::BVHSubsetNb; // VInspector_ItemBVHTree items
+}
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemSelectMgrSelectableObjectSet::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();
+
+  SelectMgr_SelectableObjectSet aSet;
+  if (!GetSelectableObjectSet (aSet))
+    return Column() == 0 ? "Empty selectable object set" : "";
+
+  switch (Column())
+  {
+    case 0: return "SelectMgr_SelectableObjectSet";
+    default:
+      break;
+  }
+  return QVariant();
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+
+void VInspector_ItemSelectMgrSelectableObjectSet::Init()
+{
+  //VInspector_ItemFolderObjectPtr aParentItem = itemDynamicCast<VInspector_ItemFolderObject>(Parent());
+  //Handle(SelectMgr_SelectingVolumeManager) aVolumeMgr;
+  //if (aParentItem)
+  //{
+  //  VInspector_ItemContextPtr aParentContextItem = itemDynamicCast<VInspector_ItemContext>(aParentItem->Parent());
+  //  if (aParentContextItem)
+  //  {
+  //    Handle(AIS_InteractiveContext) aContext = aParentContextItem->GetContext();
+  //    aVolumeMgr = aContext->MainSelector();
+  //  }
+  //}
+  //setViewerSelector (aVolumeMgr);
+
+  //UpdatePresentationShape();
+  TreeModel_ItemBase::Init(); // to use getIO() without circling initialization
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+
+void VInspector_ItemSelectMgrSelectableObjectSet::Reset()
+{
+  VInspector_ItemBase::Reset();
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+
+void VInspector_ItemSelectMgrSelectableObjectSet::initItem() const
+{
+  if (IsInitialized())
+    return;
+  const_cast<VInspector_ItemSelectMgrSelectableObjectSet*>(this)->Init();
+}
+
+// =======================================================================
+// function : GetSelectableObjectSet
+// purpose :
+// =======================================================================
+Standard_Boolean VInspector_ItemSelectMgrSelectableObjectSet::GetSelectableObjectSet (SelectMgr_SelectableObjectSet& theSet) const
+{
+  VInspector_ItemSelectMgrViewerSelectorPtr aParentItem = itemDynamicCast<VInspector_ItemSelectMgrViewerSelector>(Parent());
+
+  if (!aParentItem || aParentItem->GetViewerSelector().IsNull())
+    return Standard_False;
+
+  theSet = aParentItem->GetViewerSelector()->GetSelectableObjects();
+  return Standard_True;
+}
+
+// =======================================================================
+// function : GetBVHTree
+// purpose :
+// =======================================================================
+opencascade::handle<BVH_Tree<Standard_Real, 3> > VInspector_ItemSelectMgrSelectableObjectSet::GetBVHTree (const int theRow,
+  TCollection_AsciiString& theName) const
+{
+  SelectMgr_SelectableObjectSet aSet;
+  if (!GetSelectableObjectSet (aSet))
+    return NULL;
+
+  if (theRow >= SelectMgr_SelectableObjectSet::BVHSubsetNb)
+    return NULL;
+
+  SelectMgr_SelectableObjectSet::BVHSubset aBVHSubset = (SelectMgr_SelectableObjectSet::BVHSubset)theRow;
+  theName = TCollection_AsciiString ("BVH_Tree_") + SelectMgr::BVHSubsetToString (aBVHSubset);
+
+  return aSet.BVH (SelectMgr_SelectableObjectSet::BVHSubset_2dPersistent);
+}
+
+// =======================================================================
+// function : GetTableRowCount
+// purpose :
+// =======================================================================
+int VInspector_ItemSelectMgrSelectableObjectSet::GetTableRowCount() const
+{
+  return 60;
+}
+
+// =======================================================================
+// function : GetTableData
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemSelectMgrSelectableObjectSet::GetTableData (const int theRow, const int theColumn, const int theRole) const
+{
+  if (theRole != Qt::DisplayRole)
+    return QVariant();
+
+  //SelectMgr_SelectingVolumeManager aVolumeMgr;
+  //if (!GetViewerSelector (aVolumeMgr))
+  //  return QVariant();
+
+  //bool isFirstColumn = theColumn == 0;
+  //switch (theRow)
+  //{
+  //  case 0: return isFirstColumn ? QVariant ("GetActiveSelectionType") : QVariant (aVolumeMgr.GetActiveSelectionType());
+  //  case 1: return isFirstColumn ? QVariant ("IsOverlapAllowed()") : QVariant (aVolumeMgr.IsOverlapAllowed());
+  //  case 2: return isFirstColumn ? "GetNearPickedPnt" : ViewControl_Tools::ToString (aVolumeMgr.GetNearPickedPnt()).ToCString();
+  //  case 3: return isFirstColumn ? "GetFarPickedPnt" : ViewControl_Tools::ToString (aVolumeMgr.GetFarPickedPnt()).ToCString();
+  //  default: break;
+  //}
+  return QVariant();
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr VInspector_ItemSelectMgrSelectableObjectSet::createChild (int theRow, int theColumn)
+{
+  if (theRow == 0 || theRow == 1 || theRow == 2)
+    return VInspector_ItemBVHTree::CreateItem (currentItem(), theRow, theColumn);
+  return TreeModel_ItemBasePtr();
+}
diff --git a/tools/VInspector/VInspector_ItemSelectMgrSelectableObjectSet.hxx b/tools/VInspector/VInspector_ItemSelectMgrSelectableObjectSet.hxx
new file mode 100644 (file)
index 0000000..9a6a575
--- /dev/null
@@ -0,0 +1,102 @@
+// Created on: 2019-04-29
+// 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_ItemSelectMgrSelectableObjectSet_H
+#define VInspector_ItemSelectMgrSelectableObjectSet_H
+
+#include <inspector/VInspector_ItemBase.hxx>
+
+#include <BVH_Tree.hxx>
+#include <Standard.hxx>
+#include <SelectMgr_SelectableObjectSet.hxx>
+#include <TCollection_AsciiString.hxx>
+
+class SelectMgr_BaseFrustum;
+
+class VInspector_ItemSelectMgrSelectableObjectSet;
+typedef QExplicitlySharedDataPointer<VInspector_ItemSelectMgrSelectableObjectSet> VInspector_ItemSelectMgrSelectableObjectSetPtr;
+
+//! \class VInspector_ItemSelectMgrSelectableObjectSet
+//! Parent item, that corresponds Folder under the AIS_InteractiveContext
+//! Children of the item are: none
+class VInspector_ItemSelectMgrSelectableObjectSet : public VInspector_ItemBase
+{
+public:
+
+  //! Creates an item wrapped by a shared pointer
+  static VInspector_ItemSelectMgrSelectableObjectSetPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  { return VInspector_ItemSelectMgrSelectableObjectSetPtr (new VInspector_ItemSelectMgrSelectableObjectSet (theParent, theRow, theColumn)); }
+
+  //! Destructor
+  virtual ~VInspector_ItemSelectMgrSelectableObjectSet() Standard_OVERRIDE {};
+
+  //! Inits the item, fills internal containers
+  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+
+  //! Resets cached values
+  Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
+
+  //! Returns data object of the item.
+  //! \return object
+  virtual Handle(Standard_Transient) GetObject() const { initItem(); return NULL; }
+
+  //! Returns current drawer, initialize the drawer if it was not initialized yet
+  Standard_EXPORT Standard_Boolean GetSelectableObjectSet (SelectMgr_SelectableObjectSet& theSet) const;
+
+  //! Returns child BVH tree of the row
+  opencascade::handle<BVH_Tree<Standard_Real, 3> > GetBVHTree (const int theRow, TCollection_AsciiString& theName) const;
+
+protected:
+  //! Initialize the current item. It is empty because Reset() is also empty.
+  virtual void initItem() const Standard_OVERRIDE;
+
+  //! Returns number of displayed presentations
+  //! \return rows count
+  Standard_EXPORT virtual int initRowCount() const Standard_OVERRIDE;
+
+  //! Returns item information for the given role. Fills internal container if it was not filled yet
+  //! \param theItemRole a value role
+  //! \return the value
+  Standard_EXPORT virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
+
+  //! Returns 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:
+
+  //! 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_ItemSelectMgrSelectableObjectSet(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+    : VInspector_ItemBase(theParent, theRow, theColumn) {}
+
+};
+
+#endif
index 8a08b488782dd289631368e165292822ed2eb1cc..3f89dec6846fdae34ebaa64f2f02ea5965884cda 100644 (file)
@@ -29,7 +29,7 @@ int VInspector_ItemSelectMgrSelectingVolumeManager::initRowCount() const
   if (Column() != 0)
     return 0;
 
-  return 1;
+  return 2;
 }
 
 // =======================================================================
@@ -119,6 +119,24 @@ Standard_Boolean VInspector_ItemSelectMgrSelectingVolumeManager::GetViewerSelect
   return Standard_True;
 }
 
+// =======================================================================
+// function : GetTableRowCount
+// purpose :
+// =======================================================================
+Handle(SelectMgr_BaseFrustum) VInspector_ItemSelectMgrSelectingVolumeManager::GetFrustum (const int theRow) const
+{
+  SelectMgr_SelectingVolumeManager aVolumeManager;
+  if (!GetViewerSelector (aVolumeManager))
+    return NULL;
+
+  if (theRow == 0)
+    return aVolumeManager.GetVolume (SelectBasics_SelectingVolumeManager::Box);
+  else if (theRow == 1)
+    return aVolumeManager.GetVolume (SelectBasics_SelectingVolumeManager::Polyline);
+
+  return NULL;
+}
+
 // =======================================================================
 // function : GetTableRowCount
 // purpose :
@@ -159,7 +177,7 @@ QVariant VInspector_ItemSelectMgrSelectingVolumeManager::GetTableData (const int
 // =======================================================================
 TreeModel_ItemBasePtr VInspector_ItemSelectMgrSelectingVolumeManager::createChild (int theRow, int theColumn)
 {
-  if (theRow == 0)
+  if (theRow == 0 || theRow == 1)
     return VInspector_ItemSelectMgrBaseFrustum::CreateItem (currentItem(), theRow, theColumn);
   //else if (theRow == 1)
   //  return VInspector_ItemAspectWindow::CreateItem (currentItem(), theRow, theColumn);
index b08765e477f0e95e584db219d4a4b392feccbfbd..b0f4a94b8a578663584dada7112a12efdc1edf12 100644 (file)
@@ -22,6 +22,8 @@
 #include <TopoDS_Shape.hxx>
 #include <SelectMgr_SelectingVolumeManager.hxx>
 
+class SelectMgr_BaseFrustum;
+
 class VInspector_ItemSelectMgrSelectingVolumeManager;
 typedef QExplicitlySharedDataPointer<VInspector_ItemSelectMgrSelectingVolumeManager> VInspector_ItemSelectMgrSelectingVolumeManagerPtr;
 
@@ -52,6 +54,9 @@ public:
   //! Returns current drawer, initialize the drawer if it was not initialized yet
   Standard_EXPORT Standard_Boolean GetViewerSelector (SelectMgr_SelectingVolumeManager& theVolumeManager) const;
 
+  //! Returns frustum Frustum for row = 0, FrustumSet for row = 1   
+  Handle(SelectMgr_BaseFrustum) GetFrustum (const int theRow) const;
+
 protected:
   //! Initialize the current item. It is empty because Reset() is also empty.
   virtual void initItem() const Standard_OVERRIDE;
diff --git a/tools/VInspector/VInspector_ItemSelectMgrSensitiveEntitySet.cxx b/tools/VInspector/VInspector_ItemSelectMgrSensitiveEntitySet.cxx
new file mode 100644 (file)
index 0000000..e0b5389
--- /dev/null
@@ -0,0 +1,137 @@
+// Created on: 2017-06-16
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2017 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_ItemSelectMgrSensitiveEntitySet.hxx>
+#include <inspector/VInspector_ItemSelectMgrViewerSelector.hxx>
+#include <inspector/VInspector_ItemSelect3DSensitiveSetItem.hxx>
+
+#include <AIS_ListOfInteractive.hxx>
+#include <SelectMgr_SensitiveEntitySet.hxx>
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+int VInspector_ItemSelectMgrSensitiveEntitySet::initRowCount() const
+{
+  Handle(SelectMgr_SensitiveEntitySet) aSensitiveSet = Handle(SelectMgr_SensitiveEntitySet)::DownCast (GetSensitiveEntitySet());
+  if (!aSensitiveSet.IsNull())
+    return aSensitiveSet->Size();
+
+  return 2;
+}
+
+// =======================================================================
+// function : initValue
+// purpose :
+// =======================================================================
+QVariant VInspector_ItemSelectMgrSensitiveEntitySet::initValue (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(SelectMgr_SensitiveEntitySet) anEntitySet = GetSensitiveEntitySet();
+  const Handle(SelectMgr_SelectableObject)& aSelectableObject = GetSelectableObject();
+
+  if (anEntitySet.IsNull())
+    return Column() == 0 ? "Empty sensitive entity set" : "";
+
+  if (aSelectableObject.IsNull())
+    return Column() == 0 ? "Empty selectable object for sensitive entity set" : "";
+
+  switch (theItemRole)
+  {
+    case Qt::DisplayRole:
+    case Qt::EditRole:
+    case Qt::ToolTipRole:
+    {
+      switch (Column())
+      {
+        case 0: return aSelectableObject->DynamicType()->Name();
+        default:
+          break;
+      }
+      break;
+    }
+    default:
+    break;
+  }
+  return QVariant();
+}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr VInspector_ItemSelectMgrSensitiveEntitySet::createChild (int theRow, int theColumn)
+{
+  return VInspector_ItemSelect3DSensitiveSetItem::CreateItem (currentItem(), theRow, theColumn);
+}
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrSensitiveEntitySet::Init()
+{
+  VInspector_ItemSelectMgrViewerSelectorPtr aParentItem = itemDynamicCast<VInspector_ItemSelectMgrViewerSelector>(Parent()->Parent());
+
+  Handle(SelectMgr_SelectableObject) anObject;
+  Handle(SelectMgr_SensitiveEntitySet) anEntitySet = aParentItem->GetSensitiveEntitySet (Row(), anObject);
+
+  myEntitySet = anEntitySet;
+  mySelectableObject = anObject;
+
+  UpdatePresentationShape();
+  TreeModel_ItemBase::Init();
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrSensitiveEntitySet::Reset()
+{
+  // an empty method to don't clear the main label, otherwise the model will be empty
+  TreeModel_ItemBase::Reset();
+  myEntitySet = NULL;
+  mySelectableObject = NULL;
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+void VInspector_ItemSelectMgrSensitiveEntitySet::initItem() const
+{
+  if (IsInitialized())
+    return;
+  const_cast<VInspector_ItemSelectMgrSensitiveEntitySet*>(this)->Init();
+}
+
+// =======================================================================
+// function : buildPresentationShape
+// purpose :
+// =======================================================================
+TopoDS_Shape VInspector_ItemSelectMgrSensitiveEntitySet::buildPresentationShape()
+{
+  //mySelectableObject
+  return TopoDS_Shape();
+}
diff --git a/tools/VInspector/VInspector_ItemSelectMgrSensitiveEntitySet.hxx b/tools/VInspector/VInspector_ItemSelectMgrSensitiveEntitySet.hxx
new file mode 100644 (file)
index 0000000..85ee1cd
--- /dev/null
@@ -0,0 +1,108 @@
+// Created on: 2017-06-16
+// Created by: Natalia ERMOLAEVA
+// Copyright (c) 2017 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_ItemSelectMgrSensitiveEntitySet_H
+#define VInspector_ItemSelectMgrSensitiveEntitySet_H
+
+#include <AIS_InteractiveObject.hxx>
+#include <SelectMgr_SensitiveEntitySet.hxx>
+#include <Standard.hxx>
+#include <inspector/VInspector_ItemBase.hxx>
+
+class SelectMgr_SelectableObject;
+
+class QItemSelectionModel;
+class VInspector_ItemSelectMgrSensitiveEntitySet;
+
+typedef QExplicitlySharedDataPointer<VInspector_ItemSelectMgrSensitiveEntitySet> VInspector_ItemSelectMgrSensitiveEntitySetPtr;
+
+//! \class VInspector_ItemSelectMgrSensitiveEntitySet
+class VInspector_ItemSelectMgrSensitiveEntitySet : public VInspector_ItemBase
+{
+
+public:
+
+  //! Creates an item wrapped by a shared pointer
+  static VInspector_ItemSelectMgrSensitiveEntitySetPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  { return VInspector_ItemSelectMgrSensitiveEntitySetPtr (new VInspector_ItemSelectMgrSensitiveEntitySet (theParent, theRow, theColumn)); }
+
+  //! Destructor
+  virtual ~VInspector_ItemSelectMgrSensitiveEntitySet() Standard_OVERRIDE {};
+
+  //! Returns data object of the item.
+  //! \return object
+  virtual Handle(Standard_Transient) GetObject() const { initItem(); return myEntitySet; }
+
+  //! \return the current sensitive entity
+  Standard_EXPORT Handle(SelectMgr_SensitiveEntitySet) GetSensitiveEntitySet() const
+  { return Handle(SelectMgr_SensitiveEntitySet)::DownCast (GetObject()); }
+
+  //! \return the current sensitive entity
+  Standard_EXPORT const Handle(SelectMgr_SelectableObject)& GetSelectableObject() const
+  { GetObject(); return mySelectableObject; }
+
+  //! Inits the item, fills internal containers
+  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+
+  //! Resets cached values
+  Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
+
+protected:
+
+  //! Initialize the current item. It is empty because Reset() is also empty.
+  virtual void initItem() const Standard_OVERRIDE;
+
+  //! \return number of children.
+  virtual int initRowCount() const Standard_OVERRIDE;
+
+  //! Returns item information for the given role. Fills internal container if it was not filled yet
+  //! \param theItemRole a value role
+  //! \return the value
+  virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
+
+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;
+
+  //! Returns table value for the row in form: <function name> <function value> depending on the aspect kind
+  //! \param theRow a model index row
+  //! \param theColumn a model index column
+  //! \param theEntityKind kind or kind of entity
+  QVariant getTableData (const int theRow,
+                         const int theColumn,
+                         const int theRole,
+                         const TCollection_AsciiString& theEntityKind) const;
+
+protected:
+  //! Build presentation shape
+  //! \return generated shape of the item parameters
+  virtual TopoDS_Shape buildPresentationShape() Standard_OVERRIDE;
+
+  //! Constructor
+  //! param theParent a parent item
+  VInspector_ItemSelectMgrSensitiveEntitySet(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
+  : VInspector_ItemBase(theParent, theRow, theColumn) {}
+
+private:
+
+  Handle(SelectMgr_SensitiveEntitySet) myEntitySet; //!< the current sensitive entity
+  Handle(SelectMgr_SelectableObject) mySelectableObject; //!< the current presentation
+};
+
+#endif
index 1f15cf506af6a35772a7f31cf754d78f64938760..8c9687f55522eca24b124085ff8ef09edda86002 100644 (file)
 
 #include <inspector/VInspector_ItemSelectMgrViewerSelector.hxx>
 
+#include <inspector/VInspector_ItemContainer.hxx>
+#include <inspector/VInspector_ItemSelectMgrSelectableObjectSet.hxx>
 #include <inspector/VInspector_ItemSelectMgrSelectingVolumeManager.hxx>
+#include <inspector/VInspector_ItemSelectMgrSensitiveEntitySet.hxx>
 #include <inspector/VInspector_ItemSelectMgrViewerSelectorPicked.hxx>
 
 #include <inspector/VInspector_ItemFolderObject.hxx>
@@ -50,7 +53,8 @@ int VInspector_ItemSelectMgrViewerSelector::initRowCount() const
   if (Column() != 0)
     return 0;
 
-  Standard_Integer aNbRows = GetFirstChildOfPicked(); // SelectMgr_SelectingVolumeManager
+  // SelectMgr_SelectingVolumeManager, VInspector_ItemSelectMgrSelectableObjectSet, VInspector_ItemContainer
+  Standard_Integer aNbRows = GetFirstChildOfPicked();
 
   Handle(SelectMgr_ViewerSelector) aViewSelector = GetViewerSelector();
   if (!aViewSelector.IsNull())
@@ -125,6 +129,80 @@ void VInspector_ItemSelectMgrViewerSelector::Reset()
   setViewerSelector (NULL);
 }
 
+// =======================================================================
+// function : GetContainerRowCount
+// purpose :
+// =======================================================================
+
+int VInspector_ItemSelectMgrViewerSelector::GetContainerRowCount (const int theContainerRow) const
+{
+  if (theContainerRow != 2)
+    return 0;
+
+  Handle(SelectMgr_ViewerSelector) aViewSelector = GetViewerSelector();
+  if (aViewSelector.IsNull())
+    return 0;
+
+  return aViewSelector->GetObjectSensitives().Extent();
+}
+
+// =======================================================================
+// function : GetSensitiveEntitySet
+// purpose :
+// =======================================================================
+Handle(SelectMgr_SensitiveEntitySet) VInspector_ItemSelectMgrViewerSelector::GetSensitiveEntitySet (const int theRow,
+  Handle(SelectMgr_SelectableObject)& theObject)
+{
+  Standard_Integer anIndex = 0;
+
+  Handle(SelectMgr_ViewerSelector) aViewSelector = GetViewerSelector();
+  if (!aViewSelector.IsNull())
+    return NULL;
+
+  for (SelectMgr_MapOfObjectSensitivesIterator anIterator (aViewSelector->GetObjectSensitives()); anIterator.More(); anIterator.Next(), anIndex++)
+  {
+    if (anIndex != theRow)
+      continue;
+
+    theObject = anIterator.Key();
+    return anIterator.Value();
+  }
+  return NULL;
+}
+
+// =======================================================================
+// function : GetContainerValue
+// purpose :
+// =======================================================================
+
+QVariant VInspector_ItemSelectMgrViewerSelector::GetContainerValue (const int theContainerRow, const int theItemRole) const
+{
+  if (theContainerRow != 2)
+    return 0;
+
+  if (theItemRole != Qt::DisplayRole)
+    return QVariant();
+
+  Handle(SelectMgr_ViewerSelector) aViewSelector = GetViewerSelector();
+  if (aViewSelector.IsNull())
+    return QVariant();
+
+  return "SelectMgr_MapOfObjectSensitives";
+}
+
+// =======================================================================
+// function : CreateContainerChild
+// purpose :
+// =======================================================================
+
+TreeModel_ItemBasePtr VInspector_ItemSelectMgrViewerSelector::CreateContainerChild (const TreeModel_ItemBasePtr& theParent, const int theContainerRow, int theRow, int theColumn)
+{
+  if (theContainerRow != 2)
+    return TreeModel_ItemBasePtr();
+
+  return VInspector_ItemSelectMgrSensitiveEntitySet::CreateItem (theParent, theRow, theColumn);
+}
+
 // =======================================================================
 // function : initItem
 // purpose :
@@ -245,6 +323,20 @@ bool VInspector_ItemSelectMgrViewerSelector::SetTableData (const int theRow, con
   return Standard_True;
 }
 
+// =======================================================================
+// function : Dump
+// purpose :
+// =======================================================================
+Standard_Boolean VInspector_ItemSelectMgrViewerSelector::Dump (Standard_OStream& OS) const
+{
+  Handle(SelectMgr_ViewerSelector) aViewerSelector = GetViewerSelector();
+  if (aViewerSelector.IsNull())
+    return Standard_False;
+
+  aViewerSelector->Dump (OS);
+  return Standard_True;
+}
+
 // =======================================================================
 // function : buildPresentationShape
 // purpose :
@@ -272,12 +364,10 @@ TreeModel_ItemBasePtr VInspector_ItemSelectMgrViewerSelector::createChild (int t
 {
   if (theRow == 0)
     return VInspector_ItemSelectMgrSelectingVolumeManager::CreateItem (currentItem(), theRow, theColumn);
+  else if (theRow == 1)
+    return VInspector_ItemSelectMgrSelectableObjectSet::CreateItem (currentItem(), theRow, theColumn);
+  else if (theRow == 2)
+    return VInspector_ItemContainer::CreateItem (currentItem(), theRow, theColumn);
   else
     return VInspector_ItemSelectMgrViewerSelectorPicked::CreateItem (currentItem(), theRow, theColumn);
-  //else if (theRow == 1)
-  //  return VInspector_ItemAspectWindow::CreateItem (currentItem(), theRow, theColumn);
-  //else if (theRow == 2)
-  //  return VInspector_ItemGraphic3dCView::CreateItem (currentItem(), theRow, theColumn);
-  //
-  return TreeModel_ItemBasePtr();
 }
index 978a70b34bef64f53ac55ac381b38f38583027dc..136776787346ef871e67fa2a7c0ddfbcc07fc908 100644 (file)
 
 #include <Standard.hxx>
 #include <inspector/VInspector_ItemBase.hxx>
+#include <inspector/VInspector_ItemContainerAPI.hxx>
 
 #include <TopoDS_Shape.hxx>
 #include <SelectMgr_ViewerSelector.hxx>
+#include <Standard_OStream.hxx>
 
 class VInspector_ItemSelectMgrViewerSelector;
 typedef QExplicitlySharedDataPointer<VInspector_ItemSelectMgrViewerSelector> VInspector_ItemSelectMgrViewerSelectorPtr;
@@ -28,7 +30,7 @@ typedef QExplicitlySharedDataPointer<VInspector_ItemSelectMgrViewerSelector> VIn
 //! \class VInspector_ItemSelectMgrViewerSelector
 //! Parent item, that corresponds Folder under the AIS_InteractiveContext
 //! Children of the item are: none
-class VInspector_ItemSelectMgrViewerSelector : public VInspector_ItemBase
+class VInspector_ItemSelectMgrViewerSelector : public VInspector_ItemBase, public VInspector_ItemContainerAPI
 {
 public:
 
@@ -55,7 +57,31 @@ public:
 
   //! Returns the span from the 0 row to the first item corresponded to the picked item
   //! the 0 item is SelectMgr_SelectingVolumeManager
-  Standard_Integer GetFirstChildOfPicked() const { return 1; }
+  //! the 1 item is VInspector_ItemSelectMgrSelectableObjectSet
+  //! the 2 item is VInspector_ItemContainer for SelectMgr_MapOfObjectSensitives
+  Standard_Integer GetFirstChildOfPicked() const { return 3; }
+
+  //! Returns entity set if possible from SelectMgr_MapOfObjectSensitives
+  //! \param theRow row index
+  //! \param theObject [out] object connected to the sensitive entity set
+  Standard_EXPORT Handle(SelectMgr_SensitiveEntitySet) GetSensitiveEntitySet (const int theRow,
+    Handle(SelectMgr_SelectableObject)& theObject);
+
+  //! Returns number of item selected
+  //! \return rows count
+  virtual int GetContainerRowCount (const int theContainerRow) const Standard_OVERRIDE;
+
+  //! Returns item information for the given role. Fills internal container if it was not filled yet
+  //! \param theItemRole a value role
+  //! \return the value
+  virtual QVariant GetContainerValue (const int theContainerRow, const int theItemRole) const Standard_OVERRIDE;
+
+  //! Creates a child item in the given position.
+  //! \param theRow the child row position
+  //! \param theColumn the child column position
+  //! \return the created item
+  virtual TreeModel_ItemBasePtr CreateContainerChild (const TreeModel_ItemBasePtr& theParent, const int theContainerRow, int theRow, int theColumn) Standard_OVERRIDE;
+
 protected:
   //! Initialize the current item. It is empty because Reset() is also empty.
   virtual void initItem() const Standard_OVERRIDE;
@@ -90,6 +116,9 @@ protected:
   //! \param theValue a new cell value
   virtual bool SetTableData (const int theRow, const int theColumn, const QVariant& theValue) Standard_OVERRIDE;
 
+  //! Dumps the content of me on the stream <OS>.
+  virtual Standard_Boolean Dump (Standard_OStream& OS) const;
+
 protected:
 
   //! Build presentation shape
diff --git a/tools/VInspector/VInspector_PropertiesCreator.cxx b/tools/VInspector/VInspector_PropertiesCreator.cxx
new file mode 100644 (file)
index 0000000..eb70a40
--- /dev/null
@@ -0,0 +1,40 @@
+// Created on: 2019-04-28
+// 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_PropertiesCreator.hxx>
+#include <inspector/VInspectorPaneAIS_ColoredShape.hxx>
+#include <inspector/ViewControl_PropertiesStream.hxx>
+
+#include <Standard_OStream.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(VInspector_PropertiesCreator, TreeModel_ItemPropertiesCreator)
+
+// =======================================================================
+// function : GetProperties
+// purpose :
+// =======================================================================
+TreeModel_ItemProperties* VInspector_PropertiesCreator::GetProperties (const TreeModel_ItemBasePtr& theItem)
+{
+  Handle(Standard_Transient) anObject = theItem->GetObject();
+  if (anObject.IsNull())
+    return NULL;
+
+  Standard_SStream aSStream;
+  if (theItem->Dump (aSStream))
+    return new ViewControl_PropertiesStream (theItem);
+
+  return NULL;
+}
+
diff --git a/tools/VInspector/VInspector_PropertiesCreator.hxx b/tools/VInspector/VInspector_PropertiesCreator.hxx
new file mode 100644 (file)
index 0000000..b0673db
--- /dev/null
@@ -0,0 +1,47 @@
+// Created on: 2019-04-28
+// 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_PropertiesCreator_H
+#define VInspector_PropertiesCreator_H
+
+#include <Standard.hxx>
+#include <Standard_Macro.hxx>
+
+#include <inspector/TreeModel_ItemPropertiesCreator.hxx>
+
+DEFINE_STANDARD_HANDLE (VInspector_PropertiesCreator, TreeModel_ItemPropertiesCreator)
+
+//! \class VInspector_PropertiesCreator
+//! \brief An interface to create custom panes by transient object name.
+class VInspector_PropertiesCreator : public TreeModel_ItemPropertiesCreator
+{
+public:
+
+  //! Constructor
+  VInspector_PropertiesCreator() {}
+
+  //! Destructor
+  virtual ~VInspector_PropertiesCreator() {}
+
+  //! Returns pane for the name, creates a new pane if it does not exist and possible to create
+  //! \param theName type of the pane
+  //! \return a pane instance or NULL
+  virtual TreeModel_ItemProperties* GetProperties (const TreeModel_ItemBasePtr& theItem) Standard_OVERRIDE;
+
+  DEFINE_STANDARD_RTTIEXT(VInspector_PropertiesCreator, TreeModel_ItemPropertiesCreator)
+
+};
+
+#endif 
index a44046decdd0f6478f0ba09ab5ecdbad93b66576..7f8bbb001c279ee55588f58f712e28aa914cd4c2 100644 (file)
@@ -600,6 +600,30 @@ TopoDS_Shape VInspector_Tools::CreateShape (const Bnd_Box& theBoundingBox)
   return CreateBoxShape (aPntMin, aPntMax);
 }
 
+//=======================================================================
+//function : CreateShape
+//purpose  :
+//=======================================================================
+TopoDS_Shape VInspector_Tools::CreateShape (const Bnd_OBB& theBoundingBox)
+{
+  if (theBoundingBox.IsVoid())
+    return TopoDS_Shape();
+
+  TColgp_Array1OfPnt anArrPnts(0, 8);
+  theBoundingBox.GetVertex(&anArrPnts(0));
+
+  BRep_Builder aBuilder;
+  TopoDS_Compound aCompound;
+  aBuilder.MakeCompound (aCompound);
+
+  aBuilder.Add (aCompound, BRepBuilderAPI_MakeEdge (gp_Pnt (anArrPnts.Value(0)), gp_Pnt (anArrPnts.Value(1))));
+  aBuilder.Add (aCompound, BRepBuilderAPI_MakeEdge (gp_Pnt (anArrPnts.Value(0)), gp_Pnt (anArrPnts.Value(2))));
+  aBuilder.Add (aCompound, BRepBuilderAPI_MakeEdge (gp_Pnt (anArrPnts.Value(1)), gp_Pnt (anArrPnts.Value(3))));
+  aBuilder.Add (aCompound, BRepBuilderAPI_MakeEdge (gp_Pnt (anArrPnts.Value(2)), gp_Pnt (anArrPnts.Value(3))));
+
+  return aCompound;
+}
+
 //=======================================================================
 //function : CreateShape
 //purpose  :
index add7d38fdc1533e813a67314dc2339b7321c3473..7b02cd9532fe911e9136b9623de92137d1211f2f 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <AIS_InteractiveContext.hxx>
 #include <Bnd_Box.hxx>
+#include <Bnd_OBB.hxx>
 #include <Graphic3d_Buffer.hxx>
 #include <Graphic3d_Mat4.hxx>
 #include <Graphic3d_Mat4d.hxx>
@@ -188,6 +189,11 @@ public:
   //! \return created shape
   Standard_EXPORT static TopoDS_Shape CreateShape (const Bnd_Box& theBoundingBox);
 
+  //! Creates box shape
+  //! \param theBoundingBox box shape parameters
+  //! \return created shape
+  Standard_EXPORT static TopoDS_Shape CreateShape (const Bnd_OBB& theBoundingBox);
+
   //! Creates box shape
   //! \param theBoundingBox box shape parameters
   //! \return created shape
index 6f42d6ca777e7b0c1d06499cce0d61e147bb3f4f..7fe674d6a5f0846522e3cf4ceb86f33e192a5521 100644 (file)
@@ -45,6 +45,7 @@
 #include <inspector/VInspector_ItemFolderObject.hxx>
 #include <inspector/VInspector_ItemOpenGlElement.hxx>
 #include <inspector/VInspector_ItemPresentableObject.hxx>
+#include <inspector/VInspector_PropertiesCreator.hxx>
 #include <inspector/VInspector_PrsOpenGlElement.hxx>
 #include <inspector/VInspector_TableModelValues.hxx>
 #include <inspector/VInspector_ToolBar.hxx>
@@ -127,6 +128,7 @@ VInspector_Window::VInspector_Window()
   //((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());
   myTreeView->setModel (aTreeModel);
   // hide Visibility column
   TreeModel_HeaderSection anItem = aTreeModel->GetHeaderItem ((int)TreeModel_ColumnType_Visibility);
@@ -830,8 +832,6 @@ void VInspector_Window::onExportToShapeView()
 {
   const QModelIndexList anIndices;
   NCollection_List<TopoDS_Shape> aSelectedShapes = GetSelectedShapes (myTreeView->selectionModel()->selectedIndexes());
-  if (aSelectedShapes.Extent() <= 0)
-    return;
 
   TCollection_AsciiString aPluginName ("TKShapeView");
   NCollection_List<Handle(Standard_Transient)> aParameters;
@@ -843,20 +843,42 @@ void VInspector_Window::onExportToShapeView()
     anItemNames = myParameters->GetSelectedNames (aPluginName);
 
   QStringList anExportedPointers;
-  for (NCollection_List<TopoDS_Shape>::Iterator anIOIt (aSelectedShapes); anIOIt.More(); anIOIt.Next())
+  if (aSelectedShapes.Extent() > 0)
   {
-    const TopoDS_Shape& aShape = anIOIt.Value();
-    if (aShape.IsNull())
+    for (NCollection_List<TopoDS_Shape>::Iterator anIOIt (aSelectedShapes); anIOIt.More(); anIOIt.Next())
+    {
+      const TopoDS_Shape& aShape = anIOIt.Value();
+      if (aShape.IsNull())
+        continue;
+      aParameters.Append (aShape.TShape());
+      anItemNames.Append (TInspectorAPI_PluginParameters::ParametersToString(aShape));
+      anExportedPointers.append (VInspector_Tools::GetPointerInfo (aShape.TShape(), true).ToCString());
+    }
+  }
+
+  // seach for objects to be exported
+  QList<TreeModel_ItemBasePtr> anItems = TreeModel_ModelBase::GetSelectedItems (myTreeView->selectionModel()->selectedIndexes());
+  for (QList<TreeModel_ItemBasePtr>::const_iterator anItemIt = anItems.begin(); anItemIt != anItems.end(); anItemIt++)
+  {
+    TreeModel_ItemBasePtr anItem = *anItemIt;
+    VInspector_ItemBasePtr aVItem = itemDynamicCast<VInspector_ItemBase>(anItem);
+    if (!aVItem)
+    continue;
+
+    Handle(Standard_Transient) anObject = aVItem->GetObject();
+    if (anObject.IsNull())
       continue;
-    aParameters.Append (aShape.TShape());
-    anItemNames.Append (TInspectorAPI_PluginParameters::ParametersToString(aShape));
-    anExportedPointers.append (VInspector_Tools::GetPointerInfo (aShape.TShape(), true).ToCString());
+
+    aParameters.Append (anObject);
+    anItemNames.Append (anObject->DynamicType()->Name());
+    anExportedPointers.append (VInspector_Tools::GetPointerInfo (anObject, true).ToCString());
   }
-  if (anExportedPointers.empty())
+
+  if (anExportedPointers.isEmpty())
     return;
 
   TCollection_AsciiString aPluginShortName = aPluginName.SubString (3, aPluginName.Length());
-  QString aMessage = QString ("TShape %1 is sent to %2.")
+  QString aMessage = QString ("Objects %1 are sent to %2.")
     .arg (anExportedPointers.join(", "))
     .arg (aPluginShortName.ToCString());
   QString aQuestion = QString ("Would you like to activate %1 immediately?\n")
index a4f8e6e13e5a4e8b6285d0b455661c58177bf472..76115eb0428cfc068120493a109eff82e80b99c7 100644 (file)
 #include <Standard_Macro.hxx>
 
 #include <inspector/TreeModel_ItemPropertiesCreator.hxx>
-#include <inspector/ViewControl_Pane.hxx>
-
-#include <NCollection_DataMap.hxx>
-#include <TCollection_AsciiString.hxx>
 
 DEFINE_STANDARD_HANDLE (VInspectorPaneAIS_PropertiesCreator, TreeModel_ItemPropertiesCreator)
 
@@ -46,8 +42,6 @@ public:
 
   DEFINE_STANDARD_RTTIEXT(VInspectorPaneAIS_PropertiesCreator, TreeModel_ItemPropertiesCreator)
 
-private:
-  NCollection_DataMap<TCollection_AsciiString, ViewControl_Pane*> myPanes; //!< created panes
 };
 
 #endif 
index 49fa7908287e4456a74f34d809038778ef8b5541..a74d190df18acc397e4254357ab27b11c0423594 100644 (file)
@@ -313,7 +313,7 @@ Handle(Standard_Transient) View_Displayer::CreatePresentation (const TopoDS_Shap
 {
   Handle(AIS_Shape) aShape = new AIS_Shape (theShape);
 
-  aShape->Attributes()->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_WHITE, 1.0));
+  //aShape->Attributes()->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_WHITE, 1.0));
 
   return aShape;
 }
index ef24ca5231d2f85286a3c472673575cf18b195c0..03e8abe6912185e77635e6256e23519e9f0ff6e4 100644 (file)
 #include <Standard_ExtString.hxx>
 #include <Standard_Version.hxx>
 
+#define USE_CLIPPLANE
+
+#ifdef USE_CLIPPLANE
+#include <Graphic3d_ClipPlane.hxx>
+#include <gp_Pln.hxx>
+#endif
+
 // =======================================================================
 // function : CreateView
 // purpose :
 void View_Viewer::CreateView()
 {
   if (myView.IsNull())
+  {
     myView = myContext->CurrentViewer()->CreateView();
+
+#ifdef USE_CLIPPLANE
+    gp_Pln aPln (gp_Pnt (50, 0, 0), gp_Dir (-1., 0., 0.));
+    Handle(Graphic3d_ClipPlane) aClipPlane = new Graphic3d_ClipPlane(aPln);
+    myView->AddClipPlane (aClipPlane);
+#endif
+  }
 }
 
 // =======================================================================
index ad85f4f68f6cea9e32ba182657125d5f53a54dc4..8c21c99ce9c8fa7d26fc5bcad4c64d9548526670 100644 (file)
@@ -8,6 +8,8 @@ ViewControl_Pane.hxx
 ViewControl_PaneCreator.cxx
 ViewControl_PaneCreator.hxx
 ViewControl_PaneItem.hxx
+ViewControl_PropertiesStream.cxx
+ViewControl_PropertiesStream.hxx
 ViewControl_PropertyView.cxx
 ViewControl_PropertyView.hxx
 ViewControl_Table.cxx
diff --git a/tools/ViewControl/ViewControl_PropertiesStream.cxx b/tools/ViewControl/ViewControl_PropertiesStream.cxx
new file mode 100644 (file)
index 0000000..c37ee42
--- /dev/null
@@ -0,0 +1,160 @@
+// Created on: 2019-04-28
+// 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/ViewControl_PropertiesStream.hxx>
+#include <inspector/ViewControl_TransientShape.hxx>
+
+#include <BRepBuilderAPI_MakeVertex.hxx>
+
+#include <Message.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(ViewControl_PropertiesStream, TreeModel_ItemProperties)
+
+// =======================================================================
+// function : Init
+// purpose :
+// =======================================================================
+
+void ViewControl_PropertiesStream::Init()
+{
+  if (!getItem() || !myValues.IsEmpty())
+    return;
+
+  Standard_SStream aSStream;
+  getItem()->Dump (aSStream);
+
+  TCollection_AsciiString aStream (aSStream.str().c_str());
+  Standard_Character aSeparator = Message::DumpSeparator();
+  Standard_Integer aColumnCount = 0;
+
+  TCollection_AsciiString aCurrentString = aStream;
+  Standard_Integer aPosition = aCurrentString.Search (aSeparator);
+  if (aPosition >= 1)
+  {
+    TCollection_AsciiString aTailString = aCurrentString.Split (aPosition);
+    Standard_Boolean aClassNameFound = Standard_False;
+    while (!aCurrentString.IsEmpty())
+    {
+      TCollection_AsciiString aValueString = aCurrentString;
+      aPosition = aValueString.Search (aSeparator);
+      if (aPosition < 0 )
+        break;
+      aCurrentString = aValueString.Split (aPosition - 1);
+
+      if (!aColumnCount)
+      {
+        if (!aClassNameFound)
+          aClassNameFound = Standard_True;
+        else
+        {
+          if (!aValueString.IsIntegerValue())
+            break; // not correct Dump, in correct the first value is number of property columns
+          aColumnCount = aValueString.IntegerValue();
+        }
+      }
+      else
+        myValues.Append (aValueString);
+
+      if (aTailString.IsEmpty())
+        break;
+      aCurrentString = aTailString;
+      aPosition = aCurrentString.Search (aSeparator);
+      if (aPosition < 0 )
+      {
+        aCurrentString = aTailString;
+        aTailString = TCollection_AsciiString();
+      }
+      else
+        aTailString = aCurrentString.Split (aPosition);
+    }
+  }
+  myColumnCount = aColumnCount;
+}
+
+// =======================================================================
+// function : Reset
+// purpose :
+// =======================================================================
+
+void ViewControl_PropertiesStream::Reset()
+{
+  if (!getItem())
+    return;
+  myValues.Clear();
+  myColumnCount = 0;
+}
+
+// =======================================================================
+// function : initItem
+// purpose :
+// =======================================================================
+
+void ViewControl_PropertiesStream::initItem() const
+{
+  const_cast<ViewControl_PropertiesStream*>(this)->Init();
+}
+
+// =======================================================================
+// function : GetTableRowCount
+// purpose :
+// =======================================================================
+
+int ViewControl_PropertiesStream::GetTableRowCount() const
+{
+  initItem();
+
+  return getValues().Length() / myColumnCount;
+}
+
+// =======================================================================
+// function : GetTableData
+// purpose :
+// =======================================================================
+
+QVariant ViewControl_PropertiesStream::GetTableData (const int theRow, const int theColumn, int theRole) const
+{
+  if (theRole != Qt::DisplayRole)
+    return QVariant();
+
+  initItem();
+
+  int anIndex = theRow * myColumnCount + theColumn;
+  if (theRole == Qt::DisplayRole && anIndex < getValues().Length())
+    return getValues().Value(anIndex).ToCString();
+
+  return QVariant();
+}
+
+// =======================================================================
+// function : GetPresentations
+// purpose :
+// =======================================================================
+
+void ViewControl_PropertiesStream::GetPresentations (const int theRow,
+                                                     const int theColumn,
+  NCollection_List<Handle(Standard_Transient)>& thePresentations)
+{
+  if (theColumn == 0)
+    return;
+
+  QVariant aValue = GetTableData (theRow, theColumn, Qt::DisplayRole);
+  TCollection_AsciiString aStrValue = aValue.toString().toStdString().c_str();
+
+  gp_XYZ aPoint;
+  if (!aPoint.FromString (aStrValue))
+    return;
+
+  thePresentations.Append (new ViewControl_TransientShape (BRepBuilderAPI_MakeVertex (aPoint)));
+}
diff --git a/tools/ViewControl/ViewControl_PropertiesStream.hxx b/tools/ViewControl/ViewControl_PropertiesStream.hxx
new file mode 100644 (file)
index 0000000..91730e8
--- /dev/null
@@ -0,0 +1,90 @@
+// Created on: 2019-04-28
+// 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 ViewControl_PropertiesStream_H
+#define ViewControl_PropertiesStream_H
+
+#include <Standard.hxx>
+#include <NCollection_Vector.hxx>
+#include <TCollection_AsciiString.hxx>
+
+#include <inspector/TreeModel_ItemProperties.hxx>
+#include <inspector/TreeModel_ItemBase.hxx>
+
+DEFINE_STANDARD_HANDLE (ViewControl_PropertiesStream, TreeModel_ItemProperties)
+
+//! \class ViewControl_PropertiesStream
+//! \brief This is an interace for ViewControl_TableModel to give real values of the model
+//! It should be filled or redefined.
+class ViewControl_PropertiesStream : public TreeModel_ItemProperties
+{
+public:
+
+  //! Constructor
+  Standard_EXPORT ViewControl_PropertiesStream (const TreeModel_ItemBasePtr& theItem)
+    : TreeModel_ItemProperties (theItem) {}
+
+  //! Destructor
+  virtual ~ViewControl_PropertiesStream() {}
+
+  //! If me has internal values, it should be initialized here.
+  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+
+  //! If the item has internal values, there should be reseted here.
+  Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
+
+  //! Returns number of table columns
+  //! \return an integer value
+  virtual int GetTableColumnCount() const { initItem(); return myColumnCount; }
+
+  //! 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 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;
+
+protected:
+  //! Returns values
+  //! @return values
+  const NCollection_Vector<TCollection_AsciiString>& getValues() const { return myValues; }
+
+protected:
+
+  //! Initialize me.
+  Standard_EXPORT void initItem() const;
+
+public:
+  DEFINE_STANDARD_RTTIEXT (ViewControl_PropertiesStream, TreeModel_ItemProperties)
+
+protected:
+  NCollection_Vector<TCollection_AsciiString> myValues; //!< container of values
+  Standard_Integer myColumnCount; //!< value to present container of values into table
+};
+
+#endif