#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. 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 | 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() ) { ... }
|
returns true if it's beyond the end.
|
|
retrieves the value of the desired field of the current element.
|
|
retrieves the value of the desired field of the current element.
|
|
retrieves the value of the desired field of the current element. NOTE: 'value' is a pointer to a miMatrix.
|
|
retrieves the value of the desired field of the current element.
|
|
retrieves the value of the desired field of the current element.
|
|
retrieves the value of the desired field of the current element.
|
|
retrieves the value of the desired field of the current element.
|
|
returns a copy of the current element.
|
|
returns the current lookup entry.
|
|
returns the n-th entry of the lookup.
|
|
returns the distance of the current element.
|
|
returns the index in the map of the current element.
|
|
retrieves the position of the current element, 3D case.
|
|
retrieves the position of the current element.
|
|
returns true if the lookup is empty.
|
|
moves to the next element.
|
|
resets itself to point to the first element.
|
|
searches for the closest elements to a given point, specialized case of the above for a simple quadratic distance in 3D.
|
|
searches for the closest elements to a given point.
|
|
returns the number of elements in the lookup.
|
|
sorts the elements in ascending order of distance.
|
|
sorts the elements in descending order of distance.
|
Copyright © 1986-2009 by
mental images GmbH