An example simple point set shape implementation of IPoint_set. More...
#include <attribute_point_set.h>
Public Member Functions | |
Attribute_point_set (const std::vector< mi::math::Vector_struct< mi::Float32, 3 > > &vertex_vec, const std::vector< mi::Float32 > &attribute_vec, nv::index::IPoint_set::Point_style point_style) | |
Constructing a point set shape using a cloud of initial points. More... | |
Attribute_point_set () | |
Constructing the point set shape for serialization. More... | |
virtual | ~Attribute_point_set () |
Destructing the point set shape. More... | |
void | set_attribute (std::vector< mi::Float32 > const &attribute_vec) |
set point attribute More... | |
mi::math::Vector_struct< mi::Float32, 3 > * | peek_vertices () |
peek the vertex position for change. More... | |
virtual mi::Size | get_nb_vertices () const |
virtual const mi::math::Vector_struct< mi::Float32, 3 > * | get_vertices () const |
Get the pointer to the array of vertices (points). More... | |
virtual mi::Size | get_nb_colors () const |
Get the size of color buffer. More... | |
virtual const mi::math::Color_struct * | get_colors () const |
Get the pointer to the array of per-vertex color values. More... | |
virtual mi::Size | get_nb_radii () const |
Get the size of radius buffer. More... | |
virtual const mi::Float32 * | get_radii () const |
Get the pointer to the array of per-vertex radii. More... | |
virtual Point_style | get_point_style () const |
The rasterizer enabling stylized points supports different point styles such as flat disks or shaded spheres. More... | |
virtual void | set_point_style (Point_style style) |
virtual void | set_enabled (bool enable) |
Set enable/disable rendering state of this shape. More... | |
virtual bool | get_enabled () const |
Get enable/disable rendering state of this shape. More... | |
virtual void | set_meta_data (mi::neuraylib::Tag_struct tag) |
Each scene element can store additional user-defined meta data. More... | |
virtual mi::neuraylib::Tag_struct | get_meta_data () const |
Retrieve the scene element's reference to the user-defined meta data. More... | |
virtual bool | get_pickable () const |
virtual void | set_pickable (bool pickable) |
virtual mi::neuraylib::IElement * | copy () const |
virtual const char * | get_class_name () const |
virtual void | serialize (mi::neuraylib::ISerializer *serializer) const |
virtual void | deserialize (mi::neuraylib::IDeserializer *deserializer) |
virtual void | get_references (mi::neuraylib::ITag_set *result) const |
Protected Member Functions | |
mi::math::Color_struct | get_color_from_attribute (mi::Float32 attrib) |
attribute to color map example More... | |
mi::Float32 | get_radius_from_attribute (mi::Float32 attrib) |
attribute to radius map example More... | |
An example simple point set shape implementation of IPoint_set.
In this point set, some of the point properties depend on so called attributes.
The color and radius are determined by an attribute vector. In this example, the attribute is any scalar value. There are several sets: attribute set A, color set C, and radius set R. We map them as follows:
\[M_c: A \mapsto C\]
\[M_r: A \mapsto R\]
Definition at line 31 of file attribute_point_set.h.
Attribute_point_set::Attribute_point_set | ( | const std::vector< mi::math::Vector_struct< mi::Float32, 3 > > & | vertex_vec, |
const std::vector< mi::Float32 > & | attribute_vec, | ||
nv::index::IPoint_set::Point_style | point_style | ||
) |
Constructing a point set shape using a cloud of initial points.
[in] | vertex_vec | coordinates vector of vertices |
[in] | attribute_vec | attribute vector of vertices. They are mapped to colors and radii. |
[in] | point_style | point style |
Definition at line 10 of file attribute_point_set.cpp.
|
inline |
Constructing the point set shape for serialization.
Definition at line 47 of file attribute_point_set.h.
|
inlinevirtual |
Destructing the point set shape.
Definition at line 60 of file attribute_point_set.h.
|
virtual |
Definition at line 94 of file attribute_point_set.cpp.
|
virtual |
Definition at line 135 of file attribute_point_set.cpp.
|
virtual |
Definition at line 108 of file attribute_point_set.cpp.
|
protected |
attribute to color map example
[in] | attrib | attribute value |
Definition at line 162 of file attribute_point_set.cpp.
|
virtual |
Get the pointer to the array of per-vertex color values.
Definition at line 70 of file attribute_point_set.cpp.
|
inlinevirtual |
Get enable/disable rendering state of this shape.
Definition at line 121 of file attribute_point_set.h.
|
inlinevirtual |
Retrieve the scene element's reference to the user-defined meta data.
Definition at line 139 of file attribute_point_set.h.
|
inlinevirtual |
Get the size of color buffer.
Definition at line 89 of file attribute_point_set.h.
|
inlinevirtual |
Get the size of radius buffer.
Definition at line 100 of file attribute_point_set.h.
|
inlinevirtual |
Get number of 3D points or vertices in this shape.
Definition at line 78 of file attribute_point_set.h.
|
inlinevirtual |
Definition at line 144 of file attribute_point_set.h.
|
inlinevirtual |
The rasterizer enabling stylized points supports different point styles such as flat disks or shaded spheres.
Definition at line 113 of file attribute_point_set.h.
|
virtual |
Get the pointer to the array of per-vertex radii.
Definition at line 82 of file attribute_point_set.cpp.
|
protected |
attribute to radius map example
[in] | attrib | attribute value |
Definition at line 176 of file attribute_point_set.cpp.
|
inlinevirtual |
Definition at line 156 of file attribute_point_set.h.
|
virtual |
Get the pointer to the array of vertices (points).
Definition at line 58 of file attribute_point_set.cpp.
mi::math::Vector_struct< mi::Float32, 3 > * Attribute_point_set::peek_vertices | ( | ) |
peek the vertex position for change.
Definition at line 46 of file attribute_point_set.cpp.
|
virtual |
Definition at line 114 of file attribute_point_set.cpp.
void Attribute_point_set::set_attribute | ( | std::vector< mi::Float32 > const & | attribute_vec | ) |
set point attribute
[in] | attribute_vec | attribute vector of vertices. They are mapped to colors and radii. |
Definition at line 27 of file attribute_point_set.cpp.
|
inlinevirtual |
Set enable/disable rendering state of this shape.
[in] | enable | true when rendering this shape is enabled. |
Definition at line 118 of file attribute_point_set.h.
|
inlinevirtual |
Each scene element can store additional user-defined meta data.
Meta data, for instance, may include a string representing the scene element's name or domain specific attributes. A class that represents meta data has to be a database element and the scene element then referes to the database element by means of a tag.
[in] | tag | The tag that refers to the user-defined meta data associated with the scene element. |
Definition at line 132 of file attribute_point_set.h.
|
inlinevirtual |
Definition at line 145 of file attribute_point_set.h.
|
inlinevirtual |
Definition at line 114 of file attribute_point_set.h.