OpenMesh::BaseProperty Class Reference

#include <OpenMesh/Core/Utils/PropertyT.hh>

Inheritance diagram for OpenMesh::BaseProperty:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 BaseProperty (const BaseProperty &_rhs)
 Copy constructor.
 BaseProperty (const std::string &_name="<unknown>")
 Default constructor.
virtual void clear ()=0
 Clear all elements and free memory.
virtual BasePropertyclone () const =0
 Return a deep copy of self.
virtual size_t element_size () const =0
 Size of one element in bytes or UnknownSize if not known.
virtual size_t n_elements () const =0
 Number of elements in property.
const std::string & name () const
 Return the name of the property.
bool persistent (void) const
 Returns true if the persistent flag is enabled else false.
virtual void push_back ()=0
 Extend the number of elements by one.
virtual void reserve (size_t _n)=0
 Reserve memory for n elements.
virtual void resize (size_t _n)=0
 Resize storage to hold n elements.
virtual size_t restore (std::istream &_istr, bool _swap)=0
virtual void set_persistent (bool _yn)=0
virtual size_t size_of (size_t _n_elem) const
virtual size_t size_of () const
 Return size of property in bytes.
virtual void stats (std::ostream &_ostr) const
virtual size_t store (std::ostream &_ostr, bool _swap) const =0
 Store self as one binary block.
virtual void swap (size_t _i0, size_t _i1)=0
 Let two elements swap their storage place.
virtual ~BaseProperty ()
 Destructor.

Static Public Attributes

static const size_t UnknownSize = size_t(-1)
 Indicates an error when a size is returned by a member.

Protected Member Functions

template<typename T >
void check_and_set_persistent (bool _yn)

Private Attributes

std::string name_
bool persistent_

Detailed Description

Abstract class defining the basic interface of a dynamic property.

Definition at line 58 of file BaseProperty.hh.


Constructor & Destructor Documentation

OpenMesh::BaseProperty::BaseProperty ( const std::string &  _name = "<unknown>"  )  [inline]

Default constructor.

In OpenMesh all mesh data is stored in so-called properties. We distinuish between standard properties, which can be defined at compile time using the Attributes in the traits definition and at runtime using the request property functions defined in one of the kernels.

If the property should be stored along with the default properties in the OM-format one must name the property and enable the persistant flag with set_persistent().

Parameters:
_name Optional textual name for the property.

Definition at line 81 of file BaseProperty.hh.

OpenMesh::BaseProperty::BaseProperty ( const BaseProperty _rhs  )  [inline]

Copy constructor.

Definition at line 86 of file BaseProperty.hh.

virtual OpenMesh::BaseProperty::~BaseProperty (  )  [inline, virtual]

Destructor.

Definition at line 90 of file BaseProperty.hh.


Member Function Documentation

template<typename T >
void OpenMesh::BaseProperty::check_and_set_persistent ( bool  _yn  )  [inline, protected]

Definition at line 161 of file BaseProperty.hh.

virtual void OpenMesh::BaseProperty::clear (  )  [pure virtual]
virtual BaseProperty* OpenMesh::BaseProperty::clone (  )  const [pure virtual]
virtual size_t OpenMesh::BaseProperty::element_size (  )  const [pure virtual]
virtual size_t OpenMesh::BaseProperty::n_elements (  )  const [pure virtual]
const std::string& OpenMesh::BaseProperty::name (  )  const [inline]

Return the name of the property.

Definition at line 115 of file BaseProperty.hh.

bool OpenMesh::BaseProperty::persistent ( void   )  const [inline]

Returns true if the persistent flag is enabled else false.

Definition at line 122 of file BaseProperty.hh.

virtual void OpenMesh::BaseProperty::push_back (  )  [pure virtual]
virtual void OpenMesh::BaseProperty::reserve ( size_t  _n  )  [pure virtual]
virtual void OpenMesh::BaseProperty::resize ( size_t  _n  )  [pure virtual]
virtual size_t OpenMesh::BaseProperty::restore ( std::istream &  _istr,
bool  _swap 
) [pure virtual]

Restore self from a binary block. Uses reserve() to set the size of self before restoring.

Implemented in OpenMesh::PropertyT< T >, OpenMesh::PropertyT< bool >, OpenMesh::PropertyT< std::string >, and OpenMesh::Kernel_OSG::oPropertyT< GeoProperty >.

virtual void OpenMesh::BaseProperty::set_persistent ( bool  _yn  )  [pure virtual]

Enable or disable persistency. Self must be a named property to enable persistency.

Implemented in OpenMesh::PropertyT< T >, OpenMesh::PropertyT< bool >, OpenMesh::PropertyT< std::string >, and OpenMesh::Kernel_OSG::oPropertyT< GeoProperty >.

virtual size_t OpenMesh::BaseProperty::size_of ( size_t  _n_elem  )  const [inline, virtual]

Estimated size of property if it has _n_elem elements. The member returns UnknownSize if the size cannot be estimated.

Reimplemented in OpenMesh::PropertyT< T >, OpenMesh::PropertyT< bool >, and OpenMesh::PropertyT< std::string >.

Definition at line 142 of file BaseProperty.hh.

virtual size_t OpenMesh::BaseProperty::size_of ( void   )  const [inline, virtual]

Return size of property in bytes.

Reimplemented in OpenMesh::PropertyT< T >, OpenMesh::PropertyT< bool >, and OpenMesh::PropertyT< std::string >.

Definition at line 135 of file BaseProperty.hh.

virtual void OpenMesh::BaseProperty::stats ( std::ostream &  _ostr  )  const [virtual]
virtual size_t OpenMesh::BaseProperty::store ( std::ostream &  _ostr,
bool  _swap 
) const [pure virtual]
virtual void OpenMesh::BaseProperty::swap ( size_t  _i0,
size_t  _i1 
) [pure virtual]

Member Data Documentation

std::string OpenMesh::BaseProperty::name_ [private]

Definition at line 170 of file BaseProperty.hh.

Definition at line 171 of file BaseProperty.hh.

const size_t OpenMesh::BaseProperty::UnknownSize = size_t(-1) [static]

Indicates an error when a size is returned by a member.

Definition at line 63 of file BaseProperty.hh.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


openmesh
Author(s): Benjamin Pitzer
autogenerated on Fri Jan 11 12:11:16 2013