#include <shader_map.h>
Public Types | |
enum | File_format { Closed_binary = 0, Open_binary, Open_ASCII } |
all the map file formats, used when writing maps to file. More... | |
Public Member Functions | |
virtual miUint | size () const =0 |
returns the number of elements in the map. | |
virtual bool | is_empty () const =0 |
returns true if the map is empty. | |
virtual bool | has_declaration () const =0 |
returns true if the map has a declaration. | |
virtual Map_status | get (const miUint index, Map_element &map_element) const =0 |
gets the copy of an element. | |
virtual Map_status | set (const miUint index, const Map_element &map_element)=0 |
sets the desired element in the map. | |
virtual Map_status | append (const Map_element &map_element)=0 |
appends the desired element at the end. | |
virtual Map_status | read (const char *file_name, const bool notify=true)=0 |
reads a map from a file. | |
virtual Map_status | append_to (const char *file_name, const bool notify=true) const =0 |
appends the map to the existing file. | |
virtual Map_status | append_from (const char *file_name, const bool notify=true)=0 |
appends the contents of the file to the map. | |
virtual Map_status | write (const char *file_name, const bool notify=true, const File_format file_format=Closed_binary) const =0 |
writes the map to file. | |
virtual Map_status | consolidate (const float bvh_quality=0.6f)=0 |
takes into account all the appended elements and rebuilds the map BVH | |
virtual Map_status | get (const Map_field_id field_id, float &value) const =0 |
retrieves the value of the desired global field. | |
virtual Map_status | get (const Map_field_id field_id, int &value) const =0 |
retrieves the value of the desired global field. | |
virtual Map_status | get (const Map_field_id field_id, miVector &value) const =0 |
retrieves the value of the desired global field. | |
virtual Map_status | get (const Map_field_id field_id, miColor &value) const =0 |
retrieves the value of the desired global field. | |
virtual Map_status | get (const Map_field_id field_id, miMatrix *value) const =0 |
retrieves the value of the desired global field. | |
virtual Map_status | get (const Map_field_id field_id, float *value) const =0 |
retrieves the value of the desired global field. | |
virtual Map_status | get (const Map_field_id field_id, int *value) const =0 |
retrieves the value of the desired global field. | |
virtual Map_status | get (const Map_field_id field_id, char *value) const =0 |
retrieves the value of the desired global field. | |
virtual Map_status | set (const Map_field_id field_id, const float value)=0 |
sets the value of the desired global field. | |
virtual Map_status | set (const Map_field_id field_id, const int value)=0 |
sets the value of the desired global field. | |
virtual Map_status | set (const Map_field_id field_id, const miVector &value)=0 |
sets the value of the desired global field. | |
virtual Map_status | set (const Map_field_id field_id, const miColor &value)=0 |
sets the value of the desired global field. | |
virtual Map_status | set (const Map_field_id field_id, const miMatrix *value)=0 |
sets the value of the desired global field. | |
virtual Map_status | set (const Map_field_id field_id, const float *value)=0 |
sets the value of the desired global field. | |
virtual Map_status | set (const Map_field_id field_id, const int *value)=0 |
sets the value of the desired global field. | |
virtual Map_status | set (const Map_field_id field_id, const char *value, const int length=-1)=0 |
sets the value of the desired global field. |
Map_base class.
The Map_base class is an interface class which provides access to a map, to its elements through the use of get/set methods and to its declaration, and it also provides ways to read/write maps from/to files. There are two wrapper classes which provide a convenient way to manage this class: the Access_map class (read-only access to a map) and the Edit_map class (read-write access to a map). For example, a shader might access and use a map in the following way:
Access_map map (tag);
if (!map->is_empty()) { ... }
virtual Map_status mi::shader_v3::Map_base::append | ( | const Map_element & | map_element | ) | [pure virtual] |
appends the desired element at the end.
map_element | is the map element to append |
virtual Map_status mi::shader_v3::Map_base::append_from | ( | const char * | file_name, |
const bool | notify = true |
||
) | [pure virtual] |
appends the contents of the file to the map.
file_name | is the name of the file to read |
notify | is a flag, if true then notify messages will be printed |
virtual Map_status mi::shader_v3::Map_base::append_to | ( | const char * | file_name, |
const bool | notify = true |
||
) | const [pure virtual] |
appends the map to the existing file.
file_name | is the name of the file to append to |
notify | is a flag, if true then notify messages will be printed |
virtual Map_status mi::shader_v3::Map_base::consolidate | ( | const float | bvh_quality = 0.6f | ) | [pure virtual] |
takes into account all the appended elements and rebuilds the map BVH
bvh_quality | is the quality of the BVH, between 0 and 1 |
virtual Map_status mi::shader_v3::Map_base::get | ( | const miUint | index, |
Map_element & | map_element | ||
) | const [pure virtual] |
gets the copy of an element.
index | is the desired element index |
map_element | is the map element which will hold the copy |
virtual Map_status mi::shader_v3::Map_base::get | ( | const Map_field_id | field_id, |
float & | value | ||
) | const [pure virtual] |
retrieves the value of the desired global field.
field_id | is the id of the desired global field |
value | is the float output value |
virtual Map_status mi::shader_v3::Map_base::get | ( | const Map_field_id | field_id, |
int & | value | ||
) | const [pure virtual] |
retrieves the value of the desired global field.
field_id | is the id of the desired global field |
value | is the integer output value |
virtual Map_status mi::shader_v3::Map_base::get | ( | const Map_field_id | field_id, |
miVector & | value | ||
) | const [pure virtual] |
retrieves the value of the desired global field.
field_id | is the id of the desired global field |
value | is the vector output value |
virtual Map_status mi::shader_v3::Map_base::get | ( | const Map_field_id | field_id, |
miColor & | value | ||
) | const [pure virtual] |
retrieves the value of the desired global field.
field_id | is the id of the desired global field |
value | is the color output value |
virtual Map_status mi::shader_v3::Map_base::get | ( | const Map_field_id | field_id, |
miMatrix * | value | ||
) | const [pure virtual] |
retrieves the value of the desired global field.
NOTE: 'value' is a pointer to a miMatrix.
field_id | is the id of the desired global field |
value | is the transform output value |
virtual Map_status mi::shader_v3::Map_base::get | ( | const Map_field_id | field_id, |
float * | value | ||
) | const [pure virtual] |
retrieves the value of the desired global field.
field_id | is the id of the desired global field |
value | is the float array output value |
virtual Map_status mi::shader_v3::Map_base::get | ( | const Map_field_id | field_id, |
int * | value | ||
) | const [pure virtual] |
retrieves the value of the desired global field.
field_id | is the id of the desired global field |
value | is the integer array output value |
virtual Map_status mi::shader_v3::Map_base::get | ( | const Map_field_id | field_id, |
char * | value | ||
) | const [pure virtual] |
retrieves the value of the desired global field.
field_id | is the id of the desired global field |
value | is the string output value |
virtual bool mi::shader_v3::Map_base::has_declaration | ( | ) | const [pure virtual] |
returns true if the map has a declaration.
virtual bool mi::shader_v3::Map_base::is_empty | ( | ) | const [pure virtual] |
returns true if the map is empty.
virtual Map_status mi::shader_v3::Map_base::read | ( | const char * | file_name, |
const bool | notify = true |
||
) | [pure virtual] |
reads a map from a file.
file_name | is the name of the file to read |
notify | is a flag, if true then notify messages will be printed |
virtual Map_status mi::shader_v3::Map_base::set | ( | const miUint | index, |
const Map_element & | map_element | ||
) | [pure virtual] |
sets the desired element in the map.
index | is the index of the element to set |
map_element | is the map element |
virtual Map_status mi::shader_v3::Map_base::set | ( | const Map_field_id | field_id, |
const float | value | ||
) | [pure virtual] |
sets the value of the desired global field.
field_id | is the id of the desired global field |
value | is the float input value |
virtual Map_status mi::shader_v3::Map_base::set | ( | const Map_field_id | field_id, |
const int | value | ||
) | [pure virtual] |
sets the value of the desired global field.
field_id | is the id of the desired global field |
value | is the integer input value |
virtual Map_status mi::shader_v3::Map_base::set | ( | const Map_field_id | field_id, |
const miVector & | value | ||
) | [pure virtual] |
sets the value of the desired global field.
field_id | is the id of the desired global field |
value | is the vector input value |
virtual Map_status mi::shader_v3::Map_base::set | ( | const Map_field_id | field_id, |
const miColor & | value | ||
) | [pure virtual] |
sets the value of the desired global field.
field_id | is the id of the desired global field |
value | is the color input value |
virtual Map_status mi::shader_v3::Map_base::set | ( | const Map_field_id | field_id, |
const miMatrix * | value | ||
) | [pure virtual] |
sets the value of the desired global field.
NOTE: 'value' is a pointer to a miMatrix.
field_id | is the id of the desired global field |
value | is the transform input value |
virtual Map_status mi::shader_v3::Map_base::set | ( | const Map_field_id | field_id, |
const float * | value | ||
) | [pure virtual] |
sets the value of the desired global field.
field_id | is the id of the desired global field |
value | is the float array input value |
virtual Map_status mi::shader_v3::Map_base::set | ( | const Map_field_id | field_id, |
const int * | value | ||
) | [pure virtual] |
sets the value of the desired global field.
field_id | is the id of the desired global field |
value | is the integer array input value |
virtual Map_status mi::shader_v3::Map_base::set | ( | const Map_field_id | field_id, |
const char * | value, | ||
const int | length = -1 |
||
) | [pure virtual] |
sets the value of the desired global field.
field_id | is the id of the desired global field |
value | is the string input value |
length | is the amount of characters to write, if < 0 then only the characters up to the first '\0' will be copied |
virtual miUint mi::shader_v3::Map_base::size | ( | ) | const [pure virtual] |
returns the number of elements in the map.
virtual Map_status mi::shader_v3::Map_base::write | ( | const char * | file_name, |
const bool | notify = true , |
||
const File_format | file_format = Closed_binary |
||
) | const [pure virtual] |
writes the map to file.
file_name | is the name of the file to write |
notify | is a flag, if true then notify messages will be printed |
file_format | is the format of the map file |
Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.