OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ColorMaski.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 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_COLORMASKI
15 #define OSG_COLORMASKI 1
16 
17 #include <osg/ColorMask>
18 
19 namespace osg {
20 
24 {
25  public :
26 
27  ColorMaski();
28 
29  ColorMaski(unsigned int buf, bool red, bool green, bool blue, bool alpha):
30  ColorMask(red, green,blue,alpha),
31  _index(buf) {}
32 
35  ColorMask(cm,copyop),
36  _index(cm._index) {}
37 
38  META_StateAttribute(osg, ColorMaski, COLORMASK);
39 
41  virtual int compare(const StateAttribute& sa) const
42  {
43  // Check for equal types, then create the rhs variable
44  // used by the COMPARE_StateAttribute_Parameter macros below.
46 
48 
49  return ColorMask::compare(sa);
50  }
51 
53  virtual unsigned int getMember() const { return _index; }
54 
56  void setIndex(unsigned int buf) { _index = buf; }
57 
59  unsigned int getIndex() const { return _index; }
60 
61  virtual void apply(State& state) const;
62 
63  protected:
64 
65  virtual ~ColorMaski();
66 
67  unsigned int _index;
68 
69 };
70 
71 }
72 
73 #endif
ColorMaski(unsigned int buf, bool red, bool green, bool blue, bool alpha)
Definition: ColorMaski.h:29
#define OSG_EXPORT
Definition: Export.h:43
virtual int compare(const StateAttribute &sa) const
Definition: ColorMaski.h:41
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
ColorMaski(const ColorMaski &cm, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition: ColorMaski.h:34
unsigned int getIndex() const
Definition: ColorMaski.h:59
virtual unsigned int getMember() const
Definition: ColorMaski.h:53
#define META_StateAttribute(library, name, type)
virtual int compare(const StateAttribute &sa) const
Definition: ColorMask.h:49
Definition: AlphaFunc.h:19
#define COMPARE_StateAttribute_Parameter(parameter)
unsigned int _index
Definition: ColorMaski.h:67
void setIndex(unsigned int buf)
Definition: ColorMaski.h:56