|
|
virtual Uint32 | points_size () const =0 |
| Returns the number of points in the mesh. More...
|
|
virtual Uint32 | points_capacity () const =0 |
| Returns the number of points for which space is allocated in the mesh. More...
|
|
virtual void | reserve_points (Uint32 n)=0 |
| Reserves space for at least n points. More...
|
|
virtual Sint32 | point (Uint32 index, Float32_3_struct &p) const =0 |
| Returns the coordinates of the point of index index in the output parameter p . More...
|
|
virtual Sint32 | point (Uint32 index, Float64_3_struct &p) const =0 |
| Returns the coordinates of the point of index index in the output parameter p . More...
|
|
virtual Uint32 | append_point (const Float32_3_struct &p)=0 |
| Adds a point p to the end of all points and returns the index of the new point. More...
|
|
virtual Uint32 | append_point (const Float64_3_struct &p)=0 |
| Adds a point p to the end of all points and returns the index of the new point. More...
|
|
virtual Uint32 | append_points (const Float32_3_struct *p, Size n)=0 |
| Adds an array of points to the end of all points and returns the index of the first new point. More...
|
|
virtual Uint32 | append_points (const Float64_3_struct *p, Size n)=0 |
| Adds an array of points to the end of all points and returns the index of the first new point. More...
|
|
virtual Sint32 | set_point (Uint32 index, const Float32_3_struct &p)=0 |
| Sets the point of index index to the new point p . More...
|
|
virtual Sint32 | set_point (Uint32 index, const Float64_3_struct &p)=0 |
| Sets the point of index index to the new point p . More...
|
|
virtual Sint32 | set_points (Uint32 index, const Float32_3_struct *p, Size n)=0 |
| Sets an array of points starting at index index . More...
|
|
virtual Sint32 | set_points (Uint32 index, const Float64_3_struct *p, Size n)=0 |
| Sets an array of points starting at index index . More...
|
|
|
virtual Uint32 | triangles_size () const =0 |
| Returns the number of triangles. More...
|
|
virtual Uint32 | triangles_capacity () const =0 |
| Returns the number of triangles for which space is allocated in the mesh. More...
|
|
virtual void | reserve_triangles (Uint32 n)=0 |
| Reserves space for at least n triangles. More...
|
|
virtual Triangle_point_indices_struct | triangle_point_indices (Triangle_handle_struct hnd) const =0 |
| Returns the triple of indices describing the vertices of the triangle of index i . More...
|
|
virtual Triangle_handle_struct | append_triangle (const Triangle_point_indices_struct &triangle)=0 |
| Adds a triangle to the mesh. More...
|
|
virtual Triangle_handle_struct | append_triangles (const Triangle_point_indices_struct *triangles, Size n)=0 |
| Adds an array of triangles to the mesh. More...
|
|
virtual Triangle_handle_struct | append_triangles (const Uint32 *indices, Size n)=0 |
| Adds an array of triangles to the mesh. More...
|
|
virtual Sint32 | set_triangle (Triangle_handle_struct hnd, const Triangle_point_indices_struct &triangle)=0 |
| Modifies a triangle of the mesh. More...
|
|
virtual Sint32 | set_triangles (Triangle_handle_struct hnd, const Triangle_point_indices_struct *triangle, Size n)=0 |
| Modifies an array of triangles of the mesh. More...
|
|
|
virtual const ITriangle_connectivity * | access_mesh_connectivity () const =0 |
| Returns the mesh connectivity. More...
|
|
virtual ITriangle_connectivity * | edit_mesh_connectivity ()=0 |
| Detaches and returns the mesh connectivity. More...
|
|
virtual Sint32 | attach_mesh_connectivity (ITriangle_connectivity *connectivity)=0 |
| Attaches the mesh connectivity to the mesh. More...
|
|
|
virtual ITriangle_connectivity * | create_connectivity (Connectivity_map_type map_type=CONNECTIVITY_MAP_GENERIC)=0 |
| Creates a new connectivity for non-per-primitive attributes. More...
|
|
virtual const ITriangle_connectivity * | access_connectivity (Mesh_attribute_name name) const =0 |
| Returns the connectivity for a given mesh attribute. More...
|
|
virtual ITriangle_connectivity * | edit_connectivity (Mesh_attribute_name name)=0 |
| Detaches and returns the connectivity for a given mesh attribute. More...
|
|
virtual Sint32 | attach_connectivity (ITriangle_connectivity *connectivity)=0 |
| Attaches a given connectivity to the mesh. More...
|
|
virtual Sint32 | remove_connectivity (Mesh_attribute_name name)=0 |
| Removes the connectivity for a non-per-primitive mesh attribute. More...
|
|
|
virtual bool | has_attribute (Mesh_attribute_name name) const =0 |
| Indicates whether the mesh has a particular mesh attribute (per-primitive or other types). More...
|
|
virtual IAttribute_vector * | create_attribute_vector (Mesh_attribute_name name, Uint32 dim=1)=0 |
| Creates a per-primitive mesh attribute. More...
|
|
virtual const IAttribute_vector * | access_attribute_vector (Mesh_attribute_name name) const =0 |
| Returns a per-primitive mesh attribute. More...
|
|
virtual IAttribute_vector * | edit_attribute_vector (Mesh_attribute_name name)=0 |
| Detaches and returns a per-primitive mesh attribute. More...
|
|
virtual Sint32 | attach_attribute_vector (IAttribute_vector *attribute_vector)=0 |
| Attaches a given per-primitive mesh attribute to the mesh. More...
|
|
virtual Sint32 | remove_attribute_vector (Mesh_attribute_name name)=0 |
| Removes a per-primitive mesh attribute. More...
|
|
|
virtual Bbox3_struct | get_bbox () const =0 |
| Returns the bounding box of the triangle mesh. More...
|
|
virtual Bbox3_struct | get_tight_bbox (const Float64_4_4_struct &transformation_matrix) const =0 |
| Returns the bounding box of the triangle mesh after transformation. More...
|
|
|
virtual void | set_maximum_displacement (Float32 displacement)=0 |
| Sets the maximum displacement of the triangle mesh. More...
|
|
virtual Float32 | get_maximum_displacement () const =0 |
| Returns the maximum displacement of the triangle mesh. More...
|
|
virtual Element_type | get_element_type () const =0 |
| Indicates the actual scene element represented by interfaces derived from this interface. More...
|
|
virtual IData * | create_attribute (const char *name, const char *type)=0 |
| Creates a new attribute name of the type type . More...
|
|
template<class T> |
T * | create_attribute (const char *name, const char *type) |
| Creates a new attribute name of the type type . More...
|
|
template<class T> |
T * | create_attribute (const char *name) |
| Creates a new attribute name of the type T . More...
|
|
virtual bool | destroy_attribute (const char *name)=0 |
| Destroys the attribute name . More...
|
|
virtual const IData * | access_attribute (const char *name) const =0 |
| Returns a const pointer to the attribute name . More...
|
|
template<class T> |
const T * | access_attribute (const char *name) const |
| Returns a const pointer to the attribute name . More...
|
|
virtual IData * | edit_attribute (const char *name)=0 |
| Returns a mutable pointer to the attribute name . More...
|
|
template<class T> |
T * | edit_attribute (const char *name) |
| Returns a mutable pointer to the attribute name . More...
|
|
virtual bool | is_attribute (const char *name) const =0 |
| Indicates existence of an attribute. More...
|
|
virtual const char * | get_attribute_type_name (const char *name) const =0 |
| Returns the type of an attribute. More...
|
|
virtual Sint32 | set_attribute_propagation (const char *name, Propagation_type value)=0 |
| Sets the propagation type of the attribute name . More...
|
|
virtual Propagation_type | get_attribute_propagation (const char *name) const =0 |
| Returns the propagation type of the attribute name . More...
|
|
virtual const char * | enumerate_attributes (Sint32 index) const =0 |
| Returns the name of the attribute indicated by index . More...
|
|
virtual Uint32 | retain () const =0 |
| Increments the reference count. More...
|
|
virtual Uint32 | release () const =0 |
| Decrements the reference count. More...
|
|
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
| Acquires a const interface from another. More...
|
|
template<class T> |
const T * | get_interface () const |
| Acquires a const interface from another. More...
|
|
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
| Acquires a mutable interface from another. More...
|
|
template<class T> |
T * | get_interface () |
| Acquires a mutable interface from another. More...
|
|
virtual Uuid | get_iid () const =0 |
| Returns the interface ID of the most derived interface. More...
|
|
|
typedef Interface_declare< id1, ... > | Self |
| Own type. More...
|
|
typedef Uuid_t< id1, ... > | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
typedef Interface_declare< id1, ... > | Self |
| Own type. More...
|
|
typedef Uuid_t< id1, ... > | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
typedef Interface_declare< id1, ... > | Self |
| Own type. More...
|
|
typedef Uuid_t< id1, ... > | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface. More...
|
|
Interface representing a triangle mesh.
Triangle meshes are represented in an indexed format where triangles are triples of indices pointing into an array of points. Points and triangles are stored with consecutive indices, starting with the index 0 each. Both, points and triangles, can then be referred to by their index numbers. For type safety, triangle indices are represented using mi::neuraylib::Triangle_handle instead of plain integers.
In addition to regular attributes (see mi::neuraylib::IAttribute_set), meshes can also have mesh attributes. In contrast to regular attributes which exist only once per object, mesh attributes are always a vector of values with one vector element per primitive, per point, or per vertex (see mi::neuraylib::Mesh_attribute_name and mi::neuraylib::IAttribute_vector for details).
Per-primitive attributes can be directly used with the methods of this interface, namely create_attribute_vector(), access_attribute_vector(), edit_attribute_vector(), and attach_attribute_vector().
Per-point and per-vertex attributes require the use of a connectivity instead. Per-point attributes use the mesh connectivity (see edit_mesh_connectivity() and related methods), whereas per-vertex attributes use custom connectivities (see create_connectivity() and related methods).
This mesh interface supports the incremental construction of a mesh. Points and triangles can be added one at a time and in alternating order, if so desired. The only constraint is that triangles shall only refer to point indices of points that have been added already. Triangles can only be added or modified while the mesh connectivity is attached. This implies that per-point attributes (using the mesh connectivity) can only be created or modified before or after the triangles are added, not during that process.
The deletion of once added elements is not supported.
See also the "approx"
attribute on mi::neuraylib::IAttribute_set for information how to control the tessellation of the triangle mesh.
- See also
- mi::neuraylib::ITriangle_connectivity
-
mi::neuraylib::IAttribute_vector
Example: Create a mesh with a single triangle with one normal and three texture coordinates
mesh->append_point(
point[i]);
mesh->edit_mesh_connectivity());
texture_coordinates->append_float32( &tex_coord[i].x, 2);
mesh_connectivity->attach_attribute_vector( texture_coordinates.get());
mesh->attach_mesh_connectivity( mesh_connectivity.get());
normal_connectivity->set_triangle_indices( triangle_handle, 0, 0, 0);
normals->append_vector3( normal);
normal_connectivity->attach_attribute_vector( normals.get());
mesh->attach_connectivity( normal_connectivity.get());
Handle class template for interfaces, automatizing the lifetime control via reference counting.
Definition: handle.h:113
Fixed-size math vector class template with generic operations.
Definition: vector.h:286
Interface representing a triangle mesh.
Definition: itriangle_mesh.h:122
virtual Sint32 point(Uint32 index, Float32_3_struct &p) const =0
Returns the coordinates of the point of index index in the output parameter p.
Handle class for type-safety.
Definition: identifier.h:66
A triangle defined by three point indices, starting at index 0.
Definition: itriangle_connectivity.h:33
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
math::Vector<Float32, 2> Float32_2
Vector of two Float32.
Definition: vector_typedefs.h:83
math::Vector<Float32, 3> Float32_3
Vector of three Float32.
Definition: vector_typedefs.h:90
@ ATTR_TEXTURE
Texture coordinates of type mi::Float32[] per point or per vertex (also called texture space).
Definition: iattribute_vector.h:101
@ ATTR_NORMAL
Surface normals of type mi::Float32_3 per point or per vertex.
Definition: iattribute_vector.h:65
@ CONNECTIVITY_MAP_GENERIC
A generic connectivity allows to map the vertices of every polygon to arbitrary indices.
Definition: iattribute_vector.h:136