SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HexMC.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2009 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9 
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 
30 /*
31  * HexMC.h
32  *
33  * SCI Institute
34  * University of Utah
35  * Feb 2001
36  *
37  */
38 
39 #ifndef CORE_ALGORITHMS_VISUALIZATION_HEXMC_H
40 #define CORE_ALGORITHMS_VISUALIZATION_HEXMC_H 1
41 
42 #include <Core/Datatypes/Field.h>
43 #include <Core/Datatypes/Matrix.h>
44 
45 #include <Core/Geom/GeomTriangles.h>
46 
47 #include <Core/Algorithms/Fields/MarchingCubes/BaseMC.h>
48 
49 
50 namespace SCIRun {
51 
52 class HexMC : public BaseMC
53 {
54  public:
55 
56  HexMC( Field *field ) : field_handle_(field),
57  field_(field->vfield()),
58  mesh_(field->vmesh()),
59  triangles_(0),
60  trisurf_(0),
61  trisurf_handle_(0),
62  quadsurf_(0),
63  quadsurf_handle_(0) {}
64 
65  virtual ~HexMC() {}
66 
67  void extract( VMesh::Elem::index_type , double);
68  void extract_c( VMesh::Elem::index_type, double);
69  void extract_n( VMesh::Elem::index_type, double);
70 
71  virtual void reset( int, bool build_field, bool build_geom, bool transparency );
72  virtual FieldHandle get_field(double val);
73 
74  private:
75 
76  VMesh::Node::index_type find_or_add_edgepoint(index_type n0,
77  index_type n1,
78  double d0,
79  const Point &p);
80 
81  VMesh::Node::index_type find_or_add_nodepoint(VMesh::Node::index_type& );
82 
83  void find_or_add_parent(index_type u0, index_type u1,
84  double d0, index_type face);
85 
86  FieldHandle field_handle_;
87  VField* field_;
88  VMesh* mesh_;
89 
90  GeomFastTriangles *triangles_;
91 
92  VMesh* trisurf_;
93  FieldHandle trisurf_handle_;
94 
95  VMesh* quadsurf_;
96  FieldHandle quadsurf_handle_;
97 };
98 
99 } // End namespace SCIRun
100 
101 #endif
Distinct type for elem index.
Definition: FieldVIndex.h:228
Definition: HexMC.h:52
Definition: Point.h:49
void extract(VMesh::Elem::index_type, double)
Definition: HexMC.cc:171
Distinct type for node index.
Definition: FieldVIndex.h:181
virtual ~HexMC()
Definition: HexMC.h:65
Definition: BaseMC.h:55
Definition: Field.h:41
virtual void reset(int, bool build_field, bool build_geom, bool transparency)
Definition: HexMC.cc:44
HexMC(Field *field)
Definition: HexMC.h:56
void extract_c(VMesh::Elem::index_type, double)
Definition: HexMC.cc:181
long long index_type
Definition: Types.h:39
boost::shared_ptr< Field > FieldHandle
Definition: DatatypeFwd.h:65
Definition: VField.h:46
virtual FieldHandle get_field(double val)
Definition: HexMC.cc:306
void extract_n(VMesh::Elem::index_type, double)
Definition: HexMC.cc:229
Definition: VMesh.h:53