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