ENH: Add class level documentation across the project. Remove a couple methods that

unnecessarily duplicated functionality.
parent 6ff2d202
......@@ -103,18 +103,16 @@ class XdmfAttributePtr(_object):
__swig_destroy__ = _Xdmf.delete_XdmfAttributePtr
__del__ = lambda self : None;
def New(self): return _Xdmf.XdmfAttributePtr_New(self)
def getName(self): return _Xdmf.XdmfAttributePtr_getName(self)
def setName(self, *args): return _Xdmf.XdmfAttributePtr_setName(self, *args)
def getAttributeType(self): return _Xdmf.XdmfAttributePtr_getAttributeType(self)
def setAttributeType(self, *args): return _Xdmf.XdmfAttributePtr_setAttributeType(self, *args)
def getAttributeTypeAsString(self): return _Xdmf.XdmfAttributePtr_getAttributeTypeAsString(self)
def getAttributeCenter(self): return _Xdmf.XdmfAttributePtr_getAttributeCenter(self)
def getAttributeType(self): return _Xdmf.XdmfAttributePtr_getAttributeType(self)
def getName(self): return _Xdmf.XdmfAttributePtr_getName(self)
def printSelf(self): return _Xdmf.XdmfAttributePtr_printSelf(self)
def setAttributeCenter(self, *args): return _Xdmf.XdmfAttributePtr_setAttributeCenter(self, *args)
def getAttributeCenterAsString(self): return _Xdmf.XdmfAttributePtr_getAttributeCenterAsString(self)
def setAttributeType(self, *args): return _Xdmf.XdmfAttributePtr_setAttributeType(self, *args)
def setName(self, *args): return _Xdmf.XdmfAttributePtr_setName(self, *args)
def write(self, *args): return _Xdmf.XdmfAttributePtr_write(self, *args)
def printSelf(self): return _Xdmf.XdmfAttributePtr_printSelf(self)
def setArray(self, *args): return _Xdmf.XdmfAttributePtr_setArray(self, *args)
def getArray(self, *args): return _Xdmf.XdmfAttributePtr_getArray(self, *args)
def setArray(self, *args): return _Xdmf.XdmfAttributePtr_setArray(self, *args)
def traverse(self, *args): return _Xdmf.XdmfAttributePtr_traverse(self, *args)
XdmfAttributePtr_swigregister = _Xdmf.XdmfAttributePtr_swigregister
XdmfAttributePtr_swigregister(XdmfAttributePtr)
......@@ -205,9 +203,9 @@ class XdmfDataItemPtr(_object):
except: self.this = this
__swig_destroy__ = _Xdmf.delete_XdmfDataItemPtr
__del__ = lambda self : None;
def setArray(self, *args): return _Xdmf.XdmfDataItemPtr_setArray(self, *args)
def getArray(self, *args): return _Xdmf.XdmfDataItemPtr_getArray(self, *args)
def printSelf(self): return _Xdmf.XdmfDataItemPtr_printSelf(self)
def setArray(self, *args): return _Xdmf.XdmfDataItemPtr_setArray(self, *args)
def traverse(self, *args): return _Xdmf.XdmfDataItemPtr_traverse(self, *args)
def write(self, *args): return _Xdmf.XdmfDataItemPtr_write(self, *args)
XdmfDataItemPtr_swigregister = _Xdmf.XdmfDataItemPtr_swigregister
......@@ -227,8 +225,8 @@ class XdmfDomainPtr(_object):
__swig_destroy__ = _Xdmf.delete_XdmfDomainPtr
__del__ = lambda self : None;
def New(self): return _Xdmf.XdmfDomainPtr_New(self)
def insert(self, *args): return _Xdmf.XdmfDomainPtr_insert(self, *args)
def getGrid(self, *args): return _Xdmf.XdmfDomainPtr_getGrid(self, *args)
def insert(self, *args): return _Xdmf.XdmfDomainPtr_insert(self, *args)
def getNumberOfGrids(self): return _Xdmf.XdmfDomainPtr_getNumberOfGrids(self)
def printSelf(self): return _Xdmf.XdmfDomainPtr_printSelf(self)
def traverse(self, *args): return _Xdmf.XdmfDomainPtr_traverse(self, *args)
......@@ -252,12 +250,10 @@ class XdmfGeometryPtr(_object):
def New(self): return _Xdmf.XdmfGeometryPtr_New(self)
def getGeometryType(self): return _Xdmf.XdmfGeometryPtr_getGeometryType(self)
def setGeometryType(self, *args): return _Xdmf.XdmfGeometryPtr_setGeometryType(self, *args)
def getGeometryTypeAsString(self): return _Xdmf.XdmfGeometryPtr_getGeometryTypeAsString(self)
def getDimensions(self): return _Xdmf.XdmfGeometryPtr_getDimensions(self)
def printSelf(self): return _Xdmf.XdmfGeometryPtr_printSelf(self)
def write(self, *args): return _Xdmf.XdmfGeometryPtr_write(self, *args)
def setArray(self, *args): return _Xdmf.XdmfGeometryPtr_setArray(self, *args)
def getArray(self, *args): return _Xdmf.XdmfGeometryPtr_getArray(self, *args)
def setArray(self, *args): return _Xdmf.XdmfGeometryPtr_setArray(self, *args)
def traverse(self, *args): return _Xdmf.XdmfGeometryPtr_traverse(self, *args)
XdmfGeometryPtr_swigregister = _Xdmf.XdmfGeometryPtr_swigregister
XdmfGeometryPtr_swigregister(XdmfGeometryPtr)
......@@ -276,16 +272,16 @@ class XdmfGridPtr(_object):
__swig_destroy__ = _Xdmf.delete_XdmfGridPtr
__del__ = lambda self : None;
def New(self): return _Xdmf.XdmfGridPtr_New(self)
def getAttribute(self, *args): return _Xdmf.XdmfGridPtr_getAttribute(self, *args)
def getGeometry(self, *args): return _Xdmf.XdmfGridPtr_getGeometry(self, *args)
def setGeometry(self, *args): return _Xdmf.XdmfGridPtr_setGeometry(self, *args)
def getTopology(self, *args): return _Xdmf.XdmfGridPtr_getTopology(self, *args)
def setTopology(self, *args): return _Xdmf.XdmfGridPtr_setTopology(self, *args)
def getName(self): return _Xdmf.XdmfGridPtr_getName(self)
def setName(self, *args): return _Xdmf.XdmfGridPtr_setName(self, *args)
def insert(self, *args): return _Xdmf.XdmfGridPtr_insert(self, *args)
def getAttribute(self, *args): return _Xdmf.XdmfGridPtr_getAttribute(self, *args)
def getNumberOfAttributes(self): return _Xdmf.XdmfGridPtr_getNumberOfAttributes(self)
def getTopology(self, *args): return _Xdmf.XdmfGridPtr_getTopology(self, *args)
def insert(self, *args): return _Xdmf.XdmfGridPtr_insert(self, *args)
def printSelf(self): return _Xdmf.XdmfGridPtr_printSelf(self)
def setGeometry(self, *args): return _Xdmf.XdmfGridPtr_setGeometry(self, *args)
def setTopology(self, *args): return _Xdmf.XdmfGridPtr_setTopology(self, *args)
def setName(self, *args): return _Xdmf.XdmfGridPtr_setName(self, *args)
def traverse(self, *args): return _Xdmf.XdmfGridPtr_traverse(self, *args)
def write(self, *args): return _Xdmf.XdmfGridPtr_write(self, *args)
XdmfGridPtr_swigregister = _Xdmf.XdmfGridPtr_swigregister
......@@ -341,15 +337,13 @@ class XdmfTopologyPtr(_object):
__swig_destroy__ = _Xdmf.delete_XdmfTopologyPtr
__del__ = lambda self : None;
def New(self): return _Xdmf.XdmfTopologyPtr_New(self)
def getTopologyType(self): return _Xdmf.XdmfTopologyPtr_getTopologyType(self)
def setTopologyType(self, *args): return _Xdmf.XdmfTopologyPtr_setTopologyType(self, *args)
def getNumberElements(self): return _Xdmf.XdmfTopologyPtr_getNumberElements(self)
def getTopologyTypeAsString(self): return _Xdmf.XdmfTopologyPtr_getTopologyTypeAsString(self)
def getNodesPerElement(self): return _Xdmf.XdmfTopologyPtr_getNodesPerElement(self)
def getTopologyType(self): return _Xdmf.XdmfTopologyPtr_getTopologyType(self)
def printSelf(self): return _Xdmf.XdmfTopologyPtr_printSelf(self)
def setTopologyType(self, *args): return _Xdmf.XdmfTopologyPtr_setTopologyType(self, *args)
def write(self, *args): return _Xdmf.XdmfTopologyPtr_write(self, *args)
def setArray(self, *args): return _Xdmf.XdmfTopologyPtr_setArray(self, *args)
def getArray(self, *args): return _Xdmf.XdmfTopologyPtr_getArray(self, *args)
def setArray(self, *args): return _Xdmf.XdmfTopologyPtr_setArray(self, *args)
def traverse(self, *args): return _Xdmf.XdmfTopologyPtr_traverse(self, *args)
XdmfTopologyPtr_swigregister = _Xdmf.XdmfTopologyPtr_swigregister
XdmfTopologyPtr_swigregister(XdmfTopologyPtr)
......@@ -368,10 +362,10 @@ class XdmfVisitorPtr(_object):
__swig_destroy__ = _Xdmf.delete_XdmfVisitorPtr
__del__ = lambda self : None;
def New(self): return _Xdmf.XdmfVisitorPtr_New(self)
def visit(self, *args): return _Xdmf.XdmfVisitorPtr_visit(self, *args)
def printSelf(self): return _Xdmf.XdmfVisitorPtr_printSelf(self)
def getLightDataLimit(self): return _Xdmf.XdmfVisitorPtr_getLightDataLimit(self)
def printSelf(self): return _Xdmf.XdmfVisitorPtr_printSelf(self)
def setLightDataLimit(self, *args): return _Xdmf.XdmfVisitorPtr_setLightDataLimit(self, *args)
def visit(self, *args): return _Xdmf.XdmfVisitorPtr_visit(self, *args)
XdmfVisitorPtr_swigregister = _Xdmf.XdmfVisitorPtr_swigregister
XdmfVisitorPtr_swigregister(XdmfVisitorPtr)
......@@ -411,10 +405,10 @@ class XdmfVisitor(XdmfObject):
__repr__ = _swig_repr
__swig_getmethods__["New"] = lambda x: _Xdmf.XdmfVisitor_New
if _newclass:New = staticmethod(_Xdmf.XdmfVisitor_New)
def visit(self, *args): return _Xdmf.XdmfVisitor_visit(self, *args)
def printSelf(self): return _Xdmf.XdmfVisitor_printSelf(self)
def getLightDataLimit(self): return _Xdmf.XdmfVisitor_getLightDataLimit(self)
def printSelf(self): return _Xdmf.XdmfVisitor_printSelf(self)
def setLightDataLimit(self, *args): return _Xdmf.XdmfVisitor_setLightDataLimit(self, *args)
def visit(self, *args): return _Xdmf.XdmfVisitor_visit(self, *args)
XdmfVisitor_swigregister = _Xdmf.XdmfVisitor_swigregister
XdmfVisitor_swigregister(XdmfVisitor)
......@@ -431,10 +425,11 @@ class XdmfDataItem(XdmfItem):
__getattr__ = lambda self, name: _swig_getattr(self, XdmfDataItem, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def setArray(self, *args): return _Xdmf.XdmfDataItem_setArray(self, *args)
def getArray(self, *args): return _Xdmf.XdmfDataItem_getArray(self, *args)
def printSelf(self): return _Xdmf.XdmfDataItem_printSelf(self)
def setArray(self, *args): return _Xdmf.XdmfDataItem_setArray(self, *args)
def traverse(self, *args): return _Xdmf.XdmfDataItem_traverse(self, *args)
def write(self, *args): return _Xdmf.XdmfDataItem_write(self, *args)
XdmfDataItem_swigregister = _Xdmf.XdmfDataItem_swigregister
XdmfDataItem_swigregister(XdmfDataItem)
......@@ -449,16 +444,14 @@ class XdmfAttribute(XdmfDataItem):
__repr__ = _swig_repr
__swig_getmethods__["New"] = lambda x: _Xdmf.XdmfAttribute_New
if _newclass:New = staticmethod(_Xdmf.XdmfAttribute_New)
def getName(self): return _Xdmf.XdmfAttribute_getName(self)
def setName(self, *args): return _Xdmf.XdmfAttribute_setName(self, *args)
def getAttributeType(self): return _Xdmf.XdmfAttribute_getAttributeType(self)
def setAttributeType(self, *args): return _Xdmf.XdmfAttribute_setAttributeType(self, *args)
def getAttributeTypeAsString(self): return _Xdmf.XdmfAttribute_getAttributeTypeAsString(self)
def getAttributeCenter(self): return _Xdmf.XdmfAttribute_getAttributeCenter(self)
def getAttributeType(self): return _Xdmf.XdmfAttribute_getAttributeType(self)
def getName(self): return _Xdmf.XdmfAttribute_getName(self)
def printSelf(self): return _Xdmf.XdmfAttribute_printSelf(self)
def setAttributeCenter(self, *args): return _Xdmf.XdmfAttribute_setAttributeCenter(self, *args)
def getAttributeCenterAsString(self): return _Xdmf.XdmfAttribute_getAttributeCenterAsString(self)
def setAttributeType(self, *args): return _Xdmf.XdmfAttribute_setAttributeType(self, *args)
def setName(self, *args): return _Xdmf.XdmfAttribute_setName(self, *args)
def write(self, *args): return _Xdmf.XdmfAttribute_write(self, *args)
def printSelf(self): return _Xdmf.XdmfAttribute_printSelf(self)
XdmfAttribute_swigregister = _Xdmf.XdmfAttribute_swigregister
XdmfAttribute_swigregister(XdmfAttribute)
......@@ -622,8 +615,8 @@ class XdmfDomain(XdmfItem):
__repr__ = _swig_repr
__swig_getmethods__["New"] = lambda x: _Xdmf.XdmfDomain_New
if _newclass:New = staticmethod(_Xdmf.XdmfDomain_New)
def insert(self, *args): return _Xdmf.XdmfDomain_insert(self, *args)
def getGrid(self, *args): return _Xdmf.XdmfDomain_getGrid(self, *args)
def insert(self, *args): return _Xdmf.XdmfDomain_insert(self, *args)
def getNumberOfGrids(self): return _Xdmf.XdmfDomain_getNumberOfGrids(self)
def printSelf(self): return _Xdmf.XdmfDomain_printSelf(self)
def traverse(self, *args): return _Xdmf.XdmfDomain_traverse(self, *args)
......@@ -648,8 +641,6 @@ class XdmfGeometry(XdmfDataItem):
if _newclass:New = staticmethod(_Xdmf.XdmfGeometry_New)
def getGeometryType(self): return _Xdmf.XdmfGeometry_getGeometryType(self)
def setGeometryType(self, *args): return _Xdmf.XdmfGeometry_setGeometryType(self, *args)
def getGeometryTypeAsString(self): return _Xdmf.XdmfGeometry_getGeometryTypeAsString(self)
def getDimensions(self): return _Xdmf.XdmfGeometry_getDimensions(self)
def printSelf(self): return _Xdmf.XdmfGeometry_printSelf(self)
def write(self, *args): return _Xdmf.XdmfGeometry_write(self, *args)
XdmfGeometry_swigregister = _Xdmf.XdmfGeometry_swigregister
......@@ -743,16 +734,16 @@ class XdmfGrid(XdmfItem):
__repr__ = _swig_repr
__swig_getmethods__["New"] = lambda x: _Xdmf.XdmfGrid_New
if _newclass:New = staticmethod(_Xdmf.XdmfGrid_New)
def getAttribute(self, *args): return _Xdmf.XdmfGrid_getAttribute(self, *args)
def getGeometry(self, *args): return _Xdmf.XdmfGrid_getGeometry(self, *args)
def setGeometry(self, *args): return _Xdmf.XdmfGrid_setGeometry(self, *args)
def getTopology(self, *args): return _Xdmf.XdmfGrid_getTopology(self, *args)
def setTopology(self, *args): return _Xdmf.XdmfGrid_setTopology(self, *args)
def getName(self): return _Xdmf.XdmfGrid_getName(self)
def setName(self, *args): return _Xdmf.XdmfGrid_setName(self, *args)
def insert(self, *args): return _Xdmf.XdmfGrid_insert(self, *args)
def getAttribute(self, *args): return _Xdmf.XdmfGrid_getAttribute(self, *args)
def getNumberOfAttributes(self): return _Xdmf.XdmfGrid_getNumberOfAttributes(self)
def getTopology(self, *args): return _Xdmf.XdmfGrid_getTopology(self, *args)
def insert(self, *args): return _Xdmf.XdmfGrid_insert(self, *args)
def printSelf(self): return _Xdmf.XdmfGrid_printSelf(self)
def setGeometry(self, *args): return _Xdmf.XdmfGrid_setGeometry(self, *args)
def setTopology(self, *args): return _Xdmf.XdmfGrid_setTopology(self, *args)
def setName(self, *args): return _Xdmf.XdmfGrid_setName(self, *args)
def traverse(self, *args): return _Xdmf.XdmfGrid_traverse(self, *args)
def write(self, *args): return _Xdmf.XdmfGrid_write(self, *args)
XdmfGrid_swigregister = _Xdmf.XdmfGrid_swigregister
......@@ -773,12 +764,10 @@ class XdmfTopology(XdmfDataItem):
__repr__ = _swig_repr
__swig_getmethods__["New"] = lambda x: _Xdmf.XdmfTopology_New
if _newclass:New = staticmethod(_Xdmf.XdmfTopology_New)
def getTopologyType(self): return _Xdmf.XdmfTopology_getTopologyType(self)
def setTopologyType(self, *args): return _Xdmf.XdmfTopology_setTopologyType(self, *args)
def getNumberElements(self): return _Xdmf.XdmfTopology_getNumberElements(self)
def getTopologyTypeAsString(self): return _Xdmf.XdmfTopology_getTopologyTypeAsString(self)
def getNodesPerElement(self): return _Xdmf.XdmfTopology_getNodesPerElement(self)
def getTopologyType(self): return _Xdmf.XdmfTopology_getTopologyType(self)
def printSelf(self): return _Xdmf.XdmfTopology_printSelf(self)
def setTopologyType(self, *args): return _Xdmf.XdmfTopology_setTopologyType(self, *args)
def write(self, *args): return _Xdmf.XdmfTopology_write(self, *args)
XdmfTopology_swigregister = _Xdmf.XdmfTopology_swigregister
XdmfTopology_swigregister(XdmfTopology)
......@@ -846,9 +835,9 @@ class XdmfTopologyType(_object):
if _newclass:ThreeDRectMesh = staticmethod(_Xdmf.XdmfTopologyType_ThreeDRectMesh)
__swig_getmethods__["ThreeDCoRectMesh"] = lambda x: _Xdmf.XdmfTopologyType_ThreeDCoRectMesh
if _newclass:ThreeDCoRectMesh = staticmethod(_Xdmf.XdmfTopologyType_ThreeDCoRectMesh)
def getNodesPerElement(self): return _Xdmf.XdmfTopologyType_getNodesPerElement(self)
def getName(self): return _Xdmf.XdmfTopologyType_getName(self)
def getCellType(self): return _Xdmf.XdmfTopologyType_getCellType(self)
def getName(self): return _Xdmf.XdmfTopologyType_getName(self)
def getNodesPerElement(self): return _Xdmf.XdmfTopologyType_getNodesPerElement(self)
def __eq__(self, *args): return _Xdmf.XdmfTopologyType___eq__(self, *args)
def __ne__(self, *args): return _Xdmf.XdmfTopologyType___ne__(self, *args)
def __init__(self, *args):
......
/*
* XdmfArray.hpp
*
* Created on: Jan 25, 2010
* Author: kleiter
*/
#ifndef XDMFARRAY_HPP_
#define XDMFARRAY_HPP_
......@@ -18,7 +11,7 @@ template<typename T>
class XdmfArrayCopyValues : public boost::static_visitor <void> {
public:
XdmfArrayCopyValues(int startIndex, T* valuesPointer, int numValues = 1, int arrayStride = 1, int valuesStride = 1) :
XdmfArrayCopyValues(int startIndex, T * valuesPointer, int numValues = 1, int arrayStride = 1, int valuesStride = 1) :
mStartIndex(startIndex),
mValuesPointer(valuesPointer),
mNumValues(numValues),
......@@ -27,7 +20,7 @@ public:
{
}
template<typename U> void operator()(boost::shared_ptr<std::vector<U> > array) const
template<typename U> void operator()(boost::shared_ptr<std::vector<U> > & array) const
{
int size = mStartIndex + mNumValues;
if(mArrayStride > 1)
......@@ -61,13 +54,13 @@ public:
{
}
boost::shared_ptr<std::vector<T> > operator()(const boost::shared_ptr<std::vector<T> > array) const
boost::shared_ptr<std::vector<T> > operator()(const boost::shared_ptr<std::vector<T> > & array) const
{
return array;
}
template <typename U>
boost::shared_ptr<std::vector<T> > operator()(const boost::shared_ptr<std::vector<U> > array) const
boost::shared_ptr<std::vector<T> > operator()(const boost::shared_ptr<std::vector<U> > & array) const
{
return boost::shared_ptr<std::vector<T> >();
}
......@@ -81,18 +74,53 @@ public:
{
}
const boost::shared_ptr<const std::vector<T> > operator()(const boost::shared_ptr<const std::vector<T> > array) const
const boost::shared_ptr<const std::vector<T> > operator()(const boost::shared_ptr<const std::vector<T> > & array) const
{
return array;
}
template <typename U>
const boost::shared_ptr<const std::vector<T> > operator()(const boost::shared_ptr<const std::vector<U> > array) const
const boost::shared_ptr<const std::vector<T> > operator()(const boost::shared_ptr<const std::vector<U> > & array) const
{
return boost::shared_ptr<std::vector<T> >();
}
};
/**
* @brief Provides a single interface for storing a wide variety of data types.
*
* XdmfArray stores data values that are read in or will be written to heavy data on disk. The
* data type stored is determined by the type initially inserted into the XdmfArray. XdmfArray
* allows for insertion and retrieval of data in two fundamental ways:
*
* By Copy:
*
* copyValues
* getCopyValues
*
* XdmfArray stores its own copy of the data. Modifications to the data stored in the XdmfArray will
* not change values stored in the original array.
*
* By Shared Reference:
*
* setValues
* getValues
*
* XdmfArray shares a reference to the data. No copy is made. XdmfArray holds a shared pointer to the original
* data. Modifications to the data stored in the XdmfArray also causes modification to values stored in the original
* array.
*
* Xdmf supports the following datatypes:
* Char
* Short
* Int
* Long
* Float
* Double
* Unsigned Char
* Unsigned Short
* Unsigned Int
*/
class XdmfArray : public XdmfItem {
public:
......@@ -103,6 +131,7 @@ public:
*
* @param startIndex the index in this array to begin insertion.
* @param values a shared pointer to an XdmfArray to copy into this array.
* @param valuesStartIndex the index in the XdmfArray to begin copying.
* @param numValues the number of values to copy into this array.
* @param arrayStride number of values to stride in this array between each copy.
* @param valuesStride number of values to stride in the XdmfArray between each copy.
......@@ -118,7 +147,7 @@ public:
* @param arrayStride number of values to stride in this array between each copy.
* @param valuesStride number of values to stride in the pointer between each copy.
*/
template<typename T> void copyValues(int startIndex, T* valuesPointer, int numValues = 1, int arrayStride = 1, int valuesStride = 1)
template<typename T> void copyValues(int startIndex, T * valuesPointer, int numValues = 1, int arrayStride = 1, int valuesStride = 1)
{
if(!mInitialized)
{
......@@ -131,7 +160,7 @@ public:
}
/**
* Clears all values from this array
* Remove all values from this array
*/
virtual void clear();
......@@ -153,14 +182,14 @@ public:
/**
* Get the precision, in bytes, of the data type of this array.
*
* @return a int containing the precision, in bytes, of the data type of this array.
* @return an int containing the precision, in bytes, of the data type of this array.
*/
virtual int getPrecision() const;
/**
* Get the number of values stored in this array.
*
* @return a int containing the number of values stored in this array.
* @return an int containing the number of values stored in this array.
*/
virtual int getSize() const;
......@@ -187,7 +216,7 @@ public:
}
/**
* Get a pointer to the values stored in this array (const version).
* Get a pointer to the values stored in this array.
*
* @return a void pointer to the first value stored in this array.
*/
......@@ -206,7 +235,7 @@ public:
* Sets the values of this array to the values stored in the vector. No copy is made. This array shares ownership with
* other references to the smart pointer.
*
* @param a smart pointer to a vector to store in this array.
* @param array a smart pointer to a vector to store in this array.
*/
template<typename T> void setValues(boost::shared_ptr<std::vector<T> > array)
{
......
......@@ -21,42 +21,37 @@ XdmfAttribute::~XdmfAttribute()
std::cout << "Deleted Attribute " << this << std::endl;
}
XdmfAttributeType XdmfAttribute::getAttributeType() const
XdmfAttributeCenter XdmfAttribute::getAttributeCenter() const
{
return mAttributeType;
return mAttributeCenter;
}
void XdmfAttribute::setAttributeType(const XdmfAttributeType& attributeType)
XdmfAttributeType XdmfAttribute::getAttributeType() const
{
mAttributeType = attributeType;
return mAttributeType;
}
std::string XdmfAttribute::getAttributeTypeAsString() const
std::string XdmfAttribute::getName() const
{
return mAttributeType.getName();
return mName;
}
XdmfAttributeCenter XdmfAttribute::getAttributeCenter() const
std::string XdmfAttribute::printSelf() const
{
return mAttributeCenter;
return "<XdmfAttribute>";
}
void XdmfAttribute::setAttributeCenter(const XdmfAttributeCenter& attributeCenter)
void XdmfAttribute::setAttributeCenter(const XdmfAttributeCenter & attributeCenter)
{
mAttributeCenter = attributeCenter;
}
std::string XdmfAttribute::getAttributeCenterAsString() const
{
return mAttributeCenter.getName();
}
std::string XdmfAttribute::getName() const
void XdmfAttribute::setAttributeType(const XdmfAttributeType & attributeType)
{
return mName;
mAttributeType = attributeType;
}
void XdmfAttribute::setName(const std::string& name)
void XdmfAttribute::setName(const std::string & name)
{
mName= name;
}
......@@ -65,8 +60,3 @@ void XdmfAttribute::write(boost::shared_ptr<XdmfVisitor> visitor) const
{
visitor->visit(this, visitor);
}
std::string XdmfAttribute::printSelf() const
{
return "<XdmfAttribute>";
}
/*
* XdmfAttribute.hpp
*
* Created on: Jan 25, 2010
* Author: kleiter
*/
#ifndef XDMFATTRIBUTE_HPP_
#define XDMFATTRIBUTE_HPP_
......@@ -13,6 +6,12 @@
#include "XdmfAttributeType.hpp"
#include "XdmfDataItem.hpp"
/**
* @brief Handles computed values attached to an XdmfGrid.
*
* XdmfAttribute contains two properties that should be set, XdmfAttributeCenter and XdmfAttributeType.
* XdmfAttribute is a subclass of XdmfDataItem, meaning it contains an XdmfArray to store values.
*/
class XdmfAttribute : public XdmfDataItem {
public:
......@@ -20,65 +19,51 @@ public:
XdmfNewMacro(XdmfAttribute);
/**
* Get the name of the attribute.
*
* @return a string containing the name of the attribute.
*/
std::string getName() const;
/**
* Set the name of the attribute.
* Get the XdmfAttributeCenter associated with this attribute.
*
* @param a string containing the name to set.
* @return XdmfAttributeCenter of the attribute.
*/
void setName(const std::string&);
XdmfAttributeCenter getAttributeCenter() const;
/**
* Get the XdmfAttributeType associated with this Attribute.
* Get the XdmfAttributeType associated with this attribute.
*
* @return XdmfAttributeType.
* @return XdmfAttributeType of the attribute.
*/
XdmfAttributeType getAttributeType() const;
/**
* Set the XdmfAttributeType associated with this Attribute.
* Get the name of the attribute.
*
* @param XdmfAttributeType to set.
* @return a string containing the name of the attribute.
*/
void setAttributeType(const XdmfAttributeType& attributeType);
std::string getName() const;
/**
* Get the name of the XdmfAttributeType associated with this Attribute.
*
* @return std::string containing name of the XdmfAttributeType.
*/
std::string getAttributeTypeAsString() const;
virtual std::string printSelf() const;
/**
* Get the XdmfAttributeCenter associated with this Attribute.
* Set the XdmfAttributeCenter associated with this attribute.
*
* @return XdmfAttributeCenter.
* @param attributeCenter the XdmfAttributeCenter to set.
*/
XdmfAttributeCenter getAttributeCenter() const;
void setAttributeCenter(const XdmfAttributeCenter & attributeCenter);
/**
* Set the XdmfAttributeCenter associated with this Attribute.
* Set the XdmfAttributeType associated with this attribute.
*
* @param XdmfAttributeCenter to set.
* @param attributeType XdmfAttributeType to set.
*/
void setAttributeCenter(const XdmfAttributeCenter& attributeCenter);
void setAttributeType(const XdmfAttributeType & attributeType);
/**
* Get the name of the XdmfAttributeCenter associated with this Attribute.
* Set the name of the attribute.
*
* @return std::string containing name of the XdmfAttributeCenter.
* @param name a string containing the name to set.
*/
std::string getAttributeCenterAsString() const;
void setName(const std::string & name);
void write(boost::shared_ptr<XdmfVisitor> visitor) const;
virtual std::string printSelf() const;
protected:
XdmfAttribute();
......@@ -86,14 +71,12 @@ protected:
private:
XdmfAttribute(const XdmfAttribute&); // Not implemented.
void operator=(const XdmfAttribute&); // Not implemented.
XdmfAttribute(const XdmfAttribute & attribute); // Not implemented.
void operator=(const XdmfAttribute & attribute); // Not implemented.
std::string mName;
XdmfAttributeType mAttributeType;
XdmfAttributeCenter mAttributeCenter;
};
#endif /* XDMFATTRIBUTE_HPP_ */
......@@ -33,32 +33,32 @@ XdmfAttributeCenter XdmfAttributeCenter::Node()
return XdmfAttributeCenter("Node");
}
XdmfAttributeCenter::XdmfAttributeCenter(const std::string& name) :
XdmfAttributeCenter::XdmfAttributeCenter(const std::string & name) :
mName(name)
{};
XdmfAttributeCenter::XdmfAttributeCenter(const XdmfAttributeCenter& attributeCenter):
mName(attributeCenter.mName)
XdmfAttributeCenter::XdmfAttributeCenter(const XdmfAttributeCenter & attributeCenter):
mName(attributeCenter.mName)
{
}
XdmfAttributeCenter& XdmfAttributeCenter::operator=(const XdmfAttributeCenter& attributeCenter)
XdmfAttributeCenter& XdmfAttributeCenter::operator=(const XdmfAttributeCenter & attributeCenter)
{
if(this != &attributeCenter)
{
mName = attributeCenter.mName;
}
return *this;
if(this != &attributeCenter)
{
mName = attributeCenter.mName;
}