8#if !defined(_SO_AUTO_MAP_H_)
11#include <Inventor/devices/SoLocalCpuBufferObject.h>
55 :m_bufferObject(bufferObject)
57 m_bufferObject->
map(&m_cpuBufferObject,accessMode);
58 m_pointer =
static_cast<T*
>(m_cpuBufferObject.map(accessMode));
59 m_arraySize = bufferObject->
getSize()/
sizeof(T);
65 m_cpuBufferObject.unmap();
66 m_bufferObject->
unmap(&m_cpuBufferObject);
72 assert(i<m_arraySize);
73 return (m_pointer[i]);
79 assert(i<m_arraySize);
80 return (m_pointer[i]);
85 {
return m_arraySize; }
92 SoLocalCpuBufferObject m_cpuBufferObject;
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> buffer object ma...
const T & operator[](const size_t i) const
const accessor to T element at index i
T & operator[](const size_t i)
accessor to T element at index i
size_t getSize() const
return the number of T element in the mapped array
SoAutoMap(SoBufferObject *bufferObject, SoBufferObject::AccessMode accessMode)
Constructor.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
AccessMode
This enum provides the possible access modes for a mapped buffer object.
virtual void * map(AccessMode accessMode, size_t offset=0, size_t count=SO_BUFFER_SIZE_ALL)
Map the buffer to a system memory address and allows the mapping of a sub part of the buffer object i...
virtual size_t getSize() const
Returns the size, in bytes, of the buffer object.
virtual void unmap()
Unmaps the buffer from CPU address space.