Graphic.hpp

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 /* COPYRIGHT
00004  *
00005  * This file is part of the Simple Object Loader and Renderer - SOLAR
00006  *
00007  * Read the file "SOLAR-LICENSE" for the license.
00008  *
00009  * Authors & Copyright:
00010  *
00011  * Tommi Ilmonen, 2001-2003, except LWO-code by RJ, 2001-2003
00012  *
00013  * Tommi's email: firstname.lastname@hut.fi
00014  *
00015  */
00016 
00017 #ifndef SOLAR_GRAPHIC_HPP
00018 #define SOLAR_GRAPHIC_HPP
00019 
00020 #include <Fluid/Vector3.hpp>
00021 #include <Fluid/Matrix3.hpp>
00022 
00023 #include <iosfwd>
00024 #include <string>
00025 
00026 #include <Solar/BoundingBox.hpp>
00027 #include <Solar/Garbage.hpp>
00028 
00029 namespace Solar {
00030 
00031   // class BoundingBox;
00032 class Renderer;
00033 
00037   class Graphic : public Garbage
00038   {
00039   public:
00040 
00041   enum Type {
00042     Triangles,
00043     TriangleMesh,
00044     TriangleStrips,
00045     Extension
00046   };
00047 
00048   Graphic() : m_generation(0) {}
00049   virtual ~Graphic() {}
00050 
00052   virtual Type type() const = 0;
00054   virtual void getBoundingBox(BoundingBox *bbox) = 0;
00055 
00056   virtual int nofPrimitives() const = 0;
00057 
00058   virtual void render(Renderer *) = 0;
00059   virtual void scale(const Fluid::Vector3 &) = 0;
00060   virtual void move(const Fluid::Vector3 &) = 0;
00061   virtual void transform(const Fluid::Matrix3 &) = 0;
00062 
00063   virtual void write(std::ostream *) = 0;
00064 
00065   const std::string & material() const { return m_material; }
00066   void setMaterial(const std::string &material) { m_material = material; }
00067   void setMaterial(const char *material) { m_material = material; }
00068 
00069   int generation() const { return m_generation; }
00070   void newGeneration() { m_generation++; }
00071 
00072 private:
00073   std::string m_material;
00074   int m_generation;
00075 };
00076 
00077 } // namespace Solar
00078 
00079 
00080 #endif

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