+
+/*!
+ \brief Indicates whether preselection is enabled
+ \return true if preselection is enabled
+*/
+bool OCCViewer_ViewWindow::isPreselectionEnabled() const
+{
+ return myPreselectionEnabled;
+}
+
+/*!
+ \brief Enables/disables preselection
+ \param theIsToEnable if true - preselection will be enabled
+*/
+void OCCViewer_ViewWindow::enablePreselection( bool theIsToEnable )
+{
+ onSwitchPreselection( theIsToEnable );
+}
+
+/*!
+ \brief Indicates whether selection is enabled
+ \return true if selection is enabled
+*/
+bool OCCViewer_ViewWindow::isSelectionEnabled() const
+{
+ return mySelectionEnabled;
+}
+
+/*!
+ \brief Enables/disables selection
+ \param theIsToEnable if true - selection will be enabled
+*/
+void OCCViewer_ViewWindow::enableSelection( bool theIsToEnable )
+{
+ onSwitchSelection( theIsToEnable );
+}
+
+
+/*!
+ \brief called if clipping operation is activated / deactivated.
+
+ Enables/disables clipping plane displaying.
+
+ \parma on action state
+*/
+void OCCViewer_ViewWindow::onClipping (bool theIsOn)
+{
+ if(!myModel) return;
+ OCCViewer_ClippingDlg* aClippingDlg = myModel->getClippingDlg();
+
+ if (theIsOn) {
+ if (!aClippingDlg) {
+ aClippingDlg = new OCCViewer_ClippingDlg (this, myModel);
+ myModel->setClippingDlg(aClippingDlg);
+ }
+ if (!aClippingDlg->isVisible())
+ aClippingDlg->show();
+ } else {
+ if ( aClippingDlg ) {
+ aClippingDlg->close();
+ myModel->setClippingDlg(0);
+ }
+ }
+
+ SUIT_ViewManager* mgr = getViewManager();
+ if( mgr ) {
+ QVector<SUIT_ViewWindow*> aViews = mgr->getViews();
+ for(int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
+ if(SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
+ QtxActionToolMgr* mgr = aViewWindow->toolMgr();
+ if(!mgr) continue;
+ QAction* a = toolMgr()->action( ClippingId );
+ if(!a) continue;
+ if(theIsOn != a->isChecked()){
+ disconnect (a, SIGNAL (toggled (bool)), aViewWindow, SLOT (onClipping (bool)));
+ a->setChecked(theIsOn);
+ connect (a, SIGNAL (toggled (bool)), aViewWindow, SLOT (onClipping (bool)));
+ }
+ }
+ }
+ }
+}