NVIDIA Index example code nvidia_logo_transpbg.gif Up
Attribute_point_set Class Reference

An example simple point set shape implementation of IPoint_set. More...

#include <attribute_point_set.h>

Inheritance diagram for Attribute_point_set:

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

 Attribute_point_set() [1/2]

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.

Parameters
[in]vertex_veccoordinates vector of vertices
[in]attribute_vecattribute vector of vertices. They are mapped to colors and radii.
[in]point_stylepoint style

Definition at line 10 of file attribute_point_set.cpp.

 Attribute_point_set() [2/2]

Attribute_point_set::Attribute_point_set ( )
inline

Constructing the point set shape for serialization.

Definition at line 47 of file attribute_point_set.h.

 ~Attribute_point_set()

virtual Attribute_point_set::~Attribute_point_set ( )
inlinevirtual

Destructing the point set shape.

Definition at line 60 of file attribute_point_set.h.

Member Function Documentation

 copy()

mi::neuraylib::IElement * Attribute_point_set::copy ( ) const
virtual

Definition at line 94 of file attribute_point_set.cpp.

 deserialize()

void Attribute_point_set::deserialize ( mi::neuraylib::IDeserializer *  deserializer)
virtual

Definition at line 135 of file attribute_point_set.cpp.

 get_class_name()

const char * Attribute_point_set::get_class_name ( ) const
virtual

Definition at line 108 of file attribute_point_set.cpp.

 get_color_from_attribute()

mi::math::Color_struct Attribute_point_set::get_color_from_attribute ( mi::Float32  attrib)
protected

attribute to color map example

Parameters
[in]attribattribute value
Returns
a color corresponding to the attribute value

Definition at line 162 of file attribute_point_set.cpp.

 get_colors()

const mi::math::Color_struct * Attribute_point_set::get_colors ( ) const
virtual

Get the pointer to the array of per-vertex color values.

Returns
The pointer to the array of per-vertex color values.

Definition at line 70 of file attribute_point_set.cpp.

 get_enabled()

virtual bool Attribute_point_set::get_enabled ( ) const
inlinevirtual

Get enable/disable rendering state of this shape.

Returns
true when rendering this shape is enabled.

Definition at line 121 of file attribute_point_set.h.

 get_meta_data()

virtual mi::neuraylib::Tag_struct Attribute_point_set::get_meta_data ( ) const
inlinevirtual

Retrieve the scene element's reference to the user-defined meta data.

Returns
Returns the tag that refers to the user-defined meta data associated with the scene element.

Definition at line 139 of file attribute_point_set.h.

 get_nb_colors()

virtual mi::Size Attribute_point_set::get_nb_colors ( ) const
inlinevirtual

Get the size of color buffer.

Returns
The size of color buffer

Definition at line 89 of file attribute_point_set.h.

 get_nb_radii()

virtual mi::Size Attribute_point_set::get_nb_radii ( ) const
inlinevirtual

Get the size of radius buffer.

Returns
The size of radius buffer

Definition at line 100 of file attribute_point_set.h.

 get_nb_vertices()

virtual mi::Size Attribute_point_set::get_nb_vertices ( ) const
inlinevirtual

Get number of 3D points or vertices in this shape.

Returns
The number of vertices (and per vertex colors and radii).

Definition at line 78 of file attribute_point_set.h.

 get_pickable()

virtual bool Attribute_point_set::get_pickable ( ) const
inlinevirtual

Definition at line 144 of file attribute_point_set.h.

 get_point_style()

virtual Point_style Attribute_point_set::get_point_style ( ) const
inlinevirtual

The rasterizer enabling stylized points supports different point styles such as flat disks or shaded spheres.

Returns
The point style.

Definition at line 113 of file attribute_point_set.h.

 get_radii()

const mi::Float32 * Attribute_point_set::get_radii ( ) const
virtual

Get the pointer to the array of per-vertex radii.

Returns
The pointer to the array of per-vertex radii.

Definition at line 82 of file attribute_point_set.cpp.

 get_radius_from_attribute()

mi::Float32 Attribute_point_set::get_radius_from_attribute ( mi::Float32  attrib)
protected

attribute to radius map example

Parameters
[in]attribattribute value
Returns
a radius corresponding to the attribute value

Definition at line 176 of file attribute_point_set.cpp.

 get_references()

virtual void Attribute_point_set::get_references ( mi::neuraylib::ITag_set *  result) const
inlinevirtual

Definition at line 156 of file attribute_point_set.h.

 get_vertices()

const mi::math::Vector_struct< mi::Float32, 3 > * Attribute_point_set::get_vertices ( ) const
virtual

Get the pointer to the array of vertices (points).

Returns
Pointer to the array of vertices.

Definition at line 58 of file attribute_point_set.cpp.

 peek_vertices()

mi::math::Vector_struct< mi::Float32, 3 > * Attribute_point_set::peek_vertices ( )

peek the vertex position for change.

Returns
Pointer to the array of vertices.

Definition at line 46 of file attribute_point_set.cpp.

 serialize()

void Attribute_point_set::serialize ( mi::neuraylib::ISerializer *  serializer) const
virtual

Definition at line 114 of file attribute_point_set.cpp.

 set_attribute()

void Attribute_point_set::set_attribute ( std::vector< mi::Float32 > const &  attribute_vec)

set point attribute

Parameters
[in]attribute_vecattribute vector of vertices. They are mapped to colors and radii.

Definition at line 27 of file attribute_point_set.cpp.

 set_enabled()

virtual void Attribute_point_set::set_enabled ( bool  enable)
inlinevirtual

Set enable/disable rendering state of this shape.

Parameters
[in]enabletrue when rendering this shape is enabled.

Definition at line 118 of file attribute_point_set.h.

 set_meta_data()

virtual void Attribute_point_set::set_meta_data ( mi::neuraylib::Tag_struct  tag)
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.

Parameters
[in]tagThe tag that refers to the user-defined meta data associated with the scene element.

Definition at line 132 of file attribute_point_set.h.

 set_pickable()

virtual void Attribute_point_set::set_pickable ( bool  pickable)
inlinevirtual

Definition at line 145 of file attribute_point_set.h.

 set_point_style()

virtual void Attribute_point_set::set_point_style ( Point_style  style)
inlinevirtual

Definition at line 114 of file attribute_point_set.h.


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