#include <vtkMatrix4x4.h>
#include <vtkTransform.h>
#include <vtkVectorText.h>
+#include <vtkCoordinate.h>
+#include <vtkTextActor.h>
+#include <vtkTextMapper.h>
/*
Class : GEOM_VTKTrihedron
GEOM_VTKTrihedronAxis::GEOM_VTKTrihedronAxis()
{
- vtkProperty* aProperty = vtkProperty::New();
- aProperty->SetColor( 0.0, 0.0, 1.0 );
- SetProperty( aProperty );
- aProperty->Delete();
+ VTKViewer_Axis::SetColor( 0.0, 0.0, 1.0 );
myMatrix = vtkMatrix4x4::New();
myTrsf = vtkTransform::New();
}
myArrowActor->SetUserMatrix( myMatrix );
myArrowActor->SetPosition( aPosition );
+#ifdef IPAL21440
+ if( vtkCoordinate* aCoord = myLabelActor->GetPositionCoordinate()->GetReferenceCoordinate() )
+ aCoord->SetValue( aPosition );
+#else
myLabelActor->SetPosition( 0, 0, 0 );
myLabelActor->AddPosition( aPosition );
+#endif
}
void GEOM_VTKTrihedronAxis::Render(vtkRenderer* theRenderer)
{
myLineActor->Render( theRenderer );
myArrowActor->Render( theRenderer );
+#ifndef IPAL21440
myLabelActor->Render( theRenderer );
+#endif
vtkCamera* aCamera = theRenderer->GetActiveCamera();
SetCamera( aCamera );
vtkFloatingPointType aColor[ 3 ] = { 0, 0, 0 };
aColor[ theRot ] = 1;
- vtkProperty* aProperty = vtkProperty::New();
if ( theColor[ 0 ] == -1 )
- aProperty->SetColor( aColor[ 0 ], aColor[ 1 ], aColor[ 2 ] );
+ VTKViewer_Axis::SetColor( aColor[ 0 ], aColor[ 1 ], aColor[ 2 ] );
else
- aProperty->SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
- SetProperty( aProperty );
- aProperty->Delete();
+ VTKViewer_Axis::SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
+#ifdef IPAL21440
+ if ( theRot == 0 ) myTextMapper->SetInput( "X" );
+ else if ( theRot == 1 ) myTextMapper->SetInput( "Y" );
+ else if ( theRot == 2 ) myTextMapper->SetInput( "Z" );
+#else
if ( theRot == 0 ) myVectorText->SetText( "X" );
else if ( theRot == 1 ) myVectorText->SetText( "Y" );
else if ( theRot == 2 ) myVectorText->SetText( "Z" );
+#endif
}
void GEOM_VTKTrihedronAxis::SetColor( const vtkFloatingPointType theColor[ 3 ] )
{
- vtkProperty* aProperty = vtkProperty::New();
- aProperty->SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
- SetProperty( aProperty );
- aProperty->Delete();
+ VTKViewer_Axis::SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
}