gee_gallery.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_GALLERY_H
00021 #define GEE_GALLERY_H
00022 
00023 #include <gee_world.h>
00024 
00025 #include <vee_reference_object.h>
00026 
00027 #include <map>
00028 
00036 class GEE_Gallery
00037 {
00038 public:
00039   typedef std::map<GEE_id_t, VEE_RefPtr<GEE_World> > container;
00040   typedef container::iterator iterator;
00041 
00042   GEE_Gallery();
00043   ~GEE_Gallery();
00044 
00045   GEE_id_t takeSnapshot(GEE_World *, 
00046       GEE_id_t layer = -1,
00047       bool onlySelected = false);
00048 
00049   GEE_World * item(GEE_id_t id);
00050   VEE_RefPtr<GEE_World> * item2(GEE_id_t id);
00051   
00052   void clear();
00053 
00054   bool read(GEE_Io *);
00055   bool write(GEE_Io *);
00056   bool writeItem(const char *file, GEE_id_t id);
00057 
00058   void collectIds(GEE_IdContainer::id_remap &);
00059   void remapIds(GEE_IdContainer::id_remap &);
00060 
00061   void merge(GEE_Gallery &);
00062 
00063   iterator begin() { return m_worlds.begin(); }
00064   iterator end()   { return m_worlds.end(); }
00065   iterator getIndex(uint);
00066   void erase(iterator it);
00067 
00068   void setGarbageBin(VEE_GarbageBin * bin);
00069 
00070   uint size() { return m_worlds.size(); }
00071 
00072   static VEE_RefPtr<GEE_World> & getWorld(iterator & it) 
00073   { return (*it).second; }
00074   
00075   GEE_id_t itemId(int index);
00076 
00077 protected:
00078   container m_worlds;
00079   VEE_GarbageBin * m_deleted;
00080 };
00081 
00082 #endif

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