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_X_H 00021 #define GEE_PATH_TO_X_H 00022 00023 #include <gee_edit_set.h> 00024 #include <gee_operator.h> 00025 #include <gee_path.h> 00026 00027 class GEE_PathToX : public GEE_Operator 00028 { 00029 public: 00030 GEE_PathToX(GEE_id_t pathId = -1, 00031 GEE_id_t pathId2 = -1); 00032 virtual ~GEE_PathToX(); 00033 00034 virtual bool start(GEE_World *, const GEE_TimeStamp &); 00035 virtual bool act(GEE_World *, const GEE_TimeStamp &); 00036 virtual bool stop(GEE_World *, const GEE_TimeStamp &); 00037 00038 bool readPathId(GEE_Io *); 00039 bool writePathId(GEE_Io *); 00040 00041 uint processedPathVertices() const { return m_processedPathVertices; } 00042 00043 void setShowToolSphere(bool show) { m_showToolSphere = show; } 00044 void setToolSphereRadius(float r) { m_sphereRadius = r; } 00045 00046 GEE_id_t pathId() const { return m_pathId; } 00047 00048 protected: 00049 00050 virtual bool handleNewVertex(GEE_Path3D::iterator &); 00051 virtual bool handleNewVertices(GEE_Path3D::iterator &, 00052 GEE_Path3D::iterator &); 00053 00054 void addEditedGeometry(GEE_Geometry *g) { m_edits.addGeo(g); } 00055 private: 00056 00057 bool initializePath(GEE_World *w, GEE_id_t id); 00058 00059 bool handlePath(GEE_World *, const GEE_TimeStamp & tworld); 00060 bool handleTwoPaths(GEE_World *, const GEE_TimeStamp & tworld); 00061 00062 inline GEE_Path3D * getPath(GEE_World *, GEE_id_t); 00063 00064 GEE_id_t m_pathId; 00065 GEE_id_t m_pathId2; 00066 GEE_id_t m_sphereId; 00067 00068 int m_pathIterator1; 00069 int m_pathIterator2; 00070 bool m_nodeIsUsed; 00071 bool m_showToolSphere; 00072 float m_sphereRadius; 00073 GEE_EditSet m_edits; 00074 00075 00076 uint m_processedPathVertices; 00077 }; 00078 00079 #endif