00001 #ifndef __NEBULA_VCLIP_H__
00002 #define __NEBULA_VCLIP_H__
00003
00004 class feature;
00005 class vertex;
00006 class face;
00007
00008 class plane {
00009 public:
00010 plane(feature* feat0,feature* feat1) {
00011
00012 }
00013 float dist(math::vec3<double> v)
00014 {
00015 return 0.0;
00016 }
00017 math::vec3<double> n;
00018 };
00019 class polyhedron
00020 {
00021 public:
00022 std::set<face*> f;
00023 };
00024 class feature
00025 {
00026 public:
00027 };
00028 class face: public feature
00029 {
00030 public:
00031 std::set<feature*> e;
00032 plane p;
00033 };
00034 class edge: public feature
00035 {
00036 public:
00037 math::vec3<double> at(float l);
00038 vertex* other(vertex*);
00039
00040
00041 math::vec3<double> u;
00042 vertex* t;
00043 vertex* h;
00044 face* f[2];
00045 };
00046 class vertex: public feature
00047 {
00048 public:
00049 std::set<feature*> e;
00050 math::vec3<double> v;
00051 };
00052 math::vec3<double> edge::at(float l)
00053 {
00054 return h->v - t->v;
00055 }
00056
00057
00058
00059 class vclip
00060 {
00061 public:
00062 enum rc
00063 {
00064 SIMPLY_EXCLUDED,
00065 NOT_EXCLUDED,
00066 EXCLUDED,
00067 CONTINUE,
00068 PENETRATION,
00069 NEXT,
00070 DONE
00071 };
00072
00073
00074
00075 rc clip(edge* e, feature* feat0, std::set<feature*> feats);
00076 feature* post(face* f, edge* e, float l);
00077 rc handleLocalMin(int a, face* f, vertex* v);
00078 rc vvstate();
00079 rc vvstate(int,int);
00080 rc vestate(int,int);
00081 rc vfstate(int,int);
00082 rc eestate();
00083 rc eestate(int,int);
00084
00085
00086 polyhedron* poly_[2];
00087
00088 feature* x_[2];
00089
00090 feature* N_[2];
00091 };
00092
00093 #endif