NVIDIA Index example code nvidia_logo_transpbg.gif Up
Attribute_line_set Class Reference

An example of line set that contains 3D line segments (stored as vertices in a array) and a color as well as as a line width/radius per line segment (per-segment attributes). More...

#include <attribute_line_set.h>

Inheritance diagram for Attribute_line_set:

Public Member Functions

 Attribute_line_set (const std::vector< mi::math::Vector_struct< mi::Float32, 3 > > &line_segments_vec, const std::vector< mi::Float32 > &attribute_vec)
 constructor More...
 
 Attribute_line_set ()
 Constructing the attribute line set shape for serialization. More...
 
void set_attribute (std::vector< mi::Float32 > const &attribute_vec)
 set line attribute More...
 
virtual Cap_style get_cap_style () const
 Get the line cap style. More...
 
virtual void set_cap_style (Cap_style style)
 Set the line cap style. More...
 
virtual mi::Size get_nb_lines () const
 Get number of line segment in this line set. More...
 
virtual mi::Size get_nb_vertices () const
 Get number of line segment in this line set. More...
 
virtual const mi::math::Vector_struct< mi::Float32, 3 > * get_lines () const
 Get the pointer to the array of line vertices (two vertices per line segment) More...
 
virtual mi::Size get_nb_colors () const
 Get number of color values. More...
 
virtual const mi::math::Color_struct * get_colors () const
 Get the pointer to the array of per-segment color values. More...
 
virtual mi::Size get_nb_widths () const
 Get number of radii. More...
 
virtual const mi::Float32 * get_widths () const
 Get the pointer to the array of per-segment widths (for rasterized lines) or radii (for ray traced cylinders). More...
 
virtual nv::index::ILine_set::Line_style get_line_style () const
 Get the line style. More...
 
virtual nv::index::ILine_set::Line_type get_line_type () const
 Get the line style. More...
 
virtual bool get_pickable () const
 Each shape may be set pickable, i.e., the ray cast through the scene can intersect the shape. More...
 
virtual void set_pickable (bool pickable)
 
virtual void set_enabled (bool is_enable)
 Set graphical representation can be enabled or disabled from rendering. More...
 
virtual bool get_enabled () const
 get rendering mode 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 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_width_from_attribute (mi::Float32 attrib)
 attribute to width map example More...
 

Detailed Description

An example of line set that contains 3D line segments (stored as vertices in a array) and a color as well as as a line width/radius per line segment (per-segment attributes).

Definition at line 22 of file attribute_line_set.h.

Constructor & Destructor Documentation

 Attribute_line_set() [1/2]

Attribute_line_set::Attribute_line_set ( const std::vector< mi::math::Vector_struct< mi::Float32, 3 > > &  line_segments_vec,
const std::vector< mi::Float32 > &  attribute_vec 
)

constructor

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

Definition at line 10 of file attribute_line_set.cpp.

 Attribute_line_set() [2/2]

Attribute_line_set::Attribute_line_set ( )
inline

Constructing the attribute line set shape for serialization.

Definition at line 36 of file attribute_line_set.h.

Member Function Documentation

 copy()

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

Definition at line 120 of file attribute_line_set.cpp.

 deserialize()

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

Definition at line 157 of file attribute_line_set.cpp.

 get_cap_style()

nv::index::ILine_set::Cap_style Attribute_line_set::get_cap_style ( ) const
virtual

Get the line cap style.

Returns
The cap style used by stylized lines.

Definition at line 45 of file attribute_line_set.cpp.

 get_class_name()

const char * Attribute_line_set::get_class_name ( ) const
virtual

Definition at line 135 of file attribute_line_set.cpp.

 get_color_from_attribute()

mi::math::Color_struct Attribute_line_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 177 of file attribute_line_set.cpp.

 get_colors()

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

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

Returns
Pointer to the array of per-segment color values.

Definition at line 77 of file attribute_line_set.cpp.

 get_enabled()

