Main Page   Class Hierarchy   Compound List   File List   Compound Members  

cganim::AnimationData Class Reference

Contains animation data as well as loading facility. More...

#include <animdata.h>

List of all members.

Public Member Functions

 AnimationData ()
 Default constructor.

void Load (const std::string &filename)
 Load source animation data from given filename.

bool IsLoaded () const
 Return true if the file is already loaded.

int GetNObjects () const
 Return total number of objects.

const AnimObjectGetAnimObject (int i) const
 Return i-th object.

AnimObjectGetAnimObject (int i)
 Return i-th object.

gml::Camera * GetCamera ()
 Return camera.

int GetNLights () const
 Return number of lights in the scene.

gml::Vector3d GetLightPosition (int i) const
 Return position of i-th point light.


Detailed Description

Contains animation data as well as loading facility.

Usage:

  // include GML lib required include
  #include "../csl/base/gmlcommon.h"
  
    // include animdata headers
    #include "../animdata/include/animdata.h"
    #include "../animdata/include/exception.h"
    #include "../animdata/include/sphere.h"
    #include "../animdata/include/rectangle.h"
    
    using namespace gml;
    using namespace cganim;
 
   ...

   AnimationData* anim_data = new AnimationData;
  
  try
    {
    anim_data->Load("..\\demos\\simple.cganim");
    }
  catch(IOException& ex)
    {
    printf("Loading error: %s", ex.What().c_str());
    return -1;
    }

  for(int i = 0; i < anim_data->GetNObjects(); ++i)
    {
    AnimObject* obj = anim_data->GetAnimObject(i);

    Sphere* sphere = dynamic_cast<Sphere*>(obj);
    if (sphere != NULL)
      {
      printf("Sphere object found\n");
      continue;
      }

    Rectangle* rect = dynamic_cast<Rectangle*>(obj);
    if (rect != NULL)
      {
      printf("Rect object found\n");
      continue;
      };
    }
  delete anim_data;


The documentation for this class was generated from the following file:
Generated on Wed May 5 13:20:39 2004 for AnimDatalibrary by doxygen1.3