Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

model::ReferenceModel Class Reference
[The PCG model layer]

An ReferenceModel in PCG. More...

#include <ReferenceModel.h>

Inheritance diagram for model::ReferenceModel:

Inheritance graph
[legend]
Collaboration diagram for model::ReferenceModel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ReferenceModel ()
 ReferenceModel (Skeleton *skeleton)
 ~ReferenceModel ()
 ReferenceModel (const ReferenceModel &other)
ReferenceModeloperator= (const ReferenceModel &other)
SkeletongetSkeleton ()
void setSkeleton (Skeleton *skeleton)
bool save (char *filename)
bool save (ofstream *saveFile)
bool load (char *filename)
bool load (ifstream *loadFile)

Private Attributes

Skeletonm_skeleton

Detailed Description

An ReferenceModel in PCG.

Definition at line 19 of file ReferenceModel.h.


Constructor & Destructor Documentation

ReferenceModel::ReferenceModel  ) 
 

Definition at line 5 of file ReferenceModel.cpp.

References m_skeleton.

00005                                {
00006         m_skeleton = new Skeleton();
00007 }

ReferenceModel::ReferenceModel Skeleton skeleton  ) 
 

Write brief comment for ReferenceModel here.

Parameters:
skeleton Description of parameter skeleton.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for ReferenceModel here.

Remarks:
Write remarks for ReferenceModel here.
See also:
Separate items with the '|' character.

Definition at line 26 of file ReferenceModel.cpp.

References m_skeleton.

00026                                                  {
00027         m_skeleton = skeleton;
00028 }

model::ReferenceModel::~ReferenceModel  )  [inline]
 

Write brief comment for ~ReferenceModel here.

Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for ~ReferenceModel here.

Remarks:
Write remarks for ~ReferenceModel here.
See also:
Separate items with the '|' character.

Definition at line 42 of file ReferenceModel.h.

00042 {};

ReferenceModel::ReferenceModel const ReferenceModel other  ) 
 

Write brief comment for ReferenceModel here.

Parameters:
other Description of parameter other.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for ReferenceModel here.

Remarks:
Write remarks for ReferenceModel here.
See also:
Separate items with the '|' character.

Definition at line 47 of file ReferenceModel.cpp.

References model::Model::m_annotations, model::Model::m_contours, model::Model::m_faces, model::Model::m_landmarks, m_skeleton, and model::Model::m_vertexs.

00047                                                           {
00048         m_skeleton = other.m_skeleton;
00049         m_vertexs = other.m_vertexs;
00050         m_faces = other.m_faces;
00051         m_landmarks = other.m_landmarks;
00052         m_contours = other.m_contours;
00053         m_annotations = other.m_annotations;
00054 }  


Member Function Documentation

Skeleton * ReferenceModel::getSkeleton  ) 
 

Write brief comment for getSkeleton here.

Returns:
Write description of return value here.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for getSkeleton here.

Remarks:
Write remarks for getSkeleton here.
See also:
Separate items with the '|' character.

Definition at line 111 of file ReferenceModel.cpp.

Referenced by pcggui::ConvertBone(), and pcggui::ConvertSkin().

00111                                       {
00112         return m_skeleton;
00113 }

bool ReferenceModel::load ifstream *  loadFile  ) 
 

Write brief comment for load here.

Parameters:
loadFile Description of parameter loadFile.
Returns:
Write description of return value here.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for load here.

Remarks:
Write remarks for load here.
See also:
Separate items with the '|' character.

Reimplemented from model::Model.

Definition at line 250 of file ReferenceModel.cpp.

References model::Model::load().

00250                                             {
00251         bool res = Model::load(loadFile);
00252         if(res) {
00253                 string line;
00254                 vector<string> tokens;
00255                 vector<string> coords;
00256                 
00257                 if(loadFile->is_open()) {
00258                         getline(*loadFile,line);//Skeleton
00259                         getline(*loadFile,line);//Data
00260                         return true;
00261                 } else {
00262                         return false;
00263                 }
00264         } else {
00265                 return false;
00266         }
00267 }

