#include "SphereMeshSource.h" #include #include #include #include // ------------------------------------------------------------------------- cpPlugins::BasicFilters::SphereMeshSource:: SphereMeshSource( ) : Superclass( ) { this->SetNumberOfInputs( 0 ); this->SetNumberOfOutputs( 1 ); this->_MakeOutput< cpPlugins::Interface::Mesh >( 0 ); double point[ 3 ] = { double( 0 ) }; this->m_Parameters->ConfigureAsPoint( "Center", 3, point ); this->m_Parameters->ConfigureAsReal( "Radius", 1 ); this->m_Parameters->ConfigureAsUint( "PhiResolution", 8 ); this->m_Parameters->ConfigureAsUint( "ThetaResolution", 8 ); } // ------------------------------------------------------------------------- cpPlugins::BasicFilters::SphereMeshSource:: ~SphereMeshSource( ) { } // ------------------------------------------------------------------------- std::string cpPlugins::BasicFilters::SphereMeshSource:: _GenerateData( ) { itk::Point< double, 3 > center = this->m_Parameters->GetPoint< itk::Point< double, 3 > >( "Center", 3 ); // TODO: center.Fill( double( 0 ) ); // TODO double radius = this->m_Parameters->GetReal( "Radius" ); unsigned int phi = this->m_Parameters->GetUint( "PhiResolution" ); unsigned int theta = this->m_Parameters->GetUint( "ThetaResolution" ); vtkSphereSource* src = this->_CreateVTK< vtkSphereSource >( ); src->SetCenter( center[ 0 ], center[ 1 ], center[ 2 ] ); src->SetRadius( radius ); src->SetPhiResolution( phi ); src->SetThetaResolution( theta ); src->Update( ); // Execute filter cpPlugins::Interface::Mesh* out = this->GetOutput< cpPlugins::Interface::Mesh >( 0 ); out->SetVTK( src->GetOutput( ) ); return( "" ); } // eof - $RCSfile$