void cpExtensions::Visualization::MPRActors::
SetInputConnection( vtkAlgorithmOutput* aout )
{
- this->Slices[ 0 ][ 0 ]->SetInputConnection( aout );
- this->Slices[ 0 ][ 1 ]->SetInputConnection( aout );
- this->Slices[ 0 ][ 2 ]->SetInputConnection( aout );
- this->Slices[ 1 ][ 0 ]->SetInputConnection( aout );
- this->Slices[ 1 ][ 1 ]->SetInputConnection( aout );
- this->Slices[ 1 ][ 2 ]->SetInputConnection( aout );
+ for( int i = 0; i < 2; ++i )
+ {
+ for( int j = 0; j < 3; ++j )
+ {
+ this->Slices[ i ][ j ]->SetInputConnection( aout );
+ this->Slices[ i ][ j ]->SetAxis( j );
+
+ } // rof
+
+ } // rof
+ this->_CreateBoundingBox( );
}
// -------------------------------------------------------------------------
void cpExtensions::Visualization::MPRActors::
SetInputImage( vtkImageData* data )
{
- this->Slices[ 0 ][ 0 ]->SetInputImage( data );
- this->Slices[ 0 ][ 1 ]->SetInputImage( data );
- this->Slices[ 0 ][ 2 ]->SetInputImage( data );
- this->Slices[ 1 ][ 0 ]->SetInputImage( data );
- this->Slices[ 1 ][ 1 ]->SetInputImage( data );
- this->Slices[ 1 ][ 2 ]->SetInputImage( data );
+ for( int i = 0; i < 2; ++i )
+ {
+ for( int j = 0; j < 3; ++j )
+ {
+ this->Slices[ i ][ j ]->SetInputImage( data );
+ this->Slices[ i ][ j ]->SetAxis( j );
+
+ } // rof
+
+ } // rof
+ this->_CreateBoundingBox( );
}
// -------------------------------------------------------------------------
vtkRenderer* wren =
( w != NULL )? w->GetRenderers( )->GetFirstRenderer( ): NULL;
if( wren != NULL )
+ {
wren->AddViewProp( this->ImageOutlineActor );
+ wren->AddViewProp( this->Slices[ 1 ][ 0 ]->GetPlaneActor( ) );
+ wren->AddViewProp( this->Slices[ 1 ][ 1 ]->GetPlaneActor( ) );
+ wren->AddViewProp( this->Slices[ 1 ][ 2 ]->GetPlaneActor( ) );
+
+ } // fi
}
// -------------------------------------------------------------------------
vtkRenderer* wren =
( w != NULL )? w->GetRenderers( )->GetFirstRenderer( ): NULL;
if( wren != NULL )
+ {
wren->RemoveViewProp( this->ImageOutlineActor );
+ wren->RemoveViewProp( this->Slices[ 1 ][ 0 ]->GetPlaneActor( ) );
+ wren->RemoveViewProp( this->Slices[ 1 ][ 1 ]->GetPlaneActor( ) );
+ wren->RemoveViewProp( this->Slices[ 1 ][ 2 ]->GetPlaneActor( ) );
+
+ } // fi
}
// -------------------------------------------------------------------------
} // fi
}
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetAxesCursor( const int& axis, double* pos )
+{
+ if( axis < 3 )
+ this->Slices[ 0 ][ axis ]->SetAxesCursor( pos );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+Render( const int& axis )
+{
+ if( axis < 3 )
+ {
+ this->Slices[ 0 ][ axis ]->Render( );
+ this->Slices[ 1 ][ axis ]->Render( );
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+Render( )
+{
+ this->Render( 0 );
+ this->Render( 1 );
+ this->Render( 2 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+ResetCamera( const int& axis )
+{
+ if( axis < 3 )
+ this->Slices[ 0 ][ axis ]->ResetCamera( );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+ResetCameras( )
+{
+ this->ResetCamera( 0 );
+ this->ResetCamera( 1 );
+ this->ResetCamera( 2 );
+}
+
// -------------------------------------------------------------------------
cpExtensions::Visualization::MPRActors::
MPRActors( )
if( actors == NULL )
return;
for( unsigned int j = 0; j < 3; ++j )
+ {
if( actors->Slices[ 0 ][ j ]->GetAxis( ) != axis )
+ {
actors->SetSlice( j, pos );
+ actors->SetAxesCursor( j, pos );
+ actors->Render( j );
+
+ } // fi
+
+ } // rof
}
// -------------------------------------------------------------------------
if( actors == NULL )
return;
actors->SetWindowLevel( window, level );
+ actors->Render( );
}
// -------------------------------------------------------------------------
MPRActors* actors = reinterpret_cast< MPRActors* >( data );
if( actors == NULL )
return;
+ actors->Render( );
}
// eof - $RCSfile$