OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
map_iso_gen.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_MAP_ISO_GEN_HH
20 #define OST_MAP_ISO_GEN_HH
21 
22 /*
23  Author: Ansgar Philippsen
24 */
25 
26 #include <vector>
27 #include <ost/geom/geom.hh>
28 #include <ost/img/map.hh>
29 
30 #include <ost/gfx/map_iso_prop.hh>
31 
32 
33 namespace ost { namespace gfx {
34 
35 namespace map_iso {
36 
37 // this must match the signature in map_iso_spec.hh
38 // \internal
39 typedef void (*AddLF)(IndexedVertexArray& va,
40  unsigned int vertex_id[12]);
41 
42 typedef std::vector<AddLF> AddLFList;
43 
44 } // map_iso ns
45 
46 namespace impl {
47 
48 // \internal
50 public:
51  // singleton
52  static IsosurfaceGenerator& Instance();
53 
55 
56  void Generate(const img::MapHandle& mh, IndexedVertexArray& va, float level);
57 
58  void AddLF(uint code, IndexedVertexArray& va,unsigned int vertex_id[12]);
59 
60 private:
61  map_iso::AddLFList add_lf_func_;
62 };
63 
64 }}}
65 
66 #endif