void ModuleBase_ModelWidget::moveObject(ObjectPtr theObj)
{
- blockUpdateViewer(true);
+ //blockUpdateViewer(true);
static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_MOVED);
ModelAPI_EventCreator::get()->sendUpdated(theObj, anEvent);
Events_Loop::loop()->flush(anEvent);
- blockUpdateViewer(false);
+ //blockUpdateViewer(false);
}
bool ModuleBase_ModelWidget::eventFilter(QObject* theObject, QEvent *theEvent)
aView3d->SetTwist( theTwist );
aView3d->FitAll(0.01, true);
aView3d->SetZSize(0.);
- aView3d->DepthFitAll();
+ if (aView3d->Depth() < 0.1)
+ aView3d->DepthFitAll();
}
}
}
OCCViewer_ViewFrame* aView = dynamic_cast<OCCViewer_ViewFrame*>(aMgr->getActiveView());
if (aView) {
OCCViewer_ViewWindow* aWnd = aView->getView(OCCViewer_ViewFrame::MAIN_VIEW);
- aWnd->getViewPort()->getView()->ZFitAll();
- aWnd->getViewPort()->getView()->DepthFitAll();
+ Handle(V3d_View) aView3d = aWnd->getViewPort()->getView();
+ aView3d->ZFitAll();
+ if (aView3d->Depth() < 0.1)
+ aView3d->DepthFitAll();
}
}
\ No newline at end of file
mySketchMgr->stopNestedSketch(theOperation);
}
- if (isModified) {
- XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
- XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
- aDisplayer->updateViewer();
- }
+ //VSV: Viewer is updated on feature update and redisplay
+ //if (isModified) {
+ // XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
+ // XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+ // aDisplayer->updateViewer();
+ //}
mySketchMgr->onShowConstraintsToggle(myHasConstraintShown);
}
// 6. Update sketcher actions
XGUI_ActionsMgr* anActMgr = workshop()->actionsMgr();
anActMgr->update();
- myWorkshop->viewer()->update();
+ //VSV myWorkshop->viewer()->update();
}
std::shared_ptr<GeomAPI_Pln> PartSet_WidgetSketchLabel::plane() const
connect(workshop()->selector(), SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
activateFilters(true);
- aDisp->updateViewer();
+ //VSV aDisp->updateViewer();
}
void PartSet_WidgetSketchLabel::deactivate()
for (; anIt != aLast; anIt++) {
deactivate(*anIt, false);
}
- if (theUpdateViewer)
- updateViewer();
+ //VSV It seems that there is no necessity to update viewer on deactivation
+ //if (theUpdateViewer)
+ // updateViewer();
}
void XGUI_Displayer::getModesOfActivation(ObjectPtr theObject, QIntList& theModes)
}
AIS_ListIteratorOfListOfInteractive aLIt(aPrsList);
+ bool isActivationChanged = false;
for(aLIt.Initialize(aPrsList); aLIt.More(); aLIt.Next()){
anAISIO = aLIt.Value();
- activate(anAISIO, myActiveSelectionModes, false);
+ if (activate(anAISIO, myActiveSelectionModes, false))
+ isActivationChanged = true;
}
- if (theUpdateViewer)
- updateViewer();
+ // VSV It seems that there is no necessity to update viewer on activation
+ //if (theUpdateViewer && isActivationChanged)
+ // updateViewer();
}
bool XGUI_Displayer::isActive(ObjectPtr theObject) const
void XGUI_Displayer::updateViewer() const
{
+ static int ai = 0;
Handle(AIS_InteractiveContext) aContext = AISContext();
if (!aContext.IsNull() && myEnableUpdateViewer) {
myWorkshop->viewer()->Zfitall();
return ::canBeShaded(anAIS);
}
-void XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO,
+bool XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO,
const QIntList& theModes,
const bool theUpdateViewer) const
{
Handle(AIS_InteractiveContext) aContext = AISContext();
if (aContext.IsNull() || theIO.IsNull())
- return;
-
+ return false;
+
+ bool isActivationChanged = false;
// deactivate object in all modes, which are not in the list of activation
// It seems that after the IO deactivation the selected state of the IO's owners
// is modified in OCC(version: 6.8.0) and the selection of the object later is lost.
// the selection from the previous activation modes should be cleared manually (#26172)
theIO->ClearSelected();
aContext->LocalContext()->ClearOutdatedSelection(theIO, true);
- if (theUpdateViewer)
- updateViewer();
+ // For performance issues
+ //if (theUpdateViewer)
+ // updateViewer();
+ isActivationChanged = true;
}
// loading the interactive object allowing the decomposition
//aContext->Load(anAISIO, aMode, true);
if (!aModesActivatedForIO.contains(aMode)) {
activateAIS(theIO, aMode, theUpdateViewer);
+ isActivationChanged = true;
}
}
}
}
+ return isActivationChanged;
}
bool XGUI_Displayer::customizeObject(ObjectPtr theObject)
/// Activates the interactive object in the local context.
/// \param theIO an interactive object
/// \param theModes - modes on which it has to be activated (can be empty)
- void activate(const Handle(AIS_InteractiveObject)& theIO, const QIntList& theModes,
+ /// \return a flag is object activated or not
+ bool activate(const Handle(AIS_InteractiveObject)& theIO, const QIntList& theModes,
const bool theUpdateViewer) const;
/// Deactivates the given object (not allow selection)
aView3d->SetTwist( theTwist );
aView3d->FitAll(0.01, true);
aView3d->SetZSize(0.);
- aView3d->DepthFitAll();
+ if (aView3d->Depth() < 0.1)
+ aView3d->DepthFitAll();
}
}
AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
AppElements_ViewWindow* aView = aViewer->activeViewWindow();
if (aView) {
- aView->v3dView()->ZFitAll();
- aView->v3dView()->DepthFitAll();
+ Handle(V3d_View) aView3d = aView->v3dView();
+ aView3d->ZFitAll();
+ if (aView3d->Depth() < 0.1)
+ aView3d->DepthFitAll();
}
}
}
\ No newline at end of file
}
}
if (aRedisplayed) {
+ customizeCurrentObject();
+ //VSV FitAll updated viewer by it self
if (aFirstVisualizedBody)
myWorkshop->viewer()->fitAll();
- customizeCurrentObject();
- aDisplayer->updateViewer();
+ else
+ aDisplayer->updateViewer();
}
}
//******************************************************
//if (myObjectBrowser)
// myObjectBrowser->processEvent(theMsg);
if (aDisplayed) {
+ customizeCurrentObject();
+ //VSV FitAll updated viewer by it self
if (aFirstVisualizedBody)
myWorkshop->viewer()->fitAll();
- customizeCurrentObject();
- workshop()->displayer()->updateViewer();
+ else
+ workshop()->displayer()->updateViewer();
}
//if (aHasPart) { // TODO: Avoid activate last part on loading of document
// activateLastPart();