ml::WEM Class Reference

A WEM comprises a number of WEMPatches. More...

#include <WEM.h>

Inheritance diagram for ml::WEM:

ml::Base

List of all members.

Classes

struct  WEMNotificationCBData
 This struct combines a function pointer, a user data pointer and a flag for the notification observer mechanism. More...

Public Member Functions

 WEM ()
 Standard constructor.
 WEM (const WEM &wem)
 Copy constructor.
virtual ~WEM ()
 Standard destructor.
void clone (const WEM &wem)
 Clones the internal WEMs of the given WEM to this one.
void addNotificationObserver (wemNotificationCB *callback, void *userData)
 Adds a notification observer to this WEM.
void removeNotificationObserver (wemNotificationCB *callback, void *userData)
 Removes a notification observer from this WEM.
void notifyObservers (std::vector< WEMEventContainer > ecList)
 Notifies all observers.
unsigned int getCurrentWEMPatchId ()
 Returns the current last id (incremented each call) for WEMPatches.
void setCurrentWEMPatchId (unsigned int id)
 Sets the current last id for WEMPatches. Do not mess with it.
void addWEMPatch (WEMPatch *wemPatch)
 Adds the given WEMPatch as a pointer to the list.
WEMTrianglePatchaddWEMPatchCopy (WEMTrianglePatch *wemPatch, bool assignNewId=false)
 Adds a copy of the given WEMPatch (WEMTrianglePatch) to the list. Assigns optionally a new id to the patch.
WEMQuadPatchaddWEMPatchCopy (WEMQuadPatch *wemPatch, bool assignNewId=false)
 Adds a copy of the given WEMPatch (WEMQuadPatch) to the list. Assigns optionally a new id to the patch.
WEMPolygonPatchaddWEMPatchCopy (WEMPolygonPatch *wemPatch, bool assignNewId=false)
 Adds a copy of the given WEMPatch (WEMPolygonPatch) to the list. Assigns optionally a new id to the patch.
bool removeWEMPatch (WEMPatch *wemPatch)
 Removes a given WEMPatch from the list.
bool removeWEMPatch (unsigned int id)
 Removes a WEMPatch by its id .
bool removeAll ()
 Removes all WEMPatches from the list.
void clear ()
 Clear internal vector (DOES NOT DELETE WEMs!!).
WEMPatchgetWEMPatchAt (unsigned int index)
 Returns a pointer to the WEMPatch at the given position in the internal list.
const WEMPatchgetWEMPatchAt (unsigned int index) const
 Returns a pointer to the WEMPatch at the given position in the internal list.
WEMPatchgetWEMPatchById (unsigned int id)
 Returns a pointer to the WEMPatch with the given unique id.
const WEMPatchgetWEMPatchById (unsigned int id) const
 Returns a pointer to the WEMPatch with the given unique id.
unsigned int getWEMPatchIndex (WEMPatch *wemPatch) const
 Returns the index of the given WEMPatch in its list.
unsigned int getWEMPatchIndex (unsigned int id) const
 Returns the index of the WEMPatch with the given id in its list.
bool hasWEMPatch (WEMPatch *wemPatch) const
 Returns whether there is the given WEMPatch in the list.
unsigned int getNumWEMPatches () const
 Returns the number of WEMs in the list.
void enableRepaintObserver ()
 Enables the repaint observer mechanism.
void disableRepaintObserver ()
 Disables the repaint observer mechanism.
void enableFinishedObserver ()
 Enables the finished observer mechanism.
void disableFinishedObserver ()
 Disables the finished observer mechanism.
void enableInteractionObserver ()
 Enables the interaction observer mechanism.
void disableInteractionObserver ()
 Disables the interaction observer mechanism.
void enableSelectionObserver ()
 Enables the selection observer mechanism.
void disableSelectionObserver ()
 Disables the selection observer mechanism.
bool isRepaintNotificationEnabled () const
 Returns 'true' if the repaint notification is enabled, 'false' otherwise.
bool isFinishedNotificationEnabled () const
 Returns 'true' if the finished notification is enabled, 'false' otherwise.
bool isInteractionInitNotificationEnabled () const
 Returns 'true' if the interaction init notification is enabled, 'false' otherwise.
bool isSelectionNotificationEnabled () const
 Returns 'true' if the selection notification is enabled, 'false' otherwise.
int getId () const
 Get the id of the WEM.
std::string getName () const
 Get name of the WEM.
void setName (std::string name)
 Set name of the WEM to the given string.
bool loadWEMSurface (const std::string &filename, bool generateEdges=true, ProgressField *progressFld=NULL)
 Loads the geometry from a file given by its file name.
