mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-22 02:15:38 +05:00
Bug IPAL21440 - Labels of trihedron in VTK view are dissappared
This commit is contained in:
parent
388bc0705e
commit
0f6aed6c55
@ -44,6 +44,9 @@
|
|||||||
#include <vtkMatrix4x4.h>
|
#include <vtkMatrix4x4.h>
|
||||||
#include <vtkTransform.h>
|
#include <vtkTransform.h>
|
||||||
#include <vtkVectorText.h>
|
#include <vtkVectorText.h>
|
||||||
|
#include <vtkCoordinate.h>
|
||||||
|
#include <vtkTextActor.h>
|
||||||
|
#include <vtkTextMapper.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class : GEOM_VTKTrihedron
|
Class : GEOM_VTKTrihedron
|
||||||
@ -80,10 +83,7 @@ vtkStandardNewMacro( GEOM_VTKTrihedronAxis );
|
|||||||
|
|
||||||
GEOM_VTKTrihedronAxis::GEOM_VTKTrihedronAxis()
|
GEOM_VTKTrihedronAxis::GEOM_VTKTrihedronAxis()
|
||||||
{
|
{
|
||||||
vtkProperty* aProperty = vtkProperty::New();
|
VTKViewer_Axis::SetColor( 0.0, 0.0, 1.0 );
|
||||||
aProperty->SetColor( 0.0, 0.0, 1.0 );
|
|
||||||
SetProperty( aProperty );
|
|
||||||
aProperty->Delete();
|
|
||||||
myMatrix = vtkMatrix4x4::New();
|
myMatrix = vtkMatrix4x4::New();
|
||||||
myTrsf = vtkTransform::New();
|
myTrsf = vtkTransform::New();
|
||||||
}
|
}
|
||||||
@ -122,15 +122,22 @@ void GEOM_VTKTrihedronAxis::SetSize( vtkFloatingPointType theSize )
|
|||||||
myArrowActor->SetUserMatrix( myMatrix );
|
myArrowActor->SetUserMatrix( myMatrix );
|
||||||
myArrowActor->SetPosition( aPosition );
|
myArrowActor->SetPosition( aPosition );
|
||||||
|
|
||||||
|
#ifdef IPAL21440
|
||||||
|
if( vtkCoordinate* aCoord = myLabelActor->GetPositionCoordinate()->GetReferenceCoordinate() )
|
||||||
|
aCoord->SetValue( aPosition );
|
||||||
|
#else
|
||||||
myLabelActor->SetPosition( 0, 0, 0 );
|
myLabelActor->SetPosition( 0, 0, 0 );
|
||||||
myLabelActor->AddPosition( aPosition );
|
myLabelActor->AddPosition( aPosition );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void GEOM_VTKTrihedronAxis::Render(vtkRenderer* theRenderer)
|
void GEOM_VTKTrihedronAxis::Render(vtkRenderer* theRenderer)
|
||||||
{
|
{
|
||||||
myLineActor->Render( theRenderer );
|
myLineActor->Render( theRenderer );
|
||||||
myArrowActor->Render( theRenderer );
|
myArrowActor->Render( theRenderer );
|
||||||
|
#ifndef IPAL21440
|
||||||
myLabelActor->Render( theRenderer );
|
myLabelActor->Render( theRenderer );
|
||||||
|
#endif
|
||||||
|
|
||||||
vtkCamera* aCamera = theRenderer->GetActiveCamera();
|
vtkCamera* aCamera = theRenderer->GetActiveCamera();
|
||||||
SetCamera( aCamera );
|
SetCamera( aCamera );
|
||||||
@ -158,25 +165,25 @@ void GEOM_VTKTrihedronAxis::SetAxis( const gp_Ax1& theAxis,
|
|||||||
|
|
||||||
vtkFloatingPointType aColor[ 3 ] = { 0, 0, 0 };
|
vtkFloatingPointType aColor[ 3 ] = { 0, 0, 0 };
|
||||||
aColor[ theRot ] = 1;
|
aColor[ theRot ] = 1;
|
||||||
vtkProperty* aProperty = vtkProperty::New();
|
|
||||||
if ( theColor[ 0 ] == -1 )
|
if ( theColor[ 0 ] == -1 )
|
||||||
aProperty->SetColor( aColor[ 0 ], aColor[ 1 ], aColor[ 2 ] );
|
VTKViewer_Axis::SetColor( aColor[ 0 ], aColor[ 1 ], aColor[ 2 ] );
|
||||||
else
|
else
|
||||||
aProperty->SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
|
VTKViewer_Axis::SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
|
||||||
SetProperty( aProperty );
|
|
||||||
aProperty->Delete();
|
|
||||||
|
|
||||||
|
#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" );
|
if ( theRot == 0 ) myVectorText->SetText( "X" );
|
||||||
else if ( theRot == 1 ) myVectorText->SetText( "Y" );
|
else if ( theRot == 1 ) myVectorText->SetText( "Y" );
|
||||||
else if ( theRot == 2 ) myVectorText->SetText( "Z" );
|
else if ( theRot == 2 ) myVectorText->SetText( "Z" );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void GEOM_VTKTrihedronAxis::SetColor( const vtkFloatingPointType theColor[ 3 ] )
|
void GEOM_VTKTrihedronAxis::SetColor( const vtkFloatingPointType theColor[ 3 ] )
|
||||||
{
|
{
|
||||||
vtkProperty* aProperty = vtkProperty::New();
|
VTKViewer_Axis::SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
|
||||||
aProperty->SetColor( theColor[ 0 ], theColor[ 1 ], theColor[ 2 ] );
|
|
||||||
SetProperty( aProperty );
|
|
||||||
aProperty->Delete();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user