gee_id.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 /* COPYRIGHT
00004  *
00005  * This file is part of the Visual Effects Engine - VEE
00006  *
00007  * Read the "VEE-LICENSE" file for the license.
00008  *
00009  * Authors & Copyright:   
00010  *
00011  * Tommi Ilmonen, Tuukka Heikura, Marko Myllymaa and 
00012  * Janne Kontkanen 2001-2004
00013  *
00014  * Additional copyrights: Tekes 2003-2004
00015  *
00016  * firstname.lastname@hut.fi
00017  *
00018  */
00019 
00020 #ifndef GEE_ID_H
00021 #define GEE_ID_H
00022 
00023 #include <gee_config.h>
00024 
00025 #include <map>
00026 #include <set>
00027 
00028 class GEE_Io;
00029 
00046 class GEE_IdContainer
00047 {
00048 public:
00049 
00050   typedef std::set<int> id_distances;
00051   typedef std::set<GEE_id_t> id_container;
00052   typedef id_distances::iterator id_iterator;
00053 
00054   typedef std::map<GEE_id_t, GEE_id_t> id_remap;
00055 
00056   GEE_IdContainer();
00057   GEE_IdContainer(const GEE_IdContainer &);
00058   virtual ~GEE_IdContainer();
00059 
00060   id_iterator idBegin() { return m_idDistances.begin(); }
00061   id_iterator idEnd()   { return m_idDistances.end(); }
00062 
00063   GEE_id_t getIdMember(id_iterator it);
00064   void addIdMember(GEE_id_t *);
00065 
00066   virtual id_container * getExtraIds();
00067   virtual bool remapIdMembers(id_remap &);
00068   virtual void addIdsToRemap(id_remap &);
00069 
00070   static GEE_id_t allocateId();
00071 
00072   GEE_id_t id() const { return m_id; }
00073   void setId(GEE_id_t id) { m_id = id; }
00075   void autoId() { m_id = allocateId(); }
00076 
00077   GEE_id_t layer() const { return m_layer; }
00078   void setLayer(GEE_id_t layer) { m_layer = layer; }
00079 
00080   static bool writeIds(GEE_Io *, id_container *);
00081   static bool readIds(GEE_Io *, id_container *);
00082   
00083 private:
00084   id_distances m_idDistances;
00085 protected:
00086   GEE_id_t m_id;
00087   GEE_id_t m_layer;
00088 };
00089 
00090 #endif

Generated on Mon Mar 12 21:09:00 2007 for VEE - The Visual Effects Engine by  doxygen 1.4.6