Panda3D

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