Inviwo
0.9.10.1
Inviwo documentation
|
Classes | |
struct | BufferInfo |
struct | MeshInfo |
Public Types | |
using | IndexVector = std::vector< std::pair< MeshInfo, std::shared_ptr< IndexBuffer > >> |
using | BufferVector = std::vector< std::pair< BufferInfo, std::shared_ptr< BufferBase > >> |
Public Types inherited from inviwo::DataGroup< Mesh, MeshRepresentation > | |
using | self = Mesh |
using | repr = MeshRepresentation |
Public Member Functions | |
Mesh (DrawType dt, ConnectivityType ct) | |
Mesh (const Mesh &rhs) | |
Mesh & | operator= (const Mesh &that) |
virtual Mesh * | clone () const |
virtual Document | getInfo () const |
void | addBuffer (BufferInfo info, std::shared_ptr< BufferBase > att) |
void | addBuffer (BufferType type, std::shared_ptr< BufferBase > att) |
void | removeBuffer (size_t idx) |
void | replaceBuffer (size_t idx, BufferInfo info, std::shared_ptr< BufferBase > att) |
void | setBuffer (size_t idx, BufferInfo info, std::shared_ptr< BufferBase > att) |
void | addIndicies (MeshInfo info, std::shared_ptr< IndexBuffer > ind) |
std::shared_ptr< IndexBufferRAM > | addIndexBuffer (DrawType dt, ConnectivityType ct) |
void | removeIndexBuffer (size_t idx) |
void | reserveSizeInVertexBuffer (size_t size) |
void | reserveIndexBuffers (size_t size) |
const BufferVector & | getBuffers () const |
const IndexVector & | getIndexBuffers () const |
const BufferBase * | getBuffer (size_t idx) const |
BufferInfo | getBufferInfo (size_t idx) const |
const IndexBuffer * | getIndices (size_t idx) const |
std::pair< const BufferBase *, int > | findBuffer (BufferType type) const |
bool | hasBuffer (BufferType type) const |
BufferBase * | getBuffer (size_t idx) |
IndexBuffer * | getIndices (size_t idx) |
MeshInfo | getDefaultMeshInfo () const |
MeshInfo | getIndexMeshInfo (size_t idx) const |
size_t | getNumberOfBuffers () const |
size_t | getNumberOfIndicies () const |
void | append (const Mesh &mesh) |
Append another mesh to this mesh. More... | |
virtual const SpatialCameraCoordinateTransformer< 3 > & | getCoordinateTransformer (const Camera &camera) const |
Public Member Functions inherited from inviwo::DataGroup< Mesh, MeshRepresentation > | |
const T * | getRepresentation () const |
T * | getEditableRepresentation () |
bool | hasRepresentation () const |
bool | hasRepresentations () const |
void | clearRepresentations () |
Public Member Functions inherited from inviwo::SpatialEntity< 3 > | |
SpatialEntity (const SpatialEntity< N > &rhs) | |
SpatialEntity (const Matrix< N+1, float > &modelMatrix) | |
SpatialEntity (const Matrix< N+1, float > &modelMatrix, const Matrix< N+1, float > &worldMatrix) | |
SpatialEntity< N > & | operator= (const SpatialEntity< N > &that) |
Vector< N, float > | getOffset () const |
void | setOffset (const Vector< N, float > &offset) |
Matrix< N, float > | getBasis () const |
void | setBasis (const Matrix< N, float > &basis) |
Matrix< N+1, float > | getModelMatrix () const |
void | setModelMatrix (const Matrix< N+1, float > &modelMatrix) |
Matrix< N+1, float > | getWorldMatrix () const |
void | setWorldMatrix (const Matrix< N+1, float > &worldMatrix) |
virtual const SpatialCoordinateTransformer< N > & | getCoordinateTransformer () const |
virtual const SpatialCameraCoordinateTransformer< N > & | getCoordinateTransformer (const CameraND< N > &camera) const |
Public Member Functions inherited from inviwo::MetaDataOwner | |
MetaDataOwner (const MetaDataOwner &rhs)=default | |
MetaDataOwner & | operator= (const MetaDataOwner &rhs)=default |
void | copyMetaDataFrom (const MetaDataOwner &src) |
void | copyMetaDataTo (MetaDataOwner &dst) |
template<typename T > | |
T * | createMetaData (const std::string &key) |
template<typename T , typename U > | |
void | setMetaData (const std::string &key, U value) |
template<typename T > | |
bool | unsetMetaData (const std::string &key) |
unset, i.e. remove the metadata entry matching the given key and type More... | |
template<typename T , typename U > | |
U | getMetaData (const std::string &key, U val) const |
template<typename T > | |
T * | getMetaData (const std::string &key) |
template<typename T > | |
const T * | getMetaData (const std::string &key) const |
MetaDataMap * | getMetaDataMap () |
const MetaDataMap * | getMetaDataMap () const |
template<typename T > | |
bool | hasMetaData (const std::string &key) const |
virtual void | serialize (Serializer &s) const |
virtual void | deserialize (Deserializer &d) |
Static Public Attributes | |
static uvec3 | colorCode = uvec3(188, 188, 101) |
static const std::string | classIdentifier = "org.inviwo.Mesh" |
static const std::string | dataName = "Mesh" |
Protected Attributes | |
BufferVector | buffers_ |
IndexVector | indices_ |
MeshInfo | meshInfo_ |
Protected Attributes inherited from inviwo::DataGroup< Mesh, MeshRepresentation > | |
std::mutex | mutex_ |
std::unordered_map< std::type_index, std::shared_ptr< MeshRepresentation > > | representations_ |
Protected Attributes inherited from inviwo::SpatialEntity< 3 > | |
SpatialCoordinateTransformer< N > * | transformer_ |
SpatialCameraCoordinateTransformer< N > * | cameraTransformer_ |
Matrix< N+1, float > | modelMatrix_ |
Matrix< N+1, float > | worldMatrix_ |
Protected Attributes inherited from inviwo::MetaDataOwner | |
MetaDataMap | metaData_ |
Additional Inherited Members | |
Protected Member Functions inherited from inviwo::DataGroup< Mesh, MeshRepresentation > | |
DataGroup (const DataGroup< Mesh, MeshRepresentation > &rhs) | |
DataGroup< Mesh, MeshRepresentation > & | operator= (const DataGroup< Mesh, MeshRepresentation > &rhs) |
void inviwo::Mesh::addBuffer | ( | BufferInfo | info, |
std::shared_ptr< BufferBase > | att | ||
) |
Add a buffer with rendering data, such as positions/colors/normals.
info | information about the buffer contents (e.g. buffer type and attrib location) |
att | buffer data used during rendering |
void inviwo::Mesh::addBuffer | ( | BufferType | type, |
std::shared_ptr< BufferBase > | att | ||
) |
Add a buffer with rendering data, such as positions/colors/normals, and associate it with its default attrib location.
type | buffer type (Position, Color, Normal, etc.) |
att | buffer data used during rendering |
std::shared_ptr< inviwo::IndexBufferRAM > inviwo::Mesh::addIndexBuffer | ( | DrawType | dt, |
ConnectivityType | ct | ||
) |
Creates and add a new index buffer to the mesh
dt | DrawType of the new buffer |
ct | ConnectivityType of the new buffer |
void inviwo::Mesh::addIndicies | ( | MeshInfo | info, |
std::shared_ptr< IndexBuffer > | ind | ||
) |
Add index buffer. The indices will be used as look up values into the buffers during rendering. The Mesh will take ownership of the added buffer.
info | Rendering type and connectivity. |
ind | Index buffer, will be owned by mesh. |
void inviwo::Mesh::append | ( | const Mesh & | mesh | ) |
Append another mesh to this mesh.
Requires that both meshes has the same type and number of vertex buffers. Will append the contents of each vertex buffer in mesh to each vertex in this. Index buffers are copied and each index is incremented with an offset.
mesh | The mesh to copy values from |
std::pair< const BufferBase *, int > inviwo::Mesh::findBuffer | ( | BufferType | type | ) | const |
Try and find a buffer of the given BufferType. Returns the buffer and its location. If no buffer is found the buffer will be a nullptr.
bool inviwo::Mesh::hasBuffer | ( | BufferType | type | ) | const |
Check if there exits a buffer of BufferType type in the mesh.
void inviwo::Mesh::removeBuffer | ( | size_t | idx | ) |
Removes buffer at given position, all subsequent buffers will be moved. Does nothing if index is out of range.
idx | position of buffer to be removed |
void inviwo::Mesh::removeIndexBuffer | ( | size_t | idx | ) |
Removes index buffer at given position, all subsequent index buffers will be moved. Does nothing if index is out of range.
idx | position of index buffer to be removed |
void inviwo::Mesh::replaceBuffer | ( | size_t | idx, |
BufferInfo | info, | ||
std::shared_ptr< BufferBase > | att | ||
) |
Replaces buffer at index with new buffer Does nothing if index out of range.
idx | Index of buffer to replace |
info | information about the buffer contents (e.g. buffer type and shader location) |
att | new buffer data used during rendering |
void inviwo::Mesh::reserveIndexBuffers | ( | size_t | size | ) |
Reserve memory for a given number of index buffers. Useful when having a mesh on which we will add a lot of index buffers
size | the new reserved size of the vector containing index buffers |
void inviwo::Mesh::reserveSizeInVertexBuffer | ( | size_t | size | ) |
Reserve memory for a given number of vertices in each buffer.
size | number of elements that will be reserved in each buffer |
void inviwo::Mesh::setBuffer | ( | size_t | idx, |
BufferInfo | info, | ||
std::shared_ptr< BufferBase > | att | ||
) |
Deprecated: Mesh::setBuffer() has been renamed to Mesh::replaceBuffer()
idx | Index of buffer to replace |
info | information about the buffer contents (e.g. buffer type and shader location) |
att | new buffer data used during rendering |