VectorEntity  1.1.0
Medical Data Segmentation Toolkit
Public Member Functions | Static Public Member Functions | Protected Attributes
vctl::MCEntity< ENTITY_TYPE > Class Template Reference

Base class for all vector entities like edges, etc. More...

#include <mcentity.h>

Inheritance diagram for vctl::MCEntity< ENTITY_TYPE >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

template<class S >
void DeserializeEntity (mds::mod::CChannelSerializer< S > &Reader)
 Deserializes the entity attributes.
int GetFlag ()
 Returns the current value of internal flags.
virtual unsigned int GetHashCode () const =0
 Calculates hash code identifieng the entity.
int GetObject () const
 Returns the object number.
doubleGetValue ()
 Returns the current value attribute.
const doubleGetValue () const
void * GetValuePtr () const
 Returns the current value of the pointer attribute.
void MaskFlag (int mask_flag)
 Clears all bits specified in the mask.
 MCEntity ()
 Default constructor.
void ReplaceFlag (int new_flag)
 Changes the internal flags completely.
template<class S >
void SerializeEntity (mds::mod::CChannelSerializer< S > &Writer)
 Serialization of entity attributes.
void SetEntityAttributes (MCEntity< ENTITY_TYPE > *entity)
 Copies all entity attributes.
void SetFlag (int set_flag)
 Adds a given flag using the binary or operation.
void SetObject (int _value)
 Sets the object number.
void SetValue (const double &_value)
 Sets the value attribute.
void SetValuePtr (void *_ptr)
 Sets the pointer attribute.
bool TestFlag (int test_flag) const
 Checks if a given flag is present.
virtual bool TestIdentity (ENTITY_TYPE *test_entity) const =0
 Compares two entities and returns true if they are equal.
virtual std::string ToString () const =0
 Returns textual representation of all entity attributes.
virtual ~MCEntity ()
 Virtual destructor.

Static Public Member Functions

static unsigned int MakeStringHashCode (const char *hash_string, int hash_string_size)
 Returns a simple hash code of a given block of bytes.

Protected Attributes

int flag
 Internal entity flags.
int object
 Entity number.
double value
 A user specific value attribute of the entity.
void * value_ptr
 A user specific pointer attribute of the entity.

Detailed Description

template<typename ENTITY_TYPE>
class vctl::MCEntity< ENTITY_TYPE >

Base class for all vector entities like edges, etc.


Constructor & Destructor Documentation

template<typename ENTITY_TYPE>
vctl::MCEntity< ENTITY_TYPE >::MCEntity ( ) [inline]

Default constructor.

template<typename ENTITY_TYPE>
virtual vctl::MCEntity< ENTITY_TYPE >::~MCEntity ( ) [inline, virtual]

Virtual destructor.


Member Function Documentation

template<typename ENTITY_TYPE>
template<class S >
void vctl::MCEntity< ENTITY_TYPE >::DeserializeEntity ( mds::mod::CChannelSerializer< S > &  Reader) [inline]

Deserializes the entity attributes.

Reimplemented in vctl::MCVertex.

template<typename ENTITY_TYPE>
int vctl::MCEntity< ENTITY_TYPE >::GetFlag ( ) [inline]

Returns the current value of internal flags.

template<typename ENTITY_TYPE>
virtual unsigned int vctl::MCEntity< ENTITY_TYPE >::GetHashCode ( ) const [pure virtual]

Calculates hash code identifieng the entity.

Implemented in vctl::MCTetra, vctl::MCTri, vctl::MCEdge, and vctl::MCVertex.

template<typename ENTITY_TYPE>
int vctl::MCEntity< ENTITY_TYPE >::GetObject ( ) const [inline]

Returns the object number.

template<typename ENTITY_TYPE>
double& vctl::MCEntity< ENTITY_TYPE >::GetValue ( ) [inline]

Returns the current value attribute.

template<typename ENTITY_TYPE>
void* vctl::MCEntity< ENTITY_TYPE >::GetValuePtr ( ) const [inline]

Returns the current value of the pointer attribute.

template<typename ENTITY_TYPE>
static unsigned int vctl::MCEntity< ENTITY_TYPE >::MakeStringHashCode ( const char *  hash_string,
int  hash_string_size 
) [inline, static]

Returns a simple hash code of a given block of bytes.

template<typename ENTITY_TYPE>
void vctl::MCEntity< ENTITY_TYPE >::MaskFlag ( int  mask_flag) [inline]

Clears all bits specified in the mask.

template<typename ENTITY_TYPE>
void vctl::MCEntity< ENTITY_TYPE >::ReplaceFlag ( int  new_flag) [inline]

Changes the internal flags completely.

template<typename ENTITY_TYPE>
template<class S >
void vctl::MCEntity< ENTITY_TYPE >::SerializeEntity ( mds::mod::CChannelSerializer< S > &  Writer) [inline]

Serialization of entity attributes.

Reimplemented in vctl::MCTetra, vctl::MCTri, vctl::MCEdge, and vctl::MCVertex.

template<typename ENTITY_TYPE>
void vctl::MCEntity< ENTITY_TYPE >::SetEntityAttributes ( MCEntity< ENTITY_TYPE > *  entity) [inline]

Copies all entity attributes.

template<typename ENTITY_TYPE>
void vctl::MCEntity< ENTITY_TYPE >::SetFlag ( int  set_flag) [inline]

Adds a given flag using the binary or operation.

template<typename ENTITY_TYPE>
void vctl::MCEntity< ENTITY_TYPE >::SetObject ( int  _value) [inline]

Sets the object number.

template<typename ENTITY_TYPE>
void vctl::MCEntity< ENTITY_TYPE >::SetValue ( const double _value) [inline]

Sets the value attribute.

template<typename ENTITY_TYPE>
void vctl::MCEntity< ENTITY_TYPE >::SetValuePtr ( void *  _ptr) [inline]

Sets the pointer attribute.

template<typename ENTITY_TYPE>
bool vctl::MCEntity< ENTITY_TYPE >::TestFlag ( int  test_flag) const [inline]

Checks if a given flag is present.

template<typename ENTITY_TYPE>
virtual bool vctl::MCEntity< ENTITY_TYPE >::TestIdentity ( ENTITY_TYPE *  test_entity) const [pure virtual]

Compares two entities and returns true if they are equal.

Implemented in vctl::MCTetra, vctl::MCTri, vctl::MCEdge, and vctl::MCVertex.

template<typename ENTITY_TYPE>
virtual std::string vctl::MCEntity< ENTITY_TYPE >::ToString ( ) const [pure virtual]

Returns textual representation of all entity attributes.

Implemented in vctl::MCTetra, vctl::MCTri, vctl::MCEdge, and vctl::MCVertex.


Member Data Documentation

template<typename ENTITY_TYPE>
int vctl::MCEntity< ENTITY_TYPE >::flag [protected]

Internal entity flags.

template<typename ENTITY_TYPE>
int vctl::MCEntity< ENTITY_TYPE >::object [protected]

Entity number.

template<typename ENTITY_TYPE>
double vctl::MCEntity< ENTITY_TYPE >::value [protected]

A user specific value attribute of the entity.

template<typename ENTITY_TYPE>
void* vctl::MCEntity< ENTITY_TYPE >::value_ptr [protected]

A user specific pointer attribute of the entity.

  • You should manage the underlying memory on your own.
  • Please, remember to clear the pointer before destructor is called.

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