From: enk Date: Wed, 20 Jul 2005 12:45:54 +0000 (+0000) Subject: Update comments. X-Git-Tag: V3_0_1~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e419a9e3e3172b670ee68f7fcc73cae7d424bc70;p=modules%2Fgui.git Update comments. --- diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h index b8f0190f1..acdbddb84 100755 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h @@ -9,7 +9,7 @@ #include #include /*! \class vtkUnstructuredGridToUnstructuredGridFilter - * \brief For more information see VTK documentation + * \brief For more information see VTK documentation */ /*! \class vtkUnstructuredGridToUnstructuredGridFilter * \brief For more information see VTK documentation. diff --git a/src/VTKViewer/VTKViewer_Filter.cxx b/src/VTKViewer/VTKViewer_Filter.cxx index ccbe6cef5..3d1e9a20e 100755 --- a/src/VTKViewer/VTKViewer_Filter.cxx +++ b/src/VTKViewer/VTKViewer_Filter.cxx @@ -31,27 +31,38 @@ using namespace std; IMPLEMENT_STANDARD_HANDLE(VTKViewer_Filter, MMgt_TShared) IMPLEMENT_STANDARD_RTTIEXT(VTKViewer_Filter, MMgt_TShared) -/* - Class : VTKViewer_Filter - Description : Base class of filters of for VTK viewer. Method IsValid - should be redefined in derived classes -*/ +/*! + * \class VTKViewer_Filter + * Description : Base class of filters of for VTK viewer. Method IsValid \n + * should be redefined in derived classes + */ +/*!Constructor.*/ VTKViewer_Filter::VTKViewer_Filter() { myActor = 0; } +/*!Virtual Destructor.*/ VTKViewer_Filter::~VTKViewer_Filter() { } +/*!Check correctness of \a theCellId for actor \a theActor by + * call virtual method IsValid( const int theId ). + * \param theActor - actor + * \param theCellId - cell id. + * \retval TRUE - if cell id is valid, else false. + */ bool VTKViewer_Filter::IsValid( VTKViewer_Actor* theActor, const int theCellId ) { SetActor( theActor ); return IsValid( theCellId ); } +/*!Virtual method.Set actor to \a theActor. + * \param theActor - actor. + */ void VTKViewer_Filter::SetActor( VTKViewer_Actor* theActor ) { myActor = theActor; diff --git a/src/VTKViewer/VTKViewer_Filter.h b/src/VTKViewer/VTKViewer_Filter.h index 30350814c..407bace53 100755 --- a/src/VTKViewer/VTKViewer_Filter.h +++ b/src/VTKViewer/VTKViewer_Filter.h @@ -35,11 +35,11 @@ class VTKViewer_Actor; -DEFINE_STANDARD_HANDLE(VTKViewer_Filter, MMgt_TShared) +DEFINE_STANDARD_HANDLE(VTKViewer_Filter, MMgt_TShared); /* Class : VTKViewer_Filter - Description : Base class of filters of for VTK viewer. Method IsValid + Description : Base class of filters of for VTK viewer. Method IsValid should be redefined in derived classes */ diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.cxx b/src/VTKViewer/VTKViewer_InteractorStyle.cxx index 3e4f69719..18a496089 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.cxx +++ b/src/VTKViewer/VTKViewer_InteractorStyle.cxx @@ -93,8 +93,9 @@ static int GetEdgeId(vtkPicker *thePicker, SALOME_Actor *theActor, int theObjId) */ //---------------------------------------------------------------------------- vtkStandardNewMacro(VTKViewer_InteractorStyle); -//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- +/*!Constructor.*/ VTKViewer_InteractorStyle::VTKViewer_InteractorStyle() { m_Trihedron = 0; @@ -113,6 +114,7 @@ VTKViewer_InteractorStyle::VTKViewer_InteractorStyle() } //---------------------------------------------------------------------------- +/*!Destructor.*/ VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle() { // if(MYDEBUG) INFOS("VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle()"); @@ -120,6 +122,12 @@ VTKViewer_InteractorStyle::~VTKViewer_InteractorStyle() } //---------------------------------------------------------------------------- +/*!Set preselection properties. + *\param theRed - red color. + *\param theGreen - green color. + *\param theBlue - blue color. + *\param theWidth - width.. + */ void VTKViewer_InteractorStyle::setPreselectionProp(const double& theRed, const double& theGreen, const double& theBlue, const int& theWidth) { @@ -131,12 +139,18 @@ void VTKViewer_InteractorStyle::setPreselectionProp(const double& theRed, const } //---------------------------------------------------------------------------- +/*!Set render window interactor + *\param theInteractor - interactor. + */ void VTKViewer_InteractorStyle::SetInteractor(vtkRenderWindowInteractor *theInteractor){ m_Interactor = dynamic_cast(theInteractor); Superclass::SetInteractor(theInteractor); } //---------------------------------------------------------------------------- +/*!Set view window. + *\param theViewWnd - SALOME VTKViewer_ViewWindow + */ void VTKViewer_InteractorStyle::setViewWnd(VTKViewer_ViewWindow* theViewWnd ){ m_ViewWnd = theViewWnd; m_ViewWnd->AddActor(myPreSelectionActor); @@ -144,16 +158,26 @@ void VTKViewer_InteractorStyle::setViewWnd(VTKViewer_ViewWindow* theViewWnd ){ } //---------------------------------------------------------------------------- +/*!Set GUI window. + *\param theWindow - QWidget window. + */ void VTKViewer_InteractorStyle::setGUIWindow(QWidget* theWindow){ myGUIWindow = theWindow; } //---------------------------------------------------------------------------- +/*!Set triedron. + *\param theTrihedron - SALOME VTKViewer_Trihedron + */ void VTKViewer_InteractorStyle::setTriedron(VTKViewer_Trihedron* theTrihedron){ m_Trihedron = theTrihedron; } //---------------------------------------------------------------------------- +/*!Rotate camera. + *\param dx - + *\param dy - + */ void VTKViewer_InteractorStyle::RotateXY(int dx, int dy) { double rxf; @@ -191,6 +215,7 @@ void VTKViewer_InteractorStyle::PanXY(int x, int y, int oldX, int oldY) //---------------------------------------------------------------------------- +/*! Move the position of the camera along the direction of projection. (dx,dy)*/ void VTKViewer_InteractorStyle::DollyXY(int dx, int dy) { if (this->CurrentRenderer == NULL) return; @@ -213,6 +238,7 @@ void VTKViewer_InteractorStyle::DollyXY(int dx, int dy) } //---------------------------------------------------------------------------- +/*!*/ void VTKViewer_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY) { vtkCamera *cam; @@ -240,6 +266,12 @@ void VTKViewer_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY) //---------------------------------------------------------------------------- +/*!On mouse move event. + *\param ctrl - CTRL (not used) + *\param shift - SHIFT (on/off - integer 0/1) + *\param x - x coordinate + *\param y - y coordinate + */ void VTKViewer_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl), int shift, int x, int y) @@ -253,6 +285,12 @@ void VTKViewer_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl), //---------------------------------------------------------------------------- +/*!On Left button down event. + *\param ctrl - CTRL (on/off - integer 0/1) + *\param shift - SHIFT (on/off - integer 0/1) + *\param x - x coordinate + *\param y - y coordinate + */ void VTKViewer_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, int x, int y) { @@ -284,6 +322,12 @@ void VTKViewer_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, //---------------------------------------------------------------------------- +/*!On left button up event. + *\param ctrl - CTRL (not used) + *\param shift - SHIFT (on/off - integer 0/1) + *\param x - x coordinate (not used) + *\param y - y coordinate (not used) + */ void VTKViewer_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl), int shift, int vtkNotUsed(x), @@ -299,6 +343,12 @@ void VTKViewer_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl), //---------------------------------------------------------------------------- +/*!On left button up event. + *\param ctrl - CTRL (on/off - integer 0/1) + *\param shift - SHIFT (on/off - integer 0/1) + *\param x - x coordinate + *\param y - y coordinate + */ void VTKViewer_InteractorStyle::OnMiddleButtonDown(int ctrl, int shift, int x, int y) @@ -331,6 +381,12 @@ void VTKViewer_InteractorStyle::OnMiddleButtonDown(int ctrl, //---------------------------------------------------------------------------- +/*!On middle button up event. + *\param ctrl - CTRL (not used) + *\param shift - SHIFT (on/off - integer 0/1) + *\param x - x coordinate (not used) + *\param y - y coordinate (not used) + */ void VTKViewer_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl), int shift, int vtkNotUsed(x), @@ -346,6 +402,12 @@ void VTKViewer_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl), //---------------------------------------------------------------------------- +/*!On right button down event. + *\param ctrl - CTRL (on/off - integer 0/1) + *\param shift - SHIFT (on/off - integer 0/1) + *\param x - x coordinate + *\param y - y coordinate + */ void VTKViewer_InteractorStyle::OnRightButtonDown(int ctrl, int shift, int x, int y) @@ -377,6 +439,12 @@ void VTKViewer_InteractorStyle::OnRightButtonDown(int ctrl, } //---------------------------------------------------------------------------- +/*!On right button up event. + *\param ctrl - CTRL (not used) + *\param shift - SHIFT (on/off - integer 0/1) + *\param x - x coordinate (not used) + *\param y - y coordinate (not used) + */ void VTKViewer_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl), int shift, int vtkNotUsed(x), @@ -391,7 +459,9 @@ void VTKViewer_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl), } //---------------------------------------------------------------------------- -/* XPM */ +/** @name XPM - x pixmaps. */ +//@{ +/*!Image Zoom cursor*/ const char* imageZoomCursor[] = { "32 32 3 1", ". c None", @@ -430,6 +500,7 @@ const char* imageZoomCursor[] = { "................................", "................................"}; +/*!Image rotate cursor*/ const char* imageRotateCursor[] = { "32 32 3 1", ". c None", @@ -467,10 +538,10 @@ const char* imageRotateCursor[] = { "................................", "................................", "................................"}; - +//@} //---------------------------------------------------------------------------- -// loads cursors for viewer operations - zoom, pan, etc... +/*! Loads cursors for viewer operations - zoom, pan, etc...*/ void VTKViewer_InteractorStyle::loadCursors() { myDefCursor = QCursor(ArrowCursor); @@ -485,7 +556,7 @@ void VTKViewer_InteractorStyle::loadCursors() //---------------------------------------------------------------------------- -// event filter - controls mouse and keyboard events during viewer operations +/*! event filter - controls mouse and keyboard events during viewer operations*/ bool VTKViewer_InteractorStyle::eventFilter(QObject* object, QEvent* event) { if (!myGUIWindow) return false; @@ -499,7 +570,7 @@ bool VTKViewer_InteractorStyle::eventFilter(QObject* object, QEvent* event) //---------------------------------------------------------------------------- -// starts Zoom operation (e.g. through menu command) +/*! starts Zoom operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startZoom() { if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) @@ -514,7 +585,7 @@ void VTKViewer_InteractorStyle::startZoom() //---------------------------------------------------------------------------- -// starts Pan operation (e.g. through menu command) +/*! starts Pan operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startPan() { if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) @@ -528,7 +599,7 @@ void VTKViewer_InteractorStyle::startPan() } //---------------------------------------------------------------------------- -// starts Rotate operation (e.g. through menu command) +/*! starts Rotate operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startRotate() { if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) @@ -543,7 +614,7 @@ void VTKViewer_InteractorStyle::startRotate() //---------------------------------------------------------------------------- -// starts Spin operation (e.g. through menu command) +/*! starts Spin operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startSpin() { if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) @@ -559,7 +630,7 @@ void VTKViewer_InteractorStyle::startSpin() //---------------------------------------------------------------------------- -// starts Fit Area operation (e.g. through menu command) +/*! starts Fit Area operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startFitArea() { if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) @@ -574,6 +645,7 @@ void VTKViewer_InteractorStyle::startFitArea() //---------------------------------------------------------------------------- +/*!View fit all.*/ void VTKViewer_InteractorStyle::ViewFitAll() { int aTriedronWasVisible = false; if(m_Trihedron){ @@ -595,7 +667,7 @@ void VTKViewer_InteractorStyle::ViewFitAll() { //---------------------------------------------------------------------------- -// starts Global Panning operation (e.g. through menu command) +/*! starts Global Panning operation (e.g. through menu command)*/ void VTKViewer_InteractorStyle::startGlobalPan() { if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) @@ -619,7 +691,7 @@ void VTKViewer_InteractorStyle::startGlobalPan() //---------------------------------------------------------------------------- -// returns TRUE if needs redrawing +/*!\retval TRUE if needs redrawing*/ bool VTKViewer_InteractorStyle::needsRedrawing() { return State == VTK_INTERACTOR_STYLE_CAMERA_ZOOM || @@ -631,7 +703,12 @@ bool VTKViewer_InteractorStyle::needsRedrawing() //---------------------------------------------------------------------------- -// fits viewer contents to rect +/*! fits viewer contents to rectangle + *\param left - left side + *\param top - top side + *\param right - right side + *\param bottom - bottom side + */ void VTKViewer_InteractorStyle::fitRect(const int left, const int top, const int right, @@ -665,7 +742,7 @@ void VTKViewer_InteractorStyle::fitRect(const int left, //---------------------------------------------------------------------------- -// starts viewer operation (!internal usage!) +/*! starts viewer operation (!internal usage!)*/ void VTKViewer_InteractorStyle::startOperation(int operation) { switch(operation) @@ -694,7 +771,7 @@ void VTKViewer_InteractorStyle::startOperation(int operation) //---------------------------------------------------------------------------- -// sets proper cursor for window when viewer operation is activated +/*! sets proper cursor for window when viewer operation is activated*/ void VTKViewer_InteractorStyle::setCursor(const int operation) { if (!myGUIWindow) return; @@ -735,7 +812,7 @@ void VTKViewer_InteractorStyle::setCursor(const int operation) //---------------------------------------------------------------------------- -// called when viewer operation started (!put necessary initialization here!) +/*! called when viewer operation started (!put necessary initialization here!)*/ void VTKViewer_InteractorStyle::onStartOperation() { if (!myGUIWindow) return; @@ -762,7 +839,7 @@ void VTKViewer_InteractorStyle::onStartOperation() //---------------------------------------------------------------------------- -// called when viewer operation finished (!put necessary post-processing here!) +/*! called when viewer operation finished (!put necessary post-processing here!)*/ void VTKViewer_InteractorStyle::onFinishOperation() { if (!myGUIWindow) return; @@ -1076,7 +1153,7 @@ void VTKViewer_InteractorStyle::onFinishOperation() */ } -// called during viewer operation when user moves mouse (!put necessary processing here!) +/*! called during viewer operation when user moves mouse (!put necessary processing here!)*/ void VTKViewer_InteractorStyle::onOperation(QPoint mousePos) { if (!myGUIWindow) return; @@ -1139,7 +1216,7 @@ void VTKViewer_InteractorStyle::onOperation(QPoint mousePos) this->LastPos[1] = h - mousePos.y() - 1; } -// called when selection mode changed (!put necessary initialization here!) +/*! called when selection mode changed (!put necessary initialization here!)*/ void VTKViewer_InteractorStyle::OnSelectionModeChanged() { @@ -1148,8 +1225,9 @@ void VTKViewer_InteractorStyle::OnSelectionModeChanged() mySelectedActor = NULL; } -// called when user moves mouse inside viewer window and there is no active viewer operation -// (!put necessary processing here!) +/*! called when user moves mouse inside viewer window and there is no active viewer operation \n + * (!put necessary processing here!) + */ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) { // processing highlighting // SUIT_Study* anActiveStudy = SUIT_Application::getDesktop()->getActiveStudy(); @@ -1273,7 +1351,7 @@ void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) { this->LastPos[1] = y;*/ } -// called on finsh GlobalPan operation +/*! called on finsh GlobalPan operation */ void VTKViewer_InteractorStyle::Place(const int theX, const int theY) { if (this->CurrentRenderer == NULL) { @@ -1298,7 +1376,7 @@ void VTKViewer_InteractorStyle::Place(const int theX, const int theY) -// Translates view from Point to Point +/*! Translates view from Point to Point*/ void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY) { vtkCamera *cam = this->CurrentRenderer->GetActiveCamera(); @@ -1331,7 +1409,7 @@ void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int f } -/// Checks: is the given Actor within display coordinates? +/*! Checks: is the given Actor within display coordinates?*/ bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor, const int left, const int top, const int right, const int bottom) @@ -1355,7 +1433,7 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkActor* theActor, } -/// Checks: is the given Cell within display coordinates? +/*! Checks: is the given Cell within display coordinates?*/ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, const int left, const int top, const int right, const int bottom) @@ -1378,7 +1456,7 @@ bool VTKViewer_InteractorStyle::IsInRect(vtkCell* theCell, return ((aMin[0]>left) && (aMax[0]bottom) && (aMax[1]left) && (aPnt[0]bottom) && (aPnt[1]GetId() ] = theFilter; } +/*!Checks: is filter present (with id \a theId) + *\param theId - filter id. + */ bool VTKViewer_InteractorStyle::IsFilterPresent( const int theId ) { return myFilters.find( theId ) != myFilters.end(); } +/*!Remove filter with id \a theId. + *\param theId - filter id. + */ void VTKViewer_InteractorStyle::RemoveFilter( const int theId ) { if ( IsFilterPresent( theId ) ) myFilters.erase( theId ); } - +/*!Checks: is valid cell(node) with id \a theId in actor \a theActor. + *\param theActor - VTKViewer_Actor pointer. + *\param theId - cell id. + *\param theIsNode - boolean flag, if true - node, else - cell. + */ bool VTKViewer_InteractorStyle::IsValid( VTKViewer_Actor* theActor, const int theId, const bool theIsNode ) @@ -1421,21 +1510,33 @@ bool VTKViewer_InteractorStyle::IsValid( VTKViewer_Actor* theActor, return true; } +/*!Gets filter handle by filter id \a theId.*/ Handle(VTKViewer_Filter) VTKViewer_InteractorStyle::GetFilter( const int theId ) { return IsFilterPresent( theId ) ? myFilters[ theId ] : Handle(VTKViewer_Filter)(); } +/*!Increment pan. + *\param incrX - X coordinate increment. + *\param incrY - Y coordinate increment. + */ void VTKViewer_InteractorStyle::IncrementalPan( const int incrX, const int incrY ) { this->PanXY( incrX, incrY, 0, 0 ); } +/*!Increment zoom. + *\param incr - zoom increment. + */ void VTKViewer_InteractorStyle::IncrementalZoom( const int incr ) { this->DollyXY( incr, incr ); } +/*!Increment rotate. + *\param incrX - X coordinate increment. + *\param incrY - Y coordinate increment. + */ void VTKViewer_InteractorStyle::IncrementalRotate( const int incrX, const int incrY ) { this->RotateXY( incrX, -incrY ); diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.h b/src/VTKViewer/VTKViewer_InteractorStyle.h index 99914712f..ed3f08d99 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.h +++ b/src/VTKViewer/VTKViewer_InteractorStyle.h @@ -56,13 +56,14 @@ class VTKViewer_RenderWindowInteractor; #define VTK_INTERACTOR_STYLE_CAMERA_SELECT 6 #define VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN 7 +/*! Description:\n + * This class must be supplied with a vtkRenderWindowInteractor wrapper or\n + * parent. This class should not normally be instantiated by application\n + * programmers. + */ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInteractorStyle { -public: - // Description: - // This class must be supplied with a vtkRenderWindowInteractor wrapper or - // parent. This class should not normally be instantiated by application - // programmers. + public: static VTKViewer_InteractorStyle *New(); vtkTypeMacro(VTKViewer_InteractorStyle, vtkInteractorStyle); @@ -176,10 +177,12 @@ public: std::map myFilters; - // members from old version + /** @name members from old version*/ + //@{ double DeltaElevation; double DeltaAzimuth; int LastPos[2]; + //@} }; #endif diff --git a/src/VTKViewer/VTKViewer_PassThroughFilter.cxx b/src/VTKViewer/VTKViewer_PassThroughFilter.cxx index 24805dfc4..be6cfe1e0 100755 --- a/src/VTKViewer/VTKViewer_PassThroughFilter.cxx +++ b/src/VTKViewer/VTKViewer_PassThroughFilter.cxx @@ -36,6 +36,13 @@ vtkCxxRevisionMacro(VTKViewer_PassThroughFilter, "$Revision$"); vtkStandardNewMacro(VTKViewer_PassThroughFilter); +/*! \class VTKViewer_PassThroughFilter + * Passive filter take a dataset as input and create a dataset as output.\n + * The form of the input geometry is not changed in these filters, \n + * only the point attributes (e.g. scalars, vectors, etc.). + */ + +/*!Execute method.Output calculation.*/ void VTKViewer_PassThroughFilter::Execute() { vtkDataSet *input = static_cast(this->GetInput()); @@ -44,13 +51,18 @@ void VTKViewer_PassThroughFilter::Execute() // This has to be here because it initialized all field datas. output->CopyStructure( input ); - // Pass all. (data object's field data is passed by the - // superclass after this method) + //! Pass all. (data object's field data is passed by the + //! superclass after this method) output->GetPointData()->PassData( input->GetPointData() ); output->GetCellData()->PassData( input->GetCellData() ); } +/*!Methods invoked by print to print information about the object including superclasses.\n + * Typically not called by the user (use Print() instead) but used in the hierarchical \n + * print process to combine the output of several classes. + *\param os - output stream. + */ void VTKViewer_PassThroughFilter::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); diff --git a/src/VTKViewer/VTKViewer_PassThroughFilter.h b/src/VTKViewer/VTKViewer_PassThroughFilter.h index 5833561d4..0cacb2531 100755 --- a/src/VTKViewer/VTKViewer_PassThroughFilter.h +++ b/src/VTKViewer/VTKViewer_PassThroughFilter.h @@ -11,19 +11,18 @@ public: vtkTypeRevisionMacro( VTKViewer_PassThroughFilter, vtkDataSetToDataSetFilter ); void PrintSelf( ostream& os, vtkIndent indent ); - // Description: - // Create a new VTKViewer_PassThroughFilter. + /*!Create a new VTKViewer_PassThroughFilter.*/ static VTKViewer_PassThroughFilter *New(); protected: - VTKViewer_PassThroughFilter() {}; - virtual ~VTKViewer_PassThroughFilter() {}; + VTKViewer_PassThroughFilter() {};//!< Null body. + virtual ~VTKViewer_PassThroughFilter() {};//!< Null body. void Execute(); private: - VTKViewer_PassThroughFilter( const VTKViewer_PassThroughFilter& ); // Not implemented. - void operator=( const VTKViewer_PassThroughFilter& ); // Not implemented. + VTKViewer_PassThroughFilter( const VTKViewer_PassThroughFilter& ); //!< Not implemented. + void operator=( const VTKViewer_PassThroughFilter& ); //!< Not implemented. }; #endif diff --git a/src/VTKViewer/VTKViewer_RectPicker.cxx b/src/VTKViewer/VTKViewer_RectPicker.cxx index 6453097c0..698a54b3e 100755 --- a/src/VTKViewer/VTKViewer_RectPicker.cxx +++ b/src/VTKViewer/VTKViewer_RectPicker.cxx @@ -51,13 +51,19 @@ using namespace std; //---------------------------------------------------------------------------- vtkStandardNewMacro(VTKViewer_RectPicker); -//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- +/*!Constructor. Do nothing*/ VTKViewer_RectPicker::VTKViewer_RectPicker() { } //---------------------------------------------------------------------------- +/*!Perform pick operation with selection rectangle provided. Normally the + * first two values for the selection top-left and right-bottom points are + * x-y pixel coordinate, and the third value is =0. + * \retval Return non-zero if something was successfully picked. + */ int VTKViewer_RectPicker::Pick(float selectionX1, float selectionY1, float selectionZ1, float selectionX2, float selectionY2, float selectionZ2, vtkRenderer *renderer) @@ -423,6 +429,11 @@ char GetIntersectionPoint(const float start[3], const float end[3], } //---------------------------------------------------------------------------- +/*! Bounding box intersection with hexahedron. Origin[4][4] starts the ray from corner points, + * dir[4][3] is the vector components of the ray in the x-y-z directions. + * (Notes: the intersection ray dir[4][3] is NOT normalized.) + * \retval The method returns a non-zero value, if the bounding box is hit. + */ char VTKViewer_RectPicker::HitBBox (float bounds[6], float origin[4][4], float dir[4][3]) { int i, j, k, n; @@ -715,6 +726,10 @@ char VTKViewer_RectPicker::HitBBox (float bounds[6], float origin[4][4], float d } //---------------------------------------------------------------------------- +/*! Position of point relative to hexahedron. p1[4][4] is the corner points of top face, + * p2[4][4] is the corner points of bottom face. + * \retval The method returns a non-zero value, if the point is inside. + */ char VTKViewer_RectPicker::PointInside (float p[3], float p1[4][4], float p2[4][4], float tol) { int i, j, k; diff --git a/src/VTKViewer/VTKViewer_RectPicker.h b/src/VTKViewer/VTKViewer_RectPicker.h index dbd1f8427..c6d90cbd5 100755 --- a/src/VTKViewer/VTKViewer_RectPicker.h +++ b/src/VTKViewer/VTKViewer_RectPicker.h @@ -39,20 +39,16 @@ class VTK_EXPORT VTKViewer_RectPicker : public vtkPicker { public: + /*!Create new instance of VTKViewer_RectPicker.*/ static VTKViewer_RectPicker *New(); vtkTypeMacro(VTKViewer_RectPicker,vtkPicker); - /*! \brief Perform pick operation with selection rectangle provided. Normally the - * first two values for the selection top-left and right-bottom points are - * x-y pixel coordinate, and the third value is =0. - * \retval Return non-zero if something was successfully picked. - */ virtual int Pick(float selectionX1, float selectionY1, float selectionZ1, float selectionX2, float selectionY2, float selectionZ2, vtkRenderer *renderer); /*! - * \brief Perform pick operation with selection rectangle provided. Normally the first + * Perform pick operation with selection rectangle provided. Normally the first * two values for the selection top-left and right-bottom points are x-y pixel * coordinate, and the third value is =0. * \retval Return non-zero if something was successfully picked. @@ -62,17 +58,8 @@ public: selectionPt2[0], selectionPt2[1], selectionPt2[2], ren);}; - /*! \brief Bounding box intersection with hexahedron. Origin[4][4] starts the ray from corner points, - * dir[4][3] is the vector components of the ray in the x-y-z directions. - * (Notes: the intersection ray dir[4][3] is NOT normalized.) - * \retval The method returns a non-zero value, if the bounding box is hit. - */ static char HitBBox(float bounds[6], float origin[4][4], float dir[4][3]); - /*! \brief Position of point relative to hexahedron. p1[4][4] is the corner points of top face, - * p2[4][4] is the corner points of bottom face. - * \retval The method returns a non-zero value, if the point is inside. - */ static char PointInside(float point[3], float p1[4][4], float p2[4][4], float tol=0); protected: diff --git a/src/VTKViewer/VTKViewer_RenderWindow.cxx b/src/VTKViewer/VTKViewer_RenderWindow.cxx index 87368c872..cfffd5671 100755 --- a/src/VTKViewer/VTKViewer_RenderWindow.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindow.cxx @@ -20,7 +20,10 @@ #include #endif -//**************************************************************** +/*!Constructor. Create render window with parant \a parent and name \a name. + *\param parent - parent window + *\param name - render window name. + */ VTKViewer_RenderWindow::VTKViewer_RenderWindow(QWidget* parent, const char* name) : QWidget(parent, name, Qt::WStyle_NoBorder | Qt::WDestructiveClose | @@ -35,19 +38,19 @@ QWidget(parent, name, setMouseTracking(true); } -//**************************************************************** +/*!Destructor.*/ VTKViewer_RenderWindow::~VTKViewer_RenderWindow() { myRW->Delete(); } -//**************************************************************** +/*!Call Render method for render window field.*/ void VTKViewer_RenderWindow::paintEvent(QPaintEvent* theEvent) { myRW->Render(); } -//**************************************************************** +/*!Resize render window.*/ void VTKViewer_RenderWindow::resizeEvent(QResizeEvent* theEvent) { int aWidth = myRW->GetSize()[0], aHeight = myRW->GetSize()[1]; @@ -69,49 +72,49 @@ void VTKViewer_RenderWindow::resizeEvent(QResizeEvent* theEvent) } } -//**************************************************************** +/*!Emit mouse move event.*/ void VTKViewer_RenderWindow::mouseMoveEvent(QMouseEvent* event) { emit MouseMove(event) ; } -//**************************************************************** +/*!Emit mouse button press event.*/ void VTKViewer_RenderWindow::mousePressEvent(QMouseEvent* event) { emit MouseButtonPressed( event ); } -//**************************************************************** +/*!Emit mouse button release event.*/ void VTKViewer_RenderWindow::mouseReleaseEvent( QMouseEvent *event ) { emit MouseButtonReleased( event ); } -//**************************************************************** +/*!Emit mouse button double click event.*/ void VTKViewer_RenderWindow::mouseDoubleClickEvent( QMouseEvent* event ) { emit MouseDoubleClicked( event ); } -//**************************************************************** +/*!Emit key pressed event.*/ void VTKViewer_RenderWindow::keyPressEvent (QKeyEvent* event) { emit KeyPressed(event) ; } -//**************************************************************** +/*!Emit key release event.*/ void VTKViewer_RenderWindow::keyReleaseEvent (QKeyEvent * event) { emit KeyReleased(event) ; } -//**************************************************************** +/*!Emit wheel move event.*/ void VTKViewer_RenderWindow::wheelEvent(QWheelEvent* event) { emit WheelMoved(event) ; } -//**************************************************************** +/*!Reaction on change background color.*/ void VTKViewer_RenderWindow::onChangeBackgroundColor() { //float red, green, blue; @@ -133,7 +136,7 @@ void VTKViewer_RenderWindow::onChangeBackgroundColor() } } -//**************************************************************** +/*!Emit content menu requested.*/ void VTKViewer_RenderWindow::contextMenuEvent ( QContextMenuEvent * e ) { if ( e->reason() != QContextMenuEvent::Mouse ) diff --git a/src/VTKViewer/VTKViewer_RenderWindow.h b/src/VTKViewer/VTKViewer_RenderWindow.h index 2b155b6d1..e535d3c1d 100755 --- a/src/VTKViewer/VTKViewer_RenderWindow.h +++ b/src/VTKViewer/VTKViewer_RenderWindow.h @@ -20,7 +20,8 @@ public: public: VTKViewer_RenderWindow(QWidget *parent, const char *name); virtual ~VTKViewer_RenderWindow() ; - + + /*!Get render window pointer.*/ vtkRenderWindow* getRenderWindow() { return myRW; } protected: @@ -37,21 +38,38 @@ public: virtual void contextMenuEvent( QContextMenuEvent * e ); signals: + /*!On mouse move signal.*/ void MouseMove( QMouseEvent* ); + /*!On mouse button pressed signal.*/ void MouseButtonPressed( QMouseEvent* ); + /*!On mouse button released signal.*/ void MouseButtonReleased( QMouseEvent* ); + /*!On mouse double click signal.*/ void MouseDoubleClicked( QMouseEvent* ); + /*!On wheel moved signal.*/ void WheelMoved( QWheelEvent* ); + /*!On left button pressed signal.*/ void LeftButtonPressed(const QMouseEvent *event) ; + /*!On left button released signal.*/ void LeftButtonReleased(const QMouseEvent *event) ; + /*!On middle button pressed signal.*/ void MiddleButtonPressed(const QMouseEvent *event) ; + /*!On middle button released signal.*/ void MiddleButtonReleased(const QMouseEvent *event) ; + /*!On right button pressed signal.*/ void RightButtonPressed(const QMouseEvent *event) ; + /*!On right button released signal.*/ void RightButtonReleased(const QMouseEvent *event) ; + + /*!On button pressed signal.*/ void ButtonPressed(const QMouseEvent *event); + /*!On button released signal.*/ void ButtonReleased(const QMouseEvent *event); + /*!On key pressed signal.*/ void KeyPressed( QKeyEvent* ); + /*!On key released signal.*/ void KeyReleased( QKeyEvent* ); + /*!On content menu requested signal.*/ void contextMenuRequested( QContextMenuEvent *e ); protected: diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx index de9bad829..bba404e1f 100755 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx @@ -37,7 +37,7 @@ // QT Includes #include -//**************************************************************** +/*! Create new instance of VTKViewer_RenderWindowInteractor*/ VTKViewer_RenderWindowInteractor* VTKViewer_RenderWindowInteractor::New() { vtkObject *ret = vtkObjectFactory::CreateInstance("VTKViewer_RenderWindowInteractor") ; @@ -47,7 +47,7 @@ VTKViewer_RenderWindowInteractor* VTKViewer_RenderWindowInteractor::New() return new VTKViewer_RenderWindowInteractor; } -//**************************************************************** +/*!Constructor.*/ VTKViewer_RenderWindowInteractor::VTKViewer_RenderWindowInteractor() { this->Enabled = 0 ; @@ -79,7 +79,7 @@ VTKViewer_RenderWindowInteractor::VTKViewer_RenderWindowInteractor() connect(mTimer, SIGNAL(timeout()), this, SLOT(TimerFunc())) ; } -//**************************************************************** +/*!Destructor.*/ VTKViewer_RenderWindowInteractor::~VTKViewer_RenderWindowInteractor() { delete mTimer ; @@ -99,7 +99,6 @@ VTKViewer_RenderWindowInteractor::~VTKViewer_RenderWindowInteractor() myPointPicker->Delete(); } -//**************************************************************** void VTKViewer_RenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent) { vtkRenderWindowInteractor::PrintSelf(os, indent) ; @@ -111,10 +110,13 @@ void VTKViewer_RenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent) // } -//**************************************************************** -// We never allow the VTKViewer_RenderWindowInteractor to control -// the event loop. The application always has the control. -// +/*!Description:\n + * Initializes the event handlers without an XtAppContext. This is \n + * good for when you don`t have a user interface, but you still \n + * want to have mouse interaction.\n + * We never allow the VTKViewer_RenderWindowInteractor to control \n + * the event loop. The application always has the control. + */ void VTKViewer_RenderWindowInteractor::Initialize() { // @@ -168,8 +170,7 @@ void VTKViewer_RenderWindowInteractor::Initialize() return ; } - -//---------------------------------------------------------------------------- +/*!Sets view window and add to it selection actors.*/ void VTKViewer_RenderWindowInteractor::setViewWindow(VTKViewer_ViewWindow* theViewWnd){ myViewWnd = theViewWnd; @@ -180,7 +181,7 @@ void VTKViewer_RenderWindowInteractor::setViewWindow(VTKViewer_ViewWindow* theVi } } -//---------------------------------------------------------------------------- +/*!Move selection actors to view window.*/ void VTKViewer_RenderWindowInteractor::MoveInternalActors() { myViewWnd->MoveActor(myCellActor); @@ -188,14 +189,15 @@ void VTKViewer_RenderWindowInteractor::MoveInternalActors() myViewWnd->MoveActor(myPointActor); } -//---------------------------------------------------------------------------- +/*!Sets interactor style.*/ void VTKViewer_RenderWindowInteractor::SetInteractorStyle(vtkInteractorObserver *theInteractor){ myInteractorStyle = dynamic_cast(theInteractor); vtkRenderWindowInteractor::SetInteractorStyle(theInteractor); } -/*void VTKViewer_RenderWindowInteractor::SetSelectionMode(Selection_Mode theMode) +/* +void VTKViewer_RenderWindowInteractor::SetSelectionMode(Selection_Mode theMode) { myCellActor->SetVisibility(false); myEdgeActor->SetVisibility(false); @@ -218,9 +220,15 @@ void VTKViewer_RenderWindowInteractor::SetInteractorStyle(vtkInteractorObserver } myInteractorStyle->OnSelectionModeChanged(); -}*/ +} +*/ -//**************************************************************** +/*!Sets selection properties. + *\param theRed - red component of color + *\param theGreen - green component of color + *\param theBlue - blue component of color + *\param theWidth - point size and line width + */ void VTKViewer_RenderWindowInteractor::SetSelectionProp(const double& theRed, const double& theGreen, const double& theBlue, const int& theWidth) { @@ -231,7 +239,10 @@ void VTKViewer_RenderWindowInteractor::SetSelectionProp(const double& theRed, co myPointActor->GetProperty()->SetPointSize(theWidth); } -//**************************************************************** +/*!Sets selection tolerance + *\param theTolNodes - nodes selection tolerance + *\param theTolItems - selection tolerance for basic and cell pickers. + */ void VTKViewer_RenderWindowInteractor::SetSelectionTolerance(const double& theTolNodes, const double& theTolItems) { myTolNodes = theTolNodes; @@ -243,7 +254,15 @@ void VTKViewer_RenderWindowInteractor::SetSelectionTolerance(const double& theTo } -//**************************************************************** +/*! Description:\n + * Enable/Disable interactions. By default interactors are enabled when \n + * initialized. Initialize() must be called prior to enabling/disabling \n + * interaction. These methods are used when a window/widget is being \n + * shared by multiple renderers and interactors. This allows a "modal" \n + * display where one interactor is active when its data is to be displayed \n + * and all other interactors associated with the widget are disabled \n + * when their data is not displayed. + */ void VTKViewer_RenderWindowInteractor::Enable() { // @@ -257,7 +276,7 @@ void VTKViewer_RenderWindowInteractor::Enable() this->Modified() ; } -//**************************************************************** +/*!See Enable().*/ void VTKViewer_RenderWindowInteractor::Disable() { if( ! this->Enabled ) { @@ -268,7 +287,11 @@ void VTKViewer_RenderWindowInteractor::Disable() this->Modified() ; } -//**************************************************************** +/*!Description:\n + * This will start up the X event loop and never return. If you \n + * call this method it will loop processing X events until the \n + * application is exited. + */ void VTKViewer_RenderWindowInteractor::Start() { // @@ -279,7 +302,9 @@ void VTKViewer_RenderWindowInteractor::Start() vtkErrorMacro(<<"VTKViewer_RenderWindowInteractor::Start() not allowed to start event loop.") ; } -//**************************************************************** +/*! Description:\n + * Event loop notification member for Window size change + */ void VTKViewer_RenderWindowInteractor::UpdateSize(int w, int h) { // if the size changed send this on to the RenderWindow @@ -290,35 +315,48 @@ void VTKViewer_RenderWindowInteractor::UpdateSize(int w, int h) } } -//**************************************************************** +/*! Description: + * Timer methods must be overridden by platform dependent subclasses. + * flag is passed to indicate if this is first timer set or an update + * as Win32 uses repeating timers, whereas X uses One shot more timer + * if flag == VTKXI_TIMER_FIRST Win32 and X should createtimer + * otherwise Win32 should exit and X should perform AddTimeOut + * \retval 1 + */ int VTKViewer_RenderWindowInteractor::CreateTimer(int vtkNotUsed(timertype)) { - // - // Start a one-shot timer for 10ms. - // + /// + /// Start a one-shot timer for 10ms. + /// mTimer->start(10, TRUE) ; return 1 ; } -//**************************************************************** +/**@see CreateTimer(int ) + *\retval 1 + */ int VTKViewer_RenderWindowInteractor::DestroyTimer(void) { // // :TRICKY: Tue May 2 00:17:32 2000 Pagey // - // QTimer will automatically expire after 10ms. So - // we do not need to do anything here. In fact, we - // should not even Stop() the QTimer here because doing - // this will skip some of the processing that the TimerFunc() - // does and will result in undesirable effects. For - // example, this will result in vtkLODActor to leave - // the models in low-res mode after the mouse stops - // moving. - // + /*! QTimer will automatically expire after 10ms. So + * we do not need to do anything here. In fact, we + * should not even Stop() the QTimer here because doing + * this will skip some of the processing that the TimerFunc() + * does and will result in undesirable effects. For + * example, this will result in vtkLODActor to leave + * the models in low-res mode after the mouse stops + * moving. + */ return 1 ; } -//**************************************************************** +/*! Not all of these slots are needed in VTK_MAJOR_VERSION=3,\n + * but moc does not understand "#if VTK_MAJOR_VERSION". Hence, \n + * we have to include all of these for the time being. Once,\n + * this bug in MOC is fixed, we can separate these. + */ void VTKViewer_RenderWindowInteractor::TimerFunc() { if( ! this->Enabled ) { @@ -329,6 +367,8 @@ void VTKViewer_RenderWindowInteractor::TimerFunc() emit RenderWindowModified() ; } +/*!Emit render window modified on mouse move,\n + *if interactor style needs redrawing and render window enabled.*/ void VTKViewer_RenderWindowInteractor::MouseMove(QMouseEvent *event) { if( ! this->Enabled ) { return ; @@ -338,6 +378,10 @@ void VTKViewer_RenderWindowInteractor::MouseMove(QMouseEvent *event) { emit RenderWindowModified() ; } +/*!Reaction on left button pressed.\n + *Same as left button down for interactor style.\n + *If render window enabled. + */ void VTKViewer_RenderWindowInteractor::LeftButtonPressed(const QMouseEvent *event) { if( ! this->Enabled ) { return ; @@ -347,6 +391,10 @@ void VTKViewer_RenderWindowInteractor::LeftButtonPressed(const QMouseEvent *even event->x(), event->y()); } +/*!Reaction on left button releases.\n + *Same as left button up for interactor style.\n + *If render window enabled. + */ void VTKViewer_RenderWindowInteractor::LeftButtonReleased(const QMouseEvent *event) { if( ! this->Enabled ) { return ; @@ -356,6 +404,10 @@ void VTKViewer_RenderWindowInteractor::LeftButtonReleased(const QMouseEvent *eve event->x(), event->y() ) ; } +/*!Reaction on middle button pressed.\n + *Same as middle button down for interactor style.\n + *If render window enabled. + */ void VTKViewer_RenderWindowInteractor::MiddleButtonPressed(const QMouseEvent *event) { if( ! this->Enabled ) { return ; @@ -365,6 +417,10 @@ void VTKViewer_RenderWindowInteractor::MiddleButtonPressed(const QMouseEvent *ev event->x(), event->y() ) ; } +/*!Reaction on middle button released.\n + *Same as middle button up for interactor style.\n + *If render window enabled. + */ void VTKViewer_RenderWindowInteractor::MiddleButtonReleased(const QMouseEvent *event) { if( ! this->Enabled ) { return ; @@ -374,6 +430,10 @@ void VTKViewer_RenderWindowInteractor::MiddleButtonReleased(const QMouseEvent *e event->x(), event->y() ) ; } +/*!Reaction on right button pressed.\n + *Same as right button down for interactor style.\n + *If render window enabled. + */ void VTKViewer_RenderWindowInteractor::RightButtonPressed(const QMouseEvent *event) { if( ! this->Enabled ) { return ; @@ -383,6 +443,10 @@ void VTKViewer_RenderWindowInteractor::RightButtonPressed(const QMouseEvent *eve event->x(), event->y() ) ; } +/*!Reaction on right button released.\n + *Same as right button up for interactor style.If render window enabled.\n + *Emit context menu requested, if interactor style state equal VTK_INTERACTOR_STYLE_CAMERA_NONE. + */ void VTKViewer_RenderWindowInteractor::RightButtonReleased(const QMouseEvent *event) { if( ! this->Enabled ) { return ; @@ -400,19 +464,26 @@ void VTKViewer_RenderWindowInteractor::RightButtonReleased(const QMouseEvent *ev } } +/*!Reaction on button pressed. + *\warning Do nothing. + */ void VTKViewer_RenderWindowInteractor::ButtonPressed(const QMouseEvent *event) { return ; } +/*!Reaction on button released.. + *\warning Do nothing. + */ void VTKViewer_RenderWindowInteractor::ButtonReleased(const QMouseEvent *event) { return ; } - +/*!Gets display mode.*/ int VTKViewer_RenderWindowInteractor::GetDisplayMode() { return myDisplayMode; } +/*!Sets display mode.*/ void VTKViewer_RenderWindowInteractor::SetDisplayMode(int theMode) { if(theMode == 0) ChangeRepresentationToWireframe(); @@ -421,20 +492,21 @@ void VTKViewer_RenderWindowInteractor::SetDisplayMode(int theMode) { myDisplayMode = theMode; } -//**************************************************************** +/*!Change all actors to wireframe*/ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe() -// change all actors to wireframe { ChangeRepresentationToWireframe(GetRenderer()->GetActors()); } -//**************************************************************** +/*!Change all actors to surface*/ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface() { ChangeRepresentationToSurface(GetRenderer()->GetActors()); } - +/*!Change all actors from \a theCollection to wireframe and + * emit render window modified. + */ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe(vtkActorCollection* theCollection) { using namespace VTK; @@ -444,6 +516,9 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToWireframe(vtkActorC emit RenderWindowModified(); } +/*!Change all actors from \a theCollection to surface and + * emit render window modified. + */ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface(vtkActorCollection* theCollection) { using namespace VTK; @@ -453,7 +528,7 @@ void VTKViewer_RenderWindowInteractor::ChangeRepresentationToSurface(vtkActorCol emit RenderWindowModified(); } -//**************************************************************** +/*!Gets renderer.*/ vtkRenderer* VTKViewer_RenderWindowInteractor::GetRenderer() { vtkRendererCollection * theRenderers = this->RenderWindow->GetRenderers(); @@ -461,12 +536,14 @@ vtkRenderer* VTKViewer_RenderWindowInteractor::GetRenderer() return theRenderers->GetNextItem(); } -//**************************************************************** +/*!Do nothing*/ void VTKViewer_RenderWindowInteractor::EraseAll() { } -//**************************************************************** +/*!Display all actors. + *Sets visible for all actors from renderer collection and emit render window modified. + */ void VTKViewer_RenderWindowInteractor::DisplayAll() { using namespace VTK; @@ -476,11 +553,12 @@ void VTKViewer_RenderWindowInteractor::DisplayAll() emit RenderWindowModified() ; } -//**************************************************************** +/*!Do nothing*/ void VTKViewer_RenderWindowInteractor::Erase( VTKViewer_Actor* SActor, bool update) { } +/*!Remove \a SActor from renderer and emit update window, if \a updateViewer - true*/ void VTKViewer_RenderWindowInteractor::Remove( VTKViewer_Actor* SActor, bool updateViewer ) { if ( SActor != 0 ) @@ -491,6 +569,9 @@ void VTKViewer_RenderWindowInteractor::Remove( VTKViewer_Actor* SActor, bool upd } } +/*!Remove actors from render window collection(not implemented). + *Emit render window modified, if \a updateViewer - true. + */ void VTKViewer_RenderWindowInteractor::RemoveAll( const bool updateViewer ) { vtkRenderer* aRenderer = GetRenderer(); @@ -510,9 +591,10 @@ void VTKViewer_RenderWindowInteractor::RemoveAll( const bool updateViewer ) } } - - - +/*!\brief Display the \a theActor.*/ +/*! Add actor to renderer and set visibility to true. + * Emit render window modified, if \a update - true. + */ void VTKViewer_RenderWindowInteractor::Display( VTKViewer_Actor* theActor, bool update) { GetRenderer()->AddActor(theActor); @@ -524,16 +606,18 @@ void VTKViewer_RenderWindowInteractor::Display( VTKViewer_Actor* theActor, bool void VTKViewer_RenderWindowInteractor::KeyPressed(QKeyEvent *event) { - // NOT_IMPLEMENTED + /// NOT_IMPLEMENTED } - +/*!Structure with one function "operator()", which call apply properties for actor.*/ struct TUpdateAction{ + /*!Apply properties for \a theActor.*/ void operator()(vtkActor* theActor){ theActor->ApplyProperties(); } }; +/*!Update all actors from renderer and emit render window modified.*/ void VTKViewer_RenderWindowInteractor::Update() { using namespace VTK; vtkRenderer* aRen = GetRenderer(); @@ -544,13 +628,16 @@ void VTKViewer_RenderWindowInteractor::Update() { emit RenderWindowModified(); } - +/*!Unhighlight all selection actors.*/ void VTKViewer_RenderWindowInteractor::unHighlightSubSelection(){ myPointActor->SetVisibility(false); myEdgeActor->SetVisibility(false); myCellActor->SetVisibility(false); } +/*!@see unHighlightSubSelection() + * Also emit render window modified. + */ bool VTKViewer_RenderWindowInteractor::unHighlightAll(){ unHighlightSubSelection(); @@ -559,7 +646,10 @@ bool VTKViewer_RenderWindowInteractor::unHighlightAll(){ } -//---------------------------------------------------------------------------- +/*! \li Sets actors data and sets visibility to true, if flag \a hilight - true, + * else sets visibility to false. + * \li Emit render window modified, if flag \a update - true. + */ bool VTKViewer_RenderWindowInteractor::highlight(const TColStd_IndexedMapOfInteger& theMapIndex, VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor, TUpdateActor theFun, bool hilight, bool update) @@ -582,6 +672,7 @@ bool VTKViewer_RenderWindowInteractor::highlight(const TColStd_IndexedMapOfInteg return false; } +/*!Sets actors data.*/ void VTKViewer_RenderWindowInteractor::setActorData(const TColStd_IndexedMapOfInteger& theMapIndex, VTKViewer_Actor * theMapActor, VTKViewer_Actor * theActor, diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.h b/src/VTKViewer/VTKViewer_RenderWindowInteractor.h index db70ce200..16aa877fd 100755 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.h +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.h @@ -39,52 +39,33 @@ public: void PrintSelf(ostream& os, vtkIndent indent); - // Description: - // Initializes the event handlers without an XtAppContext. This is - // good for when you don`t have a user interface, but you still - // want to have mouse interaction. virtual void Initialize(); virtual void SetInteractorStyle(vtkInteractorObserver *); + /*!Return interactor style pointer.*/ VTKViewer_InteractorStyle* GetInteractorStyle() const { return myInteractorStyle; } - // Description: - // This will start up the X event loop and never return. If you - // call this method it will loop processing X events until the - // application is exited. virtual void Start(); - // Description: - // Enable/Disable interactions. By default interactors are enabled when - // initialized. Initialize() must be called prior to enabling/disabling - // interaction. These methods are used when a window/widget is being - // shared by multiple renderers and interactors. This allows a "modal" - // display where one interactor is active when its data is to be displayed - // and all other interactors associated with the widget are disabled - // when their data is not displayed. virtual void Enable(); virtual void Disable(); - // Description: - // Event loop notification member for Window size change virtual void UpdateSize(int x,int y); - // Description: - // Timer methods must be overridden by platform dependent subclasses. - // flag is passed to indicate if this is first timer set or an update - // as Win32 uses repeating timers, whereas X uses One shot more timer - // if flag==VTKXI_TIMER_FIRST Win32 and X should createtimer - // otherwise Win32 should exit and X should perform AddTimeOut() - virtual int CreateTimer(int ) ; + /** @name Timer options*/ + //@{ + virtual int CreateTimer(int ) ; virtual int DestroyTimer() ; + //@} - // Description: - // This function is called on 'q','e' keypress if exitmethod is not - // specified and should be overidden by platform dependent subclasses - // to provide a termination procedure if one is required. + /*! Description:\n + * This function is called on 'q','e' keypress if exitmethod is not\n + * specified and should be overidden by platform dependent subclasses\n + * to provide a termination procedure if one is required. + */ virtual void TerminateApp(void) { /* empty */ } // Description: @@ -95,7 +76,8 @@ public: //virtual void StartPickCallback(); //virtual void EndPickCallback(); - /* Selection Management */ + /** @name Selection Management */ + //@{ bool highlightCell(const TColStd_IndexedMapOfInteger& MapIndex, VTKViewer_Actor* theMapActor, bool hilight, @@ -116,20 +98,28 @@ public: void SetSelectionProp(const double& theRed = 1, const double& theGreen = 1, const double& theBlue = 0, const int& theWidth = 5); void SetSelectionTolerance(const double& theTolNodes = 0.025, const double& theTolCell = 0.001); + //@} - // Displaymode management + /** @name Displaymode management*/ + //@{ int GetDisplayMode(); void SetDisplayMode(int); + //@} - // Change all actors to wireframe or surface + /** @name Change all actors to wireframe or surface*/ + //@{ void ChangeRepresentationToWireframe(); void ChangeRepresentationToSurface(); + //@} - // Change to wireframe or surface a list of vtkactor + /** @name Change to wireframe or surface a list of vtkactor*/ + //@{ void ChangeRepresentationToWireframe(vtkActorCollection* ListofActors); void ChangeRepresentationToSurface(vtkActorCollection* ListofActors); + //@} - // Erase Display functions + /** @name Erase Display functions*/ + //@{ void EraseAll(); void DisplayAll(); void RemoveAll( const bool immediatly ); @@ -137,6 +127,7 @@ public: void Display( VTKViewer_Actor* SActor, bool immediatly = true ); void Erase( VTKViewer_Actor* SActor, bool immediatly = true ); void Remove( VTKViewer_Actor* SActor, bool updateViewer = true ); + //@} void Update(); @@ -173,8 +164,9 @@ public: VTKViewer_Actor *theActor, TUpdateActor theFun); - // Timer used during various mouse events to figure - // out mouse movements. + /*! Timer used during various mouse events to figure + * out mouse movements. + */ QTimer *mTimer ; int myDisplayMode; @@ -189,7 +181,7 @@ public: vtkCellPicker* myCellPicker; vtkPointPicker* myPointPicker; - // User for switching to stereo mode. + /*! User for switching to stereo mode.*/ int PositionBeforeStereo[2]; public slots: @@ -205,10 +197,6 @@ public: void KeyPressed(QKeyEvent *event) ; private slots: - // Not all of these slots are needed in VTK_MAJOR_VERSION=3, - // but moc does not understand "#if VTK_MAJOR_VERSION". Hence, - // we have to include all of these for the time being. Once, - // this bug in MOC is fixed, we can separate these. void TimerFunc() ; signals: @@ -219,7 +207,9 @@ private: friend class VTKViewer_ViewWindow; VTKViewer_ViewWindow* myViewWnd; + /** Selection node tolerance.*/ double myTolNodes; + /** Selection cell tolerance.*/ double myTolItems; };