OpenSceneGraph 3.6.5
Validator
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13//osgFX - Copyright (C) 2003 Marco Jez
14
15#ifndef OSGFX_VALIDATOR_
16#define OSGFX_VALIDATOR_
17
18#include <osgFX/Effect>
19
20#include <osg/ref_ptr>
21#include <osg/StateAttribute>
22
23#include <vector>
24
25namespace osgFX
26{
27
36 public:
37
39 Validator(Effect* effect);
41
43
44 void apply(osg::State& state) const;
45 void compileGLObjects(osg::State& state) const;
46
47 inline int compare(const osg::StateAttribute& sa) const;
48
49 inline void disable() { _effect = 0; }
50
51 protected:
52 virtual ~Validator() {}
53 Validator& operator=(const Validator&) { return *this; }
54
55 private:
56 mutable Effect* _effect;
57 };
58
59 // INLINE METHODS
60
61 inline int Validator::compare(const osg::StateAttribute& sa) const
62 {
63 // check the types are equal and then create the rhs variable
64 //used by the COMPARE_StateAttribute_Parameter macros below.
66
67 // compare parameters
69
70 return 0;
71 }
72
73}
74
75#endif
#define COMPARE_StateAttribute_Parameter(parameter)
COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(....
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(....
Definition StateAttribute:57
The osgFX library is a NodeKit that extends the core scene graph to provide a special effects framewo...
Definition AnisotropicLighting:25
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
@ VALIDATOR
osgFX namespace
Definition StateAttribute:172
The base class for special effects.
Definition Effect:66
void apply(osg::State &state) const
apply the OpenGL state attributes.
Validator(const Validator &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
int compare(const osg::StateAttribute &sa) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition Validator:61
void disable()
Definition Validator:49
Validator & operator=(const Validator &)
Definition Validator:53
Validator(Effect *effect)
virtual ~Validator()
Definition Validator:52
void compileGLObjects(osg::State &state) const
Default to nothing to compile - all state is applied immediately.
META_StateAttribute(osgFX, Validator, VALIDATOR)
#define OSGFX_EXPORT
Definition Export:27

osg logo
Generated at Sun Jul 20 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.