ug4
|
Used to access data that has been attached to an attachment pipe. More...
#include <attachment_pipe.h>
Public Types | |
typedef attachment_traits< TElem, TElemHandler > | atraits |
typedef TAttachment | attachment |
typedef AttachmentPipe< TElem, TElemHandler > | attachment_pipe |
typedef TAttachment::ContainerType | ContainerType |
typedef TElem | element |
typedef TElemHandler | ElemHandler |
typedef TAttachment::ValueType | ValueType |
Public Member Functions | |
bool | access (attachment_pipe &attachmentPipe, TAttachment &attachment) |
AttachmentAccessor () | |
AttachmentAccessor (AttachmentPipe< TElem, TElemHandler > &attachmentPipe, TAttachment &attachment) | |
AttachmentAccessor (const AttachmentAccessor &aa) | |
size_t | element_data_index (typename atraits::ConstElemPtr elem) |
returns the data index of the given element regarding the associated container. More... | |
void | invalidate () |
attachment_value_traits< ValueType >::reference | operator[] (typename atraits::ConstElemPtr elem) |
attachment_value_traits< ValueType >::const_reference | operator[] (typename atraits::ConstElemPtr elem) const |
ValueType * | raw_data () |
returns the raw pointer to the data of the associated container More... | |
void | swap (AttachmentAccessor< TElem, TAttachment, TElemHandler > &acc) |
calls swap on associated containers More... | |
bool | valid () const |
Protected Attributes | |
ContainerType * | m_pContainer |
TElemHandler * | m_pHandler |
Used to access data that has been attached to an attachment pipe.
Once initialized, an AttachmentAccessor can be used to access the data stored in the given Attachment at the given AttachmentPipe. The reference type of the associated value is taken from attachment_value_traits. By default this is the standard reference type.
To initialize an AttachmentAccessor, you may either use its constructor or its access method, which returns false if the specified attachment is not present in the specified attachment pipe.
Note that data-access using an attachment accessor is cheap. Setting up a new attachment accessor however involves some work. While this is generally fast, too, it would introduce an unnecessary overhead inside inner loops or frequently called methods. You should thus try to minimize calls to access or to the accessors constructor.
typedef attachment_traits<TElem, TElemHandler> ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::atraits |
typedef TAttachment ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::attachment |
typedef AttachmentPipe<TElem, TElemHandler> ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::attachment_pipe |
typedef TAttachment::ContainerType ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::ContainerType |
typedef TElem ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::element |
typedef TElemHandler ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::ElemHandler |
typedef TAttachment::ValueType ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::ValueType |
ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::AttachmentAccessor |
ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::AttachmentAccessor | ( | const AttachmentAccessor< TElem, TAttachment, TElemHandler > & | aa | ) |
ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::AttachmentAccessor | ( | AttachmentPipe< TElem, TElemHandler > & | attachmentPipe, |
TAttachment & | attachment | ||
) |
bool ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::access | ( | attachment_pipe & | attachmentPipe, |
TAttachment & | attachment | ||
) |
|
inline |
returns the data index of the given element regarding the associated container.
Note that the data index does not stay constant all the time. If the associated container is, e.g., defragmented, the data index may change.
References ug::attachment_traits< TElem, TElemHandler >::get_data_index().
|
inline |
Referenced by ug::MultiElementAttachmentAccessor< TAttachment >::access(), ug::DoFIndexStorage::clear_attachments(), ug::MultiElementAttachmentAccessor< TAttachment >::invalidate(), ug::PerformRetetrahedralization(), ug::PerformTetrahedralization(), ug::RasterLayersProjector::remove_attachments(), and ug::AttachedElementList< TAttachmentPipe >::set_pipe().
|
inline |
References ug::INVALID_ATTACHMENT_INDEX.
|
inline |
References ug::INVALID_ATTACHMENT_INDEX.
|
inline |
returns the raw pointer to the data of the associated container
ATTENTION: Use this method with extreme care! Returns NULL if no container was associated.
|
inline |
calls swap on associated containers
References ug::AttachmentAccessor< TElem, TAttachment, TElemHandler >::m_pContainer.
Referenced by ug::ProjectToLimitPLoop(), and ug::ProjectToLimitSubdivBoundary().
|
inline |
Referenced by ug::DoFIndexStorage::clear_attachments(), ug::GridWriterUGX::create_selector_element_node(), ug::GridWriterUGX::create_subset_element_node(), ug::ExtrudeLayers(), ug::ExtrudeLayersMixed(), ug::ImportGridFromTETGEN(), ug::Integrate(), ug::MultiElementAttachmentAccessor< TAttachment >::is_valid_edge_accessor(), ug::MultiElementAttachmentAccessor< TAttachment >::is_valid_face_accessor(), ug::MultiElementAttachmentAccessor< TAttachment >::is_valid_vertex_accessor(), ug::MultiElementAttachmentAccessor< TAttachment >::is_valid_volume_accessor(), ug::LoadGridFromSTL(), ug::LoadMarkerPointsFromFile(), ug::NTreeGridData< world_dim >::position(), and ug::SeparateFaceSubsetsByNormal().
|
protected |
|
protected |