5 #include <vtkLineSource.h> 6 #include <vtkPolyDataMapper.h> 7 #include <vtkProperty.h> 8 #include <vtkSmartPointer.h> 21 Line::Line(
double x1,
double y1,
double z1,
double x2,
double y2,
double z2 )
27 m_pSource->SetPoint1( x1, y1, z1 );
28 m_pSource->SetPoint1( x1, y1, z1 );
38 m_pSource->SetPoint1( x1, y1, z1 );
39 m_pSource->SetPoint2( x2, y2, z2 );
49 m_pSource = vtkSmartPointer< vtkLineSource >::New();
51 m_pMapper = vtkSmartPointer< vtkPolyDataMapper >::New();
52 m_pMapper->SetInputData( m_pSource->GetOutput() );
54 m_pActor = vtkSmartPointer< vtkActor >::New();
55 m_pActor->SetMapper( m_pMapper );
65 double* data = m_pSource->GetPoint1();
73 m_pSource->SetPoint1( x, y, z );
78 double* data = m_pSource->GetPoint2();
86 m_pSource->SetPoint2( x, y, z );
95 m_pActor->GetProperty()->SetColor( r, g, b );
101 m_pActor->GetProperty()->GetColor( r, g, b );
106 return m_pActor->GetProperty()->GetOpacity();
112 m_pActor->GetProperty()->SetOpacity( a );
118 return m_pActor->GetVisibility() > 0 ?
true :
false;
127 m_pActor->VisibilityOn();
129 m_pActor->VisibilityOff();
void AddActor(vtkSmartPointer< vtkActor > pActor)
Add a VTK actor to the node.
void SetColor(double r, double g, double b)
Color setter.
void SetPoint2(double x, double y, double z)
void RemoveActor(vtkSmartPointer< vtkActor > pActor)
Remove a VTK actor from the assembly of the node.
void GetColor(double &r, double &g, double &b)
Color getter.
void SetAlpha(const double a)
Alpha setter.
void GetPoint2(double &x, double &y, double &z) const
void GetPoint1(double &x, double &y, double &z) const
virtual void SetVisible(bool bVisible)
Set visibility.
void SetPoint1(double x, double y, double z)
Base class for scene graph nodes.
double GetAlpha() const
Alpha getter.
#define DAFFVIZ_UNLOCK_VTK
void SetVisible(bool bVisible)
Set visibility.
bool IsVisible() const
Get visibility.