- double ori[ 3 ], spac[ 3 ], pos[ 3 ];
- info->Get( vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT( ), ext );
- info->Get( vtkDataObject::ORIGIN( ), ori );
- info->Get( vtkDataObject::SPACING( ), spac );
- this->SliceMappers[ 0 ]->GetSlicePlane( )->GetOrigin( pos );
-
- // Prevent obscuring voxels by offsetting the plane geometry
- double xbnds[ ] =
- {
- ori[ 0 ] + ( spac[ 0 ] * double( ext[ 0 ] ) ),
- ori[ 0 ] + ( spac[ 0 ] * double( ext[ 1 ] ) )
- };
- double ybnds[ ] =
- {
- ori[ 1 ] + ( spac[ 1 ] * double( ext[ 2 ] ) ),
- ori[ 1 ] + ( spac[ 1 ] * double( ext[ 3 ] ) )
- };
- double zbnds[ ] =
- {
- ori[ 2 ] + ( spac[ 2 ] * double( ext[ 4 ] ) ),
- ori[ 2 ] + ( spac[ 2 ] * double( ext[ 5 ] ) )
- };
-
- if( spac[ 0 ] < double( 0 ) )
- {
- double t = xbnds[ 0 ];
- xbnds[ 0 ] = xbnds[ 1 ];
- xbnds[ 1 ] = t;
-
- } // fi
- if( spac[ 1 ] < double( 0 ) )
- {
- double t = ybnds[ 0 ];
- ybnds[ 0 ] = ybnds[ 1 ];
- ybnds[ 1 ] = t;
-
- } // fi
- if( spac[ 2 ] < double( 0 ) )
- {
- double t = zbnds[ 0 ];
- zbnds[ 0 ] = zbnds[ 1 ];
- zbnds[ 1 ] = t;
-
- } // fi
-
- // Plane function origin
- this->PlaneFunction->SetOrigin( pos );
-
- // Configure visualization and implicit plane orientation
- int axis = this->SliceMappers[ 0 ]->GetOrientation( );
- this->PlaneActor->GetProperty( )->SetRepresentationToWireframe( );
- this->PlaneActor->GetProperty( )->SetLineWidth( 2 );
- vtkPoints* plane_points = this->PlaneSource->GetPoints( );
- if( axis == 0 ) // YZ, x-normal
- {
- this->PlaneFunction->SetNormal( 1, 0, 0 );
- plane_points->SetPoint( 0, pos[ 0 ], ybnds[ 0 ], zbnds[ 0 ] );
- plane_points->SetPoint( 1, pos[ 0 ], ybnds[ 1 ], zbnds[ 0 ] );
- plane_points->SetPoint( 2, pos[ 0 ], ybnds[ 1 ], zbnds[ 1 ] );
- plane_points->SetPoint( 3, pos[ 0 ], ybnds[ 0 ], zbnds[ 1 ] );
- this->PlaneActor->GetProperty( )->SetColor( 1, 0, 0 );
- }
- else if( axis == 1 ) // ZX, y-normal
- {
- this->PlaneFunction->SetNormal( 0, 1, 0 );
- plane_points->SetPoint( 0, xbnds[ 0 ], pos[ 1 ], zbnds[ 0 ] );
- plane_points->SetPoint( 1, xbnds[ 0 ], pos[ 1 ], zbnds[ 1 ] );
- plane_points->SetPoint( 2, xbnds[ 1 ], pos[ 1 ], zbnds[ 1 ] );
- plane_points->SetPoint( 3, xbnds[ 1 ], pos[ 1 ], zbnds[ 0 ] );
- this->PlaneActor->GetProperty( )->SetColor( 0, 1, 0 );
- }
- else // XY, z-normal
- {
- this->PlaneFunction->SetNormal( 0, 0, 1 );
- plane_points->SetPoint( 0, xbnds[ 0 ], ybnds[ 0 ], pos[ 2 ] );
- plane_points->SetPoint( 1, xbnds[ 1 ], ybnds[ 0 ], pos[ 2 ] );
- plane_points->SetPoint( 2, xbnds[ 1 ], ybnds[ 1 ], pos[ 2 ] );
- plane_points->SetPoint( 3, xbnds[ 0 ], ybnds[ 1 ], pos[ 2 ] );
- this->PlaneActor->GetProperty( )->SetColor( 0, 0, 1 );
-
- } // fi
- this->PlaneFunction->Modified( );
- this->PlaneSource->Modified( );
- this->PlaneMapper->Modified( );
- this->PlaneActor->Modified( );
-
- // Prepare other actors to update
- /* TODO
- for( unsigned int i = 0; i < this->OtherActors.size( ); ++i )
- {
- if( this->OtherActors[ i ].first.GetPointer( ) != NULL )
- {
- this->OtherActors[ i ].first->Modified( );
- this->OtherActors[ i ].first->Update( );
-
- } // fi
-
- if( this->OtherActors[ i ].second.GetPointer( ) != NULL )
- {
- this->OtherActors[ i ].second->GetMapper( )->Modified( );
- this->OtherActors[ i ].second->Modified( );
-
- } // fi