# 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     // These static data and members are used to interface to the
    00054     // implicit.c routine provided in Graphics Gems IV.
    00055     static ImplicitSurfacePolygonizer* current;
    00056     // The following should not really be used publically.
    00057     // they are public to permit access through internal
    00058     // C-language functions.
    00059   public:
    00061     static int add_triangle_to_current(int,int,int,VERTICES);
    00063     static double value_of_current(double x, double y, double z);
    00064   protected:
    00065     Ref<Volume> _volume;
    00066
    00067     std::vector<Ref<Vertex> >  _tmp_vertices;
    00068
    00069     TriangulatedSurface* _surf;
    00070     double _value;
    00071   public:
    00072     ImplicitSurfacePolygonizer(const Ref<Volume>&);
    00073     virtual ~ImplicitSurfacePolygonizer();
    00074     virtual void isosurface(double value,
    00075                             TriangulatedSurface& surf);
    00076 };
    00077
    00078 }
    00079
    00080 #endif
    00081
    00082 // Local Variables:
    00083 // mode: c++
    00084 // c-file-style: "CLJ"
    00085 // End: