Easy3D 3.0.0
Loading...
Searching...
No Matches
Geometry Class Reference

Immutable geometry snapshot submitted to a RenderDevice. More...

#include <render_device.h>

Public Member Functions

 Geometry (std::vector< Vertex > vertices, std::vector< std::uint32_t > indices={}, Topology topology=Topology::triangles, std::vector< std::uint32_t > primitive_ids={}, std::shared_ptr< const PointData > point_data={})
 Create a geometry snapshot.
 
const std::vector< Vertex > & vertices () const
 
const std::vector< std::uint32_t > & indices () const
 
const std::vector< std::uint32_t > & primitive_ids () const
 
Topology topology () const
 
const std::shared_ptr< const PointData > & point_data () const
 

Detailed Description

Immutable geometry snapshot submitted to a RenderDevice.

Constructor inputs are copied, so temporaries and subsequent model edits are safe. Updating geometry creates a new snapshot.

Constructor & Destructor Documentation

◆ Geometry()

Geometry ( std::vector< Vertex >  vertices,
std::vector< std::uint32_t >  indices = {},
Topology  topology = Topology::triangles,
std::vector< std::uint32_t >  primitive_ids = {},
std::shared_ptr< const PointData >  point_data = {} 
)

Create a geometry snapshot.

Parameters
verticesPer-vertex positions and attributes.
indicesOptional indices into vertices.
topologyPrimitive topology.
primitive_idsOptional per-primitive picking IDs.
point_dataOptional point positions and source-slot mapping.

Member Function Documentation

◆ indices()

const std::vector< std::uint32_t > & indices ( ) const
inline

Return indices, or an empty vector for non-indexed geometry.

Returns
Indices, or an empty vector for non-indexed geometry.

◆ point_data()

const std::shared_ptr< const PointData > & point_data ( ) const
inline

Return associated point data, if present.

Returns
Associated point snapshot, or an empty pointer.

◆ primitive_ids()

const std::vector< std::uint32_t > & primitive_ids ( ) const
inline

Return per-primitive IDs, if supplied.

Returns
Per-primitive picking IDs, if supplied.

◆ topology()

Topology topology ( ) const
inline

Return the geometry topology.

Returns
Primitive topology.

◆ vertices()

const std::vector< Vertex > & vertices ( ) const
inline

Return the vertex data.

Returns
Vertex positions and attributes.

The documentation for this class was generated from the following files: