aView->enablePreselection(isEnabled);
}
}
+
+bool OCCViewer_ViewFrame::enableDrawMode( bool on )
+{
+ bool prev = false;
+ foreach (OCCViewer_ViewWindow* aView, myViews) {
+ prev = prev || aView->enableDrawMode( on );
+ }
+ return prev;
+}
virtual bool isPreselectionEnabled() const { return getView(MAIN_VIEW)->isPreselectionEnabled(); }
virtual void enablePreselection( bool );
+ virtual bool enableDrawMode( bool );
+
virtual void setViewManager( SUIT_ViewManager* );
virtual bool eventFilter(QObject* watched, QEvent* e) { return SUIT_ViewWindow::eventFilter(watched, e); }
myClippingDlg = theDlg;
}
}
+
+
+bool OCCViewer_Viewer::enableDrawMode( bool on )
+{
+ //!! To be done for view windows
+ if ( !myViewManager )
+ return false;
+
+ bool prev = false;
+ QVector<SUIT_ViewWindow*> wins = myViewManager->getViews();
+ for ( int i = 0; i < (int)wins.count(); i++ )
+ {
+ OCCViewer_ViewWindow* win = ::qobject_cast<OCCViewer_ViewWindow*>( wins.at( i ) );
+ if ( win ) {
+ prev = prev || win->enableDrawMode( on );
+ }
+ }
+ return prev;
+}
void enableMultiselection(bool isEnable);
bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
+ bool enableDrawMode( bool on );
+
void setClippingColor( const QColor& );
QColor clippingColor() const;
myModel = theModel;
myRestoreFlag = 0;
myEnableDrawMode = false;
+ myDrawRectEnabled = true;
myDrawRect=false;
updateEnabledDrawMode();
myScalingDlg = 0;
return SUIT_ViewWindow::eventFilter(watched, e);
}
+/*!
+ \brief Enable / disable draw rect (rubber band) mode
+*/
+bool OCCViewer_ViewWindow::enableDrawMode( bool on )
+{
+ bool prev = myDrawRectEnabled;
+ myDrawRectEnabled = on;
+ updateEnabledDrawMode();
+ return prev;
+}
+
/*!
\brief Update state of enable draw mode state.
*/
void OCCViewer_ViewWindow::updateEnabledDrawMode()
{
+ myEnableDrawMode = myDrawRectEnabled;
if ( myModel )
- myEnableDrawMode = myModel->isSelectionEnabled() && myModel->isMultiSelectionEnabled();
+ myEnableDrawMode = myEnableDrawMode && myModel->isSelectionEnabled() && myModel->isMultiSelectionEnabled();
}
/*!
virtual void initLayout();
+ virtual bool enableDrawMode( bool );
+
virtual void updateEnabledDrawMode();
virtual void setCuttingPlane( bool on, const double x = 0 , const double y = 0 , const double z = 0,
bool myCursorIsHand;
bool myDrawRect; // set when a rect is used for selection or magnify
bool myEnableDrawMode;
+ bool myDrawRectEnabled;
bool myPaintersRedrawing; // set to draw with external painters
bool IsSketcherStyle;
bool myIsKeyFree;