Scene Class Reference

#include <Scene.hpp>

List of all members.

Public Member Functions

size_t nbObjects () const
 Returns the number of Object.
void add (ConstReferenceCounting< Object > o)
ConstReferenceCounting< Objectobject (const size_t &i) const
 Read-only access to the Object i.
int getReferenceNumber (const TinyVector< 3, real_t > &t) const
 Scene ()
 Scene (const Scene &S)
 ~Scene ()

Private Types

typedef std::map< TinyVector
< 3, real_t >, int,
Scene::VectorOrder
ReferenceMap
 references list

Private Attributes

std::vector
< ConstReferenceCounting
< Object > > 
__objects
 The vector containing objects.
ReferenceMap __references

Classes

struct  VectorOrder


Detailed Description

Definition at line 45 of file Scene.hpp.


Member Typedef Documentation

typedef std::map<TinyVector<3,real_t>, int, Scene::VectorOrder> Scene::ReferenceMap [private]

references list

Definition at line 80 of file Scene.hpp.


Constructor & Destructor Documentation

Scene::Scene (  ) 

Default Constructor

Definition at line 27 of file Scene.cpp.

00028 {
00029   ;
00030 }

Scene::Scene ( const Scene S  ) 

Copy constructor

Parameters:
S a Scene

Definition at line 32 of file Scene.cpp.

00033   : __objects(S.__objects),
00034     __references(S.__references)
00035 {
00036   ;
00037 }

Scene::~Scene (  )  [inline]

Destructor

Definition at line 144 of file Scene.hpp.

00145   {
00146     ;
00147   }


Member Function Documentation

size_t Scene::nbObjects (  )  const [inline]

Returns the number of Object.

Definition at line 85 of file Scene.hpp.

References __objects.

Referenced by InsideListExpressionLeaf::objects().

00086   {
00087     return __objects.size();
00088   }

void Scene::add ( ConstReferenceCounting< Object o  )  [inline]

Stores the object o and checks its reference

Parameters:
o the object to add

Definition at line 95 of file Scene.hpp.

References __objects, and __references.

00096   {
00097     if (o->hasReference()) {
00098       ReferenceMap::iterator i = __references.find(o->reference());
00099       if (i == __references.end()) {
00100         int size = __references.size();
00101         __references[o->reference()] = size;
00102       }
00103     }
00104 
00105     // finaly store the object
00106     __objects.push_back(o);
00107   }

ConstReferenceCounting<Object> Scene::object ( const size_t &  i  )  const [inline]

Read-only access to the Object i.

Definition at line 110 of file Scene.hpp.

References __objects, and ASSERT.

Referenced by InsideListExpressionLeaf::objects().

00111   {
00112     ASSERT (i<__objects.size());
00113     return __objects[i];
00114   }

int Scene::getReferenceNumber ( const TinyVector< 3, real_t > &  t  )  const [inline]

Definition at line 116 of file Scene.hpp.

References __references, ErrorHandler::normal, and stringify().

00117   {
00118     ReferenceMap::const_iterator i = __references.find(t);
00119     if (i == __references.end()) {
00120       throw ErrorHandler(__FILE__,__LINE__,
00121                          stringify(t)+" reference has not been found",
00122                          ErrorHandler::normal);
00123     }
00124     return i->second;
00125   }

Here is the call graph for this function:


Member Data Documentation

The vector containing objects.

Definition at line 49 of file Scene.hpp.

Referenced by add(), nbObjects(), and object().

Definition at line 81 of file Scene.hpp.

Referenced by add(), and getReferenceNumber().


The documentation for this class was generated from the following files:

Generated on Wed Nov 19 00:13:52 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6