Initial revision

This commit is contained in:
Don BURNS
2001-01-10 16:32:10 +00:00
parent 7c12eb9361
commit 70208ebc06
461 changed files with 70936 additions and 0 deletions

45
include/osg/Switch Normal file
View File

@@ -0,0 +1,45 @@
#ifndef OSG_SWITCH
#define OSG_SWITCH 1
#include <osg/Group>
namespace osg {
/** Switch - Group node which allows switching between children.
Typical uses would be for objects which might need to be rendered
differently at different times, for instance a switch could be used
to represent the different states of a traffic light.
*/
class SG_EXPORT Switch : public Group
{
public :
enum SwitchType {
ALL_CHILDREN_ON=-1,
ALL_CHILDREN_OFF=-2
};
Switch();
virtual Object* clone() const { return new Switch(); }
virtual bool isSameKindAs(Object* obj) { return dynamic_cast<Switch*>(obj)!=NULL; }
virtual const char* className() const { return "Switch"; }
virtual void accept(NodeVisitor& nv) { nv.apply(*this); }
virtual void traverse(NodeVisitor& nv);
void setVal(int val) { _value = val; }
int getVal() const { return _value; }
protected :
virtual ~Switch() {}
virtual bool readLocalData(Input& fr);
virtual bool writeLocalData(Output& fw);
int _value;
};
};
#endif