]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make branch compilable with newer version of SALOME
authormpv <mpv@opencascade.com>
Tue, 17 Sep 2019 14:30:43 +0000 (17:30 +0300)
committermpv <mpv@opencascade.com>
Tue, 17 Sep 2019 14:30:43 +0000 (17:30 +0300)
src/ModuleBase/ModuleBase_IViewer.h
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_SketcherMgr.h
src/SHAPERGUI/SHAPERGUI_SalomeViewer.cpp
src/SHAPERGUI/SHAPERGUI_SalomeViewer.h
src/XGUI/XGUI_ViewerProxy.cpp
src/XGUI/XGUI_ViewerProxy.h

index e4c4a7dcc3c750d87f72603acc3483314d9f4274..d7f1a32c53973ab0f3386df88640ae72d2835fa3 100644 (file)
@@ -199,15 +199,12 @@ Q_OBJECT
 
 #ifdef HAVE_SALOME
   virtual void setFitter(OCCViewer_Fitter* theFitter) = 0;
-  virtual OCCViewer_Fitter* currentFitter() const = 0;
+  virtual OCCViewer_Fitter* fitter() const = 0;
 #else
   virtual void setFitter(AppElements_Fitter* theFitter) = 0;
-  virtual AppElements_Fitter* currentFitter() const = 0;
+  virtual AppElements_Fitter* fitter() const = 0;
 #endif
 
-  virtual void unsetFitter() = 0;
-
-
   static Handle(Prs3d_Drawer) DefaultHighlightDrawer;
 
 
index 0f2b51f3b0c5e7dd43e32df5d7cbb0e9dbfdfc3c..bdc192f3abdcb2bf62f41554e181eb62d0c448e2 100644 (file)
@@ -1107,8 +1107,8 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation)
 void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* theOperation)
 {
   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
-  PartSet_Fitter* aFitter = (PartSet_Fitter*)myModule->workshop()->viewer()->currentFitter();
-  myModule->workshop()->viewer()->unsetFitter();
+  PartSet_Fitter* aFitter = (PartSet_Fitter*)myModule->workshop()->viewer()->fitter();
+  myModule->workshop()->viewer()->setFitter(0);
   delete aFitter;
 
   myIsMouseOverWindow = false;
@@ -2108,7 +2108,7 @@ void PartSet_SketcherMgr::onShowPoints(bool toShow)
 }
 
 
