00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _math_isosurf_edge_h
00029 #define _math_isosurf_edge_h
00030
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034
00035 #include <util/container/avlset.h>
00036 #include <math/isosurf/vertex.h>
00037
00038 namespace sc {
00039
00040 class Edge: public RefCount {
00041 private:
00042 int _order;
00043 Ref<Vertex> *_vertices;
00044 public:
00045 Edge(const Ref<Vertex> &p1,
00046 const Ref<Vertex> &p2)
00047 {
00048 _order = 1;
00049 _vertices = new Ref<Vertex>[2];
00050 _vertices[0]=p1; _vertices[1]=p2;
00051 }
00052 Edge(const Ref<Vertex> &p1,
00053 const Ref<Vertex> &p2,
00054 const Ref<Vertex> &p3);
00055 Edge(const Ref<Vertex> &p1,
00056 const Ref<Vertex> &p2,
00057 const Ref<Vertex> &p3,
00058 const Ref<Vertex> &p4);
00059 ~Edge();
00060 int order() const { return _order; }
00061 double straight_length();
00062
00063 Ref<Vertex> vertex(int i) const
00064 {
00065 return i?_vertices[_order]:_vertices[0];
00066 }
00067
00068 Ref<Vertex> interior_vertex(int i) const
00069 {
00070 return _vertices[i];
00071 }
00072
00073 void add_vertices(AVLSet<Ref<Vertex> >&);
00074 void set_order(int order, const Ref<Volume>&vol,double isovalue);
00075
00076 int interpolate(double location, SCVector3&point, SCVector3&norm);
00077
00078 int interpolate(double location, SCVector3&point, SCVector3&norm,
00079 const Ref<Volume> &vol, double isovalue);
00080 };
00081
00082 }
00083
00084 #endif
00085
00086
00087
00088
00089