vtkStandardNewMacro(VTKViewer_Actor);
+/*!Constructor.Initialize default parameters.*/
VTKViewer_Actor::VTKViewer_Actor(){
myIsHighlighted = myIsPreselected = false;
}
+/*!Destructor.*/
VTKViewer_Actor::~VTKViewer_Actor(){
SetPreviewProperty(NULL);
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;
vtkLODActor::SetMapper(theMapper);
}
-
+/*!*/
void VTKViewer_Actor::Render(vtkRenderer *ren, vtkMapper* m){
if(myIsResolveCoincidentTopology){
int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();
}
}
-
+/*!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();
return mTime;
}
-
+/*!Set representation mode.
+ *\param theMode - int.
+ */
void VTKViewer_Actor::SetRepresentation(int theMode) {
switch(myRepresentation){
case VTK_POINTS :
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);
}
//=================================================================================
// 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 )
{
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);
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;
#define VTKViewer_POINT_SIZE 3
/*! \class vtkLODActor
- * \brief For more information see <a href="http://www.vtk.org/">VTK documentation
+ * \brief For more information see <a href="http://www.vtk.org/">VTK documentation</a>
*/
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
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();
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();
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<VTKViewer_PassThroughFilter*> myPassFilter;
+ /*!presentation mode*/
int myRepresentation;
+ /*!property*/
vtkProperty *myProperty;
//! Main method, which calculate output.
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<typename TActor, typename TFunction>
TFunction ForEach(vtkActorCollection *theCollection, TFunction theFun)
{
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<typename TActor, typename TPredicate, typename TFunction>
TFunction ForEachIf(vtkActorCollection *theCollection,
TPredicate thePredicate,
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<typename TActor, typename TPredicate>
TActor* Find(vtkActorCollection *theCollection, TPredicate thePredicate)
{
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();
this->Quad2 = vtkQuad::New();
}
-//****************************************************************
+/*!Destructor.
+ * \li Delete generic cell
+ * \li Delete two quads.
+ */
VTKViewer_CellRectPicker::~VTKViewer_CellRectPicker()
{
this->Cell->Delete();
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)
return tMin;
}
-//****************************************************************
+/*!*/
void VTKViewer_CellRectPicker::IncludeCell(vtkDataSet* input,
VTKViewer_CellData cellData,
VTKViewer_CellDataSet& dataList)
cell2->Delete();
}
-//****************************************************************
+/*!*/
void VTKViewer_CellRectPicker::IncludeActor(vtkProp3D* prop,
vtkDataSet* input,
VTKViewer_CellDataSet& dataList)
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;
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;
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.
*/
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:
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();