1 #include <cpPlugins/OrthoNormalBase.h>
3 #include <vtkCaptionActor2D.h>
4 #include <vtkMatrix4x4.h>
5 #include <vtkTextProperty.h>
7 // -------------------------------------------------------------------------
8 void cpPlugins::OrthoNormalBase::
9 SetITK( itk::LightObject* o )
11 // WARNING: Do nothing since itk::Matrix does not belong to the
12 // itk::LightObject hierarchy.
15 // -------------------------------------------------------------------------
16 void cpPlugins::OrthoNormalBase::
17 SetVTK( vtkObjectBase* o )
19 auto matrix = dynamic_cast< vtkMatrix4x4* >( o );
21 this->Superclass::SetVTK( matrix );
24 // -------------------------------------------------------------------------
25 cpPlugins::OrthoNormalBase::
29 vtkSmartPointer< vtkTextProperty > t1, t2, t3;
31 t1 = vtkSmartPointer< vtkTextProperty >::New( );
32 t2 = vtkSmartPointer< vtkTextProperty >::New( );
33 t3 = vtkSmartPointer< vtkTextProperty >::New( );
37 t1->SetFontFamilyToTimes( );
38 t2->ShallowCopy( t1 );
39 t3->ShallowCopy( t1 );
41 this->m_BaseActor = vtkSmartPointer< vtkAxesActor >::New( );
42 this->m_BaseActor->GetXAxisCaptionActor2D( )->SetCaptionTextProperty( t1 );
43 this->m_BaseActor->GetYAxisCaptionActor2D( )->SetCaptionTextProperty( t2 );
44 this->m_BaseActor->GetZAxisCaptionActor2D( )->SetCaptionTextProperty( t3 );
45 this->m_BaseActor->SetShaftTypeToLine( );
46 this->m_BaseActor->SetXAxisLabelText( "x" );
47 this->m_BaseActor->SetYAxisLabelText( "y" );
48 this->m_BaseActor->SetZAxisLabelText( "z" );
49 this->m_BaseActor->SetTotalLength( 1.0, 1.0, 1.0 );
52 // -------------------------------------------------------------------------
53 cpPlugins::OrthoNormalBase::
58 // -------------------------------------------------------------------------
59 void cpPlugins::OrthoNormalBase::
60 _CreateVTKActor( ) const
63 const_cast< vtkMatrix4x4* >( this->GetVTK< vtkMatrix4x4 >( ) );
66 this->m_BaseActor->SetUserMatrix( matrix );
67 this->m_Actor = this->m_BaseActor.GetPointer( );
68 this->m_Actor->Modified( );