mi::shader_v3::Map_declaration_base Class Reference

Map_declaration_base class. More...

#include <shader_map.h>

List of all members.


Public Member Functions

virtual void  release () const =0
  deletes the object.
virtual miUint  get_fields () const =0
  returns the total number of fields (excluding the position), global and element (non-global) fields.
virtual miUint  get_element_fields () const =0
  returns the number of element fields (excluding the position).
virtual miUint  get_global_fields () const =0
  returns the number of global fields.
virtual bool  is_empty () const =0
  returns true if the declaration is empty, excluding the position (which is always there).
virtual miUint  get_dimension () const =0
  returns the dimension of the position.
virtual bool  is_equivalent (const Map_declaration &other, Map_status *status=0) const =0
  returns true if the declaration is equivalent to the given one, that is same field types and in the same order, though names can be different.
virtual bool  matches (const Map_declaration &other, Map_status *status=0) const =0
  returns true if the declaration matches exactly the given one, that is same field types, in the same order and with the same names.
virtual bool  has_field (const char *name, Map_status *status=0) const =0
  returns true if the declaration has a field with the given name (global or not).
virtual bool  is_global (const char *name, Map_status *status=0) const =0
  returns true if the field with the given name is a global field.
virtual bool  is_global (const Map_field_id field_id, Map_status *status=0) const =0
  returns true if the field with the given id is a global field.
virtual const char *  get_field_name (const Map_field_id field_id, Map_status *status=0) const =0
  returns the name of the desired field.
virtual Map_field_id  get_field_id (const char *field_name, Map_status *status=0) const =0
  returns the id of the field with the given name.
virtual Map_field_id  get_element_field_id (const miUint index, Map_status *status=0) const =0
  returns the id of the element field with the given index (between 0 and get_element_fields()-1)
virtual Map_field_id  get_global_field_id (const miUint index, Map_status *status=0) const =0
  returns the id of the global field with the given index (between 0 and get_global_fields()-1)
virtual Map_status  get_field_info (const Map_field_id field_id, Map_field_type &field_type, miUint &field_dimension, bool &field_global) const =0
  returns the type and the dimension of the desired field, and a flag that says if the field is global or not.
virtual Map_status  get_field_info (const char *field_name, Map_field_type &field_type, miUint &field_dimension, bool &field_global) const =0
  returns the type and the dimension of the desired field, and a flag that says if the field is global or not.
virtual Map_status  add (const char *name, const Map_field_type type, const miUint dim=0)=0
  adds an element field with the given name, type and (possible) dimension (ignored in case of non-array types).
virtual Map_status  add_scalar (const char *name)=0
  adds an element scalar field with the given name.
virtual Map_status  add_integer (const char *name)=0
  adds an element integer field with the given name.
virtual Map_status  add_vector (const char *name)=0
  adds an element vector field with the given name.
virtual Map_status  add_color (const char *name)=0
  adds an element color field with the given name.
virtual Map_status  add_transform (const char *name)=0
  adds an element transform field with the given name.
virtual Map_status  add_scalar_array (const char *name, const miUint dim)=0
  adds an element scalar array field with the given name.
virtual Map_status  add_integer_array (const char *name, const miUint dim)=0
  adds an element integer array field with the given name.
virtual Map_status  add_global (const char *name, const Map_field_type type, const miUint dim=0)=0
  adds a global field with the given name, type and (possible) dimension (meaningful only for arrays and strings).
virtual Map_status  add_global_scalar (const char *name)=0
  adds a global scalar field with the given name.
virtual Map_status  add_global_integer (const char *name)=0
  adds a global integer field with the given name.
virtual Map_status  add_global_vector (const char *name)=0
  adds a global vector field with the given name.
virtual Map_status  add_global_color (const char *name)=0
  adds a global color field with the given name.
virtual Map_status  add_global_transform (const char *name)=0
  adds a global transform field with the given name.
virtual Map_status  add_global_scalar_array (const char *name, const miUint dim)=0
  adds a global scalar array field with the given name.