-void PartSet_Fitter::fitScene(Handle(V3d_View) theView)
+void PartSet_Fitter::fitAll(Handle(V3d_View) theView)
 {
   Bnd_Box aBndBox;
   int aNumberOfSubs = mySketch->numberOfSubs();
@@ -2121,11 +2121,22 @@ void PartSet_Fitter::fitScene(Handle(V3d_View) theView)
     for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
       aRes = (*aIt);
       if (aRes->isDisplayed()) {
-        GeomShapePtr aShape = aRes->shape();
-        aShape->computeSize(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
-        Bnd_Box aBox;
-        aBox.Update(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
-        aBndBox.Add(aBox);
+        FeaturePtr aFeature = ModelAPI_Feature::feature(aRes);
+        if (aFeature.get()) {
+          std::shared_ptr<SketchPlugin_SketchEntity> aSPFeature =
+            std::dynamic_pointer_cast<SketchPlugin_SketchEntity>(aFeature);
+          if (aSPFeature.get()) {
+            bool isAxiliary =
+              aSPFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+            if (!(aSPFeature->isExternal() || isAxiliary)) {
+              GeomShapePtr aShape = aRes->shape();
+              aShape->computeSize(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+              Bnd_Box aBox;
+              aBox.Update(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+              aBndBox.Add(aBox);
+            }
+          }
+        }
       }
     }
   }
index 4920caa397ca69145f89b0ccc6c9f417398b62ca..bfc8bfac67c08ef9afd5a86cf501755c8e61fe8d 100644 (file)
@@ -82,7 +82,7 @@ public:
 
   /// A method which has top be reimplemented to provide alterantive implementation FitAll command
   /// \param theView - a view which has to be fit
-  virtual void fitScene(Handle(V3d_View) theView);
+  virtual void fitAll(Handle(V3d_View) theView);
 
 private:
   CompositeFeaturePtr mySketch;
index 92113150bb02d245513679bcefcc0fee1a2b103b..1f0d054f491c861650d04b4d833b68c8a6739529 100644 (file)
@@ -582,19 +582,13 @@ void SHAPERGUI_SalomeViewer::setFitter(OCCViewer_Fitter* theFitter)
     mySelector->viewer()->setFitter(theFitter);
 }
 
-OCCViewer_Fitter* SHAPERGUI_SalomeViewer::currentFitter() const
+OCCViewer_Fitter* SHAPERGUI_SalomeViewer::fitter() const
 {
   if (mySelector)
-    return mySelector->viewer()->currentFitter();
+    return mySelector->viewer()->fitter();
   return 0;
 }
 
-void SHAPERGUI_SalomeViewer::unsetFitter()
-{
-  if (mySelector)
-    mySelector->viewer()->unsetFitter();
-}
-
 
 //void SHAPERGUI_SalomeViewer::Zfitall()
 //{
index ba778d1dfd3f77f251ebef82c65ebefdd8d25f74..97df56cdc392016221cfcc1c3599cab622aab4d5 100644 (file)
@@ -209,8 +209,7 @@ Q_OBJECT
   virtual void setColorScaleTitle(const QString& theText);
 
   virtual void setFitter(OCCViewer_Fitter* theFitter);
-  virtual OCCViewer_Fitter* currentFitter() const;
-  virtual void unsetFitter();
+  virtual OCCViewer_Fitter* fitter() const;
 
   // Fit all along Z (perpendicular to display)
   //virtual void Zfitall();
index 16fe9ee86b46e33a2cb58c0e425c9610547d696f..84e45201eb644966210e7f7a1bfd4ad2401b5223 100644 (file)
@@ -732,9 +732,9 @@ void XGUI_ViewerProxy::setFitter(OCCViewer_Fitter* theFitter)
   myWorkshop->salomeConnector()->viewer()->setFitter(theFitter);
 }
 
-OCCViewer_Fitter* XGUI_ViewerProxy::currentFitter() const
+OCCViewer_Fitter* XGUI_ViewerProxy::fitter() const
 {
-  return myWorkshop->salomeConnector()->viewer()->currentFitter();
+  return myWorkshop->salomeConnector()->viewer()->fitter();
 }
 #else
 void XGUI_ViewerProxy::setFitter(AppElements_Fitter* theFitter)
@@ -742,17 +742,8 @@ void XGUI_ViewerProxy::setFitter(AppElements_Fitter* theFitter)
   myWorkshop->mainWindow()->viewer()->setFitter(theFitter);
 }
 
-AppElements_Fitter* XGUI_ViewerProxy::currentFitter() const
+AppElements_Fitter* XGUI_ViewerProxy::fitter() const
 {
-  return myWorkshop->mainWindow()->viewer()->currentFitter();
+  return myWorkshop->mainWindow()->viewer()->fitter();
 }
 #endif
-
-void XGUI_ViewerProxy::unsetFitter()
-{
-#ifdef HAVE_SALOME
-  myWorkshop->salomeConnector()->viewer()->unsetFitter();
-#else
-  myWorkshop->mainWindow()->viewer()->unsetFitter();
-#endif
-}
index b1cbec119a6dfcfd7fd6e40ae16f0c77842b3175..723aae64437e3a602f05eb63dba01c1294f5f31d 100644 (file)
@@ -171,14 +171,12 @@ Q_OBJECT
 
 #ifdef HAVE_SALOME
   virtual void setFitter(OCCViewer_Fitter* theFitter);
-  virtual OCCViewer_Fitter* currentFitter() const;
+  virtual OCCViewer_Fitter* fitter() const;
 #else
   virtual void setFitter(AppElements_Fitter* theFitter);
-  virtual AppElements_Fitter* currentFitter() const;
+  virtual AppElements_Fitter* fitter() const;
 #endif
 
-  virtual void unsetFitter();
-
 signals:
   /// Emits by mouse entering the view port
   void enterViewPort();