bool loadWEMSurface (const std::string &filename, int filesize, bool generateEdges=true, ProgressField *progressFld=NULL)
 Loads the geometry from a file given by its file name.
bool loadWEMSurface (std::istream &instream, int filesize, bool generateEdges=true, ProgressField *progressFld=NULL)
 Loads the geometry from a given stream.
void saveWEMSurface (const std::string &filename, ProgressField *progressFld=NULL)
 Saves the geometry to the given file name.
void saveWEMSurface (std::ostream &outstream, ProgressField *progressFld=NULL)
 Saves the geometry to a given stream.
std::vector< std::string > getRegisteredPrimitiveValueLists () const
 Get unique list of registered primitive value lists for all patches as a vector.
void flatten (WEMTrianglePatch *triPatch, WEMRequirements *requirements, TriangulationModes triangulationMode)
 Flatten: joins and converts all patches to triangle patches with same normal orientation.

Static Public Member Functions

static void removeNotificationObserverFromAllWEMs (wemNotificationCB *callback, void *userData)
 Removes a certain notification observer from all WEM.


Detailed Description

A WEM comprises a number of WEMPatches.

The WEM is derived from Base and can be used as a data structure in a MeVisLab network.

Definition at line 76 of file WEM.h.


Constructor & Destructor Documentation

ml::WEM::WEM (  ) 

Standard constructor.

ml::WEM::WEM ( const WEM wem  ) 

Copy constructor.

virtual ml::WEM::~WEM (  )  [virtual]

Standard destructor.


Member Function Documentation

void ml::WEM::addNotificationObserver ( wemNotificationCB callback,
void *  userData 
)

Adds a notification observer to this WEM.

void ml::WEM::addWEMPatch ( WEMPatch wemPatch  ) 

Adds the given WEMPatch as a pointer to the list.

Be very very careful of deleting this WEMPatch from the list afterwards.

WEMPolygonPatch* ml::WEM::addWEMPatchCopy ( WEMPolygonPatch wemPatch,
bool  assignNewId = false 
)

Adds a copy of the given WEMPatch (WEMPolygonPatch) to the list. Assigns optionally a new id to the patch.

WEMQuadPatch* ml::WEM::addWEMPatchCopy ( WEMQuadPatch wemPatch,
bool  assignNewId = false 
)

Adds a copy of the given WEMPatch (WEMQuadPatch) to the list. Assigns optionally a new id to the patch.

WEMTrianglePatch* ml::WEM::addWEMPatchCopy ( WEMTrianglePatch wemPatch,
bool  assignNewId = false 
)

Adds a copy of the given WEMPatch (WEMTrianglePatch) to the list. Assigns optionally a new id to the patch.

void ml::WEM::clear (  ) 

Clear internal vector (DOES NOT DELETE WEMs!!).

void ml::WEM::clone ( const WEM wem  ) 

Clones the internal WEMs of the given WEM to this one.

void ml::WEM::disableFinishedObserver (  )  [inline]

Disables the finished observer mechanism.

Definition at line 182 of file WEM.h.

void ml::WEM::disableInteractionObserver (  )  [inline]

Disables the interaction observer mechanism.

Definition at line 187 of file WEM.h.

void ml::WEM::disableRepaintObserver (  )  [inline]

Disables the repaint observer mechanism.

Definition at line 177 of file WEM.h.

void ml::WEM::disableSelectionObserver (  )  [inline]

Disables the selection observer mechanism.

Definition at line 192 of file WEM.h.

void ml::WEM::enableFinishedObserver (  )  [inline]

Enables the finished observer mechanism.

Definition at line 180 of file WEM.h.

void ml::WEM::enableInteractionObserver (  )  [inline]

Enables the interaction observer mechanism.

Definition at line 185 of file WEM.h.

void ml::WEM::enableRepaintObserver (  )  [inline]

Enables the repaint observer mechanism.

Definition at line 175 of file WEM.h.

void ml::WEM::enableSelectionObserver (  )  [inline]

Enables the selection observer mechanism.

Definition at line 190 of file WEM.h.

void ml::WEM::flatten ( WEMTrianglePatch triPatch,
WEMRequirements requirements,
TriangulationModes  triangulationMode 
)

Flatten: joins and converts all patches to triangle patches with same normal orientation.

unsigned int ml::WEM::getCurrentWEMPatchId (  ) 

Returns the current last id (incremented each call) for WEMPatches.

If there are no WEMPatches in the list, this id is set back to 0. Can not be const, because if changes the object's state.

int ml::WEM::getId ( void   )  const [inline]

Get the id of the WEM.

Definition at line 208 of file WEM.h.

std::string ml::WEM::getName (  )  const [inline]

Get name of the WEM.

Definition at line 210 of file WEM.h.

