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

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