6 #include <vtkFollower.h> 7 #include <vtkPolyDataMapper.h> 8 #include <vtkProperty.h> 9 #include <vtkVectorText.h> 17 m_sText =
"No label text set";
24 m_sText =
"No label text set";
43 m_pLabelText = vtkSmartPointer< vtkVectorText >::New();
44 m_pLabelText->SetText( m_sText.c_str() );
46 m_pMapper = vtkSmartPointer< vtkPolyDataMapper >::New();
47 m_pMapper->SetInputConnection( m_pLabelText->GetOutputPort() );
49 m_pFollower = vtkSmartPointer< vtkFollower >::New();
50 m_pFollower->SetMapper( m_pMapper );
52 m_pFollower->SetScale( 0.1, 0.1, 0.1 );
61 m_pFollower->GetProperty()->GetColor( r, g, b );
67 m_pFollower->GetProperty()->SetColor( r, g, b );
73 return m_pFollower->GetProperty()->GetOpacity();
79 m_pFollower->GetProperty()->SetOpacity(a);
89 m_pFollower->VisibilityOn();
91 m_pFollower->VisibilityOff();
97 return m_pFollower->GetVisibility() > 0 ?
true :
false;
106 m_pLabelText->SetText( s.c_str() );
110 void Label::OnSetFollowerCamera( vtkSmartPointer< vtkCamera > pCamera )
113 m_pFollower->SetCamera( pCamera );
void AddActor(vtkSmartPointer< vtkActor > pActor)
Add a VTK actor to the node.
void SetColor(double r, double g, double b)
Color setter.
void RemoveActor(vtkSmartPointer< vtkActor > pActor)
Remove a VTK actor from the assembly of the node.
virtual void OnSetFollowerCamera(vtkSmartPointer< vtkCamera > pCamera)
Set active camera for followers.
void GetColor(double &r, double &g, double &b) const
Color getter.
bool IsVisible() const
Get visibility.
void SetAlpha(double a)
Alpha setter.
virtual void SetVisible(bool bVisible)
Set visibility.
void SetText(const std::string &sText)
Label text setter.
Base class for scene graph nodes.
double GetAlpha() const
Alpha getter.
#define DAFFVIZ_UNLOCK_VTK
void SetVisible(bool bVisible)
Set visibility.