VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtLightManagerStateAttribute.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef DtLightManagerStateAttribute_H_
11 #define DtLightManagerStateAttribute_H_
12 
13 #include <vrvCore/DtDe.h>
14 #include <vrvOsg/vrvOsg.h>
16 
17 #include <osg/StateAttribute>
18 
19 namespace makVrv
20 {
25  class DtLightManagerStateAttribute : public osg::StateAttribute
26  {
27  public:
28 
30  DtLightManagerStateAttribute(DtDe& de, bool enabled);
31 
34  const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
35  osg::StateAttribute(att, copyop), myDe(att.myDe)
36  {
37  }
38 
41 
43  virtual void apply(osg::State& state) const;
44 
45  // OSG-required overrides:
46  virtual osg::Object* cloneType() const
47  {
48  return new DtLightManagerStateAttribute(myDe, false);
49  }
50 
51  virtual osg::Object* clone(const osg::CopyOp& copyop) const
52  {
53  return new DtLightManagerStateAttribute(*this,copyop);
54  }
55 
56  virtual bool isSameKindAs(const osg::Object* obj) const {
57  return dynamic_cast<const DtLightManagerStateAttribute *>(obj) != 0;
58  }
59 
60  virtual const char *libraryName() const
61  {
62  return "vrvOsg";
63  }
64 
65  virtual const char *className() const
66  {
67  return "DtLightManagerStateAttribute";
68  }
69 
70  virtual Type getType() const
71  {
72  return (osg::StateAttribute::Type)1000;
73  }
74 
75  virtual bool getModeUsage(osg::StateAttribute::ModeUsage& usage) const
76  {
77  for (int lightNum = 1; lightNum < 8; lightNum++)
78  {
79  usage.usesMode(GL_LIGHT0 + lightNum);
80  }
81  return true;
82  }
83 
84  virtual int compare(const StateAttribute& sa) const
85  {
86  COMPARE_StateAttribute_Types(DtLightManagerStateAttribute, sa)
87  rhs;
88 
89  return 0;
90  }
91 
92  protected:
94  bool myEnabled;
95  };
96 
97 }
98 
99 #endif
100 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)