73 lines
2.2 KiB
C++
73 lines
2.2 KiB
C++
// Filename: eggComponentData.h
|
|
// Created by: drose (26Feb01)
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
//
|
|
// 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 EGGCOMPONENTDATA_H
|
|
#define EGGCOMPONENTDATA_H
|
|
|
|
#include <pandatoolbase.h>
|
|
|
|
#include <namable.h>
|
|
|
|
class EggCharacterCollection;
|
|
class EggCharacterData;
|
|
class EggBackPointer;
|
|
class EggObject;
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Class : EggComponentData
|
|
// Description : This is the base class of both EggJointData and
|
|
// EggSliderData. It represents a single component of a
|
|
// character, either a joint or a slider, along with
|
|
// back pointers to the references to this component in
|
|
// all model and animation egg files read.
|
|
////////////////////////////////////////////////////////////////////
|
|
class EggComponentData : public Namable {
|
|
public:
|
|
EggComponentData(EggCharacterCollection *collection,
|
|
EggCharacterData *char_data);
|
|
virtual ~EggComponentData();
|
|
|
|
void add_name(const string &name);
|
|
bool matches_name(const string &name) const;
|
|
|
|
virtual void add_back_pointer(int model_index, EggObject *egg_object)=0;
|
|
virtual void write(ostream &out, int indent_level = 0) const=0;
|
|
|
|
INLINE int get_num_models() const;
|
|
INLINE bool has_model(int model_index) const;
|
|
INLINE EggBackPointer *get_model(int model_index) const;
|
|
void set_model(int model_index, EggBackPointer *back);
|
|
|
|
protected:
|
|
|
|
// This points back to all the egg structures that reference this
|
|
// particular table or slider.
|
|
typedef pvector<EggBackPointer *> BackPointers;
|
|
BackPointers _back_pointers;
|
|
|
|
|
|
EggCharacterCollection *_collection;
|
|
EggCharacterData *_char_data;
|
|
};
|
|
|
|
#include "eggComponentData.I"
|
|
|
|
#endif
|
|
|
|
|