SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QuadMC.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 #ifndef CORE_ALGORITHMS_VISUALIZATION_QUADMC_H
31 #define CORE_ALGORITHMS_VISUALIZATION_QUADMC_H 1
32 
33 #include <Core/Datatypes/Field.h>
34 #include <Core/Datatypes/Matrix.h>
35 
36 #include <Core/Geom/GeomLine.h>
37 
38 #include <Core/Algorithms/Fields/MarchingCubes/BaseMC.h>
39 
40 namespace SCIRun {
41 
42 class QuadMC : public BaseMC
43 {
44  public:
45  QuadMC( Field *field ) : field_handle_(field),
46  field_(field->vfield()),
47  mesh_(field->vmesh()),
48  lines_(0),
49  curve_handle_(0),
50  curve_(0) {}
51  virtual ~QuadMC() {}
52 
53  void extract( VMesh::Elem::index_type, double );
54  virtual void reset( int, bool build_field, bool build_geom, bool transparency);
55  virtual FieldHandle get_field(double val);
56 
57  private:
58  void extract_n( VMesh::Elem::index_type, double );
59  void extract_f( VMesh::Elem::index_type, double );
60 
61  VMesh::Node::index_type find_or_add_edgepoint(index_type n0,
62  index_type n1,
63  double d0,
64  const Point &p);
65  VMesh::Node::index_type find_or_add_nodepoint(VMesh::Node::index_type &idx);
66 
67  void find_or_add_parent(index_type u0, index_type u1,
68  double d0, index_type edge);
69 
70 
71  FieldHandle field_handle_;
72  VField* field_;
73  VMesh* mesh_;
74 
75  GeomLines *lines_;
76 
77  FieldHandle curve_handle_;
78  VMesh* curve_;
79 };
80 
81 
82 } // End namespace SCIRun
83 
84 #endif
Distinct type for elem index.
Definition: FieldVIndex.h:228
Definition: QuadMC.h:42
QuadMC(Field *field)
Definition: QuadMC.h:45
Definition: Point.h:49
virtual ~QuadMC()
Definition: QuadMC.h:51
Distinct type for node index.
Definition: FieldVIndex.h:181
void extract(VMesh::Elem::index_type, double)
Definition: QuadMC.cc:152
Definition: BaseMC.h:55
Definition: Field.h:41
virtual FieldHandle get_field(double val)
Definition: QuadMC.cc:392
long long index_type
Definition: Types.h:39
boost::shared_ptr< Field > FieldHandle
Definition: DatatypeFwd.h:65
Definition: VField.h:46
virtual void reset(int, bool build_field, bool build_geom, bool transparency)
Definition: QuadMC.cc:41
Definition: VMesh.h:53