OpenWalnut  1.5.0dev
Public Member Functions | List of all members
WMeshReaderInterface Class Referenceabstract

Define the interface which is injected into an WObjectNDIP. More...

#include <WMeshReaderInterface.h>

+ Inheritance diagram for WMeshReaderInterface:

Public Member Functions

virtual WTriangleMesh::SPtr operator() (WProgressCombiner::SPtr progress, boost::filesystem::path file)=0
 Load the dataset. More...
 
virtual ~WMeshReaderInterface ()
 Destructor. More...
 
std::string getLine (std::shared_ptr< std::ifstream > ifs, const std::string &desc) const
 Read a line from the given input stream and throw an exception on error. More...
 
std::string getLine (std::ifstream &ifs, const std::string &desc) const
 Read a line from the given input stream and throw an exception on error. More...
 

Detailed Description

Define the interface which is injected into an WObjectNDIP.

Remember that WObjectNDIP is a template class deriving from its template type. This way we can inject methods into the base class. It avoids derivation from WObjectNDIP.

This defines the caller-interface common to each mesh loader

Definition at line 51 of file WMeshReaderInterface.h.

Constructor & Destructor Documentation

◆ ~WMeshReaderInterface()

WMeshReaderInterface::~WMeshReaderInterface ( )
virtual

Destructor.

Definition at line 30 of file WMeshReaderInterface.cpp.

Member Function Documentation

◆ getLine() [1/2]

std::string WMeshReaderInterface::getLine ( std::ifstream &  ifs,
const std::string &  desc 
) const

Read a line from the given input stream and throw an exception on error.

Parameters
ifsthe stream to read from
descthe description for the exception. Provide some useful info here.
Returns
the line

Definition at line 40 of file WMeshReaderInterface.cpp.

◆ getLine() [2/2]

std::string WMeshReaderInterface::getLine ( std::shared_ptr< std::ifstream >  ifs,
const std::string &  desc 
) const

Read a line from the given input stream and throw an exception on error.

Parameters
ifsthe stream to read from
descthe description for the exception. Provide some useful info here.
Returns
the line

Definition at line 35 of file WMeshReaderInterface.cpp.

Referenced by WMeshReaderFreesurfer::operator()().

+ Here is the caller graph for this function:

◆ operator()()

virtual WTriangleMesh::SPtr WMeshReaderInterface::operator() ( WProgressCombiner::SPtr  progress,
boost::filesystem::path  file 
)
pure virtual

Load the dataset.

Throws exceptions if appropriate. Refer to the implementing class.

Parameters
progressthe progress indicator
filepath to the file to load
Returns
the loaded mesh

Implemented in WMeshReaderVTK, WMeshReaderOBJ, WMeshReaderFreesurfer, WMeshReaderFiberNavigator, WMeshReaderDIP, and WMeshReaderBrainVISA.


The documentation for this class was generated from the following files: