Skip to main content
Version: 4.0

Class f3d::mesh_view

Definition: mesh\_view.h (line 26)

Abstract class to represent a 3D surfacic mesh view in memory.

The mesh_view class represents a 3D surfacic mesh with points, faces, normals and texture coordinates. It is used to add meshes directly to the scene without having to write them to a file. The interface allows to provide a view of the mesh in memory, making it possible to visualize data without having to convert and copy to F3D internal structures. It also allows to provide an animated mesh by providing different views of the mesh at different times.

Inner classes​

Members​

Public types​

Enumeration type data_type​

Definition: mesh\_view.h (line 66)

enum data_type {
U8,
I8,
U16,
I16,
U32,
I32,
U64,
I64,
F32,
F64
}

Enumeration of supported scalar types for point and face scalars

Enumerator U8​

Enumerator I8​

Enumerator U16​

Enumerator I16​

Enumerator U32​

Enumerator I32​

Enumerator U64​

Enumerator I64​

Enumerator F32​

Enumerator F64​

Public functions​

Function getTimeRange​

virtual std::pair< double, double > f3d::mesh_view::getTimeRange() const

Get the temporal range

Return type: std::pair< double, double >

Function getName​

virtual std::string f3d::mesh_view::getName() const

Get the name of the mesh

Return type: std::string

Function buffersNeedUpdate​

virtual bool f3d::mesh_view::buffersNeedUpdate() const

Signal that the buffers need to be updated. This can be used to indicate that the underlying data has changed and the mesh view should refresh its buffers accordingly. Usually derived when the time independent buffers have changed.

Return type: bool

Function buffersUpdated​

virtual void f3d::mesh_view::buffersUpdated()

Notify that the buffers have been updated. This can be used to determine when the underlying data has been successfully updated.

Return type: void

Function getMemoryView​

virtual memory_view_t f3d::mesh_view::getMemoryView(double time) const =0

Specify the mesh data by providing a view of the mesh in memory at a given time. Make sure to add a thread synchronization mechanism if the mesh data is updated asynchronously.

Parameters:

  • double time

Return type: memory_view_t

Public static functions​

Function dataTypeDispatch​

static decltype(auto) f3d::mesh_view::dataTypeDispatch(f3d::mesh_view::data_type t, Functor &&f)

Dispatch a functor based on the data type, used to avoid code duplication when handling data of different types.

Parameters:

Return type: decltype(auto)