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

isosurf.h

00001 //
00002 // isosurf.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_isosurf_h
00029 #define _math_isosurf_isosurf_h
00030 
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034 
00035 #include <vector>
00036 
00037 #include <math/isosurf/surf.h>
00038 
00039 namespace sc {
00040 
00041 class IsosurfaceGen {
00042   protected:
00043     double _resolution;
00044   public:
00045     IsosurfaceGen();
00046     virtual ~IsosurfaceGen();
00047     virtual void isosurface(double value,
00048                             TriangulatedSurface& surf) = 0;
00049     virtual void set_resolution(double);
00050 };
00051 
00052 class ImplicitSurfacePolygonizer: public IsosurfaceGen {
00053   private:
00054     // These static data and members are used to interface to the
00055     // implicit.c routine provided in Graphics Gems IV.
00056     static ImplicitSurfacePolygonizer* current;
00057     static int add_triangle_to_current(int,int,int,VERTICES);
00058     static double value_of_current(double x, double y, double z);
00059   protected:
00060     Ref<Volume> _volume;
00061 
00062     std::vector<Ref<Vertex> >  _tmp_vertices;
00063 
00064     TriangulatedSurface* _surf;
00065     double _value;
00066   public:
00067     ImplicitSurfacePolygonizer(const Ref<Volume>&);
00068     virtual ~ImplicitSurfacePolygonizer();
00069     virtual void isosurface(double value,
00070                             TriangulatedSurface& surf);
00071 };  
00072 
00073 }
00074 
00075 #endif
00076 
00077 // Local Variables:
00078 // mode: c++
00079 // c-file-style: "CLJ"
00080 // End:

Generated at Wed Apr 28 10:12:53 2004 for MPQC 2.2.2 using the documentation package Doxygen 1.2.14.