00001 #ifndef SYNAPS_SHAPE_GAIA_H
00002 #define SYNAPS_SHAPE_GAIA_H
00003
00004 #include <shape/shape.hpp>
00005 #include <shape/parametric_surface.hpp>
00006
00007 #include <shape/fxv.hpp>
00008 #include <shape/ssi/ssi_base_aabb.hpp>
00009 #include <shape/ssi/ssi_igraph.hpp>
00010 #include <shape/ssi/ssi_vcode.hpp>
00011 #include <shape/mesh3d.hpp>
00012
00013 namespace mmx {
00014
00015 static const int cfsz_ = 0;
00016 static const int cflq_ = 1;
00017 static const int cfex_ = 2;
00018 static const int cfbg_ = 3;
00019
00020 static const int cfhsz = 1 + 1 + 1;
00021
00022 namespace shape {
00023
00024 struct ssi_def {};
00025
00026 template<class C>
00027 struct use<ssi_def,C> {
00028 typedef parametric_surface<C> ParametricSurface;
00029 typedef mesh3d<C> Mesh;
00030
00031 static void sample(const ParametricSurface* s, C* lp, unsigned m, unsigned n, C* u, C* v) {
00032 s->sample(lp,m,n,u,v);
00033 }
00034
00035 static void eval(ParametricSurface* s, C* r, const C* u, unsigned n) {
00036 for (unsigned i=0; i<n;i++) {
00037 s->eval(r[0],r[1],r[2],u[0],u[1]);
00038 r+=3;
00039 u+=2;
00040 }
00041 }
00042 };
00043
00044 }
00045
00046 namespace ssi
00047 {
00048 typedef Interval<double,3> interval;
00049 typedef fxv<double,2> vector2;
00050 typedef fxv<double,3> vector3;
00051 typedef aabb<double,3> aabb3;
00052 typedef fxv<double,4> vector4;
00053 typedef igraph graph_t;
00054 typedef vector3 point3;
00055 typedef vector2 point2;
00056 typedef unsigned short coord_t;
00057 typedef short rid_t;
00058 template <class C, class V> struct qnode;
00059
00060
00061
00062
00063 inline void fill_quad_box( vcode_t c, aabb3& box,
00064 const vector3& p0, const vector3& p1,
00065 const vector3& p2, const vector3& p3 ) { fill(box,p0,p1,p2,p3); };
00066 }
00067
00068 }
00069
00070 #endif