gee_path_to_mesh.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_PATH_TO_MESH_H
00021 #define GEE_PATH_TO_MESH_H
00022 
00023 #include <gee_path_to_x.h>
00024 #include <gee_profile.h>
00025 
00026 #include <vee_reference_object.h>
00027 
00028 class GEE_TriangleMesh;
00029 
00032 class GEE_PathToMesh : public GEE_PathToX
00033 {
00034 public:
00035   GEE_PathToMesh(GEE_id_t pathId = -1, 
00036      GEE_id_t meshId = -1);
00037   virtual ~GEE_PathToMesh();
00038 
00039   virtual bool start(GEE_World *, const GEE_TimeStamp &);
00040   virtual bool stop(GEE_World *, const GEE_TimeStamp &);
00041 
00042   virtual bool read(GEE_Io *);
00043   virtual bool write(GEE_Io *);
00044   virtual const char * type() { return "GEE_PathToMesh"; }
00045 
00046   const GEE_Profile &profile() const { return m_profile; }
00047   void setProfile(const GEE_Profile &profile) 
00048   { m_profile = profile; }
00049 
00050   static void normalizeProfile(GEE_Profile * profile);
00051 
00052   GEE_TriangleMesh * triMesh();
00053 
00054   static GEE_Operator * create();
00055 
00056   GEE_Material & material() { return m_material; }
00057   void setMaterial(const GEE_Material &m) { m_material = m; }
00058 
00059   void setScale(float scale) { m_scale = scale; }
00060   void setRadius(float radius) { m_radius = radius; }
00061   void setThreshold(float t) { m_threshold = t; }
00062 
00063   void setAlignment(GEE_AlignMode m) { m_align = m; }
00064 
00065   void useNapra(bool withNapra) 
00066   { m_withNapra = withNapra; m_checkNapra = false; }
00067 
00068   void setSpecialFinger(int f)
00069   { m_specialFinger = f; }
00070 
00071   static VEE_Matrix4 createMatrix(const GEE_PathVertex3D &,
00072           float scale);
00073 
00074   float scale() const { return m_scale; }
00075 protected:
00076 
00077   virtual bool handleNewVertex(GEE_Path3D::iterator &);
00078 
00079   void setVerticesWithoutNapra(GEE_PathVertex3D & tv, 
00080              GEE_TriangleMesh * mesh);
00081   void setVerticesWithNapra(GEE_PathVertex3D & tv, 
00082           GEE_TriangleMesh * mesh);
00083 
00084   GEE_id_t    m_meshId;
00085   VEE_Vector3 m_prevLoc;
00086   VEE_Vector3 m_dir;
00087 
00088   GEE_Material         m_material;
00089   float                m_scale;
00090   float                m_radius;
00091   float                m_threshold;
00092   int                  m_align;
00093   bool                 m_newSegment;
00094   int                  m_segmentCount;
00095   bool                 m_withNapra;
00096   bool                 m_checkNapra;
00097   int                  m_specialFinger;
00098 
00099   VEE_RefPtr<GEE_Geometry> m_mesh;
00100 
00101   GEE_Profile m_profile;
00102 };
00103 
00104 #endif

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