~ubuntu-branches/ubuntu/edgy/k3d/edgy-proposed

« back to all changes in this revision

Viewing changes to modules/surface_polygonizer_library/isurface_polygonizer.h

  • Committer: Bazaar Package Importer
  • Author(s): David Martínez Moreno
  • Date: 2005-04-28 18:38:10 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050428183810-kvc6nz46z6gheo0k
Tags: 0.4.5.0-5
* AAAAAAAARGH, *patching* configure.ac broke again the build process! Fixed
  (I hope).
* Removed more cruft of shaderpreprocessor/ from configure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef ISURFACE_POLYGONIZER_H
 
2
#define ISURFACE_POLYGONIZER_H
 
3
 
 
4
// K-3D
 
5
// Copyright (c) 1995-2004, Timothy M. Shead
 
6
//
 
7
// Contact: tshead@k-3d.com
 
8
//
 
9
// This program is free software; you can redistribute it and/or
 
10
// modify it under the terms of the GNU General Public
 
11
// License as published by the Free Software Foundation; either
 
12
// version 2 of the License, or (at your option) any later version.
 
13
//
 
14
// This program is distributed in the hope that it will be useful,
 
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
// General Public License for more details.
 
18
//
 
19
// You should have received a copy of the GNU General Public
 
20
// License along with this program; if not, write to the Free Software
 
21
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
22
 
 
23
/** \file
 
24
                \brief Declares isurface_polygonizer, an abstract interface for implicit surface polygonizers
 
25
                \author Romain Behar (romainbehar@yahoo.com)
 
26
*/
 
27
 
 
28
#include <k3dsdk/vectors.h>
 
29
 
 
30
// Implicit surface functor
 
31
//  implicit_value(k3d::vector3&) returns >= threshold for inside, < threshold for outside
 
32
class implicit_functor
 
33
{
 
34
public:
 
35
        virtual ~implicit_functor() {}
 
36
 
 
37
        virtual double implicit_value(const k3d::vector3& point) = 0;
 
38
};
 
39
 
 
40
// Surface polygonizer
 
41
class isurface_polygonizer
 
42
{
 
43
public:
 
44
        isurface_polygonizer(
 
45
                const double voxel_size,
 
46
                const double threshold,
 
47
                const int xmin, const int xmax,
 
48
                const int ymin, const int ymax,
 
49
                const int zmin, const int zmax,
 
50
                const k3d::vector3& origin,
 
51
                implicit_functor& functor,
 
52
                std::vector<k3d::vector3>& surface_vertices,
 
53
                std::vector<k3d::vector3>& surface_normals,
 
54
                std::vector< std::vector<unsigned long> >& surface_polygons) {}
 
55
 
 
56
        virtual bool polygonize_from_inside_point(const k3d::vector3& startingpoint) = 0;
 
57
 
 
58
        virtual void polygonize_whole_grid() = 0;
 
59
 
 
60
protected:
 
61
        isurface_polygonizer() {}
 
62
        virtual ~isurface_polygonizer() {}
 
63
};
 
64
 
 
65
#endif // ISURFACE_POLYGONIZER_H
 
66
 
 
67