panda3d/panda/src/pgraph/selectiveChildNode.h
2002-03-06 18:06:00 +00:00

70 lines
2.0 KiB
C++

// Filename: selectiveChildNode.h
// Created by: drose (06Mar02)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef SELECTIVECHILDNODE_H
#define SELECTIVECHILDNODE_H
#include "pandabase.h"
#include "pandaNode.h"
////////////////////////////////////////////////////////////////////
// Class : SelectiveChildNode
// Description : A base class for nodes like LODNode and SequenceNode
// that select only one visible child at a time.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA SelectiveChildNode : public PandaNode {
PUBLISHED:
INLINE SelectiveChildNode(const string &name);
public:
INLINE SelectiveChildNode(const SelectiveChildNode &copy);
INLINE void operator = (const SelectiveChildNode &copy);
virtual bool has_selective_visibility() const;
virtual int get_first_visible_child() const;
virtual int get_next_visible_child(int n) const;
protected:
INLINE void select_child(int n);
private:
int _selected_child;
public:
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
PandaNode::init_type();
register_type(_type_handle, "SelectiveChildNode",
PandaNode::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;
};
#include "selectiveChildNode.I"
#endif