X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FLineSource.cxx;fp=lib%2FcpExtensions%2FVisualization%2FLineSource.cxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=6280cba326011bec74c6394e982b3b4b6bdc8bd3;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/LineSource.cxx b/lib/cpExtensions/Visualization/LineSource.cxx deleted file mode 100644 index 6280cba..0000000 --- a/lib/cpExtensions/Visualization/LineSource.cxx +++ /dev/null @@ -1,119 +0,0 @@ -#include -#include -#include - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::LineSource:: -Self* cpExtensions::Visualization::LineSource:: -New( ) -{ - return( new Self( ) ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::LineSource:: -SetPoint1( float pnt[ 3 ] ) -{ - double p[ 3 ]; - p[ 0 ] = pnt[ 0 ]; - p[ 1 ] = pnt[ 1 ]; - p[ 2 ] = pnt[ 2 ]; - this->SetPoint1( p ); -} - -// ------------------------------------------------------------------------- -void cpExtensions::Visualization::LineSource:: -SetPoint2( float pnt[ 3 ] ) -{ - double p[ 3 ]; - p[ 0 ] = pnt[ 0 ]; - p[ 1 ] = pnt[ 1 ]; - p[ 2 ] = pnt[ 2 ]; - this->SetPoint2( p ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::LineSource:: -LineSource( ) - : Superclass( ) -{ - this->SetNumberOfInputPorts( 0 ); - this->Point1[ 0 ] = -double( 0.5 ); - this->Point1[ 1 ] = double( 0.0 ); - this->Point1[ 2 ] = double( 0.0 ); - this->Point2[ 0 ] = double( 0.5 ); - this->Point2[ 1 ] = double( 0.0 ); - this->Point2[ 2 ] = double( 0.0 ); -} - -// ------------------------------------------------------------------------- -cpExtensions::Visualization::LineSource:: -~LineSource( ) -{ -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::LineSource:: -RequestData( - vtkInformation* request, - vtkInformationVector** inputVector, - vtkInformationVector* outputVector - ) -{ - // Get output object - vtkInformation* outInfo = outputVector->GetInformationObject( 0 ); - vtkPolyData* output = - vtkPolyData::SafeDownCast( - outInfo->Get( vtkDataObject::DATA_OBJECT( ) ) - ); - - // Create points - vtkPoints* points = vtkPoints::New( ); - points->SetDataType( VTK_FLOAT ); - points->Allocate( 2 ); - - // Create cells - vtkCellArray* verts = vtkCellArray::New( ); - vtkCellArray* lines = vtkCellArray::New( ); - vtkCellArray* faces = vtkCellArray::New( ); - vtkCellArray* strips = vtkCellArray::New( ); - lines->Allocate( lines->EstimateSize( 2, 2 ) ); - - // Assign points - points->InsertPoint( 0, this->Point1 ); - points->InsertPoint( 1, this->Point2 ); - - // Assign cells - vtkIdType cell_pts[ 2 ] = { 0, 1 }; - lines->InsertNextCell( 2, cell_pts ); - - // Assign to output - output->SetPoints( points ); - output->SetVerts( verts ); - output->SetLines( lines ); - output->SetPolys( faces ); - output->SetStrips( strips ); - - // Finish and return - points->Delete( ); - verts->Delete( ); - lines->Delete( ); - faces->Delete( ); - strips->Delete( ); - return( 1 ); -} - -// ------------------------------------------------------------------------- -int cpExtensions::Visualization::LineSource:: -RequestInformation( - vtkInformation* request, - vtkInformationVector** inputVector, - vtkInformationVector* outputVector - ) -{ - vtkInformation* outInfo = outputVector->GetInformationObject( 0 ); - outInfo->Set( CAN_HANDLE_PIECE_REQUEST(), 1 ); - return( 1 ); -} - -// eof - $RCSfile$