Panda3D
 All Classes Functions Variables Enumerations
eggComponentData.I
1 // Filename: eggComponentData.I
2 // Created by: drose (26Feb01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: EggComponentData::get_num_models
18 // Access: Public
19 // Description: Returns the maximum number of back pointers this
20 // component may have. The component may store a back
21 // pointer for models indexed 0 .. num_models -
22 // 1. You must call has_model() on each model
23 // index to confirm whether a particular model in that
24 // range has a back pointer.
25 ////////////////////////////////////////////////////////////////////
26 INLINE int EggComponentData::
27 get_num_models() const {
28  return _back_pointers.size();
29 }
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: EggComponentData::has_model
33 // Access: Public
34 // Description: Returns true if the component has a back pointer to
35 // an egg file somewhere for the indicated model, false
36 // otherwise.
37 ////////////////////////////////////////////////////////////////////
38 INLINE bool EggComponentData::
39 has_model(int model_index) const {
40  if (model_index >= 0 && model_index < (int)_back_pointers.size()) {
41  return _back_pointers[model_index] != (EggBackPointer *)NULL;
42  }
43  return false;
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: EggComponentData::get_model
48 // Access: Public
49 // Description: Returns the back pointer to an egg file for the
50 // indicated model if it exists, or NULL if it does not.
51 ////////////////////////////////////////////////////////////////////
53 get_model(int model_index) const {
54  if (model_index >= 0 && model_index < (int)_back_pointers.size()) {
55  return _back_pointers[model_index];
56  }
57  return (EggBackPointer *)NULL;
58 }
bool has_model(int model_index) const
Returns true if the component has a back pointer to an egg file somewhere for the indicated model...
int get_num_models() const
Returns the maximum number of back pointers this component may have.
EggBackPointer * get_model(int model_index) const
Returns the back pointer to an egg file for the indicated model if it exists, or NULL if it does not...
This stores a pointer from an EggJointData or EggSliderData object back to the referencing data in an...