Reader to read files in Obj-format. More...
#include <mitkObjFileReader.h>
Public Types | |
typedef ObjFileReader | Self |
typedef SurfaceSource | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer < const Self > | ConstPointer |
Public Member Functions | |
virtual const char * | GetClassName () const |
virtual void | SetFileName (const char *_arg) |
virtual const char * | GetFileName () const |
virtual void | SetFilePrefix (const char *_arg) |
virtual const char * | GetFilePrefix () const |
virtual void | SetFilePattern (const char *_arg) |
virtual const char * | GetFilePattern () const |
Static Public Member Functions | |
static Pointer | New () |
static bool | CanReadFile (const std::string filename, const std::string filePrefix, const std::string filePattern) |
Protected Member Functions | |
virtual void | GenerateData () |
ObjFileReader () | |
~ObjFileReader () | |
Protected Attributes | |
std::string | m_FileName |
std::string | m_FilePrefix |
std::string | m_FilePattern |
Reader to read files in Obj-format.
Definition at line 30 of file mitkObjFileReader.h.
typedef itk::SmartPointer<const Self> mitk::ObjFileReader::ConstPointer |
Definition at line 33 of file mitkObjFileReader.h.
typedef itk::SmartPointer<Self> mitk::ObjFileReader::Pointer |
Definition at line 33 of file mitkObjFileReader.h.
Definition at line 33 of file mitkObjFileReader.h.
Definition at line 33 of file mitkObjFileReader.h.
mitk::ObjFileReader::ObjFileReader | ( | ) | [protected] |
Definition at line 22 of file mitkObjFileReader.cpp.
: m_FileName("") { }
mitk::ObjFileReader::~ObjFileReader | ( | ) | [protected] |
Definition at line 27 of file mitkObjFileReader.cpp.
{ }
bool mitk::ObjFileReader::CanReadFile | ( | const std::string | filename, |
const std::string | filePrefix, | ||
const std::string | filePattern | ||
) | [static] |
Definition at line 52 of file mitkObjFileReader.cpp.
{ // First check the extension //std::string filename = file; if( filename == "" ) { //MITK_INFO<<"No filename specified."<<std::endl; return false; } bool extensionFound = false; std::string::size_type ObjPos = filename.rfind(".obj"); if ((ObjPos != std::string::npos) && (ObjPos == filename.length() - 4)) { extensionFound = true; } ObjPos = filename.rfind(".OBJ"); if ((ObjPos != std::string::npos) && (ObjPos == filename.length() - 4)) { extensionFound = true; } if( !extensionFound ) { //MITK_INFO<<"The filename extension is not recognized."<<std::endl; return false; } return true; }
void mitk::ObjFileReader::GenerateData | ( | ) | [protected, virtual] |
Definition at line 31 of file mitkObjFileReader.cpp.
References MITK_INFO.
{ mitk::Surface::Pointer output = this->GetOutput(); if( m_FileName != "") { MITK_INFO << "Loading " << m_FileName << " as obj..." << std::endl; vtkOBJReader *reader = vtkOBJReader::New(); reader->SetFileName( m_FileName.c_str() ); reader->Update(); if ( reader->GetOutput() != NULL ) output->SetVtkPolyData( reader->GetOutput() ); reader->Delete(); MITK_INFO << "...finished!" << std::endl; } }
virtual const char* mitk::ObjFileReader::GetClassName | ( | ) | const [virtual] |
virtual const char* mitk::ObjFileReader::GetFileName | ( | ) | const [virtual] |
virtual const char* mitk::ObjFileReader::GetFilePattern | ( | ) | const [virtual] |
virtual const char* mitk::ObjFileReader::GetFilePrefix | ( | ) | const [virtual] |
static Pointer mitk::ObjFileReader::New | ( | ) | [static] |
Method for creation through the object factory.
Reimplemented from mitk::SurfaceSource.
virtual void mitk::ObjFileReader::SetFileName | ( | const char * | _arg ) | [virtual] |
virtual void mitk::ObjFileReader::SetFilePattern | ( | const char * | _arg ) | [virtual] |
virtual void mitk::ObjFileReader::SetFilePrefix | ( | const char * | _arg ) | [virtual] |
std::string mitk::ObjFileReader::m_FileName [protected] |
Definition at line 56 of file mitkObjFileReader.h.
std::string mitk::ObjFileReader::m_FilePattern [protected] |
Definition at line 56 of file mitkObjFileReader.h.
std::string mitk::ObjFileReader::m_FilePrefix [protected] |
Definition at line 56 of file mitkObjFileReader.h.