virtual Map_status  add_global_integer_array (const char *name, const miUint dim)=0
  adds a global integer array field with the given name.
virtual Map_status  add_global_string (const char *name, const miUint dim)=0
  adds a global string field with the given name.

Detailed Description

Map_declaration_base class.

The Map_declaration_base class is an interface class which provides ways to add/query map field names and ids in a map declaration. There is a wrapper class which provides a convenient way to manage this class, which is the Map_declaration class. For example, a shader might create and use a map declaration in the following way:

 // declaration of a 3-dimensional map
 Map_declaration declaration (3);

 declaration->add_color ("color");
 declaration->add_scalar ("intensity");
 ...

 // creates a map which has the declaration just built
 Edit_map map (declaration);
 ...

Member Function Documentation

virtual miUint mi::shader_v3::Map_declaration_base::get_fields (  )  const [pure virtual]

returns the total number of fields (excluding the position), global and element (non-global) fields.

Returns:
the number of total fields in the declaration

virtual miUint mi::shader_v3::Map_declaration_base::get_element_fields (  )  const [pure virtual]

returns the number of element fields (excluding the position).

Returns:
the number of element fields in the declaration

virtual miUint mi::shader_v3::Map_declaration_base::get_global_fields (  )  const [pure virtual]

returns the number of global fields.

Returns:
the number of global fields in the declaration

virtual bool mi::shader_v3::Map_declaration_base::is_empty (  )  const [pure virtual]

returns true if the declaration is empty, excluding the position (which is always there).

Returns:
true if it's empty, false otherwise

virtual miUint mi::shader_v3::Map_declaration_base::get_dimension (  )  const [pure virtual]

returns the dimension of the position.

Returns:
the dimension of the position

virtual bool mi::shader_v3::Map_declaration_base::is_equivalent ( const Map_declaration other,
Map_status status = 0  
) const [pure virtual]

returns true if the declaration is equivalent to the given one, that is same field types and in the same order, though names can be different.

Parameters:
other  is the declaration to compare to
status  is a pointer to a status code
Returns:
true if they are equivalent, false otherwise

virtual bool mi::shader_v3::Map_declaration_base::matches ( const Map_declaration other,
Map_status status = 0  
) const [pure virtual]

returns true if the declaration matches exactly the given one, that is same field types, in the same order and with the same names.

Parameters:
other  is the declaration to compare to
status  is a pointer to a status code
Returns:
true if they match, false otherwise

virtual bool mi::shader_v3::Map_declaration_base::has_field ( const char *  name,
Map_status status = 0  
) const [pure virtual]

returns true if the declaration has a field with the given name (global or not).

Parameters:
name  is the name of the field to look for
status  is a pointer to a status code
Returns:
true if it has a field with such name, false otherwise

virtual bool mi::shader_v3::Map_declaration_base::is_global ( const char *  name,
Map_status status = 0  
) const [pure virtual]

returns true if the field with the given name is a global field.

Parameters:
name  is the name of the field
status  is a pointer to a status code
Returns:
true if it is a global field, false otherwise

virtual bool mi::shader_v3::Map_declaration_base::is_global ( const Map_field_id  field_id,
Map_status status = 0  
) const [pure virtual]

returns true if the field with the given id is a global field.

Parameters:
field_id  is the id of the field
status  is a pointer to a status code
Returns:
true if it is a global field, false otherwise

virtual const char* mi::shader_v3::Map_declaration_base::get_field_name ( const Map_field_id  field_id,
Map_status status = 0  
) const [pure virtual]

returns the name of the desired field.

Parameters:
field_id  is the id of the desired field
status  is the optional returned status code
Returns:
the name of the desired field

virtual Map_field_id mi::shader_v3::Map_declaration_base::get_field_id ( const char *  field_name,
Map_status status = 0  
) const [pure virtual]

returns the id of the field with the given name.

Parameters:
field_name  is the name of the desired field
status  is the optional returned status code
Returns:
the id of the field with the given name

