28 #ifndef _util_render_find_h
29 #define _util_render_find_h
31 #include <util/render/stack.h>
32 #include <util/render/parameter.h>
38 template <
class T1,
class T2>
40 find_parameter_in_stack(Stack<T1>& stack,
41 Parameter<T2>& (T1::*access)(),
46 for (
int i=stack.n()-1; i>=0; i--) {
47 if ((stack[i]->*access)().is_set()) {
48 if (!have_result || (stack[i]->*access)().overrides()) {
49 result = (stack[i]->*access)().value();
58 find_int_parameter_in_appearance_stack(Stack<Ref<Appearance> >& stack,
59 Parameter<int>& (Appearance::*access)(),
64 for (
int i=stack.n()-1; i>=0; i--) {
65 if ((stack[i].pointer()->*access)().is_set()) {
66 if (!have_result || (stack[i].pointer()->*access)().overrides()) {
67 result = (stack[i].pointer()->*access)().value();