]> OCCT Git - occt-copy.git/commitdiff
0031220: Visualization - remove internal field of viewer selector in context
authorachesnok <achesnok@opencascade.com>
Thu, 29 Jul 2021 10:28:19 +0000 (13:28 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 12 Aug 2021 15:57:05 +0000 (18:57 +0300)
- Removed myMainSel field from AIS_InteractiveContext and obtained this value from mgrSelector.
- Moved SelectMgr_ViewerSelector3d implementation into SelectMgr_ViewerSelector to get rid of redundant separation and extra DownCast's.
- Declared SelectMgr_ViewerSelector3d as deprecated.

src/AIS/AIS_InteractiveContext.cxx
src/AIS/AIS_InteractiveContext.hxx
src/SelectMgr/FILES
src/SelectMgr/SelectMgr_SelectionImageFiller.hxx
src/SelectMgr/SelectMgr_ViewerSelector.cxx
src/SelectMgr/SelectMgr_ViewerSelector.hxx
src/SelectMgr/SelectMgr_ViewerSelector3d.cxx [deleted file]
src/SelectMgr/SelectMgr_ViewerSelector3d.hxx
src/StdSelect/StdSelect_ViewerSelector3d.hxx

index c45cdad69f7294e047413d088d2a43220f51964c..0f712b50e2481674ea3c5493b5fd2b5777363dda 100644 (file)
@@ -31,7 +31,6 @@
 #include <Prs3d_PointAspect.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 #include <SelectMgr_EntityOwner.hxx>
-#include <SelectMgr_SelectionManager.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TColStd_MapIteratorOfMapOfTransient.hxx>
 #include <TopLoc_Location.hxx>
@@ -110,7 +109,6 @@ namespace
 AIS_InteractiveContext::AIS_InteractiveContext(const Handle(V3d_Viewer)& MainViewer):
 myMainPM (new PrsMgr_PresentationManager (MainViewer->StructureManager())),
 myMainVwr(MainViewer),
-myMainSel(new StdSelect_ViewerSelector3d()),
 myToHilightSelected(Standard_True),
 mySelection(new AIS_Selection()),
 myFilters (new SelectMgr_AndOrFilter(SelectMgr_FilterType_OR)),
@@ -121,7 +119,7 @@ myPickingStrategy (SelectMgr_PickingStrategy_FirstAcceptable),
 myAutoHilight(Standard_True),
 myIsAutoActivateSelMode(Standard_True)
 {
-  mgrSelector = new SelectMgr_SelectionManager (myMainSel);
+  mgrSelector = new SelectMgr_SelectionManager (new StdSelect_ViewerSelector3d());
 
   myStyles[Prs3d_TypeOfHighlight_None]          = myDefaultDrawer;
   myStyles[Prs3d_TypeOfHighlight_Selected]      = new Prs3d_Drawer();
@@ -1867,7 +1865,7 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
   // Object removes from Detected sequence
   for (Standard_Integer aDetIter = myDetectedSeq.Lower(); aDetIter <= myDetectedSeq.Upper();)
   {
-    Handle(SelectMgr_EntityOwner) aPicked = myMainSel->Picked (myDetectedSeq (aDetIter));
+    Handle(SelectMgr_EntityOwner) aPicked = MainSelector()->Picked (myDetectedSeq (aDetIter));
     Handle(AIS_InteractiveObject) anObj;
     if (!aPicked.IsNull())
     {
@@ -1970,7 +1968,7 @@ Standard_Boolean AIS_InteractiveContext::ClearDetected (Standard_Boolean theToRe
     clearDynamicHighlight();
   }
   myLastPicked.Nullify();
-  myMainSel->ClearPicked();
+  MainSelector()->ClearPicked();
   if (toUpdate && theToRedrawImmediate)
   {
     myMainVwr->RedrawImmediate();
@@ -2023,7 +2021,7 @@ Standard_Integer AIS_InteractiveContext::IsoNumber (const AIS_TypeOfIso theType)
 //=======================================================================
 void AIS_InteractiveContext::SetPixelTolerance (const Standard_Integer thePrecision)
 {
-  myMainSel->SetPixelTolerance (thePrecision);
+  MainSelector()->SetPixelTolerance (thePrecision);
 }
 
 //=======================================================================
@@ -2032,7 +2030,7 @@ void AIS_InteractiveContext::SetPixelTolerance (const Standard_Integer thePrecis
 //=======================================================================
 Standard_Integer AIS_InteractiveContext::PixelTolerance() const
 {
-  return myMainSel->PixelTolerance();
+  return MainSelector()->PixelTolerance();
 }
 
 //=======================================================================
@@ -2164,7 +2162,7 @@ Graphic3d_ZLayerId AIS_InteractiveContext::GetZLayer (const Handle(AIS_Interacti
 //=======================================================================
 void AIS_InteractiveContext::RebuildSelectionStructs()
 {
-  myMainSel->RebuildObjectsTree (Standard_True);
+  MainSelector()->RebuildObjectsTree (Standard_True);
 }
 
 //=======================================================================
@@ -2613,7 +2611,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer  th
   {
     throw Standard_ProgramError ("AIS_InteractiveContext::MoveTo() - invalid argument");
   }
-  myMainSel->Pick (theXPix, theYPix, theView);
+  MainSelector()->Pick (theXPix, theYPix, theView);
   return moveTo (theView, theToRedrawOnUpdate);
 }
 
@@ -2629,7 +2627,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const gp_Ax1& theAxis,
   {
     throw Standard_ProgramError ("AIS_InteractiveContext::MoveTo() - invalid argument");
   }
-  myMainSel->Pick (theAxis, theView);
+  MainSelector()->Pick (theAxis, theView);
   return moveTo (theView, theToRedrawOnUpdate);
 }
 
@@ -2653,12 +2651,12 @@ AIS_StatusOfDetection AIS_InteractiveContext::moveTo (const Handle(V3d_View)& th
 
   // filling of myAISDetectedSeq sequence storing information about detected AIS objects
   // (the objects must be AIS_Shapes)
-  const Standard_Integer aDetectedNb = myMainSel->NbPicked();
+  const Standard_Integer aDetectedNb = MainSelector()->NbPicked();
   Standard_Integer aNewDetected = 0;
   Standard_Boolean toIgnoreDetTop = Standard_False;
   for (Standard_Integer aDetIter = 1; aDetIter <= aDetectedNb; ++aDetIter)
   {
-    Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aDetIter);
+    Handle(SelectMgr_EntityOwner) anOwner = MainSelector()->Picked (aDetIter);
     if (anOwner.IsNull()
      || !myFilters->IsOk (anOwner))
     {
@@ -2688,7 +2686,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::moveTo (const Handle(V3d_View)& th
     // selection in current selection mode. It is necessary to check the current detected
     // entity and hilight it only if the detected entity is not the same as
     // previous detected (IsForcedHilight call)
-    Handle(SelectMgr_EntityOwner) aNewPickedOwner = myMainSel->Picked (aNewDetected);
+    Handle(SelectMgr_EntityOwner) aNewPickedOwner = MainSelector()->Picked (aNewDetected);
     if (aNewPickedOwner == myLastPicked && !aNewPickedOwner->IsForcedHilight())
     {
       return myLastPicked->IsSelected()
@@ -2809,15 +2807,15 @@ AIS_StatusOfPick AIS_InteractiveContext::SelectRectangle (const Graphic3d_Vec2i&
   }
 
   myLastActiveView = theView.get();
-  myMainSel->Pick (thePntMin.x(), thePntMin.y(), thePntMax.x(), thePntMax.y(), theView);
+  MainSelector()->Pick (thePntMin.x(), thePntMin.y(), thePntMax.x(), thePntMax.y(), theView);
 
   AIS_NArray1OfEntityOwner aPickedOwners;
-  if (myMainSel->NbPicked() > 0)
+  if (MainSelector()->NbPicked() > 0)
   {
-    aPickedOwners.Resize (1, myMainSel->NbPicked(), false);
-    for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
+    aPickedOwners.Resize (1, MainSelector()->NbPicked(), false);
+    for (Standard_Integer aPickIter = 1; aPickIter <= MainSelector()->NbPicked(); ++aPickIter)
     {
-      aPickedOwners.SetValue (aPickIter, myMainSel->Picked (aPickIter));
+      aPickedOwners.SetValue (aPickIter, MainSelector()->Picked (aPickIter));
     }
   }
 
@@ -2838,15 +2836,15 @@ AIS_StatusOfPick AIS_InteractiveContext::SelectPolygon (const TColgp_Array1OfPnt
   }
 
   myLastActiveView = theView.get();
-  myMainSel->Pick (thePolyline, theView);
+  MainSelector()->Pick (thePolyline, theView);
 
   AIS_NArray1OfEntityOwner aPickedOwners;
-  if (myMainSel->NbPicked() > 0)
+  if (MainSelector()->NbPicked() > 0)
   {
-    aPickedOwners.Resize (1, myMainSel->NbPicked(), false);
-    for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
+    aPickedOwners.Resize (1, MainSelector()->NbPicked(), false);
+    for (Standard_Integer aPickIter = 1; aPickIter <= MainSelector()->NbPicked(); ++aPickIter)
     {
-      aPickedOwners.SetValue (aPickIter, myMainSel->Picked (aPickIter));
+      aPickedOwners.SetValue (aPickIter, MainSelector()->Picked (aPickIter));
     }
   }
 
@@ -2867,15 +2865,15 @@ AIS_StatusOfPick AIS_InteractiveContext::SelectPoint (const Graphic3d_Vec2i&
   }
 
   myLastActiveView = theView.get();
-  myMainSel->Pick (thePnt.x(), thePnt.y(), theView);
+  MainSelector()->Pick (thePnt.x(), thePnt.y(), theView);
 
   AIS_NArray1OfEntityOwner aPickedOwners;
-  if (myMainSel->NbPicked() > 0)
+  if (MainSelector()->NbPicked() > 0)
   {
-    aPickedOwners.Resize (1, myMainSel->NbPicked(), false);
-    for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
+    aPickedOwners.Resize (1, MainSelector()->NbPicked(), false);
+    for (Standard_Integer aPickIter = 1; aPickIter <= MainSelector()->NbPicked(); ++aPickIter)
     {
-      aPickedOwners.SetValue (aPickIter, myMainSel->Picked (aPickIter));
+      aPickedOwners.SetValue (aPickIter, MainSelector()->Picked (aPickIter));
     }
   }
 
@@ -2891,7 +2889,7 @@ AIS_StatusOfPick AIS_InteractiveContext::SelectDetected (const AIS_SelectionSche
   if (theSelScheme == AIS_SelectionScheme_Replace && !myLastPicked.IsNull())
   {
     Graphic3d_Vec2i aMousePos (-1, -1);
-    gp_Pnt2d aMouseRealPos = myMainSel->GetManager().GetMousePosition();
+    gp_Pnt2d aMouseRealPos = MainSelector()->GetManager().GetMousePosition();
     if (!Precision::IsInfinite (aMouseRealPos.X()) &&
         !Precision::IsInfinite (aMouseRealPos.Y()))
     {
@@ -3030,7 +3028,7 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_NArray1OfEntityOwner&
     }
   }
 
-  mySelection->SelectOwners (theOwners, theSelScheme, myMainSel->GetManager().IsOverlapAllowed(), myFilters);
+  mySelection->SelectOwners (theOwners, theSelScheme, MainSelector()->GetManager().IsOverlapAllowed(), myFilters);
 
   if (myAutoHilight)
   {
@@ -3612,7 +3610,7 @@ Standard_Integer AIS_InteractiveContext::HilightNextDetected (const Handle(V3d_V
   {
     myCurHighlighted = myDetectedSeq.Lower();
   }
-  const Handle(SelectMgr_EntityOwner)& anOwner = myMainSel->Picked (myDetectedSeq (myCurHighlighted));
+  const Handle(SelectMgr_EntityOwner)& anOwner = MainSelector()->Picked (myDetectedSeq (myCurHighlighted));
   if (anOwner.IsNull())
   {
     return 0;
@@ -3647,7 +3645,7 @@ Standard_Integer AIS_InteractiveContext::HilightPreviousDetected (const Handle(V
   {
     myCurHighlighted = myDetectedSeq.Upper();
   }
-  const Handle(SelectMgr_EntityOwner)& anOwner = myMainSel->Picked (myDetectedSeq (myCurHighlighted));
+  const Handle(SelectMgr_EntityOwner)& anOwner = MainSelector()->Picked (myDetectedSeq (myCurHighlighted));
   if (anOwner.IsNull())
   {
     return 0;
@@ -3672,7 +3670,7 @@ Standard_Integer AIS_InteractiveContext::HilightPreviousDetected (const Handle(V
 Handle(SelectMgr_EntityOwner) AIS_InteractiveContext::DetectedCurrentOwner() const
 {
   return MoreDetected()
-       ? myMainSel->Picked (myDetectedSeq (myCurDetected))
+       ? MainSelector()->Picked (myDetectedSeq (myCurDetected))
        : Handle(SelectMgr_EntityOwner)();
 }
 
@@ -3699,7 +3697,7 @@ const TopoDS_Shape& AIS_InteractiveContext::DetectedCurrentShape() const
 Handle(AIS_InteractiveObject) AIS_InteractiveContext::DetectedCurrentObject() const
 {
   return MoreDetected()
-       ? Handle(AIS_InteractiveObject)::DownCast (myMainSel->Picked (myDetectedSeq (myCurDetected))->Selectable())
+       ? Handle(AIS_InteractiveObject)::DownCast (MainSelector()->Picked (myDetectedSeq (myCurDetected))->Selectable())
        : Handle(AIS_InteractiveObject)();
 }
 
@@ -3930,7 +3928,7 @@ void AIS_InteractiveContext::SubIntensityOff (const Handle(AIS_InteractiveObject
 //=======================================================================
 void AIS_InteractiveContext::DisplayActiveSensitive(const Handle(V3d_View)& theView)
 {
-  myMainSel->DisplaySensitive (theView);
+  MainSelector()->DisplaySensitive (theView);
 }
 
 //=======================================================================
@@ -3949,7 +3947,7 @@ void AIS_InteractiveContext::DisplayActiveSensitive (const Handle(AIS_Interactiv
   for (TColStd_ListIteratorOfListOfInteger aModeIter ((*aStatus)->SelectionModes()); aModeIter.More(); aModeIter.Next())
   {
     const Handle(SelectMgr_Selection)& aSel = theObj->Selection (aModeIter.Value());
-    myMainSel->DisplaySensitive (aSel, theObj->Transformation(), theView, Standard_False);
+    MainSelector()->DisplaySensitive (aSel, theObj->Transformation(), theView, Standard_False);
   }
 }
 
@@ -3959,7 +3957,7 @@ void AIS_InteractiveContext::DisplayActiveSensitive (const Handle(AIS_Interactiv
 //=======================================================================
 void AIS_InteractiveContext::ClearActiveSensitive (const Handle(V3d_View)& theView)
 {
-  myMainSel->ClearSensitive (theView);
+  MainSelector()->ClearSensitive (theView);
 }
 
 //=======================================================================
@@ -4091,7 +4089,6 @@ void AIS_InteractiveContext::DumpJson (Standard_OStream& theOStream, Standard_In
   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, mgrSelector.get())
   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMainPM.get())
   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMainVwr.get())
-  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myMainSel.get())
   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myLastActiveView)
 
   OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myLastPicked.get())
index 9d2663bbc07df7551b114d7eaebc078573d988d8..34612ced447edf83f879e60854b090d1cd1cad1e 100644 (file)
@@ -38,6 +38,7 @@
 #include <SelectMgr_IndexedMapOfOwner.hxx>
 #include <SelectMgr_ListOfFilter.hxx>
 #include <SelectMgr_PickingStrategy.hxx>
+#include <SelectMgr_SelectionManager.hxx>
 #include <StdSelect_ViewerSelector3d.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
@@ -45,7 +46,6 @@
 #include <TopAbs_ShapeEnum.hxx>
 #include <Quantity_Color.hxx>
 
-class SelectMgr_SelectionManager;
 class V3d_Viewer;
 class V3d_View;
 class TopLoc_Location;
@@ -800,7 +800,7 @@ public: //! @name common properties
 
   const Handle(PrsMgr_PresentationManager)& MainPrsMgr() const { return myMainPM; }
 
-  const Handle(StdSelect_ViewerSelector3d)& MainSelector() const { return myMainSel; }
+  const Handle(StdSelect_ViewerSelector3d)& MainSelector() const { return mgrSelector->Selector(); }
 
   //! Updates the current viewer.
   Standard_EXPORT void UpdateCurrentViewer();
@@ -1457,7 +1457,6 @@ protected: //! @name internal fields
   Handle(SelectMgr_SelectionManager) mgrSelector;
   Handle(PrsMgr_PresentationManager) myMainPM;
   Handle(V3d_Viewer) myMainVwr;
-  Handle(StdSelect_ViewerSelector3d) myMainSel;
   V3d_View* myLastActiveView;
   Handle(SelectMgr_EntityOwner) myLastPicked;
   Standard_Boolean myToHilightSelected;
index 82bc6096f0034254079cc1a627b9bb2441f3c087..887b67f019b9bb75d633c5b6eb171abe329bac5d 100755 (executable)
@@ -67,5 +67,4 @@ SelectMgr_ViewClipRange.cxx
 SelectMgr_ViewClipRange.hxx
 SelectMgr_ViewerSelector.cxx
 SelectMgr_ViewerSelector.hxx
-SelectMgr_ViewerSelector3d.cxx
 SelectMgr_ViewerSelector3d.hxx
index 5d3f0909325bfe8e6b2fabed047ca71c20121e5b..90a7277ec1faf59d98687b4478871427944898f3 100644 (file)
@@ -23,7 +23,7 @@
 class SelectMgr_ViewerSelector;
 
 //! Abstract class for filling pixel with color.
-//! This is internal tool for SelectMgr_ViewerSelector3d::ToPixMap().
+//! This is internal tool for SelectMgr_ViewerSelector::ToPixMap().
 class SelectMgr_SelectionImageFiller : public Standard_Transient
 {
 public:
index d1e646928e95ada38f3559479c83fc935b8ec34a..42c8028fba9c5f76db22e656366e3fbf740b4fd3 100644 (file)
 #include <Precision.hxx>
 #include <Select3D_SensitiveEntity.hxx>
 #include <SelectBasics_PickResult.hxx>
+#include <SelectMgr.hxx>
 #include <SelectMgr_EntityOwner.hxx>
 #include <SelectMgr_FrustumBuilder.hxx>
-#include <SelectMgr_SortCriterion.hxx>
+#include <SelectMgr_SelectionImageFiller.hxx>
 #include <SelectMgr_SensitiveEntitySet.hxx>
+#include <SelectMgr_SortCriterion.hxx>
 #include <TColStd_Array1OfInteger.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <TColStd_HArray1OfInteger.hxx>
 #include <TColStd_ListOfInteger.hxx>
+#include <V3d_View.hxx>
 
 #include <algorithm>
 
@@ -297,6 +300,30 @@ void SelectMgr_ViewerSelector::checkOverlap (const Handle(Select3D_SensitiveEnti
   }
 }
 
+//=======================================================================
+// Function: updateZLayers
+// Purpose :
+//=======================================================================
+void SelectMgr_ViewerSelector::updateZLayers (const Handle(V3d_View)& theView)
+{
+  myZLayerOrderMap.Clear();
+  TColStd_SequenceOfInteger aZLayers;
+  theView->Viewer()->GetAllZLayers (aZLayers);
+  Standard_Integer aPos = 0;
+  Standard_Boolean isPrevDepthWrite = true;
+  for (TColStd_SequenceOfInteger::Iterator aLayerIter (aZLayers); aLayerIter.More(); aLayerIter.Next())
+  {
+    Graphic3d_ZLayerSettings aSettings = theView->Viewer()->ZLayerSettings (aLayerIter.Value());
+    if (aSettings.ToClearDepth()
+     || isPrevDepthWrite != aSettings.ToEnableDepthWrite())
+    {
+      ++aPos;
+    }
+    isPrevDepthWrite = aSettings.ToEnableDepthWrite();
+    myZLayerOrderMap.Bind (aLayerIter.Value(), aPos);
+  }
+}
+
 //=======================================================================
 // function: computeFrustum
 // purpose :
@@ -1125,6 +1152,208 @@ void SelectMgr_ViewerSelector::AllowOverlapDetection (const Standard_Boolean the
   mySelectingVolumeMgr.AllowOverlapDetection (theIsToAllow);
 }
 
+//=======================================================================
+// Function: Pick
+// Purpose :
+//=======================================================================
+void SelectMgr_ViewerSelector::Pick (const Standard_Integer theXPix,
+                                     const Standard_Integer theYPix,
+                                     const Handle(V3d_View)& theView)
+{
+  updateZLayers (theView);
+
+  gp_Pnt2d aMousePos (static_cast<Standard_Real> (theXPix),
+                      static_cast<Standard_Real> (theYPix));
+  mySelectingVolumeMgr.InitPointSelectingVolume (aMousePos);
+
+  mySelectingVolumeMgr.SetPixelTolerance (myTolerances.Tolerance());
+  mySelectingVolumeMgr.SetCamera (theView->Camera());
+  Standard_Integer aWidth = 0, aHeight = 0;
+  theView->Window()->Size (aWidth, aHeight);
+  mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
+
+  mySelectingVolumeMgr.BuildSelectingVolume();
+  mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
+
+  TraverseSensitives();
+}
+
+//=======================================================================
+// Function: Pick
+// Purpose :
+//=======================================================================
+void SelectMgr_ViewerSelector::Pick (const Standard_Integer theXPMin,
+                                     const Standard_Integer theYPMin,
+                                     const Standard_Integer theXPMax,
+                                     const Standard_Integer theYPMax,
+                                     const Handle(V3d_View)& theView)
+{
+  updateZLayers (theView);
+
+  gp_Pnt2d aMinMousePos (static_cast<Standard_Real> (theXPMin),
+                         static_cast<Standard_Real> (theYPMin));
+  gp_Pnt2d aMaxMousePos (static_cast<Standard_Real> (theXPMax),
+                         static_cast<Standard_Real> (theYPMax));
+  mySelectingVolumeMgr.InitBoxSelectingVolume (aMinMousePos,
+                                               aMaxMousePos);
+
+  mySelectingVolumeMgr.SetCamera (theView->Camera());
+  Standard_Integer aWidth = 0, aHeight = 0;
+  theView->Window()->Size (aWidth, aHeight);
+  mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
+
+  mySelectingVolumeMgr.BuildSelectingVolume();
+  mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
+  TraverseSensitives();
+}
+
+//=======================================================================
+// Function: Pick
+// Purpose : Selection using a polyline
+//=======================================================================
+void SelectMgr_ViewerSelector::Pick (const TColgp_Array1OfPnt2d& thePolyline,
+                                     const Handle(V3d_View)& theView)
+{
+  updateZLayers (theView);
+
+  mySelectingVolumeMgr.InitPolylineSelectingVolume (thePolyline);
+  mySelectingVolumeMgr.SetCamera (theView->Camera());
+  Standard_Integer aWidth = 0, aHeight = 0;
+  theView->Window()->Size (aWidth, aHeight);
+  mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
+  mySelectingVolumeMgr.BuildSelectingVolume();
+  mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
+
+  TraverseSensitives();
+}
+
+//=======================================================================
+// Function: Pick
+// Purpose :
+//=======================================================================
+void SelectMgr_ViewerSelector::Pick (const gp_Ax1& theAxis,
+                                     const Handle(V3d_View)& theView)
+{
+  updateZLayers (theView);
+
+  mySelectingVolumeMgr.InitAxisSelectingVolume (theAxis);
+  mySelectingVolumeMgr.BuildSelectingVolume();
+  mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
+
+  TraverseSensitives();
+}
+
+//=======================================================================
+//function : ToPixMap
+//purpose  :
+//=======================================================================
+Standard_Boolean SelectMgr_ViewerSelector::ToPixMap (Image_PixMap& theImage,
+                                                     const Handle(V3d_View)& theView,
+                                                     const StdSelect_TypeOfSelectionImage theType,
+                                                     const Standard_Integer               thePickedIndex)
+{
+  if (theImage.IsEmpty())
+  {
+    throw Standard_ProgramError ("SelectMgr_ViewerSelector::ToPixMap() has been called with empty image");
+  }
+
+  Handle(SelectMgr_SelectionImageFiller) aFiller = SelectMgr_SelectionImageFiller::CreateFiller (theImage, this, theType);
+  if (aFiller.IsNull())
+  {
+    return Standard_False;
+  }
+
+  const Standard_Integer aSizeX = static_cast<Standard_Integer> (theImage.SizeX());
+  const Standard_Integer aSizeY = static_cast<Standard_Integer> (theImage.SizeY());
+  for (Standard_Integer aRowIter = 0; aRowIter < aSizeY; ++aRowIter)
+  {
+    for (Standard_Integer aColIter = 0; aColIter < aSizeX; ++aColIter)
+    {
+      Pick (aColIter, aRowIter, theView);
+      aFiller->Fill (aColIter, aRowIter, thePickedIndex);
+    }
+  }
+  aFiller->Flush();
+  return Standard_True;
+}
+
+//=======================================================================
+// Function: DisplaySensitive.
+// Purpose : Display active primitives.
+//=======================================================================
+void SelectMgr_ViewerSelector::DisplaySensitive (const Handle(V3d_View)& theView)
+{
+  for (SelectMgr_SelectableObjectSet::Iterator aSelectableIt (mySelectableObjects); aSelectableIt.More(); aSelectableIt.Next())
+  {
+    Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
+    const Handle (SelectMgr_SelectableObject)& anObj = aSelectableIt.Value();
+    for (SelectMgr_SequenceOfSelection::Iterator aSelIter (anObj->Selections()); aSelIter.More(); aSelIter.Next())
+    {
+      if (aSelIter.Value()->GetSelectionState() == SelectMgr_SOS_Activated)
+      {
+        SelectMgr::ComputeSensitivePrs (aStruct, aSelIter.Value(), anObj->Transformation(), anObj->TransformPersistence());
+      }
+    }
+
+    myStructs.Append (aStruct);
+  }
+
+  for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructs); aStructIter.More(); aStructIter.Next())
+  {
+    Handle(Graphic3d_Structure)& aStruct = aStructIter.ChangeValue();
+    aStruct->SetDisplayPriority (10);
+    aStruct->Display();
+  }
+
+  theView->Update();
+}
+
+//=======================================================================
+// Function: ClearSensitive
+// Purpose :
+//=======================================================================
+void SelectMgr_ViewerSelector::ClearSensitive (const Handle(V3d_View)& theView)
+{
+  for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructs); aStructIter.More(); aStructIter.Next())
+  {
+    const Handle(Graphic3d_Structure)& aPrs = aStructIter.ChangeValue();
+    aPrs->Erase();
+    aPrs->Clear();
+    aPrs->Remove();
+  }
+  myStructs.Clear();
+
+  if (!theView.IsNull())
+  {
+    theView->Update();
+  }
+}
+
+//=======================================================================
+//function : DisplaySenstive
+//purpose  :
+//=======================================================================
+void SelectMgr_ViewerSelector::DisplaySensitive (const Handle(SelectMgr_Selection)& theSel,
+                                                 const gp_Trsf& theTrsf,
+                                                 const Handle(V3d_View)& theView,
+                                                 const Standard_Boolean theToClearOthers)
+{
+  if (theToClearOthers)
+  {
+    ClearSensitive (theView);
+  }
+
+  Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
+
+  SelectMgr::ComputeSensitivePrs (aStruct, theSel, theTrsf, Handle(Graphic3d_TransformPers)());
+
+  myStructs.Append (aStruct);
+  myStructs.Last()->SetDisplayPriority (10);
+  myStructs.Last()->Display();
+
+  theView->Update();
+}
+
 //=======================================================================
 //function : DumpJson
 //purpose  : 
@@ -1159,6 +1388,13 @@ void SelectMgr_ViewerSelector::DumpJson (Standard_OStream& theOStream, Standard_
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsLeftChildQueuedFirst)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMapOfObjectSensitives.Extent())
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myStructs.Length())
+  for (Graphic3d_SequenceOfStructure::Iterator aStructsIt (myStructs); aStructsIt.More(); aStructsIt.Next())
+  {
+    const Handle(Graphic3d_Structure)& aStructure = aStructsIt.Value();
+    OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, aStructure)
+  }
 }
 
 //=======================================================================
index ef5b6276c8dde3152914e64aa721ca1e0ec242c4..23271d948e33c06d22724474f61b9b82a090bce7 100644 (file)
 #ifndef _SelectMgr_ViewerSelector_HeaderFile
 #define _SelectMgr_ViewerSelector_HeaderFile
 
-#include <Standard_Transient.hxx>
+#include <Graphic3d_SequenceOfStructure.hxx>
 #include <NCollection_DataMap.hxx>
 #include <OSD_Chronometer.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
-#include <TColStd_HArray1OfInteger.hxx>
 #include <Select3D_BVHBuilder3d.hxx>
+#include <SelectMgr_BVHThreadPool.hxx>
 #include <SelectMgr_IndexedDataMapOfOwnerCriterion.hxx>
 #include <SelectMgr_SelectingVolumeManager.hxx>
 #include <SelectMgr_Selection.hxx>
 #include <SelectMgr_StateOfSelection.hxx>
 #include <SelectMgr_ToleranceMap.hxx>
 #include <SelectMgr_TypeOfDepthTolerance.hxx>
+#include <SelectMgr_ViewerSelector.hxx>
 #include <Standard_OStream.hxx>
-#include <SelectMgr_BVHThreadPool.hxx>
+#include <Standard_Transient.hxx>
+#include <StdSelect_TypeOfSelectionImage.hxx>
+#include <TColStd_HArray1OfInteger.hxx>
+#include <TColStd_SequenceOfInteger.hxx>
 
+class Graphic3d_Structure;
+class Graphic3d_TransformPers;
 class SelectMgr_SelectionManager;
 class SelectMgr_SensitiveEntitySet;
 class SelectMgr_EntityOwner;
 class Select3D_SensitiveEntity;
+class V3d_View;
 
 // resolve name collisions with X11 headers
 #ifdef Status
@@ -84,6 +90,9 @@ class SelectMgr_ViewerSelector : public Standard_Transient
   friend class SelectMgr_SelectionManager;
 public:
 
+  //! Constructs an empty selector object.
+  Standard_EXPORT SelectMgr_ViewerSelector();
+
   //! Returns custom pixel tolerance value.
   Standard_Integer CustomPixelTolerance() const { return myTolerances.CustomTolerance(); }
 
@@ -244,6 +253,57 @@ public:
   //! mark both included and overlapped entities as matched
   Standard_EXPORT void AllowOverlapDetection (const Standard_Boolean theIsToAllow);
 
+public:
+
+  //! Picks the sensitive entity at the pixel coordinates of
+  //! the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.
+  Standard_EXPORT void Pick (const Standard_Integer theXPix,
+                             const Standard_Integer theYPix,
+                             const Handle(V3d_View)& theView);
+
+  //! Picks the sensitive entity according to the minimum
+  //! and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax>
+  //! and <theYPMax> defining a 2D area for selection in the 3D view aView.
+  Standard_EXPORT void Pick (const Standard_Integer theXPMin,
+                             const Standard_Integer theYPMin,
+                             const Standard_Integer theXPMax,
+                             const Standard_Integer theYPMax,
+                             const Handle(V3d_View)& theView);
+
+  //! pick action - input pixel values for polyline selection for selection.
+  Standard_EXPORT void Pick (const TColgp_Array1OfPnt2d& thePolyline,
+                             const Handle(V3d_View)& theView);
+
+  //! Picks the sensitive entity according to the input axis.
+  //! This is geometric intersection 3D objects by axis
+  //! (camera parameters are ignored and objects with transform persistance are skipped).
+  Standard_EXPORT void Pick (const gp_Ax1& theAxis,
+                             const Handle(V3d_View)& theView);
+
+  //! Dump of detection results into image.
+  //! This method performs axis picking for each pixel in the image
+  //! and generates a color depending on picking results and selection image type.
+  //! @param theImage       result image, should be initialized
+  //! @param theView        3D view defining camera position
+  //! @param theType        type of image to define
+  //! @param thePickedIndex index of picked entity (1 means topmost)
+  Standard_EXPORT Standard_Boolean ToPixMap (Image_PixMap&                        theImage,
+                                             const Handle(V3d_View)&              theView,
+                                             const StdSelect_TypeOfSelectionImage theType,
+                                             const Standard_Integer               thePickedIndex = 1);
+
+public:
+
+  //! Displays sensitives in view <theView>.
+  Standard_EXPORT void DisplaySensitive (const Handle(V3d_View)& theView);
+
+  Standard_EXPORT void ClearSensitive (const Handle(V3d_View)& theView);
+
+  Standard_EXPORT void DisplaySensitive (const Handle(SelectMgr_Selection)& theSel,
+                                         const gp_Trsf& theTrsf,
+                                         const Handle(V3d_View)& theView,
+                                         const Standard_Boolean theToClearOthers = Standard_True);
+
   //! Dumps the content of me into the stream
   Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
@@ -266,8 +326,6 @@ public:
 
 protected:
 
-  Standard_EXPORT SelectMgr_ViewerSelector();
-
   //! Traverses BVH containing all added selectable objects and
   //! finds candidates for further search of overlap
   Standard_EXPORT void TraverseSensitives();
@@ -292,6 +350,9 @@ protected:
                                      const gp_GTrsf& theInversedTrsf,
                                      SelectMgr_SelectingVolumeManager& theMgr);
 
+  //! Update z-layers order map.
+  Standard_EXPORT void updateZLayers (const Handle(V3d_View)& theView);
+
 private:
 
   //! Checks if the entity given requires to scale current selecting frustum
@@ -349,6 +410,8 @@ protected:
   Standard_Boolean                             myIsLeftChildQueuedFirst;
   SelectMgr_MapOfObjectSensitives              myMapOfObjectSensitives;
 
+  Graphic3d_SequenceOfStructure                myStructs; //!< list of debug presentations
+
 };
 
 DEFINE_STANDARD_HANDLE(SelectMgr_ViewerSelector, Standard_Transient)
diff --git a/src/SelectMgr/SelectMgr_ViewerSelector3d.cxx b/src/SelectMgr/SelectMgr_ViewerSelector3d.cxx
deleted file mode 100644 (file)
index 426fb28..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-// Created on: 1995-03-15
-// Created by: Robert COUBLANC
-// Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2014 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 <SelectMgr_ViewerSelector3d.hxx>
-
-#include <Graphic3d_SequenceOfHClipPlane.hxx>
-#include <Graphic3d_Structure.hxx>
-#include <math_BullardGenerator.hxx>
-#include <Quantity_ColorHasher.hxx>
-#include <TColgp_Array1OfPnt2d.hxx>
-#include <SelectMgr.hxx>
-#include <SelectMgr_EntityOwner.hxx>
-#include <SelectMgr_SelectableObject.hxx>
-#include <SelectMgr_Selection.hxx>
-#include <SelectMgr_SelectionImageFiller.hxx>
-#include <V3d_View.hxx>
-#include <V3d_Viewer.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_ViewerSelector3d, SelectMgr_ViewerSelector)
-
-//=======================================================================
-// Function : Constructor
-// Purpose  :
-//=======================================================================
-SelectMgr_ViewerSelector3d::SelectMgr_ViewerSelector3d()
-{
-  //
-}
-
-//=======================================================================
-// Function: Pick
-// Purpose :
-//=======================================================================
-void SelectMgr_ViewerSelector3d::Pick (const Standard_Integer theXPix,
-                                       const Standard_Integer theYPix,
-                                       const Handle(V3d_View)& theView)
-{
-  updateZLayers (theView);
-
-  gp_Pnt2d aMousePos (static_cast<Standard_Real> (theXPix),
-                      static_cast<Standard_Real> (theYPix));
-  mySelectingVolumeMgr.InitPointSelectingVolume (aMousePos);
-
-  mySelectingVolumeMgr.SetPixelTolerance (myTolerances.Tolerance());
-  mySelectingVolumeMgr.SetCamera (theView->Camera());
-  Standard_Integer aWidth = 0, aHeight = 0;
-  theView->Window()->Size (aWidth, aHeight);
-  mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
-
-  mySelectingVolumeMgr.BuildSelectingVolume();
-  mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
-
-  TraverseSensitives();
-}
-
-//=======================================================================
-// Function: Pick
-// Purpose :
-//=======================================================================
-void SelectMgr_ViewerSelector3d::Pick (const Standard_Integer theXPMin,
-                                       const Standard_Integer theYPMin,
-                                       const Standard_Integer theXPMax,
-                                       const Standard_Integer theYPMax,
-                                       const Handle(V3d_View)& theView)
-{
-  updateZLayers (theView);
-
-  gp_Pnt2d aMinMousePos (static_cast<Standard_Real> (theXPMin),
-                         static_cast<Standard_Real> (theYPMin));
-  gp_Pnt2d aMaxMousePos (static_cast<Standard_Real> (theXPMax),
-                         static_cast<Standard_Real> (theYPMax));
-  mySelectingVolumeMgr.InitBoxSelectingVolume (aMinMousePos,
-                                               aMaxMousePos);
-
-  mySelectingVolumeMgr.SetCamera (theView->Camera());
-  Standard_Integer aWidth = 0, aHeight = 0;
-  theView->Window()->Size (aWidth, aHeight);
-  mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
-
-  mySelectingVolumeMgr.BuildSelectingVolume();
-  mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
-  TraverseSensitives();
-}
-
-//=======================================================================
-// Function: Pick
-// Purpose : Selection using a polyline
-//=======================================================================
-void SelectMgr_ViewerSelector3d::Pick (const TColgp_Array1OfPnt2d& thePolyline,
-                                       const Handle(V3d_View)& theView)
-{
-  updateZLayers (theView);
-
-  mySelectingVolumeMgr.InitPolylineSelectingVolume (thePolyline);
-  mySelectingVolumeMgr.SetCamera (theView->Camera());
-  Standard_Integer aWidth = 0, aHeight = 0;
-  theView->Window()->Size (aWidth, aHeight);
-  mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
-  mySelectingVolumeMgr.BuildSelectingVolume();
-  mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
-
-  TraverseSensitives();
-}
-
-//=======================================================================
-// Function: Pick
-// Purpose :
-//=======================================================================
-void SelectMgr_ViewerSelector3d::Pick (const gp_Ax1& theAxis,
-                                       const Handle(V3d_View)& theView)
-{
-  updateZLayers (theView);
-
-  mySelectingVolumeMgr.InitAxisSelectingVolume (theAxis);
-  mySelectingVolumeMgr.BuildSelectingVolume();
-  mySelectingVolumeMgr.SetViewClipping (theView->ClipPlanes(), Handle(Graphic3d_SequenceOfHClipPlane)(), NULL);
-
-  TraverseSensitives();
-}
-
-//=======================================================================
-// Function: DisplaySensitive.
-// Purpose : Display active primitives.
-//=======================================================================
-void SelectMgr_ViewerSelector3d::DisplaySensitive (const Handle(V3d_View)& theView)
-{
-  for (SelectMgr_SelectableObjectSet::Iterator aSelectableIt (mySelectableObjects); aSelectableIt.More(); aSelectableIt.Next())
-  {
-    Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
-    const Handle (SelectMgr_SelectableObject)& anObj = aSelectableIt.Value();
-    for (SelectMgr_SequenceOfSelection::Iterator aSelIter (anObj->Selections()); aSelIter.More(); aSelIter.Next())
-    {
-      if (aSelIter.Value()->GetSelectionState() == SelectMgr_SOS_Activated)
-      {
-        SelectMgr::ComputeSensitivePrs (aStruct, aSelIter.Value(), anObj->Transformation(), anObj->TransformPersistence());
-      }
-    }
-
-    myStructs.Append (aStruct);
-  }
-
-  for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructs); aStructIter.More(); aStructIter.Next())
-  {
-    Handle(Graphic3d_Structure)& aStruct = aStructIter.ChangeValue();
-    aStruct->SetDisplayPriority (10);
-    aStruct->Display();
-  }
-
-  theView->Update();
-}
-
-//=======================================================================
-// Function: ClearSensitive
-// Purpose :
-//=======================================================================
-void SelectMgr_ViewerSelector3d::ClearSensitive (const Handle(V3d_View)& theView)
-{
-  for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructs); aStructIter.More(); aStructIter.Next())
-  {
-    const Handle(Graphic3d_Structure)& aPrs = aStructIter.ChangeValue();
-    aPrs->Erase();
-    aPrs->Clear();
-    aPrs->Remove();
-  }
-  myStructs.Clear();
-
-  if (!theView.IsNull())
-  {
-    theView->Update();
-  }
-}
-
-//=======================================================================
-//function : DisplaySenstive
-//purpose  :
-//=======================================================================
-void SelectMgr_ViewerSelector3d::DisplaySensitive (const Handle(SelectMgr_Selection)& theSel,
-                                                   const gp_Trsf& theTrsf,
-                                                   const Handle(V3d_View)& theView,
-                                                   const Standard_Boolean theToClearOthers)
-{
-  if (theToClearOthers)
-  {
-    ClearSensitive (theView);
-  }
-
-  Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
-
-  SelectMgr::ComputeSensitivePrs (aStruct, theSel, theTrsf, Handle(Graphic3d_TransformPers)());
-
-  myStructs.Append (aStruct);
-  myStructs.Last()->SetDisplayPriority (10);
-  myStructs.Last()->Display();
-
-  theView->Update();
-}
-
-//=======================================================================
-// Function: updateZLayers
-// Purpose :
-//=======================================================================
-void SelectMgr_ViewerSelector3d::updateZLayers (const Handle(V3d_View)& theView)
-{
-  myZLayerOrderMap.Clear();
-  TColStd_SequenceOfInteger aZLayers;
-  theView->Viewer()->GetAllZLayers (aZLayers);
-  Standard_Integer aPos = 0;
-  Standard_Boolean isPrevDepthWrite = true;
-  for (TColStd_SequenceOfInteger::Iterator aLayerIter (aZLayers); aLayerIter.More(); aLayerIter.Next())
-  {
-    Graphic3d_ZLayerSettings aSettings = theView->Viewer()->ZLayerSettings (aLayerIter.Value());
-    if (aSettings.ToClearDepth()
-     || isPrevDepthWrite != aSettings.ToEnableDepthWrite())
-    {
-      ++aPos;
-    }
-    isPrevDepthWrite = aSettings.ToEnableDepthWrite();
-    myZLayerOrderMap.Bind (aLayerIter.Value(), aPos);
-  }
-}
-
-//=======================================================================
-//function : ToPixMap
-//purpose  :
-//=======================================================================
-Standard_Boolean SelectMgr_ViewerSelector3d::ToPixMap (Image_PixMap&                        theImage,
-                                                       const Handle(V3d_View)&              theView,
-                                                       const StdSelect_TypeOfSelectionImage theType,
-                                                       const Standard_Integer               thePickedIndex)
-{
-  if (theImage.IsEmpty())
-  {
-    throw Standard_ProgramError("SelectMgr_ViewerSelector3d::ToPixMap() has been called with empty image");
-  }
-
-  Handle(SelectMgr_SelectionImageFiller) aFiller = SelectMgr_SelectionImageFiller::CreateFiller (theImage, this, theType);
-  if (aFiller.IsNull())
-  {
-    return Standard_False;
-  }
-
-  const Standard_Integer aSizeX = static_cast<Standard_Integer> (theImage.SizeX());
-  const Standard_Integer aSizeY = static_cast<Standard_Integer> (theImage.SizeY());
-  for (Standard_Integer aRowIter = 0; aRowIter < aSizeY; ++aRowIter)
-  {
-    for (Standard_Integer aColIter = 0; aColIter < aSizeX; ++aColIter)
-    {
-      Pick (aColIter, aRowIter, theView);
-      aFiller->Fill (aColIter, aRowIter, thePickedIndex);
-    }
-  }
-  aFiller->Flush();
-  return Standard_True;
-}
-
-//=======================================================================
-//function : DumpJson
-//purpose  :
-//=======================================================================
-void SelectMgr_ViewerSelector3d::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
-{
-  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
-
-  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myStructs.Length())
-  for (Graphic3d_SequenceOfStructure::Iterator aStructsIt (myStructs); aStructsIt.More(); aStructsIt.Next())
-  {
-    const Handle(Graphic3d_Structure)& aStructure = aStructsIt.Value();
-    OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, aStructure)
-  }
-}
index 4bd237286f30b06278e74d1fed094bfe3641200d..66a886301eaf0def4d5ea76ad1aebe8f649e8c36 100644 (file)
 #ifndef _SelectMgr_ViewerSelector3d_HeaderFile
 #define _SelectMgr_ViewerSelector3d_HeaderFile
 
-#include <Graphic3d_SequenceOfStructure.hxx>
 #include <SelectMgr_ViewerSelector.hxx>
-#include <SelectMgr_Selection.hxx>
-#include <StdSelect_TypeOfSelectionImage.hxx>
 
-class Graphic3d_Structure;
-class Graphic3d_TransformPers;
-class V3d_View;
-
-//! Selector Usable by Viewers from V3d
-class SelectMgr_ViewerSelector3d : public SelectMgr_ViewerSelector
-{
-  DEFINE_STANDARD_RTTIEXT(SelectMgr_ViewerSelector3d, SelectMgr_ViewerSelector)
-public:
-
-  //! Constructs an empty 3D selector object.
-  Standard_EXPORT SelectMgr_ViewerSelector3d();
-
-  //! Picks the sensitive entity at the pixel coordinates of
-  //! the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.
-  Standard_EXPORT void Pick (const Standard_Integer theXPix,
-                             const Standard_Integer theYPix,
-                             const Handle(V3d_View)& theView);
-
-  //! Picks the sensitive entity according to the minimum
-  //! and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax>
-  //! and <theYPMax> defining a 2D area for selection in the 3D view aView.
-  Standard_EXPORT void Pick (const Standard_Integer theXPMin,
-                             const Standard_Integer theYPMin,
-                             const Standard_Integer theXPMax,
-                             const Standard_Integer theYPMax,
-                             const Handle(V3d_View)& theView);
-
-  //! pick action - input pixel values for polyline selection for selection.
-  Standard_EXPORT void Pick (const TColgp_Array1OfPnt2d& thePolyline,
-                             const Handle(V3d_View)& theView);
-
-  //! Picks the sensitive entity according to the input axis.
-  //! This is geometric intersection 3D objects by axis
-  //! (camera parameters are ignored and objects with transform persistance are skipped).
-  Standard_EXPORT void Pick (const gp_Ax1& theAxis,
-                             const Handle(V3d_View)& theView);
-
-  //! Dump of detection results into image.
-  //! This method performs axis picking for each pixel in the image
-  //! and generates a color depending on picking results and selection image type.
-  //! @param theImage       result image, should be initialized
-  //! @param theView        3D view defining camera position
-  //! @param theType        type of image to define
-  //! @param thePickedIndex index of picked entity (1 means topmost)
-  Standard_EXPORT Standard_Boolean ToPixMap (Image_PixMap&                        theImage,
-                                             const Handle(V3d_View)&              theView,
-                                             const StdSelect_TypeOfSelectionImage theType,
-                                             const Standard_Integer               thePickedIndex = 1);
-
-public:
-
-  //! Displays sensitives in view <theView>.
-  Standard_EXPORT void DisplaySensitive (const Handle(V3d_View)& theView);
-
-  Standard_EXPORT void ClearSensitive (const Handle(V3d_View)& theView);
-
-  Standard_EXPORT void DisplaySensitive (const Handle(SelectMgr_Selection)& theSel,
-                                         const gp_Trsf& theTrsf,
-                                         const Handle(V3d_View)& theView,
-                                         const Standard_Boolean theToClearOthers = Standard_True);
-
-  //! Dumps the content of me into the stream
-  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
-
-protected:
-
-  //! Update z-layers order map.
-  Standard_EXPORT void updateZLayers (const Handle(V3d_View)& theView);
-
-protected:
-
-  Graphic3d_SequenceOfStructure myStructs; //!< list of debug presentations
-};
-
-DEFINE_STANDARD_HANDLE(SelectMgr_ViewerSelector3d, SelectMgr_ViewerSelector)
+Standard_DEPRECATED("Deprecated alias to moved class")
+typedef SelectMgr_ViewerSelector SelectMgr_ViewerSelector3d;
 
 #endif
index b109ad0a036e0988f9d810fef7a4da884874cde7..0497ea5207199f7f52b2b726546d868335229cdf 100644 (file)
@@ -14,8 +14,8 @@
 #ifndef _StdSelect_ViewerSelector3d_HeaderFile
 #define _StdSelect_ViewerSelector3d_HeaderFile
 
-#include <SelectMgr_ViewerSelector3d.hxx>
+#include <SelectMgr_ViewerSelector.hxx>
 
-typedef SelectMgr_ViewerSelector3d StdSelect_ViewerSelector3d;
+typedef SelectMgr_ViewerSelector StdSelect_ViewerSelector3d;
 
 #endif // _StdSelect_ViewerSelector3d_HeaderFile