Here is the call graph for this function:

bool ReferenceModel::load char *  filename  ) 
 

Write brief comment for load here.

Parameters:
filename Description of parameter filename.
Returns:
Write description of return value here.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for load here.

Remarks:
Write remarks for load here.
See also:
Separate items with the '|' character.

Reimplemented from model::Model.

Definition at line 222 of file ReferenceModel.cpp.

Referenced by model::Analyzer::load(), and pcggui::LoadAll().

00222                                         {
00223         ifstream loadFile(filename);
00224         bool res = load(&loadFile);
00225         loadFile.close();
00226         return res;
00227 }

ReferenceModel & ReferenceModel::operator= const ReferenceModel other  ) 
 

Write brief comment for operator = here.

Parameters:
other Description of parameter other.
Returns:
Write description of return value here.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for operator = here.

Remarks:
Write remarks for operator = here.
See also:
Separate items with the '|' character.

Definition at line 77 of file ReferenceModel.cpp.

References model::Model::m_annotations, model::Model::m_contours, model::Model::m_faces, model::Model::m_landmarks, m_skeleton, and model::Model::m_vertexs.

00078 {
00079     // if same object
00080     if ( this == &other )
00081         return *this;
00082         
00083         m_skeleton = other.m_skeleton;
00084         m_vertexs = other.m_vertexs;
00085         m_faces = other.m_faces;
00086         m_landmarks = other.m_landmarks;
00087         m_contours = other.m_contours;
00088         m_annotations = other.m_annotations;
00089 
00090     return *this;
00091 }  

bool ReferenceModel::save ofstream *  saveFile  ) 
 

Write brief comment for save here.

Parameters:
saveFile Description of parameter saveFile.
Returns:
Write description of return value here.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for save here.

Remarks:
Write remarks for save here.
See also:
Separate items with the '|' character.

Reimplemented from model::Model.

Definition at line 186 of file ReferenceModel.cpp.

References model::Model::save().

00186                                             {
00187         bool res = Model::save(saveFile);
00188         if(res) {
00189                 if(saveFile->is_open()) {
00190                         *saveFile << "Skeleton\n";
00191                         //m_skeleton->getBones();
00192                         return true;
00193                 } else {
00194                         return false;
00195                 }
00196         } else {
00197                 return false;
00198         }
00199 }

Here is the call graph for this function:

bool ReferenceModel::save char *  filename  ) 
 

Write brief comment for save here.

Parameters:
filename Description of parameter filename.
Returns:
Write description of return value here.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for save here.

Remarks:
Write remarks for save here.
See also:
Separate items with the '|' character.

Reimplemented from model::Model.

Definition at line 158 of file ReferenceModel.cpp.

Referenced by model::Analyzer::save().

00158                                         {
00159         ofstream saveFile(filename);
00160         bool res = save(&saveFile);
00161         saveFile.close();
00162         return res;
00163 }

void ReferenceModel::setSkeleton Skeleton skeleton  ) 
 

Write brief comment for setSkeleton here.

Parameters:
skeleton Description of parameter skeleton.
Exceptions:
<exception class> Description of criteria for throwing this exception.
Write detailed description for setSkeleton here.

Remarks:
Write remarks for setSkeleton here.
See also:
Separate items with the '|' character.

Definition at line 133 of file ReferenceModel.cpp.

References m_skeleton.

00133                                                    {
00134         m_skeleton = skeleton;
00135 }


Member Data Documentation

Skeleton* model::ReferenceModel::m_skeleton [private]
 

Definition at line 21 of file ReferenceModel.h.

Referenced by operator=(), ReferenceModel(), and setSkeleton().


The documentation for this class was generated from the following files:
Generated on Tue Apr 17 09:40:06 2007 for PCG Library by  doxygen 1.3.9.1