1 
2 #include "BodyPart.h"
3 
4 
5 using namespace mdl;
6 
7 
BodyPart(MDLBodyPart * myPart)8 BodyPart::BodyPart(MDLBodyPart * myPart)
9 {
10     // Save the body part information
11     my_body_part = myPart;
12 }
13 
14 
~BodyPart()15 BodyPart::~BodyPart()
16 {
17     // Clean up the associated data
18     delete my_body_part;
19 }
20 
21 
getBodyPart()22 MDLBodyPart * BodyPart::getBodyPart()
23 {
24     return my_body_part;
25 }
26 
27 
addModel(Model * newModel)28 void BodyPart::addModel(Model * newModel)
29 {
30     // Add the new node to our list
31     part_models.push_back(newModel);
32 }
33 
34 
getNumModels()35 int BodyPart::getNumModels()
36 {
37     return part_models.size();
38 }
39 
40 
getModel(int partIndex)41 Model * BodyPart::getModel(int partIndex)
42 {
43     if ((partIndex < 0) || (partIndex >= static_cast<int>(part_models.size())))
44         return NULL;
45     else
46         return part_models[partIndex];
47 }
48 
49