From eeaa79f6453284d3822b4a8393d520a2da6f9ae5 Mon Sep 17 00:00:00 2001 From: enk Date: Fri, 15 Jul 2005 12:45:45 +0000 Subject: [PATCH] Update comments --- src/VTKViewer/VTKViewer_Actor.cxx | 94 ++++++++++++++++++---- src/VTKViewer/VTKViewer_Actor.h | 31 +++++-- src/VTKViewer/VTKViewer_Algorithm.h | 13 ++- src/VTKViewer/VTKViewer_CellRectPicker.cxx | 35 ++++++-- src/VTKViewer/VTKViewer_CellRectPicker.h | 31 +------ 5 files changed, 148 insertions(+), 56 deletions(-) diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index de35acf20..5f71ef5dd 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -32,6 +32,7 @@ static void CopyPoints(vtkUnstructuredGrid* theGrid, vtkDataSet *theSourceDataSe vtkStandardNewMacro(VTKViewer_Actor); +/*!Constructor.Initialize default parameters.*/ VTKViewer_Actor::VTKViewer_Actor(){ myIsHighlighted = myIsPreselected = false; @@ -58,6 +59,7 @@ VTKViewer_Actor::VTKViewer_Actor(){ } +/*!Destructor.*/ VTKViewer_Actor::~VTKViewer_Actor(){ SetPreviewProperty(NULL); @@ -76,24 +78,38 @@ VTKViewer_Actor::~VTKViewer_Actor(){ myProperty->Delete(); } +/*!Add VTKViewer_Actor to renderer. + *\param theRenderer - vtkRenderer + */ void VTKViewer_Actor::AddToRender(vtkRenderer* theRenderer){ theRenderer->AddActor(this); } +/*!Remove VTKViewer_Actor from renderer. + *\param theRenderer - vtkRenderer + */ void VTKViewer_Actor::RemoveFromRender(vtkRenderer* theRenderer){ theRenderer->RemoveActor(this); } - +/*!Add transformation to transform filter. + *\param theTransform - transformation. + */ void VTKViewer_Actor::SetTransform(VTKViewer_Transform* theTransform){ myTransformFilter->SetTransform(theTransform); } - +/*!Set mapper to pipeline.\n + *Call method for pipeline initialization. + *\param theMapper - mapper + */ void VTKViewer_Actor::SetMapper(vtkMapper* theMapper){ InitPipeLine(theMapper); } +/*!Initialize sequence of filters for mapper, if \a theMapper is not null. + *\param theMapper - mapper + */ void VTKViewer_Actor::InitPipeLine(vtkMapper* theMapper){ if(theMapper){ int anId = 0; @@ -125,7 +141,7 @@ void VTKViewer_Actor::InitPipeLine(vtkMapper* theMapper){ vtkLODActor::SetMapper(theMapper); } - +/*!*/ void VTKViewer_Actor::Render(vtkRenderer *ren, vtkMapper* m){ if(myIsResolveCoincidentTopology){ int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology(); @@ -144,27 +160,42 @@ void VTKViewer_Actor::Render(vtkRenderer *ren, vtkMapper* m){ } } - +/*!Set flag myIsResolveCoincidentTopology to \a theIsResolve. + *\param theIsResolve - bool flag. + */ void VTKViewer_Actor::SetResolveCoincidentTopology(bool theIsResolve) { myIsResolveCoincidentTopology = theIsResolve; } +/*!Sets polygon offset factor and polygon offset units. + *\param factor - float factor + *\param units - float units + */ void VTKViewer_Actor::SetPolygonOffsetParameters(float factor, float units){ myPolygonOffsetFactor = factor; myPolygonOffsetUnits = units; } +/*!Gets polygon offset factor and polygon offset units. + *\param factor - output float + *\param units - output float + */ void VTKViewer_Actor::GetPolygonOffsetParameters(float& factor, float& units){ factor = myPolygonOffsetFactor; units = myPolygonOffsetUnits; } +/*!Get input data set. + *\retval vtkDataSet pointer. + */ vtkDataSet* VTKViewer_Actor::GetInput(){ return myPassFilter.front()->GetOutput(); } - +/*!Get modification time. + *\retval time - unsigned long. + */ unsigned long int VTKViewer_Actor::GetMTime(){ unsigned long mTime = this->Superclass::GetMTime(); unsigned long time = myTransformFilter->GetMTime(); @@ -176,7 +207,9 @@ unsigned long int VTKViewer_Actor::GetMTime(){ return mTime; } - +/*!Set representation mode. + *\param theMode - int. + */ void VTKViewer_Actor::SetRepresentation(int theMode) { switch(myRepresentation){ case VTK_POINTS : @@ -208,16 +241,28 @@ void VTKViewer_Actor::SetRepresentation(int theMode) { myRepresentation = theMode; } +/*!Get representation. + *\retval representation mode. + */ int VTKViewer_Actor::GetRepresentation(){ return myRepresentation; } - +/*!Get VTK cell by object ID. + *\param theObjID - object ID. + *\retval vtkCell pointer. + */ vtkCell* VTKViewer_Actor::GetElemCell(int theObjID){ return GetInput()->GetCell(theObjID); } - +/*!Get node coordinates by node ID. + *\param theObjID - node ID. + *\retval float array of coordinates. + * \li array[0] - X coordinate. + * \li array[1] - Y coordinate. + * \li array[2] - Z coordinate. + */ float* VTKViewer_Actor::GetNodeCoord(int theObjID){ return GetInput()->GetPoint(theObjID); } @@ -225,8 +270,10 @@ float* VTKViewer_Actor::GetNodeCoord(int theObjID){ //================================================================================= // function : GetObjDimension -// purpose : Return object dimension. -// Virtual method shoulb be redifined by derived classes +/*! purpose : Return object dimension.\n + * Virtual method shoulb be redifined by derived classes + *\param theObjId - object ID. + */ //================================================================================= int VTKViewer_Actor::GetObjDimension( const int theObjId ) { @@ -235,26 +282,40 @@ int VTKViewer_Actor::GetObjDimension( const int theObjId ) return 0; } - +/*!Get infinite flag*/ bool VTKViewer_Actor::IsInfinitive(){ return myIsInfinite; } - +/*!Set property - opacity. + *\param theOpacity - new apacity + */ void VTKViewer_Actor::SetOpacity(float theOpacity){ myOpacity = theOpacity; GetProperty()->SetOpacity(theOpacity); } +/*!Get property - opacity. + *\retval float value. + */ float VTKViewer_Actor::GetOpacity(){ return myOpacity; } - +/*!Set property - color + *\param r - float Red value + *\param g - float Green value + *\param b - float Blue value + */ void VTKViewer_Actor::SetColor(float r,float g,float b){ GetProperty()->SetColor(r,g,b); } +/*!Get property - color + *\param r - output float Red value + *\param g - output float Green value + *\param b - output float Blue value + */ void VTKViewer_Actor::GetColor(float& r,float& g,float& b){ float aColor[3]; GetProperty()->GetColor(aColor); @@ -263,11 +324,16 @@ void VTKViewer_Actor::GetColor(float& r,float& g,float& b){ b = aColor[2]; } - +/*!Get display mode. + *\retval int value + */ int VTKViewer_Actor::getDisplayMode(){ return myDisplayMode; } +/*!Set display mode + *\param theMode - integer value. + */ void VTKViewer_Actor::setDisplayMode(int theMode){ SetRepresentation(theMode+1); myDisplayMode = GetRepresentation() - 1; diff --git a/src/VTKViewer/VTKViewer_Actor.h b/src/VTKViewer/VTKViewer_Actor.h index 557af907d..ad050d321 100755 --- a/src/VTKViewer/VTKViewer_Actor.h +++ b/src/VTKViewer/VTKViewer_Actor.h @@ -22,16 +22,19 @@ class VTKViewer_PassThroughFilter; #define VTKViewer_POINT_SIZE 3 /*! \class vtkLODActor - * \brief For more information see VTK documentation + * \brief For more information see VTK documentation */ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor { public: + /*!Create new instance of actor.*/ static VTKViewer_Actor* New(); vtkTypeMacro( VTKViewer_Actor, vtkLODActor ); + /*!Get name of the actor*/ virtual const char* getName() { return myName.c_str(); } + /*!Set name of the actor*/ virtual void setName(const char* theName){ myName = theName;} //! To generate highlight automaticaly @@ -59,19 +62,20 @@ public: virtual void RemoveFromRender(vtkRenderer* theRenderer); - /*! For selection mapping purpose */ + /** @name For selection mapping purpose */ + //@{ virtual int GetNodeObjId(int theVtkID) { return theVtkID;} virtual float* GetNodeCoord(int theObjID); virtual int GetElemObjId(int theVtkID) { return theVtkID;} virtual vtkCell* GetElemCell(int theObjID); + //@} virtual int GetObjDimension( const int theObjId ); virtual void SetMapper(vtkMapper* theMapper); virtual vtkDataSet* GetInput(); - virtual void SetTransform(VTKViewer_Transform* theTransform); virtual unsigned long int GetMTime(); @@ -81,8 +85,9 @@ public: virtual int getDisplayMode(); virtual void setDisplayMode(int theMode); - //! Infinitive means actor without size (point for example), - //! which is not taken into account in calculation of boundaries of the scene + /*! Infinitive means actor without size (point for example), \n + * which is not taken into account in calculation of boundaries of the scene + */ void SetInfinitive(bool theIsInfinite) { myIsInfinite = theIsInfinite; } virtual bool IsInfinitive(); @@ -93,26 +98,42 @@ public: virtual void Render(vtkRenderer *, vtkMapper *); protected: + /*!resolve coincedent topology flag*/ bool myIsResolveCoincidentTopology; + /*!polygon offset factor*/ float myPolygonOffsetFactor; + /*!polygon offset units*/ float myPolygonOffsetUnits; + /*!Actor name.*/ std::string myName; + /*!preview property*/ vtkProperty *PreviewProperty; + /*!preselected flag*/ bool myIsPreselected; + /*!opacity*/ float myOpacity; + /*!highlighted flag*/ bool myIsHighlighted; + /*!display mode*/ int myDisplayMode; + /*!infinite flag*/ bool myIsInfinite; + /*!store mapping flag*/ bool myStoreMapping; + /*!geometry filter*/ VTKViewer_GeometryFilter *myGeomFilter; + /*!transform filter*/ VTKViewer_TransformFilter *myTransformFilter; + /*!vector of passive filters(siz filters used)*/ std::vector myPassFilter; + /*!presentation mode*/ int myRepresentation; + /*!property*/ vtkProperty *myProperty; //! Main method, which calculate output. diff --git a/src/VTKViewer/VTKViewer_Algorithm.h b/src/VTKViewer/VTKViewer_Algorithm.h index b3879a25b..6dcde3a40 100644 --- a/src/VTKViewer/VTKViewer_Algorithm.h +++ b/src/VTKViewer/VTKViewer_Algorithm.h @@ -35,6 +35,9 @@ class vtkActor; namespace VTK { + /*!For each actor(for ex: someActor) from \a theCollection(that can be dynamic cast to type TActor)\n + * Call method \a theFun(someActor) + */ template TFunction ForEach(vtkActorCollection *theCollection, TFunction theFun) { @@ -47,7 +50,10 @@ namespace VTK return theFun; } - + /*!For each actor(for ex: someActor) from \a theCollection(that can be dynamic cast to type TActor and \n + * method \a thePredicate(someActor) return true) \n + * Call method \a theFun(someActor) + */ template TFunction ForEachIf(vtkActorCollection *theCollection, TPredicate thePredicate, @@ -63,7 +69,10 @@ namespace VTK return theFun; } - + /*!Find actor from collection, that can be dynamicaly cast to \a TActor, \n + *and method \a thePredicate(someActor) return true) \n + *\retval someActor + */ template TActor* Find(vtkActorCollection *theCollection, TPredicate thePredicate) { diff --git a/src/VTKViewer/VTKViewer_CellRectPicker.cxx b/src/VTKViewer/VTKViewer_CellRectPicker.cxx index 7704a4019..e6647d908 100755 --- a/src/VTKViewer/VTKViewer_CellRectPicker.cxx +++ b/src/VTKViewer/VTKViewer_CellRectPicker.cxx @@ -16,7 +16,10 @@ vtkStandardNewMacro(VTKViewer_CellRectPicker); -//**************************************************************** +/*!Constructor.\n + * \li create instance of generic cell + * \li create two instances of Quad. + */ VTKViewer_CellRectPicker::VTKViewer_CellRectPicker() { this->Cell = vtkGenericCell::New(); @@ -24,7 +27,10 @@ VTKViewer_CellRectPicker::VTKViewer_CellRectPicker() this->Quad2 = vtkQuad::New(); } -//**************************************************************** +/*!Destructor. + * \li Delete generic cell + * \li Delete two quads. + */ VTKViewer_CellRectPicker::~VTKViewer_CellRectPicker() { this->Cell->Delete(); @@ -32,14 +38,14 @@ VTKViewer_CellRectPicker::~VTKViewer_CellRectPicker() this->Quad2->Delete(); } -//**************************************************************** +/*!Clear \a ActorData and call VTKViewer_RectPicker::Initialize() method*/ void VTKViewer_CellRectPicker::Initialize() { ActorData.clear(); this->VTKViewer_RectPicker::Initialize(); } -//**************************************************************** +/*!*/ float VTKViewer_CellRectPicker::IntersectWithHex(float p1[4][4], float p2[4][4], float tol, vtkAssemblyPath *path, vtkProp3D *prop3D, vtkAbstractMapper3D *m) @@ -162,7 +168,7 @@ float VTKViewer_CellRectPicker::IntersectWithHex(float p1[4][4], float p2[4][4], return tMin; } -//**************************************************************** +/*!*/ void VTKViewer_CellRectPicker::IncludeCell(vtkDataSet* input, VTKViewer_CellData cellData, VTKViewer_CellDataSet& dataList) @@ -236,7 +242,7 @@ void VTKViewer_CellRectPicker::IncludeCell(vtkDataSet* input, cell2->Delete(); } -//**************************************************************** +/*!*/ void VTKViewer_CellRectPicker::IncludeActor(vtkProp3D* prop, vtkDataSet* input, VTKViewer_CellDataSet& dataList) @@ -302,7 +308,16 @@ void VTKViewer_CellRectPicker::IncludeActor(vtkProp3D* prop, cell2->Delete(); } -//**************************************************************** +/*! The method returns a non-zero value, if the cells intersect each other + * in the direction dir[3]. + * \param c1 - first vtkCell pointer + * \param d1 - + * \param c2 - second vtkCell pointer + * \param d2 - + * \param dir[3] - direction + * \retval integer - Returned value is 1 if the first cell is top of + * the second one according to direction and 2 if the second cell is top. + */ int VTKViewer_CellRectPicker::IntersectCells(vtkCell* c1, float d1, vtkCell* c2, float d2, float dir[3]) { int i, k; @@ -362,7 +377,11 @@ int VTKViewer_CellRectPicker::IntersectCells(vtkCell* c1, float d1, vtkCell* c2, return result; } -//**************************************************************** +/*! Check point position. + * \param point[3] - point + * \param list - point data set + * \retval 0 or 1 - The method returns a non-zero value, if the point is inlide point data set + */ char VTKViewer_CellRectPicker::PointInside(float point[3], vtkPoints* list) { int i, k, l, n; diff --git a/src/VTKViewer/VTKViewer_CellRectPicker.h b/src/VTKViewer/VTKViewer_CellRectPicker.h index 94785d295..8cbbe245d 100755 --- a/src/VTKViewer/VTKViewer_CellRectPicker.h +++ b/src/VTKViewer/VTKViewer_CellRectPicker.h @@ -46,13 +46,13 @@ typedef std::map VTKViewer_ActorDataMap; class vtkCell; class vtkGenericCell; class vtkQuad; -/*! \class VTKViewer_CellRectPicker - * \brief Rectangular cell picker class. - */ +/*!Rectangular cell picker class.*/ class VTK_EXPORT VTKViewer_CellRectPicker : public VTKViewer_RectPicker { public: + /*!Create new instance of CellRectPicker class.*/ static VTKViewer_CellRectPicker *New(); + /*! \fn vtkTypeMacro(VTKViewer_CellRectPicker,VTKViewer_RectPicker); * \brief VTK type macros. */ @@ -66,25 +66,8 @@ public: VTKViewer_CellDataSet GetCellData(vtkActor* actor) { return this->ActorData[actor]; } - /*! \fn static int IntersectCells(vtkCell* c1, float d1, vtkCell* c2, float d2, float dir[3]); - * \brief The method returns a non-zero value, if the cells intersect each other - * in the direction dir[3]. - * \param c1 - first vtkCell pointer - * \param d1 - - * \param c2 - second vtkCell pointer - * \param d2 - - * \param dir[3] - direction - * \retval integer - Returned value is 1 if the first cell is top of - * the second one according to direction and 2 if the second cell is top. - */ static int IntersectCells(vtkCell* c1, float d1, vtkCell* c2, float d2, float dir[3]); - /*! \fn static char PointInside(float point[3], vtkPoints* list); - * \brief Check point position. - * \param point[3] - point - * \param list - point data set - * \retval 0 or 1 - The method returns a non-zero value, if the point is inlide point data set - */ static char PointInside(float point[3], vtkPoints* list); protected: @@ -94,16 +77,10 @@ protected: VTKViewer_ActorDataMap ActorData; - /*! \fn virtual float IntersectWithHex(float p1[4][4], float p2[4][4], float tol, - * vtkAssemblyPath *path, vtkProp3D *p, - * vtkAbstractMapper3D *m); - */ virtual float IntersectWithHex(float p1[4][4], float p2[4][4], float tol, vtkAssemblyPath *path, vtkProp3D *p, vtkAbstractMapper3D *m); - /*! \fn void Initialize(); - * \brief Clear \a ActorData and call VTKViewer_RectPicker::Initialize() method - */ + void Initialize(); -- 2.30.2