]> git.mxchange.org Git - simgear.git/blob - simgear/scene/model/ConditionNode.hxx
Add preliminary spot light animation
[simgear.git] / simgear / scene / model / ConditionNode.hxx
1 // Copyright (C) 2010 Tim Moore (timoore33@gmail.com)
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Library General Public
5 // License as published by the Free Software Foundation; either
6 // version 2 of the License, or (at your option) any later version.
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 GNU
11 // Library General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16 //
17
18 #ifndef SIMGEAR_CONDITIONNODE_HXX
19 #define SIMGEAR_CONDITIONNODE_HXX 1
20
21 #include <simgear/props/condition.hxx>
22 #include <osg/Group>
23
24 namespace simgear
25 {
26 /**
27  * If the condition is true, traverse the first child; otherwise,
28  * traverse the second if it exists.
29  */
30 class ConditionNode : public osg::Group
31 {
32 public:
33     ConditionNode();
34     ConditionNode(const ConditionNode& rhs,
35               const osg::CopyOp& op = osg::CopyOp::SHALLOW_COPY);
36     META_Node(simgear,ConditionNode);
37     ~ConditionNode();
38     const SGCondition* getCondition() const { return _condition.ptr(); }
39     void setCondition(const SGCondition* condition) { _condition = condition; }
40
41     virtual void traverse(osg::NodeVisitor& nv);
42 protected:
43     SGSharedPtr<SGCondition const> _condition;
44 };
45
46 }
47 #endif