bool Attribute_line_set::get_enabled ( ) const
virtual

get rendering mode

Returns
true when rendering is enabled of this instance

Definition at line 114 of file attribute_line_set.cpp.

 get_line_style()

nv::index::ILine_set::Line_style Attribute_line_set::get_line_style ( ) const
virtual

Get the line style.

The line styles can be solid or a dashed or dotted style.

Returns
The line style used by stylized lines.

Definition at line 95 of file attribute_line_set.cpp.

 get_line_type()

nv::index::ILine_set::Line_type Attribute_line_set::get_line_type ( ) const
virtual

Get the line style.

The line styles can be solid or a dashed or dotted style.

Returns
The line style used by stylized lines.

Definition at line 102 of file attribute_line_set.cpp.

 get_lines()

const mi::math::Vector_struct< mi::Float32, 3 > * Attribute_line_set::get_lines ( ) const
virtual

Get the pointer to the array of line vertices (two vertices per line segment)

Returns
Pointer to the array of line vertices.

Definition at line 68 of file attribute_line_set.cpp.

 get_meta_data()

virtual mi::neuraylib::Tag_struct Attribute_line_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 157 of file attribute_line_set.h.

 get_nb_colors()

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

Get number of color values.

Returns
The number of color values.

Definition at line 84 of file attribute_line_set.h.

 get_nb_lines()

mi::Size Attribute_line_set::get_nb_lines ( ) const
virtual

Get number of line segment in this line set.

Returns
number of line segments

Definition at line 56 of file attribute_line_set.cpp.

 get_nb_vertices()

mi::Size Attribute_line_set::get_nb_vertices ( ) const
virtual

Get number of line segment in this line set.

Returns
number of line vertices

Definition at line 62 of file attribute_line_set.cpp.

 get_nb_widths()

virtual mi::Size Attribute_line_set::get_nb_widths ( ) const
inlinevirtual

Get number of radii.

Returns
The number of radii.

Definition at line 96 of file attribute_line_set.h.

 get_pickable()

virtual bool Attribute_line_set::get_pickable ( ) const
inlinevirtual

Each shape may be set pickable, i.e., the ray cast through the scene can intersect the shape.

The intersection information will be returned by the pick operation.

Returns
The shape may or may not be pickable.

Definition at line 125 of file attribute_line_set.h.

 get_references()

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

Definition at line 166 of file attribute_line_set.h.

 get_width_from_attribute()

mi::Float32 Attribute_line_set::get_width_from_attribute ( mi::Float32  attrib)
protected

attribute to width map example

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

Definition at line 191 of file attribute_line_set.cpp.

 get_widths()

const mi::Float32 * Attribute_line_set::get_widths ( ) const
virtual

Get the pointer to the array of per-segment widths (for rasterized lines) or radii (for ray traced cylinders).

Returns
The pointer to the array of per-segment widths/radii.

Definition at line 86 of file attribute_line_set.cpp.

 serialize()

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

Definition at line 141 of file attribute_line_set.cpp.

 set_attribute()

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

set line attribute

Parameters
[in]attribute_vecattribute vec for line segments

Definition at line 25 of file attribute_line_set.cpp.

 set_cap_style()

void Attribute_line_set::set_cap_style ( Cap_style  style)
virtual

Set the line cap style.

Parameters
[in]styleThe line cap style used by stylized lines.

Definition at line 50 of file attribute_line_set.cpp.

 set_enabled()

void Attribute_line_set::set_enabled ( bool  is_enable)
virtual

Set graphical representation can be enabled or disabled from rendering.

Parameters
[in]is_enabletrue when rendering is enabled.

Definition at line 108 of file attribute_line_set.cpp.

 set_meta_data()

virtual void Attribute_line_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 150 of file attribute_line_set.h.

 set_pickable()

virtual void Attribute_line_set::set_pickable ( bool  pickable)
inlinevirtual

Definition at line 126 of file attribute_line_set.h.


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