OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ColorMatrix.h
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 
14 #ifndef OSG_COLORMATRIX
15 #define OSG_COLORMATRIX 1
16 
17 #include <osg/Matrix>
18 #include <osg/StateAttribute>
19 
20 namespace osg {
21 
24 {
25  public :
26 
27  ColorMatrix();
28 
31  StateAttribute(cm,copyop),
32  _matrix(cm._matrix) {}
33 
34  META_StateAttribute(osg, ColorMatrix, COLORMATRIX);
35 
37  virtual int compare(const StateAttribute& sa) const
38  {
39  // Check for equal types, then create the rhs variable
40  // used by the COMPARE_StateAttribute_Parameter macros below.
42 
43  // Compare each parameter in turn against the rhs.
45 
46  return 0; // Passed all the above comparison macros, so must be equal.
47  }
48 
50  inline void setMatrix(const Matrix& matrix) { _matrix = matrix; }
51 
53  inline Matrix& getMatrix() { return _matrix; }
54 
56  inline const Matrix& getMatrix() const { return _matrix; }
57 
59  virtual void apply(State& state) const;
60 
61  protected:
62 
63  virtual ~ColorMatrix( void );
64 
66 
67 };
68 
69 }
70 
71 
72 #endif
#define OSG_EXPORT
Definition: Export.h:43
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
virtual int compare(const StateAttribute &sa) const
Definition: ColorMatrix.h:37
const Matrix & getMatrix() const
Definition: ColorMatrix.h:56
void setMatrix(const Matrix &matrix)
Definition: ColorMatrix.h:50
#define META_StateAttribute(library, name, type)
Definition: AlphaFunc.h:19
Matrix & getMatrix()
Definition: ColorMatrix.h:53
#define COMPARE_StateAttribute_Parameter(parameter)
ColorMatrix(const ColorMatrix &cm, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition: ColorMatrix.h:30