A.4.5 Methods of Attribute Class

Fig. A.15 depicts methods defined on the abstract base class Attr.

Figure A.15: Methods to query data stored on attributes.
{\footnotesize\begin{verbatim}class Attr
const s...
...st Point_h& pt) const

The method getName returns the name of the attribute.

The method isQuantity is a predicate that returns true in case this attribute is a distributed quantity and false otherwise. The functions castToQuantity and castToProperty are used to cast the abstract class Attr to the concrete type.

getVal returns the value of the attribute at the specified point. This method returns an empty handle if the specified point is outside the segment. If the point is inside the segment the behavior of the method depends on whether the value of a property or a quantity is requested. For properties this method returns the constant value of the property. For distributed quantities the value at the given point is returned, or -- in case the exact point was not found -- a point location is performed to identify the surrounding grid element. The identified element is then used to interpolate to the given point. Finally, the interpolated value is returned.