0025552: Visualization - provide the way to hide the object in specified view of...
[occt.git] / src / Visual3d / Visual3d_View.cxx
index a25e99d..7bfe697 100644 (file)
@@ -53,6 +53,8 @@ Visual3d_View::Visual3d_View (const Handle(Visual3d_ViewManager)& theMgr)
   myAutoZFitScaleFactor (1.0),
   myStructuresUpdated   (Standard_True)
 {
+  myHiddenObjects = new Graphic3d_NMapOfTransient();
+
   MyCView.ViewId                  = theMgr->Identification (this);
   MyCView.Active                  = 0;
   MyCView.IsDeleted               = 0;
@@ -1735,6 +1737,7 @@ Bnd_Box Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
                                      const Standard_Boolean          theToIgnoreInfiniteFlag) const
 {
   Bnd_Box aResult;
+  const Standard_Integer aViewId = MyCView.ViewId;
   for (Graphic3d_MapIteratorOfMapOfStructure aStructIter (theSet); aStructIter.More(); aStructIter.Next())
   {
     const Handle(Graphic3d_Structure)& aStructure = aStructIter.Key();
@@ -1742,6 +1745,11 @@ Bnd_Box Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
     {
       continue;
     }
+    else if (!aStructIter.Value()->CStructure()->ViewAffinity.IsNull()
+          && !aStructIter.Value()->CStructure()->ViewAffinity->IsVisible (aViewId))
+    {
+      continue;
+    }
 
     addStructureBndBox (aStructure, theToIgnoreInfiniteFlag, aResult);
   }
@@ -2690,3 +2698,21 @@ Standard_Boolean Visual3d_View::Print (const Handle(Visual3d_Layer)& theUnderLay
                                  thePrintDC, theToShowBackground, theFilename,
                                  thePrintAlgorithm, theScaleFactor);
 }
+
+//=============================================================================
+//function : HiddenObjects
+//purpose  :
+//=============================================================================
+const Handle(Graphic3d_NMapOfTransient)& Visual3d_View::HiddenObjects() const
+{
+  return myHiddenObjects;
+}
+
+//=============================================================================
+//function : HiddenObjects
+//purpose  :
+//=============================================================================
+Handle(Graphic3d_NMapOfTransient)& Visual3d_View::ChangeHiddenObjects()
+{
+  return myHiddenObjects;
+}