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 <set>
00036
00037 #include <math/isosurf/vertex.h>
00038
00039 namespace sc {
00040
00041 class Edge: public RefCount {
00042 private:
00043 int _order;
00044 Ref<Vertex> *_vertices;
00045 public:
00046 Edge(const Ref<Vertex> &p1,
00047 const Ref<Vertex> &p2)
00048 {
00049 _order = 1;
00050 _vertices = new Ref<Vertex>[2];
00051 _vertices[0]=p1; _vertices[1]=p2;
00052 }
00053 Edge(const Ref<Vertex> &p1,
00054 const Ref<Vertex> &p2,
00055 const Ref<Vertex> &p3);
00056 Edge(const Ref<Vertex> &p1,
00057 const Ref<Vertex> &p2,
00058 const Ref<Vertex> &p3,
00059 const Ref<Vertex> &p4);
00060 ~Edge();
00061 int order() const { return _order; }
00062 double straight_length();
00063
00064 Ref<Vertex> vertex(int i) const
00065 {
00066 return i?_vertices[_order]:_vertices[0];
00067 }
00068
00069 Ref<Vertex> interior_vertex(int i) const
00070 {
00071 return _vertices[i];
00072 }
00073
00074 void add_vertices(std::set<Ref<Vertex> >&);
00075 void set_order(int order, const Ref<Volume>&vol,double isovalue);
00076
00077 int interpolate(double location, SCVector3&point, SCVector3&norm);
00078
00079 int interpolate(double location, SCVector3&point, SCVector3&norm,
00080 const Ref<Volume> &vol, double isovalue);
00081 };
00082
00083 }
00084
00085 #endif
00086
00087
00088
00089
00090