#include <shader_map.h>
Public Member Functions |
|
virtual void | release () const =0 |
deletes the object. |
|
virtual miUint | size () const =0 |
returns the number of elements in the
lookup. |
|
virtual bool | is_empty () const =0 |
returns true if the lookup is empty.
|
|
virtual Map_status | reset ()=0 |
resets itself to point to the first element.
|
|
virtual Map_status | next ()=0 |
moves to the next element. |
|
virtual bool | at_end (Map_status *status=0) const =0 |
returns true if it's beyond the end.
|
|
virtual Map_status | sort ()=0 |
sorts the elements in ascending order of
distance. |
|
virtual Map_status | sort_descending ()=0 |
sorts the elements in descending order of
distance. |
|
virtual Map_lookup_entry | get (const miUint n, Map_status *status=0) const =0 |
returns the n-th entry of the lookup.
|
|
virtual Map_lookup_entry | get (Map_status *status=0) const =0 |
returns the current lookup entry. |
|
virtual miUint | get_index (Map_status *status=0) const =0 |
returns the index in the map of the current
element. |
|
virtual float | get_distance (Map_status *status=0) const =0 |
returns the distance of the current element.
|
|
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. |
|
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 | search (const Map_distance_base &distance_functor, const miUint max_elements=1, const float max_search_dist=miHUGE_SCALAR)=0 |
searches for the closest elements to a given
point. |
|
virtual Map_status | search (const miVector &point, const miUint max_elements=1, const float max_search_dist=miHUGE_SCALAR)=0 |
searches for the closest elements to a given
point, specialized case of the above for a simple quadratic
distance in 3D. |
The Map_lookup_base class is an interface class which provides access (read-only) to elements which are the result of a lookup inside a map. Searches are run inside a map by calling the 'search' method which takes a Map_distance_base distance functor as argument, provided by the user, or by calling the 'search' method which takes a miVector as argument. There is a wrapper class which provides a convenient way to manage this class, which is the Map_lookup class. For example, a shader might attach a map lookup to a map and use it in the following way:
// 'map' is a Access_map. Attaches a lookup to a map Map_lookup lookup (map); miVector point = ...; // looks for the closest 10 elements to the given point lookup->search (point, 10); // loops through all the found elements, like an iterator, // but accessing only the elements which have been found // in the search for ( ; !lookup->at_end() ; lookup->next() ) { ... }
virtual miUint mi::shader_v3::Map_lookup_base::size | ( | ) | const [pure virtual] |
returns the number of elements in the lookup.
virtual bool mi::shader_v3::Map_lookup_base::is_empty | ( | ) | const [pure virtual] |
returns true if the lookup is empty.
virtual Map_status mi::shader_v3::Map_lookup_base::reset | ( | ) | [pure virtual] |
resets itself to point to the first element.
virtual Map_status mi::shader_v3::Map_lookup_base::next | ( | ) | [pure virtual] |
moves to the next element.
virtual bool mi::shader_v3::Map_lookup_base::at_end | ( | Map_status * | status = 0 |
) | const [pure virtual] |
returns true if it's beyond the end.
status | is a status code |
virtual Map_status mi::shader_v3::Map_lookup_base::sort | ( | ) | [pure virtual] |
sorts the elements in ascending order of distance.
virtual Map_status mi::shader_v3::Map_lookup_base::sort_descending | ( | ) | [pure virtual] |
sorts the elements in descending order of distance.
virtual Map_lookup_entry mi::shader_v3::Map_lookup_base::get | ( | const miUint | n, | |
Map_status * | status = 0 |
|||
) | const [pure virtual] |
returns the n-th entry of the lookup.
n | is the index of the desired entry | |
status | is a status code |
virtual Map_lookup_entry mi::shader_v3::Map_lookup_base::get | ( | Map_status * | status = 0 |
) | const [pure virtual] |
returns the current lookup entry.
status | is a status code |
virtual miUint mi::shader_v3::Map_lookup_base::get_index | ( | Map_status * | status = 0 |
) | const [pure virtual] |
returns the index in the map of the current element.
status | is a status code |
virtual float mi::shader_v3::Map_lookup_base::get_distance | ( | Map_status * | status = 0 |
) | const [pure virtual] |
returns the distance of the current element.
status | is a status code |
virtual Map_status mi::shader_v3::Map_lookup_base::get | ( | Map_element & | element | ) | const [pure virtual] |
returns a copy of the current element.
element | is the element which will hold the copy |
virtual Map_status mi::shader_v3::Map_lookup_base::get_position | ( | float * | position | ) | const [pure virtual] |
retrieves the position of the current element.
position | is the output array |
virtual Map_status mi::shader_v3::Map_lookup_base::get_position | ( | miVector & | position | ) | const [pure virtual] |
retrieves the position of the current element, 3D case.
position | is the output vector |
virtual Map_status mi::shader_v3::Map_lookup_base::get | ( | const Map_field_id | field_id, | |
float & | value | |||
) | const [pure virtual] |
retrieves the value of the desired field of the current element.
field_id | is the id of the desired field | |
value | is the float output value |
virtual Map_status mi::shader_v3::Map_lookup_base::get | ( | const Map_field_id | field_id, | |
int & | value | |||
) | const [pure virtual] |
retrieves the value of the desired field of the current element.
field_id | is the id of the desired field | |
value | is the integer output value |
virtual Map_status mi::shader_v3::Map_lookup_base::get | ( | const Map_field_id | field_id, | |
miVector & | value | |||
) | const [pure virtual] |
retrieves the value of the desired field of the current element.
field_id | is the id of the desired field | |
value | is the vector output value |
virtual Map_status mi::shader_v3::Map_lookup_base::get | ( | const Map_field_id | field_id, | |
miColor & | value | |||
) | const [pure virtual] |
retrieves the value of the desired field of the current element.
field_id | is the id of the desired field | |
value | is the color output value |
virtual Map_status mi::shader_v3::Map_lookup_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.
field_id | is the id of the desired field | |
value | is the pointer to the transform output value |
virtual Map_status mi::shader_v3::Map_lookup_base::get | ( | const Map_field_id | field_id, | |
float * | value | |||
) | const [pure virtual] |
retrieves the value of the desired field of the current element.
field_id | is the id of the desired field. | |
value | is the float array output value |
virtual Map_status mi::shader_v3::Map_lookup_base::get | ( | const Map_field_id | field_id, | |
int * | value | |||
) | const [pure virtual] |
retrieves the value of the desired field of the current element.
field_id | is the id of the desired field. | |
value | is the integer array output value |
virtual Map_status mi::shader_v3::Map_lookup_base::search | ( | const Map_distance_base & | distance_functor, | |
const miUint | max_elements = 1 , |
|||
const float | max_search_dist =
miHUGE_SCALAR |
|||
) | [pure virtual] |
searches for the closest elements to a given point.
distance_functor | provides search point and distances | |
max_elements | max num of elements to return | |
max_search_dist | is the max search distance from point, in the same metric as the distance functor |
virtual Map_status mi::shader_v3::Map_lookup_base::search | ( | const miVector & | point, | |
const miUint | max_elements = 1 , |
|||
const float | max_search_dist =
miHUGE_SCALAR |
|||
) | [pure virtual] |
searches for the closest elements to a given point, specialized case of the above for a simple quadratic distance in 3D.
point | is the three dimensional search point | |
max_elements | max num of elements to return | |
max_search_dist | is the max search distance from the point (quadratic) |
Copyright © 1986-2010 by
mental images GmbH