vtkCxxRevisionMacro(VTKViewer_ShrinkFilter, "$Revision$");
vtkStandardNewMacro(VTKViewer_ShrinkFilter);
-
+/*!Constructor. Sets store mapping to zero.*/
VTKViewer_ShrinkFilter::VTKViewer_ShrinkFilter():
myStoreMapping(0)
{}
-
+/*!Destructor.*/
VTKViewer_ShrinkFilter::~VTKViewer_ShrinkFilter()
{}
+/*!Execute method. Calculate output.*/
void VTKViewer_ShrinkFilter::Execute()
{
vtkPoints *newPts;
newPts->Delete();
}
-
+/*!Sets store mapping.*/
void VTKViewer_ShrinkFilter::SetStoreMapping(int theStoreMapping){
myStoreMapping = theStoreMapping;
this->Modified();
}
+/*!Return node object id by vtk node id.
+ *\retval -1 - if no object, else return id.
+ */
vtkIdType VTKViewer_ShrinkFilter::GetNodeObjId(int theVtkID){
if(myVTK2ObjIds.empty() || theVtkID > myVTK2ObjIds.size()) return -1;
return myVTK2ObjIds.at(theVtkID);
#include <vector>
+/*!Shrink cells composing an arbitrary data set.
+ *\warning It is possible to turn cells inside out or cause self intersection in special cases.
+ */
class VTKVIEWER_EXPORT VTKViewer_ShrinkFilter : public vtkShrinkFilter
{
public:
+ /*!Create new instance of VTKViewer_ShrinkFilter.*/
static VTKViewer_ShrinkFilter *New();
vtkTypeRevisionMacro(VTKViewer_ShrinkFilter, vtkShrinkFilter);
void SetStoreMapping(int theStoreMapping);
+ /*!Gets store mapping flag.*/
int GetStoreMapping(){ return myStoreMapping;}
virtual vtkIdType GetNodeObjId(int theVtkID);
+ /*!Return element id by vtk id.*/
virtual vtkIdType GetElemObjId(int theVtkID) { return theVtkID;}
protected:
~VTKViewer_ShrinkFilter();
void Execute();
+ /*!Not implemented.*/
void UnstructuredGridExecute();
private:
vtkStandardNewMacro(VTKViewer_Transform);
+/*!Sets matrix scale.*/
void VTKViewer_Transform::SetMatrixScale(double theScaleX, double theScaleY, double theScaleZ){
double aMatrix[16] = {theScaleX,0,0,0,
0,theScaleY,0,0,
this->SetMatrix(aMatrix);
}
+/*!Gets matrix scale.*/
void VTKViewer_Transform::GetMatrixScale(double theScale[3]){
vtkMatrix4x4 *aTMatrix=this->GetMatrix();
const double aScaleX = aTMatrix->GetElement(0,0);
theScale[2] = aScaleZ;
}
+/*!Checks: Is matrix identity, where used EPS value.
+ *If |aScaleX-1|<EPS && |aScaleY-1|<EPS && |aScaleY-1|<EPS return 1, esle 0.
+ */
int VTKViewer_Transform::IsIdentity(){
double aScale[3];
this->GetMatrixScale(aScale);
#include <vtkTransform.h>
+/*!\brief Describes linear transformations via a 4x4 matrix.
+ *@see vtkTransform class
+ */
class VTKVIEWER_EXPORT VTKViewer_Transform : public vtkTransform
{
public:
+ /*!Create new instance of VTKViewer_Transform.*/
static VTKViewer_Transform *New();
vtkTypeMacro( VTKViewer_Transform, vtkTransform );
void GetMatrixScale(double theScale[3]);
protected:
- VTKViewer_Transform() {}
- VTKViewer_Transform(const VTKViewer_Transform&) {}
- ~VTKViewer_Transform() {}
+ /*!Constructor.*/
+ VTKViewer_Transform() {/*!Do nothing*/}
+ /*!Copy contructor.*/
+ VTKViewer_Transform(const VTKViewer_Transform&) {/*!Do nothing*/}
+ /*!Destructor.*/
+ ~VTKViewer_Transform() {/*!Do nothing*/}
- void operator=( const VTKViewer_Transform& ) {}
+ /*!Operator = */
+ void operator=( const VTKViewer_Transform& ) {/*!Do nothing*/}
};
#endif
vtkStandardNewMacro(VTKViewer_TransformFilter);
+/*!Execution method. Calculate output.*/
void VTKViewer_TransformFilter::Execute(){
vtkPoints *inPts;
vtkPoints *newPts;
#include <vtkTransformFilter.h>
+/*!Transform points and associated normals and vectors
+ *@see vtkTransformFilter
+ */
class VTKVIEWER_EXPORT VTKViewer_TransformFilter : public vtkTransformFilter
{
public:
+ /*!Create new instance of VTKViewer_TransformFilter.*/
static VTKViewer_TransformFilter *New();
vtkTypeMacro(VTKViewer_TransformFilter,vtkTransformFilter);
protected:
- VTKViewer_TransformFilter() {}
- ~VTKViewer_TransformFilter() {}
- VTKViewer_TransformFilter(const VTKViewer_TransformFilter&) {}
- void operator=(const VTKViewer_TransformFilter&) {}
+ /*!Constructor.*/
+ VTKViewer_TransformFilter() {/*!Do nothing*/}
+ /*!Destructor.*/
+ ~VTKViewer_TransformFilter() {/*!Do nothing*/}
+ /*!Copy constructor.*/
+ VTKViewer_TransformFilter(const VTKViewer_TransformFilter&) {/*!Do nothing*/}
+ /*!Operator = */
+ void operator=(const VTKViewer_TransformFilter&) {/*!Do nothing*/}
void Execute();
};
vtkStandardNewMacro(VTKViewer_UnScaledActor);
-//****************************************************************
-VTKViewer_UnScaledActor::VTKViewer_UnScaledActor() {}
+/*!Constructor*/
+VTKViewer_UnScaledActor::VTKViewer_UnScaledActor() {/*!Do nothing*/}
-//****************************************************************
+/*!This causes the actor to be rendered.
+ * Set new scale for actor.
+ */
void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
{
if(theRenderer){
vtkFollower::Render(theRenderer);
}
-//****************************************************************
+/*! Sets \a mySize= \a theSize variable.
+ * \param theSize - integer size
+ */
void VTKViewer_UnScaledActor::SetSize(int theSize){
mySize = theSize;
}
vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor);
vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,VTKViewer_UnScaledActor);
-//****************************************************************
+/*!Adds Label and Arrow actors to \a theRenderer.*/
void VTKViewer_LineActor::Render(vtkRenderer *theRenderer)
{
if(LabelActor && LabelActor->GetVisibility()){
vtkFollower::Render(theRenderer);
}
-//****************************************************************
VTKViewer_Axis::VTKViewer_Axis()
{
/*! \li Initialize the Line pipe-line representation*/
myVisibility = VTKViewer_Trihedron::eOn;
}
-//****************************************************************
VTKViewer_Axis::~VTKViewer_Axis()
{
/*! \li Destroy of the Label pipe-line representation */
myLineSource->Delete();
}
-//****************************************************************
void VTKViewer_Axis::AddToRender(vtkRenderer* theRenderer){
/*! \li Order of the calls are important*/
theRenderer->AddActor(myLineActor);
theRenderer->AddActor(myArrowActor);
}
-//****************************************************************
void VTKViewer_Axis::SetVisibility(VTKViewer_Trihedron::TVisibility theVis)
{
switch(theVis){
myLabelActor->SetCamera(theCamera);
}
-//****************************************************************
void VTKViewer_Axis::SetProperty(vtkProperty* theProperty){
myLabelActor->SetProperty(theProperty);
myArrowActor->SetProperty(theProperty);
myLineActor->SetProperty(theProperty);
}
-//****************************************************************
void VTKViewer_Axis::SetSize(float theSize)
{
float aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize};
myLabelActor->AddPosition(aPosition);
}
-//****************************************************************
/*! \class VTKViewer_XAxis
* \brief X Axis actor
*/
vtkStandardNewMacro(VTKViewer_XAxis);
+/*!Initialize X Axis*/
VTKViewer_XAxis::VTKViewer_XAxis(){
myDir[0] = 1.0; myDir[1] = 0.0; myDir[2] = 0.0;
myRot[0] = 0.0; myRot[1] = 0.0; myRot[2] = 0.0;
aProperty->Delete();
}
-//==============================================================================
/*! \class VTKViewer_YAxis
* \brief Y Axis actor
*/
vtkStandardNewMacro(VTKViewer_YAxis);
-//****************************************************************
+/*!Initialize Y Axis*/
VTKViewer_YAxis::VTKViewer_YAxis()
{
myDir[0] = 0.0; myDir[1] = 1.0; myDir[2] = 0.0;
aProperty->Delete();
}
-//****************************************************************
/*! \class VTKViewer_ZAxis
* \brief Z Axis actor
*/
vtkStandardNewMacro(VTKViewer_ZAxis);
-//****************************************************************
+/*!Initialize Z Axis*/
VTKViewer_ZAxis::VTKViewer_ZAxis()
{
myDir[0] = 0.0; myDir[1] = 0.0; myDir[2] = 1.0;
vtkStandardNewMacro(VTKViewer_Trihedron);
-//****************************************************************
VTKViewer_Trihedron::VTKViewer_Trihedron()
{
myPresent = vtkActorCollection::New();
SetSize(aSize);
}
-//****************************************************************
VTKViewer_Trihedron::~VTKViewer_Trihedron()
{
myPresent->RemoveAllItems();
myAxis[i]->Delete();
}
-//****************************************************************
void VTKViewer_Trihedron::SetSize(float theSize)
{
mySize = theSize;
myAxis[i]->SetSize(theSize);
}
-//****************************************************************
void VTKViewer_Trihedron::SetVisibility(TVisibility theVis)
{
for(int i = 0; i < 3; i++)
myAxis[i]->SetVisibility(theVis);
}
-//****************************************************************
VTKViewer_Trihedron::TVisibility VTKViewer_Trihedron::GetVisibility()
{
return myAxis[0]->GetVisibility();
}
-//****************************************************************
void VTKViewer_Trihedron::AddToRender(vtkRenderer* theRenderer)
{
vtkCamera* aCamera = theRenderer->GetActiveCamera();
}
}
-//****************************************************************
void VTKViewer_Trihedron::RemoveFromRender(vtkRenderer* theRenderer)
{
myPresent->InitTraversal();
theRenderer->RemoveActor(anActor);
}
-//****************************************************************
int VTKViewer_Trihedron::GetVisibleActorCount(vtkRenderer* theRenderer)
{
//TVisibility aVis = GetVisibility();
class VTKViewer_VectorText;
/*! \class vtkFollower
- * \brief For more information see <a href="http://www.vtk.org/">VTK documentation
+ * See <a href="http://www.vtk.org/">vtk documentation</a>
*/
-/*! \class VTKViewer_UnScaledActor
- * \brief Same as VTK class vtkFollower
+/*!a subclass of actor that always faces the camera
+ *@see vtkFollower
*/
class VTKViewer_UnScaledActor: public vtkFollower
{
- /*! \fn VTKViewer_UnScaledActor(const VTKViewer_UnScaledActor&)
- */
VTKViewer_UnScaledActor(const VTKViewer_UnScaledActor&);
public:
- /*! \fn vtkTypeMacro(VTKViewer_UnScaledActor,vtkFollower);
- * \brief VTK type macros.
- */
vtkTypeMacro(VTKViewer_UnScaledActor,vtkFollower);
- /*! \fn static VTKViewer_UnScaledActor *New();
- */
+ /*!Create new instance of VTKViewer_UnScaledActor.*/
static VTKViewer_UnScaledActor *New();
- /*! \fn virtual void SetSize(int theSize);
- * \brief Sets \a mySize= \a theSize variable.
- * \param theSize - integer size
- */
virtual void SetSize(int theSize);
- /*! \fn virtual void Render(vtkRenderer *theRenderer);
- * \brief Render function.
- */
virtual void Render(vtkRenderer *theRenderer);
protected:
- /*! \fn VTKViewer_UnScaledActor();
- * \brief Constructor.
- */
VTKViewer_UnScaledActor();
- /*! \fn VTKViewer_UnScaledActor();
- * \brief Destructor..
- */
+ /*!Destructor. Do nothing.*/
~VTKViewer_UnScaledActor(){}
int mySize;
};
-//****************************************************************
-/*! \class VTKViewer_LineActor
+/*!a subclass of actor that always faces the camera
+ *@see vtkFollower
*/
class VTKViewer_LineActor: public vtkFollower
{
- /*! \fn VTKViewer_LineActor(const VTKViewer_LineActor&);
- */
VTKViewer_LineActor(const VTKViewer_LineActor&);
public:
- /*! \fn vtkTypeMacro(VTKViewer_LineActor,vtkFollower);
- * \brief VTK type macros.
- */
+ /*!vtk type macros.*/
vtkTypeMacro(VTKViewer_LineActor,vtkFollower);
- /*! \fn static VTKViewer_LineActor *New();
- */
+ /*!Create new instance of VTKViewer_LineActor.*/
static VTKViewer_LineActor *New();
- /*! \fn void SetLabelActor(VTKViewer_UnScaledActor* theLabelActor);
- * \brief Sets Lable actor.
+ /*! Sets Lable actor.
* \param theLabelActor - VTKViewer_UnScaledActor
*/
void SetLabelActor(VTKViewer_UnScaledActor* theLabelActor);
- /*! \fn void SetArrowActor(VTKViewer_UnScaledActor* theLabelActor);
- * \brief Sets Arrow actor.
+ /*! Sets Arrow actor.
* \param theLabelActor - VTKViewer_UnScaledActor
*/
void SetArrowActor(VTKViewer_UnScaledActor* theLabelActor);
- /*! \fn virtual void Render(vtkRenderer *theRenderer);
- * \brief Adds theRenderer to \a LabelActor and \a ArrowActor, if need.
- */
virtual void Render(vtkRenderer *theRenderer);
protected:
- /*! \fn VTKViewer_LineActor()
- * \brief Constructor which sets \a LabelActor and \a ArrowActor to NULL
- */
+ /*! Constructor which sets \a LabelActor and \a ArrowActor to NULL*/
VTKViewer_LineActor(){
LabelActor = NULL;
ArrowActor = NULL;
}
- /*! \fn ~VTKViewer_LineActor()
- * \brief Destructor which call SetLabelActor(NULL) and SetArrowActor(NULL)
- */
+ /*!Destructor which call SetLabelActor(NULL) and SetArrowActor(NULL)*/
~VTKViewer_LineActor(){
SetLabelActor(NULL);
SetArrowActor(NULL);
}
- /*! \var LabelActor
- * \brief Label actor pointer
- */
+ /*!Label actor pointer*/
VTKViewer_UnScaledActor* LabelActor;
- /*! \var ArrowActor
- * \brief Arrow actor pointer
- */
+ /*!Arrow actor pointer*/
VTKViewer_UnScaledActor* ArrowActor;
};
//****************************************************************
-/*! \class VTKViewer_Trihedron
- */
+/*!This class provide support trihedron object in vtk viewer.*/
class VTKVIEWER_EXPORT VTKViewer_Trihedron : public vtkObject
{
protected:
- /*! \fn VTKViewer_Trihedron();
- * \brief Initialize fields by default values.
- */
+ /*!Initialize fields by default values.*/
VTKViewer_Trihedron();
- /*! \fn VTKViewer_Trihedron(const VTKViewer_Trihedron&);
- * \brief Const copy constructor.
- */
+ /*!Const copy constructor.*/
VTKViewer_Trihedron(const VTKViewer_Trihedron&);
- /*! \fn ~VTKViewer_Trihedron();
- * \brief Destructor. Remove all fileds.
- */
+ /*!Destructor. Remove all fileds.*/
virtual ~VTKViewer_Trihedron();
public:
- /*! \fn vtkTypeMacro(VTKViewer_Trihedron,vtkObject);
- * \brief VTK type macros.
- */
+ /*!vtk type macros.*/
vtkTypeMacro(VTKViewer_Trihedron,vtkObject);
- /*! \fn static VTKViewer_Trihedron *New();
- */
+ /*!Create new instance of VTKViewer_Trihedron.*/
static VTKViewer_Trihedron *New();
- /*! \fn virtual void SetSize(float theSize);
- * \brief Sets size of trihedron.
+ /*!Sets size of trihedron.
* \param theSize - float value
*/
virtual void SetSize(float theSize);
- /*! \fn virtual float GetSize() { return mySize;}
- * \brief Get size of trihedron.
+ /*! Get size of trihedron.
* \retval mySize - float value
*/
virtual float GetSize() { return mySize;}
enum TVisibility{eOff, eOn, eOnlyLineOn};
- /*! \fn virtual void SetVisibility(TVisibility theVis);
- * \brief Sets visibility for all Axis in \a theVis
- */
+ /*! Sets visibility for all Axis to \a theVis*/
virtual void SetVisibility(TVisibility theVis);
- /*! \fn virtual void VisibilityOff()
- * \brief OFF visibility for all Axis.
- */
+ /*! OFF visibility for all Axis.*/
virtual void VisibilityOff() { SetVisibility(eOff);}
- /*! \fn virtual void VisibilityOn()
- * \brief ON visibility for all Axis.
- */
+ /*! ON visibility for all Axis.*/
virtual void VisibilityOn() { SetVisibility(eOn);}
- /*! \fn virtual TVisibility GetVisibility();
- * \brief Gets visibility of myAxis[0] actor.
- */
+ /*! Gets visibility of myAxis[0] actor.*/
virtual TVisibility GetVisibility();
- /*! \fn virtual void AddToRender(vtkRenderer* theRenderer);
- * \brief Add to render all Axis
+ /*! Add to render all Axis
* \param theRenderer - vtkRenderer pointer
*/
virtual void AddToRender(vtkRenderer* theRenderer);
- /*! \fn virtual void RemoveFromRender(vtkRenderer* theRenderer);
- * \brief Remove all actors from \a theRenderer which are in myPresent.
+ /*! Remove all actors from \a theRenderer which are in myPresent.
* \param theRenderer - vtkRenderer pointer
*/
virtual void RemoveFromRender(vtkRenderer* theRenderer);
- /*! \fn virtual int GetVisibleActorCount(vtkRenderer* theRenderer);
- * \brief Return count of visible actors.
+ /*! Return count of visible actors.
* \param theRenderer - vtkRenderer pointer
*/
virtual int GetVisibleActorCount(vtkRenderer* theRenderer);
protected:
- /*! \var myPresent
- * \brief Actor collection
- */
+ /*! Actor collection*/
vtkActorCollection* myPresent;
- /*! \var myAxis[3]
- * \brief \li myAxis[0] - X Axis actor
- * \brief \li myAxis[1] - Y Axis actor
- * \brief \li myAxis[2] - Z Axis actor
+ /*! \li myAxis[0] - X Axis actor
+ * \li myAxis[1] - Y Axis actor
+ * \li myAxis[2] - Z Axis actor
*/
VTKViewer_Axis* myAxis[3];
- /*! \var mySize
- * \brief Common size for trihedron, for each axis.
- */
+ /*! Common size for trihedron, for each axis.*/
float mySize;
};
//****************************************************************
-/*! \class VTKViewer_Axis
- * \brief The base class for concreate Axis.
+/*!The base class for concreate Axis.
* Its only duty is to give correct initialization and destruction
* of its pipe-lines
*/
class VTKViewer_Axis : public vtkObject
{
protected:
- /*! \fn VTKViewer_Axis()
- */
VTKViewer_Axis();
- /*! \fn VTKViewer_Axis(const VTKViewer_Axis&)
- */
VTKViewer_Axis(const VTKViewer_Axis&);
- /*! \fn virtual ~VTKViewer_Axis()
- */
virtual ~VTKViewer_Axis();
public:
- /*! \fn vtkTypeMacro(VTKViewer_Axis,vtkObject);
- * \brief VTK type macros.
- */
+ /*!vtk type macros.*/
vtkTypeMacro(VTKViewer_Axis,vtkObject);
- /*! \fn virtual void AddToRender(vtkRenderer* theRenderer);
- * \brief Add to \a theRenderer actors: myLineActor,myLabelActor,myArrowActor
+ /*! Add to \a theRenderer actors: myLineActor,myLabelActor,myArrowActor
*/
virtual void AddToRender(vtkRenderer* theRenderer);
- /*! \fn virtual void SetVisibility(VTKViewer_Trihedron::TVisibility theVis);
- * \brief Sets visibility for actors: myLineActor,myLabelActor,myArrowActor
+ /*! Sets visibility for actors: myLineActor,myLabelActor,myArrowActor
*/
virtual void SetVisibility(VTKViewer_Trihedron::TVisibility theVis);
- /*! \fn virtual VTKViewer_Trihedron::TVisibility GetVisibility()
- * \brief Return visibility of VTKViewer_Axis
+ /*! Return visibility of VTKViewer_Axis
* \retval myVisibility
*/
virtual VTKViewer_Trihedron::TVisibility GetVisibility() { return myVisibility; }
- /*! \fn virtual void SetCamera(vtkCamera* theCamera);
- * \brief Set camera for myLabelActor
+ /*! Set camera for myLabelActor
*/
virtual void SetCamera(vtkCamera* theCamera);
- /*! \fn virtual void SetProperty(vtkProperty* theProperty);
- * \brief Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
+ /*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
*/
virtual void SetProperty(vtkProperty* theProperty);
- /*! \fn virtual void SetSize(float theSize);
- * \brief Set size of VTKViewer_Axis
+ /*! Set size of VTKViewer_Axis
*/
virtual void SetSize(float theSize);
- /*! \fn virtual VTKViewer_UnScaledActor* GetLabel()
- * \brief Get label actor.
+ /*! Get label actor.
* \retval Return myLabelActor.
*/
virtual VTKViewer_UnScaledActor* GetLabel() { return myLabelActor; }
- /*! \fn virtual VTKViewer_UnScaledActor* GetArrow()
- * \brief Get arrow actor.
+ /*! Get arrow actor.
* \retval Return myArrowActor
*/
virtual VTKViewer_UnScaledActor* GetArrow() { return myArrowActor; }
protected:
- /*! \var myVisibility
- * \brief Visibility flag.
+ /*! Visibility flag.
*/
VTKViewer_Trihedron::TVisibility myVisibility;
/*! \var myDir[3]
- * \brief Direction vector
+ * Direction vector
*/
/*! \var myRot[3]
- * \brief Orientation vector
+ * Orientation vector
*/
float myDir[3], myRot[3];
- /*! \var myLineActor
- * \brief VTKViewer_LineActor actor pointer
+ /*! VTKViewer_LineActor actor pointer
*/
VTKViewer_LineActor *myLineActor;
- /*! \var myArrowActor
- * \brief VTKViewer_UnScaledActor actor pointer
+ /*! VTKViewer_UnScaledActor actor pointer
*/
VTKViewer_UnScaledActor *myArrowActor;
- /*! \var myLabelActor
- * \brief VTKViewer_UnScaledActor actor pointer
+ /*! VTKViewer_UnScaledActor actor pointer
*/
VTKViewer_UnScaledActor *myLabelActor;
- /*! \var myMapper[3]
- * \brief \li myMapper[0] - for the Line pipe-line representation
- * \brief \li myMapper[1] - for the Arrow pipe-line representation
- * \brief \li myMapper[2] - for the Label pipe-line representation
+ /*! \li myMapper[0] - for the Line pipe-line representation
+ * \li myMapper[1] - for the Arrow pipe-line representation
+ * \li myMapper[2] - for the Label pipe-line representation
*/
vtkPolyDataMapper *myMapper[3];
- /*! \var myLineSource
- * \brief vtkLineSource pointer (Line)
+ /*! vtkLineSource pointer (Line)
*/
vtkLineSource *myLineSource;
- /*! \var myConeSource
- * \brief vtkConeSource pointer (Arrow)
+ /*! vtkConeSource pointer (Arrow)
*/
vtkConeSource *myConeSource;
- /*! \var myVectorText
- * \brief VTKViewer_VectorText pointer (Label)
+ /*! VTKViewer_VectorText pointer (Label)
*/
VTKViewer_VectorText* myVectorText;
};
#include "VTKViewer_Utilities.h"
-//****************************************************************
-//see vtkRenderer::ResetCamera(float bounds[6]) method
+/*!@see vtkRenderer::ResetCamera(float bounds[6]) method*/
void ResetCamera(vtkRenderer* theRenderer, int theUsingZeroFocalPoint)
{
if(!theRenderer) return;
ResetCameraClippingRange(theRenderer);
}
-//****************************************************************
-// Compute the bounds of the visible props
+/*! Compute the bounds of the visible props*/
int ComputeVisiblePropBounds(vtkRenderer* theRenderer, float theBounds[6])
{
float *bounds;
return aCount;
}
-//****************************************************************
-//see vtkRenderer::ResetCameraClippingRange(float bounds[6]) method
+/*!@see vtkRenderer::ResetCameraClippingRange(float bounds[6]) method*/
void ResetCameraClippingRange(vtkRenderer* theRenderer)
{
if(!theRenderer || !theRenderer->VisibleActorCount()) return;
anActiveCamera->SetClippingRange( range );
}
+/*!Compute trihedron size.*/
bool ComputeTrihedronSize( vtkRenderer* theRenderer,double& theNewSize,
const double theSize, const float theSizeInPercents )
{
;
-// Construct object with no string set and backing enabled.
+/*! Construct object with no string set and backing enabled.*/
VTKViewer_VectorText::VTKViewer_VectorText()
{
this->Text = NULL;
}
+/*!Calculate output.*/
void VTKViewer_VectorText::Execute()
{
vtkPolyData *output = this->GetOutput();
os << indent << "Text: " << (this->Text ? this->Text : "(none)") << "\n";
}
+/*!Destructor.*/
VTKViewer_VectorText::~VTKViewer_VectorText()
{
if (this->Text)
#define __VTKViewer_VectorText_h
#include "vtkPolyDataSource.h"
-
+/*!Generates vtkPolyData from an input text string.
+ *@see vtkVectorText
+ */
class VTKViewer_VectorText : public vtkPolyDataSource
{
public:
int VTKViewer_ViewManager::_VTKViewMgr_Id = 0;
-//***************************************************************
+/*!Constructor.Initialize SIUT_ViewManager by \a study and \a theDesktop.
+ * Create new instance of VTKViewer_Viewer and set view model by it.
+ */
VTKViewer_ViewManager::VTKViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop )
: SUIT_ViewManager( study, theDesktop )
{
setViewModel( new VTKViewer_Viewer() );
}
-//***************************************************************
+/*!Destructor.*/
VTKViewer_ViewManager::~VTKViewer_ViewManager()
{
+ /*!Do nothing.*/
}
-//***************************************************************
+/*!Sets view window name*/
void VTKViewer_ViewManager::setViewName(SUIT_ViewWindow* theView)
{
int aPos = myViews.find(theView);
class SUIT_Desktop;
+/*!View manager.*/
class VTKVIEWER_EXPORT VTKViewer_ViewManager : public SUIT_ViewManager
{
Q_OBJECT
#include <qpalette.h>
#include <qpopupmenu.h>
-//****************************************************************
+/*!Constructor.Sets background color to black.*/
VTKViewer_Viewer::VTKViewer_Viewer()
: SUIT_ViewModel(),
myBgColor( Qt::black )
{
}
-//****************************************************************
+/*!Destructor.*/
VTKViewer_Viewer::~VTKViewer_Viewer()
{
}
+/*!Gets background color.*/
QColor VTKViewer_Viewer::backgroundColor() const
{
return myBgColor;
}
+/*!Sets background color.*/
void VTKViewer_Viewer::setBackgroundColor( const QColor& c )
{
if ( c.isValid() )
myBgColor = c;
}
-//****************************************************************
+/*!Create new instance of VTKViewer_ViewWindow, sets background color and return pointer to it.*/
SUIT_ViewWindow* VTKViewer_Viewer::createView( SUIT_Desktop* theDesktop )
{
VTKViewer_ViewWindow* vw = new VTKViewer_ViewWindow( theDesktop, this );
return vw;
}
-//*********************************************************************
+/*!Sets view manager and connect slots.*/
void VTKViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
{
SUIT_ViewModel::setViewManager(theViewManager);
this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
}
-//*********************************************************************
+/*!Insert context into popup menu.*/
void VTKViewer_Viewer::contextMenuPopup(QPopupMenu* thePopup)
{
thePopup->insertItem( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
thePopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
}
-//*********************************************************************
+/*!On mouse press event.*/
void VTKViewer_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
{
VTKViewer_RenderWindowInteractor* rwi = 0;
}
}
-//*********************************************************************
+/*!On mouse move event.*/
void VTKViewer_Viewer::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event)
{
VTKViewer_RenderWindowInteractor* rwi = 0;
rwi->MouseMove( event );
}
-//*********************************************************************
+/*!On mouse release event.*/
void VTKViewer_Viewer::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event)
{
VTKViewer_RenderWindowInteractor* rwi = 0;
}
}
-//*********************************************************************
+/*!Sets flag to enable selection \a isEnable.*/
void VTKViewer_Viewer::enableSelection(bool isEnabled)
{
mySelectionEnabled = isEnabled;
//!! To be done for view windows
}
-//*********************************************************************
+/*!Sets flag to multi selection enable \a isEnable.*/
void VTKViewer_Viewer::enableMultiselection(bool isEnable)
{
myMultiSelectionEnabled = isEnable;
//!! To be done for view windows
}
+/*!On dump view event.*/
void VTKViewer_Viewer::onDumpView()
{
VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView());
aView->onDumpView();
}
-//*********************************************************************
+/*!On change back ground color event.*/
void VTKViewer_Viewer::onChangeBgColor()
{
VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView());
aView->setBackgroundColor(aColor);
}
-//*********************************************************************
+/*!On show tool bar event.*/
void VTKViewer_Viewer::onShowToolbar() {
VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView());
if ( aView )
Q_OBJECT
public:
+ /*!Initialize type of viewer.*/
static QString Type() { return "VTKViewer"; }
VTKViewer_Viewer();
virtual void setViewManager(SUIT_ViewManager* theViewManager);
virtual void contextMenuPopup( QPopupMenu* );
+ /*!Gets type of viewer.*/
virtual QString getType() const { return Type(); }
public:
void enableSelection(bool isEnabled);
+ /*!Checks: is selection enabled*/
bool isSelectionEnabled() const { return mySelectionEnabled; }
void enableMultiselection(bool isEnable);
+ /*!Checks: is multi selection enabled*/
bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
int getSelectionCount() const;
#include <vtkRenderer.h>
#include <vtkCamera.h>
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
+/*! Construction*/
VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop,
VTKViewer_Viewer* theModel,
VTKViewer_InteractorStyle* iStyle,
onResetView();
}
+/*!Destructor.*/
VTKViewer_ViewWindow::~VTKViewer_ViewWindow()
{
myTransform->Delete();
myRWInteractor->GetInteractorStyle()->startZoom();
}
-//****************************************************************
/*!
Activates 'panning' transformation
*/
myRWInteractor->GetInteractorStyle()->startPan();
}
-//****************************************************************
/*!
Activates 'rotation' transformation
*/
myRWInteractor->GetInteractorStyle()->startRotate();
}
-//****************************************************************
void VTKViewer_ViewWindow::activateGlobalPanning()
{
//if(myTrihedron->GetVisibleActorCount(myRenderer))
myRWInteractor->GetInteractorStyle()->startGlobalPan();
}
-//****************************************************************
/*!
Activates 'fit area' transformation
*/
myRWInteractor->GetInteractorStyle()->startFitArea();
}
-//****************************************************************
void VTKViewer_ViewWindow::createActions()
{
if (!myActionsMap.isEmpty()) return;
myActionsMap[ TrihedronShowId ] = aAction;
}
-//****************************************************************
void VTKViewer_ViewWindow::createToolBar()
{
myActionsMap[DumpId]->addTo(myToolBar);
myActionsMap[ResetId]->addTo(myToolBar);
}
-//****************************************************************
void VTKViewer_ViewWindow::onFrontView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
-//****************************************************************
void VTKViewer_ViewWindow::onBackView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
-//****************************************************************
void VTKViewer_ViewWindow::onTopView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
-//****************************************************************
void VTKViewer_ViewWindow::onBottomView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
-//****************************************************************
void VTKViewer_ViewWindow::onLeftView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
-//****************************************************************
void VTKViewer_ViewWindow::onRightView()
{
vtkCamera* camera = myRenderer->GetActiveCamera();
onFitAll();
}
-//****************************************************************
void VTKViewer_ViewWindow::onResetView()
{
int aTriedronIsVisible = isTrihedronDisplayed();
Repaint();
}
-//****************************************************************
void VTKViewer_ViewWindow::onFitAll()
{
myRWInteractor->GetInteractorStyle()->ViewFitAll();
Repaint();
}
-//****************************************************************
/*!
Set background of the viewport
*/
myRenderer->SetBackground( color.red()/255., color.green()/255., color.blue()/255. );
}
-//****************************************************************
/*!
Returns background of the viewport
*/
InsertActor(theActor,true);
}
-//****************************************************************
void VTKViewer_ViewWindow::onTrihedronShow()
{
if (isTrihedronDisplayed())
myRenderWindow->update();
}
-//****************************************************************
QImage VTKViewer_ViewWindow::dumpView()
{
QPixmap px = QPixmap::grabWindow( myRenderWindow->winId() );
VTKViewer_RenderWindowInteractor* = 0 );
virtual ~VTKViewer_ViewWindow();
+ /*!Gets tool bar.*/
QToolBar* getToolBar() { return myToolBar; }
void setBackgroundColor( const QColor& );
QColor backgroundColor() const;
+ /*!Gets renderer.*/
vtkRenderer* getRenderer() { return myRenderer; }
+ /*!Gets render window.*/
VTKViewer_RenderWindow* getRenderWindow() { return myRenderWindow; }
+ /*!Gets render window interactor.*/
VTKViewer_RenderWindowInteractor* getRWInteractor() { return myRWInteractor; }
bool isTrihedronDisplayed();