unsigned int ml::WEM::getNumWEMPatches (  )  const [inline]

Returns the number of WEMs in the list.

Definition at line 170 of file WEM.h.

std::vector<std::string> ml::WEM::getRegisteredPrimitiveValueLists (  )  const

Get unique list of registered primitive value lists for all patches as a vector.

const WEMPatch* ml::WEM::getWEMPatchAt ( unsigned int  index  )  const [inline]

Returns a pointer to the WEMPatch at the given position in the internal list.

Definition at line 153 of file WEM.h.

References getWEMPatchAt().

Referenced by getWEMPatchAt().

WEMPatch* ml::WEM::getWEMPatchAt ( unsigned int  index  ) 

Returns a pointer to the WEMPatch at the given position in the internal list.

const WEMPatch* ml::WEM::getWEMPatchById ( unsigned int  id  )  const [inline]

Returns a pointer to the WEMPatch with the given unique id.

Returns NULL if no such WEMPatch is stored in the list.

Definition at line 159 of file WEM.h.

References getWEMPatchById().

Referenced by getWEMPatchById().

WEMPatch* ml::WEM::getWEMPatchById ( unsigned int  id  ) 

Returns a pointer to the WEMPatch with the given unique id.

Returns NULL if no such WEMPatch is stored in the list.

unsigned int ml::WEM::getWEMPatchIndex ( unsigned int  id  )  const

Returns the index of the WEMPatch with the given id in its list.

unsigned int ml::WEM::getWEMPatchIndex ( WEMPatch wemPatch  )  const

Returns the index of the given WEMPatch in its list.

bool ml::WEM::hasWEMPatch ( WEMPatch wemPatch  )  const

Returns whether there is the given WEMPatch in the list.

bool ml::WEM::isFinishedNotificationEnabled (  )  const [inline]

Returns 'true' if the finished notification is enabled, 'false' otherwise.

Definition at line 199 of file WEM.h.

bool ml::WEM::isInteractionInitNotificationEnabled (  )  const [inline]

Returns 'true' if the interaction init notification is enabled, 'false' otherwise.

Definition at line 201 of file WEM.h.

bool ml::WEM::isRepaintNotificationEnabled (  )  const [inline]

Returns 'true' if the repaint notification is enabled, 'false' otherwise.

Definition at line 197 of file WEM.h.

bool ml::WEM::isSelectionNotificationEnabled (  )  const [inline]

Returns 'true' if the selection notification is enabled, 'false' otherwise.

Definition at line 203 of file WEM.h.

bool ml::WEM::loadWEMSurface ( std::istream &  instream,
int  filesize,
bool  generateEdges = true,
ProgressField progressFld = NULL 
)

Loads the geometry from a given stream.

bool ml::WEM::loadWEMSurface ( const std::string &  filename,
int  filesize,
bool  generateEdges = true,
ProgressField progressFld = NULL 
)

Loads the geometry from a file given by its file name.

bool ml::WEM::loadWEMSurface ( const std::string &  filename,
bool  generateEdges = true,
ProgressField progressFld = NULL 
)

Loads the geometry from a file given by its file name.

void ml::WEM::notifyObservers ( std::vector< WEMEventContainer ecList  ) 

Notifies all observers.

bool ml::WEM::removeAll (  ) 

Removes all WEMPatches from the list.

Returns 'true' if there was something to remove, 'false' otherwise.

void ml::WEM::removeNotificationObserver ( wemNotificationCB callback,
void *  userData 
)

Removes a notification observer from this WEM.

static void ml::WEM::removeNotificationObserverFromAllWEMs ( wemNotificationCB callback,
void *  userData 
) [static]

Removes a certain notification observer from all WEM.

bool ml::WEM::removeWEMPatch ( unsigned int  id  ) 

Removes a WEMPatch by its id .

Returns 'true' if there was something to remove, 'false' otherwise.

bool ml::WEM::removeWEMPatch ( WEMPatch wemPatch  ) 

Removes a given WEMPatch from the list.

Returns 'true' if there was something to remove, 'false' otherwise.

void ml::WEM::saveWEMSurface ( std::ostream &  outstream,
ProgressField progressFld = NULL 
)

Saves the geometry to a given stream.

void ml::WEM::saveWEMSurface ( const std::string &  filename,
ProgressField progressFld = NULL 
)

Saves the geometry to the given file name.

void ml::WEM::setCurrentWEMPatchId ( unsigned int  id  )  [inline]

Sets the current last id for WEMPatches. Do not mess with it.

Definition at line 122 of file WEM.h.

void ml::WEM::setName ( std::string  name  )  [inline]

Set name of the WEM to the given string.

Definition at line 212 of file WEM.h.


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

Generated on Sat Sep 3 18:39:40 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8