#include #include // ------------------------------------------------------------------------- void cpPlugins::OrthoNormalBase:: SetITK( itk::LightObject* o ) { // Do nothing since itk::Matrix does not belong to LightObject hierarchy. } // ------------------------------------------------------------------------- void cpPlugins::OrthoNormalBase:: SetVTK( vtkObjectBase* o ) { auto matrix = dynamic_cast< vtkMatrix4x4* >( o ); if( matrix != NULL ) this->Superclass::SetVTK( matrix ); } // ------------------------------------------------------------------------- cpPlugins::OrthoNormalBase:: OrthoNormalBase( ) : Superclass( ) { } // ------------------------------------------------------------------------- cpPlugins::OrthoNormalBase:: ~OrthoNormalBase( ) { } // ------------------------------------------------------------------------- void cpPlugins::OrthoNormalBase:: _CreateVTKActor( ) const { auto matrix = const_cast< vtkMatrix4x4* >( this->GetVTK< vtkMatrix4x4 >( ) ); if( matrix != NULL ) { this->m_BaseActor.SetBase( matrix ); this->m_Actor = this->m_BaseActor.Actor.GetPointer( ); /* TODO double o[ 3 ], x[ 3 ], y[ 3 ], z[ 3 ]; o[ 0 ] = matrix->GetElement( 0, 3 ); o[ 1 ] = matrix->GetElement( 1, 3 ); o[ 2 ] = matrix->GetElement( 2, 3 ); x[ 0 ] = matrix->GetElement( 0, 0 ) + o[ 0 ]; x[ 1 ] = matrix->GetElement( 1, 0 ) + o[ 1 ]; x[ 2 ] = matrix->GetElement( 2, 0 ) + o[ 2 ]; y[ 0 ] = matrix->GetElement( 0, 1 ) + o[ 0 ]; y[ 1 ] = matrix->GetElement( 1, 1 ) + o[ 1 ]; y[ 2 ] = matrix->GetElement( 2, 1 ) + o[ 2 ]; z[ 0 ] = matrix->GetElement( 0, 2 ) + o[ 0 ]; z[ 1 ] = matrix->GetElement( 1, 2 ) + o[ 1 ]; z[ 2 ] = matrix->GetElement( 2, 2 ) + o[ 2 ]; static vtkPoints* points = vtkPoints::New( ); points->InsertNextPoint( o ); points->InsertNextPoint( x ); points->InsertNextPoint( y ); points->InsertNextPoint( z ); static vtkCellArray* lines = vtkCellArray::New( ); lines->InsertNextCell( 2 ); lines->InsertCellPoint( 0 ); lines->InsertCellPoint( 1 ); lines->InsertNextCell( 2 ); lines->InsertCellPoint( 0 ); lines->InsertCellPoint( 2 ); lines->InsertNextCell( 2 ); lines->InsertCellPoint( 0 ); lines->InsertCellPoint( 3 ); static vtkPolyData* base = vtkPolyData::New( ); base->SetPoints( points ); base->SetLines( lines ); static vtkPolyDataMapper* mapper = vtkPolyDataMapper::New( ); mapper->SetInputData( base ); static vtkActor* actor = vtkActor::New( ); actor->SetMapper( mapper ); this->m_Actor = actor; */ /* this->m_AxesActor = vtkSmartPointer< vtkAxesActor >::New( ); this->m_AxesActor->SetUserMatrix( matrix ); this->m_Actor = this->m_AxesActor.GetPointer( ); */ } // fi } // eof - $RCSfile$