#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;
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;
}
-void PartSet_Fitter::fitScene(Handle(V3d_View) theView)
+void PartSet_Fitter::fitAll(Handle(V3d_View) theView)
{
Bnd_Box aBndBox;
int aNumberOfSubs = mySketch->numberOfSubs();
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);
+ }
+ }
+ }
}
}
}
/// 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;
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()
//{
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();
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)
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
-}
#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();