mi::shader_v3::Map_iterator_base Class Reference

Map_iterator_base class. More...

#include <shader_map.h>

List of all members.

Public Member Functions

virtual void release () const =0
 deletes the object.
virtual Map_status reset () const =0
 resets itself to point to the first element.
virtual Map_status set_to (const miUint index) const =0
 moves to the desired element.
virtual Map_status next () const =0
 moves to the next element.
virtual Map_status previous () const =0
 moves to the previous element.
virtual Map_status skip (const miUint amount) const =0
 skips the desired number of elements.
virtual bool at_end (Map_status *status=0) const =0
 returns true if it's beyond the end.
virtual miUint current (Map_status *status=0) const =0
 returns the index of the element it points to.
virtual Map_status get (Map_element &element) const =0
 returns a copy of the current element.
virtual Map_status get_position (float *position) const =0
 retrieves the position of the current element.
virtual Map_status get_position (miVector &position) const =0
 retrieves the position of the current element, 3D case.
virtual Map_status get (const Map_field_id field_id, float &value) const =0
 retrieves the value of the desired field of the current element.
virtual Map_status get (const Map_field_id field_id, int &value) const =0
 retrieves the value of the desired field of the current element.
virtual Map_status get (const Map_field_id field_id, miVector &value) const =0
 retrieves the value of the desired field of the current element.
virtual Map_status get (const Map_field_id field_id, miColor &value) const =0
 retrieves the value of the desired field of the current element.
virtual Map_status get (const Map_field_id field_id, miMatrix *value) const =0
 retrieves the value of the desired field of the current element. NOTE: 'value' is a pointer to a miMatrix.
virtual Map_status get (const Map_field_id field_id, float *value) const =0
 retrieves the value of the desired field of the current element.
virtual Map_status get (const Map_field_id field_id, int *value) const =0
 retrieves the value of the desired field of the current element.
virtual Map_status set (const Map_element &element)=0
 sets the current element.
virtual Map_status set_position (const float *position)=0
 sets the position of the current element.
virtual Map_status set_position (const miVector &position)=0
 sets the position of the current element, 3D case.
virtual Map_status set (const Map_field_id field_id, const float value)=0
 sets the value of the desired field of the current element.
virtual Map_status set (const Map_field_id field_id, const int value)=0
 sets the value of the desired field of the current element.
virtual Map_status set (const Map_field_id field_id, const miVector &value)=0
 sets the value of the desired field of the current element.
virtual Map_status set (const Map_field_id field_id, const miColor &value)=0
 sets the value of the desired field of the current element.
virtual Map_status set (const Map_field_id field_id, const miMatrix *value)=0
 sets the value of the desired field of the current element. NOTE: 'value' is a pointer to a miMatrix.
virtual Map_status set (const Map_field_id field_id, const float *value)=0
 sets the value of the desired field of the current element.
virtual Map_status set (const Map_field_id field_id, const int *value)=0
 sets the value of the desired field of the current element.


Detailed Description

Map_iterator_base class.

The Map_iterator_base class is an interface class which provides access to the elements of the map without having to copy them first. The constness of its methods refers actually to the constness of the map it's attached to, not to the constness of the iterator itself: for instance, the 'set' methods are non-const because they change the map, even if they don't change the iterator state; conversely, the 'reset' method is const even if it does change the state of the iterator, but the map itself is untouched. There are two wrapper classes which provide a convenient way to manage this class: the Access_map_iterator class (iterator with read-only access to a map) and the Edit_map_iterator class (iterator with read-write access to a map). For example, a shader might attach a map iterator to a map and use it in the following way:

    // 'map' is a Access_map. 'it' is attached to the map, and it points
    // to the first element of the map
    Access_map_iterator it (map);
   
    for ( ; !it->at_end() ; it->next() )   { ... }


Member Function Documentation

virtual bool mi::shader_v3::Map_iterator_base::at_end Map_status status = 0  )  const [pure virtual]
 

returns true if it's beyond the end.

Parameters:
status is a status code
Returns:
true if it's beyond the end, false otherwise

virtual miUint mi::shader_v3::Map_iterator_base::current Map_status status = 0  )  const [pure virtual]
 

returns the index of the element it points to.

Parameters:
status is a status code
Returns:
the index of the current element

virtual Map_status mi::shader_v3::Map_iterator_base::get const Map_field_id  field_id,
int *  value
const [pure virtual]
 

retrieves the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the integer array output value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::get const Map_field_id  field_id,
float *  value
const [pure virtual]
 

retrieves the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the float array output value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::get const Map_field_id  field_id,
miMatrix *  value
const [pure virtual]
 

retrieves the value of the desired field of the current element. NOTE: 'value' is a pointer to a miMatrix.

Parameters:
field_id is the id of the desired field
value is the pointer to the transform output value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::get const Map_field_id  field_id,
miColor &  value
const [pure virtual]
 

retrieves the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the color output value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::get const Map_field_id  field_id,
miVector &  value
const [pure virtual]
 

retrieves the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the vector output value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::get const Map_field_id  field_id,
int &  value
const [pure virtual]
 

retrieves the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the integer output value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::get const Map_field_id  field_id,
float &  value
const [pure virtual]
 

retrieves the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the float output value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::get Map_element element  )  const [pure virtual]
 

returns a copy of the current element.

Parameters:
element is the element which will hold the copy
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::get_position miVector &  position  )  const [pure virtual]
 

retrieves the position of the current element, 3D case.

Parameters:
position is the output vector
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::get_position float *  position  )  const [pure virtual]
 

retrieves the position of the current element.

Parameters:
position is the output array
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::next  )  const [pure virtual]
 

moves to the next element.

Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::previous  )  const [pure virtual]
 

moves to the previous element.

Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::reset  )  const [pure virtual]
 

resets itself to point to the first element.

Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set const Map_field_id  field_id,
const int *  value
[pure virtual]
 

sets the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the integer array input value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set const Map_field_id  field_id,
const float *  value
[pure virtual]
 

sets the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the float array input value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set const Map_field_id  field_id,
const miMatrix *  value
[pure virtual]
 

sets the value of the desired field of the current element. NOTE: 'value' is a pointer to a miMatrix.

Parameters:
field_id is the id of the desired field
value is the pointer to the transform output value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set const Map_field_id  field_id,
const miColor &  value
[pure virtual]
 

sets the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the color input value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set const Map_field_id  field_id,
const miVector &  value
[pure virtual]
 

sets the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the vector input value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set const Map_field_id  field_id,
const int  value
[pure virtual]
 

sets the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the integer input value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set const Map_field_id  field_id,
const float  value
[pure virtual]
 

sets the value of the desired field of the current element.

Parameters:
field_id is the id of the desired field
value is the float input value
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set const Map_element element  )  [pure virtual]
 

sets the current element.

Parameters:
element is the element to set
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set_position const miVector &  position  )  [pure virtual]
 

sets the position of the current element, 3D case.

Parameters:
position is the input vector
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set_position const float *  position  )  [pure virtual]
 

sets the position of the current element.

Parameters:
position is the input array
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::set_to const miUint  index  )  const [pure virtual]
 

moves to the desired element.

Parameters:
index is the index of the element to move to
Returns:
a status code

virtual Map_status mi::shader_v3::Map_iterator_base::skip const miUint  amount  )  const [pure virtual]
 

skips the desired number of elements.

Parameters:
amount is the number of elements to skip
Returns:
a status code

Copyright © 1986-2009 by mental images GmbH