virtual Map_field_id mi::shader_v3::Map_declaration_base::get_element_field_id ( const miUint  index,
Map_status status = 0  
) const [pure virtual]

returns the id of the element field with the given index (between 0 and get_element_fields()-1)

Parameters:
index  is the index of the desired element field
status  is the optional returned status code
Returns:
the id of the field

virtual Map_field_id mi::shader_v3::Map_declaration_base::get_global_field_id ( const miUint  index,
Map_status status = 0  
) const [pure virtual]

returns the id of the global field with the given index (between 0 and get_global_fields()-1)

Parameters:
index  is the index of the desired global field
status  is the optional returned status code
Returns:
the id of the field

virtual Map_status mi::shader_v3::Map_declaration_base::get_field_info ( const Map_field_id  field_id,
Map_field_type field_type,
miUint &  field_dimension,
bool &  field_global  
) const [pure virtual]

returns the type and the dimension of the desired field, and a flag that says if the field is global or not.

Parameters:
field_id  is the id of the desired field
field_type  is the returned type
field_dimension  is the returned dimension
field_global  is a flag, true if the field is global
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::get_field_info ( const char *  field_name,
Map_field_type field_type,
miUint &  field_dimension,
bool &  field_global  
) const [pure virtual]

returns the type and the dimension of the desired field, and a flag that says if the field is global or not.

Parameters:
field_name  is the name of the desired field
field_type  is the returned type
field_dimension  is the returned dimension
field_global  is a flag, true if the field is global
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add ( const char *  name,
const Map_field_type  type,
const miUint  dim = 0  
) [pure virtual]

adds an element field with the given name, type and (possible) dimension (ignored in case of non-array types).

Parameters:
name  is the field name
type  is the field type
dim  is the dimension (ignored for non-arrays)
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_scalar ( const char *  name  )  [pure virtual]

adds an element scalar field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_integer ( const char *  name  )  [pure virtual]

adds an element integer field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_vector ( const char *  name  )  [pure virtual]

adds an element vector field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_color ( const char *  name  )  [pure virtual]

adds an element color field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_transform ( const char *  name  )  [pure virtual]

adds an element transform field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_scalar_array ( const char *  name,
const miUint  dim  
) [pure virtual]

adds an element scalar array field with the given name.

Parameters:
name  is the field name
dim  is the dimension of the array
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_integer_array ( const char *  name,
const miUint  dim  
) [pure virtual]

adds an element integer array field with the given name.

Parameters:
name  is the field name
dim  is the dimension of the array
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_global ( const char *  name,
const Map_field_type  type,
const miUint  dim = 0  
) [pure virtual]

adds a global field with the given name, type and (possible) dimension (meaningful only for arrays and strings).

Parameters:
name  is the field name
type  is the field type
dim  is the dimension (ignored for non-arrays)
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_global_scalar ( const char *  name  )  [pure virtual]

adds a global scalar field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_global_integer ( const char *  name  )  [pure virtual]

adds a global integer field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_global_vector ( const char *  name  )  [pure virtual]

adds a global vector field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_global_color ( const char *  name  )  [pure virtual]

adds a global color field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_global_transform ( const char *  name  )  [pure virtual]

adds a global transform field with the given name.

Parameters:
name  is the field name
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_global_scalar_array ( const char *  name,
const miUint  dim  
) [pure virtual]

adds a global scalar array field with the given name.

Parameters:
name  is the field name
dim  is the dimension of the array
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_global_integer_array ( const char *  name,
const miUint  dim  
) [pure virtual]

adds a global integer array field with the given name.

Parameters:
name  is the field name
dim  is the dimension of the array
Returns:
a status code

virtual Map_status mi::shader_v3::Map_declaration_base::add_global_string ( const char *  name,
const miUint  dim  
) [pure virtual]

adds a global string field with the given name.

Parameters:
name  is the field name
dim  is the dimension of the array
Returns:
a status code

Copyright © 1986-2010 by mental images GmbH