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