class VISU_PickingSettings;
-
+//! Introduce new style of interaction (keyboard free)
class VVTK_EXPORT VVTK_InteractorStyle : public SVTK_InteractorStyle
{
public:
- // Description:
- // This class must be supplied with a vtkRenderWindowInteractor wrapper or
- // parent. This class should not normally be instantiated by application
- // programmers.
static VVTK_InteractorStyle *New();
vtkTypeMacro(VVTK_InteractorStyle,SVTK_InteractorStyle);
- // redefined in order to add an observer (callback) for custorm event (space mouse event)
+ //! Redefined from SVTK_InteractorStyle::SetInteractor in order to add an observer (callback) for custorm event (space mouse event)
virtual
void
SetInteractor( vtkRenderWindowInteractor* );
+ //! To share the VISU_PickingSettings
void
SetPickingSettings(VISU_PickingSettings* thePickingSettings);
void operator=(const VVTK_InteractorStyle&); // Not implemented
// Generic event bindings must be overridden in subclasses
+
+ //! Redefine SVTK_InteractorStyle::OnLeftButtonDown
virtual void OnLeftButtonDown(int ctrl, int shift, int x, int y);
+
+ //! Redefine SVTK_InteractorStyle::OnMiddleButtonDown
virtual void OnMiddleButtonDown(int ctrl, int shift, int x, int y);
+
+ //! Redefine SVTK_InteractorStyle::OnLeftButtonUp
virtual void OnLeftButtonUp(int ctrl, int shift, int x, int y);
+
+ //! Redefine SVTK_InteractorStyle::OnMiddleButtonUp
virtual void OnMiddleButtonUp(int ctrl, int shift, int x, int y);
+
+ //! Redefine vtkInteractorStyle::OnKeyDown
virtual void OnKeyDown();
+
+ //! Redefine SVTK_InteractorStyle::onFinishOperation
virtual void onFinishOperation();
- // Main process VTK event method
+ //! Main process VTK event method
static
void
ProcessEvents(vtkObject* object,
void* clientData,
void* callData );
+ //! Redefine SVTK_InteractorStyle::onSpaceMouseButton
virtual void onSpaceMouseButton( int button );
+
+ //! To decrease magnification of the Gauss Points
void DecreaseGaussPointMagnification();
+
+ //! To increase magnification of the Gauss Points
void IncreaseGaussPointMagnification();
- // SpaceMouse short cuts
+ //! SpaceMouse short cuts
int mySMDecreaseMagnificationBtn;
int mySMIncreaseMagnificationBtn;
class VVTK_Renderer2;
//----------------------------------------------------------------------------
+//! Customize SVTK_MainWindow to provide VVTK functionality
class VVTK_EXPORT VVTK_MainWindow: public SVTK_MainWindow
{
Q_OBJECT;
public:
+ //! Construct instance of the class
VVTK_MainWindow(QWidget* theParent,
const char* theName,
SUIT_ResourceMgr* theResourceMgr);
+
+ //! Reimplement SVTK_MainWindow::Initialize
virtual
void
Initialize(SVTK_RenderWindowInteractor* theInteractor);
+ //! Destroy instance of the class
virtual
~VVTK_MainWindow();
public slots:
+ //! To change active interactor style at run-time
virtual
void
OnInteractorStyleSwitch(bool theIsGaussStyleOn);
+ //! To change active selection mode at run-time
virtual
void
OnSelectionModeSwitch(bool theIsSelectionOn);
//----------------------------------------------------------------------------
+//! Extend VVTK_MainWindow to implement functionality for base view
class VVTK_EXPORT VVTK_MainWindow1: public VVTK_MainWindow
{
Q_OBJECT;
public:
+ //! Construct instance of the class
VVTK_MainWindow1(QSplitter* theParent,
const char* theName,
SUIT_ResourceMgr* theResourceMgr);
+
+ //! Reimplement VVTK_MainWindow::Initialize
virtual
void
Initialize(SVTK_RenderWindowInteractor* theInteractor,
VVTK_Renderer1* theRenderer);
-
+ //! Destroy instance of the class
virtual
~VVTK_MainWindow1();
+ //! Create instance of the segmented VVTK_MainWindow
+ /*!
+ The two views (VVTK_MainWindow1 and VVTK_MainWindow2) should change its behaviour in the same time.
+ So, it is necessary to synhronize them through sharing some common pointers.
+ */
VVTK_MainWindow2*
CreateMainWindow2(QWidget* theParent,
const char* theName,
SUIT_ResourceMgr* theResourceMgr,
VISU_PickingSettings* thePickingSettings);
+ //! Get contained VISU_ImplicitFunctionWidget
VISU_ImplicitFunctionWidget*
GetImplicitFunctionWidget();
+ //! Get contained VISU_OutsideCursorSettings
VISU_OutsideCursorSettings*
GetOutsideCursorSettings();
+ //! Get contained VISU_PickingSettings
VISU_PickingSettings*
GetPickingSettings();
public slots:
+ //! To activate/ deactivate the segementation cursor at run-time
void
OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn);
+ //! Customize VVTK_MainWindow::OnSelectionModeSwitch
virtual
void
OnSelectionModeSwitch(bool theIsSelectionOn);
protected:
- VVTK_Renderer1* myRenderer;
+ VVTK_Renderer1* myRenderer; //!< Keeps extended version of SVTK_Renderer
- VVTK_MainWindow2* myMainWindow2;
+ VVTK_MainWindow2* myMainWindow2; //!< Refer to segmented view
- QtxAction* myStyleSwitchAction;
- QToolBar* myPtsToolBar;
- QSplitter* mySplitter;
+ QtxAction* myStyleSwitchAction; //!< Action for switch interactor style
+ QToolBar* myPtsToolBar; //!< Additional tool bar
+ //! To implement show/hide segmented view on acttivate/ deactivate segementation cursor
+ QSplitter* mySplitter;
- VVTK_SegmentationCursorDlg* mySegmentationCursorDlg;
- VVTK_PickingDlg* myPickingDlg;
+ VVTK_SegmentationCursorDlg* mySegmentationCursorDlg; //!< Keep reference to VVTK_SegmentationCursorDlg
+ VVTK_PickingDlg* myPickingDlg; //!< Keep reference to VVTK_PickingDlg
};
//----------------------------------------------------------------------------
+//! Extend VVTK_MainWindow to implement functionality for segmented view
class VVTK_EXPORT VVTK_MainWindow2: public VVTK_MainWindow
{
Q_OBJECT;
friend class VVTK_MainWindow1;
+ //! Construct instance of the class
VVTK_MainWindow2(QWidget* theParent,
const char* theName,
SUIT_ResourceMgr* theResourceMgr,
VISU_PickingSettings* thePickingSettings,
QtxAction* theStyleSwitchAction);
public:
+ //! Destroy instance of the class
virtual
~VVTK_MainWindow2();
};
class vtkImplicitFunction;
//----------------------------------------------------------------------------
+//! To customize SVTK_Renderer according to VVTK functionality
class VVTK_EXPORT VVTK_Renderer : public SVTK_Renderer
{
public:
vtkTypeMacro(VVTK_Renderer,SVTK_Renderer);
static VVTK_Renderer* New();
+ //! Reimplement SVTK_Renderer::AddActor
+ /*!
+ Perform an additional action - apply picking settings on the published VISU_GaussPtsAct actors
+ */
virtual
void
AddActor(VTKViewer_Actor* theActor);
+ //! Reimplement SVTK_Renderer::RemoveActor (remove additional settings)
virtual
void
RemoveActor(VTKViewer_Actor* theActor);
+ //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct actors published into the view
void
SetPickingSettings(VISU_PickingSettings* thePickingSettings);
VVTK_Renderer();
~VVTK_Renderer();
- VISU_PickingSettings* myPickingSettings;
- vtkSmartPointer<VISU_FPSActor> myFPSActor;
+ VISU_PickingSettings* myPickingSettings; //! Keeps reference of the VISU_PickingSettings
+ vtkSmartPointer<VISU_FPSActor> myFPSActor; //!< To show FPS of the rendering at run-time
};
//----------------------------------------------------------------------------
+//! To extend VVTK_Renderer to implement base view functionality
class VVTK_EXPORT VVTK_Renderer1 : public VVTK_Renderer
{
public:
vtkTypeMacro(VVTK_Renderer1,VVTK_Renderer);
static VVTK_Renderer1* New();
+ //! Reimplement SVTK_Renderer::Initialize
virtual
void
Initialize(vtkRenderWindowInteractor* theInteractor,
SVTK_Selector* theSelector);
+ //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings
virtual
void
AddActor(VTKViewer_Actor* theActor);
+ //! Reimplement VVTK_Renderer::RemoveActor
virtual
void
RemoveActor(VTKViewer_Actor* theActor);
+ //! To set VISU_PickingSettings to share them among all VISU_GaussPtsAct1 actors published into the view
void
SetOutsideCursorSettings(VISU_OutsideCursorSettings* theOutsideCursorSettings);
+ //! Get VISU_ImplicitFunctionWidget
VISU_ImplicitFunctionWidget*
GetImplicitFunctionWidget();
VVTK_Renderer1();
~VVTK_Renderer1();
+ //! Reimplement VVTK_Renderer::OnAdjustActors
virtual
bool
OnAdjustActors();
+ //! To adjust the VISU_ImplicitFunctionWidget to the current bounding box
void AdjustImplicitFunctionWidget();
vtkSmartPointer<VISU_ImplicitFunctionWidget> myImplicitFunctionWidget;
vtkTypeMacro(VVTK_Renderer2,VVTK_Renderer);
static VVTK_Renderer2* New();
+ //! Reimplement VVTK_Renderer::AddActor to apply to the actor additional settings
virtual
void
AddActor(VTKViewer_Actor* theActor);
+ //! Reimplement VVTK_Renderer::RemoveActor
virtual
void
RemoveActor(VTKViewer_Actor* theActor);
+ //! Set VISU_ImplicitFunctionWidget
void
SetImplicitFunctionWidget(VISU_ImplicitFunctionWidget* theWidget);
+ //! To handle vtkCommand::EndInteractionEvent to redraw the view
void
OnEndInteractionEvent();
VVTK_Renderer2();
~VVTK_Renderer2();
- // Main process VTK event method
+ //! Main process VTK event method
static
void
ProcessEvents(vtkObject* theObject,
void* theClientData,
void* theCallData);
- // Used to process VTK events
+ //! Used to process VTK events
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
- // Priority at which events are processed
+ //! Priority at which events are processed
float myPriority;
VISU_ImplicitFunctionWidget* myWidget;
class SUIT_Desktop;
+//! Extend SUIT_ViewManager to deal with VVTK_Viewer
class VVTK_EXPORT VVTK_ViewManager : public SUIT_ViewManager
{
Q_OBJECT;
public:
-
+ //! Construct the view manager
VVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* );
+
+ //! Destroy the view manager
virtual ~VVTK_ViewManager();
protected:
class VVTK_ViewWindow;
+//! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View
class VVTK_EXPORT VVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View
{
Q_OBJECT;
VVTK_Viewer();
virtual ~VVTK_Viewer();
+ //! Redefine SUIT_ViewModel::createView
virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
- virtual void setViewManager(SUIT_ViewManager* theViewManager);
- virtual void contextMenuPopup( QPopupMenu* );
- virtual QString getType() const { return Type(); }
+ //! Redefine SUIT_ViewModel::setViewManager
+ virtual void setViewManager(SUIT_ViewManager* theViewManager);
+ //! Redefine SUIT_ViewModel::contextMenuPopup
+ virtual void contextMenuPopup( QPopupMenu* );
+ //! See SUIT_ViewModel::getType
+ virtual QString getType() const { return Type(); }
+ //! Redefine SALOME_View::Repaint
virtual void Repaint();
- virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
+ //! Redefine SALOME_View::isVisible
+ virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
+ //! Get background color of the viewer
QColor backgroundColor() const;
+
+ //! Set background color to the viewer
void setBackgroundColor( const QColor& );
+ //! Get size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
int trihedronSize() const;
+
+ //! Set size of trihedron of the viewer (see SVTK_Renderer::SetTrihedronSize)
void setTrihedronSize( const int );
protected slots:
class SVTK_View;
//----------------------------------------------------------------------------
+//! Customize the SVTK_ViewWindow in order to manage two SVTK_View (base and segmented one)
class VVTK_EXPORT VVTK_ViewWindow : public SVTK_ViewWindow
{
Q_OBJECT;
public:
+ //! To construct the class
VVTK_ViewWindow(SUIT_Desktop* theDesktop);
+ //! Destroy
virtual
~VVTK_ViewWindow();
+ //! To initialize
virtual
void
Initialize(SVTK_ViewModelBase* theModel);
//----------------------------------------------------------------------------
+ //! Get access to base SVTK_MainWindow
VVTK_MainWindow1*
getMainWindow1();
+ //! Get access to segmented SVTK_MainWindow
VVTK_MainWindow2*
getMainWindow2();
//----------------------------------------------------------------------------
+ //! Redefine SVTK_ViewWindow::AddActor method
+ /*!
+ This is an entry point for publication the presentation into the viewer.
+ Pointed actor published into the basic MainWindow. If the actor is
+ a Gauss Points one second actor is created from initial actor and
+ is put into segemented MainWindow.
+ */
virtual
void
AddActor(VTKViewer_Actor* theActor,
bool theIsUpdate = false);
+ //! Redefine SVTK_ViewWindow::RemoveActor method
virtual
void
RemoveActor(VTKViewer_Actor* theActor,
bool theIsUpdate = false);
+ //! Redefine SVTK_ViewWindow::Repaint method
virtual
void
Repaint(bool theUpdateTrihedron = true);
//----------------------------------------------------------------------------
/* interactive object management */
+ //! Redefine SVTK_ViewWindow::highlight method
virtual
void
highlight(const Handle(SALOME_InteractiveObject)& theIO,
bool theIsHighlight = true,
bool theIsUpdate = true);
+
+ //! Redefine SVTK_ViewWindow::unHighlightAll method
virtual
void
unHighlightAll();
//----------------------------------------------------------------------------
public slots:
+ //! Redefine SVTK_ViewWindow::onSelectionChanged method
virtual
void
onSelectionChanged();
+ //! Redefine SVTK_ViewWindow::onResetView method
virtual
void
onResetView();
+ //! Redefine SVTK_ViewWindow::onFitAll method
virtual
void
onFitAll();
void
action( const int );
- VVTK_MainWindow1* myMainWindow1;
- SVTK_View* myView1;
+ VVTK_MainWindow1* myMainWindow1; //!< The manage base view
+ SVTK_View* myView1; //!< The manage base view
- VVTK_MainWindow2* myMainWindow2;
- SVTK_View* myView2;
+ VVTK_MainWindow2* myMainWindow2; //!< The manage segmented view
+ SVTK_View* myView2; //!< The manage segmented view
};
#ifdef WIN32