Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

edge.h

00001 //
00002 // edge.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
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 class Edge: public RefCount {
00039   private:
00040     int _order;
00041     Ref<Vertex> *_vertices; // nvertices = _order + 1
00042   public:
00043     Edge(const Ref<Vertex> &p1,
00044          const Ref<Vertex> &p2)
00045     {
00046       _order = 1;
00047       _vertices = new Ref<Vertex>[2];
00048       _vertices[0]=p1; _vertices[1]=p2;
00049     }
00050     Edge(const Ref<Vertex> &p1,
00051          const Ref<Vertex> &p2,
00052          const Ref<Vertex> &p3);
00053     Edge(const Ref<Vertex> &p1,
00054          const Ref<Vertex> &p2,
00055          const Ref<Vertex> &p3,
00056          const Ref<Vertex> &p4);
00057     ~Edge();
00058     int order() const { return _order; }
00059     double straight_length();
00060     // return the endpoints
00061     Ref<Vertex> vertex(int i) const
00062     {
00063       return i?_vertices[_order]:_vertices[0];
00064     }
00065     // returns endpoints or interior vertex 0 <= i <= order
00066     Ref<Vertex> interior_vertex(int i) const
00067     {
00068       return _vertices[i];
00069     }
00070     // add the endpoints to the set
00071     void add_vertices(AVLSet<Ref<Vertex> >&);
00072     void set_order(int order, const Ref<Volume>&vol,double isovalue);
00073     // find the position of a point on the edge
00074     int interpolate(double location, SCVector3&point, SCVector3&norm);
00075     // find the true position of a point using the isosurface
00076     int interpolate(double location, SCVector3&point, SCVector3&norm,
00077                      const Ref<Volume> &vol, double isovalue);
00078 };
00079 
00080 
00081 
00082 #endif
00083 
00084 // Local Variables:
00085 // mode: c++
00086 // c-file-style: "CLJ"
00087 // End:

Generated at Thu Oct 4 18:08:43 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.