29 #ifndef CORE_DATATYPES_POINTCLOUDMESH_H
30 #define CORE_DATATYPES_POINTCLOUDMESH_H 1
74 #if (SCIRUN_POINTCLOUD_SUPPORT > 0)
84 template <
class Basis>
85 class PointCloudMesh :
public Mesh
99 typedef boost::shared_ptr<PointCloudMesh<Basis> >
handle_type;
161 return mesh_.points_[index_];
190 return boost::make_shared<Core::Datatypes::VirtualMeshFacade<VMesh>>(
vmesh_);
197 return (
basis_.polynomial_order());
272 { a.
resize(1); a[0] = i; }
275 {
ASSERTFAIL(
"PointCloudMesh: get_nodes has not been implemented for edges"); }
278 {
ASSERTFAIL(
"PointCloudMesh: get_nodes has not been implemented for faces"); }
281 {
ASSERTFAIL(
"PointCloudMesh: get_nodes has not been implemented for cells"); }
286 {
ASSERTFAIL(
"PointCloudMesh: get_edges has not been implemented for nodes"); }
289 {
ASSERTFAIL(
"PointCloudMesh: get_edgees has not been implemented for edges"); }
292 {
ASSERTFAIL(
"PointCloudMesh: get_edgees has not been implemented for faces"); }
295 {
ASSERTFAIL(
"PointCloudMesh: get_edges has not been implemented for cells"); }
299 {
ASSERTFAIL(
"PointCloudMesh: get_faces has not been implemented"); }
302 {
ASSERTFAIL(
"PointCloudMesh: get_faces has not been implemented"); }
305 {
ASSERTFAIL(
"PointCloudMesh: get_faces has not been implemented"); }
308 {
ASSERTFAIL(
"PointCloudMesh: get_faces has not been implemented"); }
312 {
ASSERTFAIL(
"PointCloudMesh: get_cells has not been implemented"); }
315 {
ASSERTFAIL(
"PointCloudMesh: get_cells has not been implemented"); }
318 {
ASSERTFAIL(
"PointCloudMesh: get_cells has not been implemented"); }
321 {
ASSERTFAIL(
"PointCloudMesh: get_cells has not been implemented"); }
334 {
ASSERTFAIL(
"PointCloudMesh: get_elems has not been implemented for edges"); }
337 {
ASSERTFAIL(
"PointCloudMesh: get_elems has not been implemented for faces"); }
340 {
ASSERTFAIL(
"PointCloudMesh: get_elems has not been implemented for cells"); }
344 {
ASSERTFAIL(
"PointCloudMesh: get_delems has not been implemented for nodes"); }
347 {
ASSERTFAIL(
"PointCloudMesh: get_delems has not been implemented for edges"); }
350 {
ASSERTFAIL(
"PointCloudMesh: get_delems has not been implemented for faces"); }
353 {
ASSERTFAIL(
"PointCloudMesh: get_delems has not been implemented for cells"); }
357 template<
class VECTOR>
363 ASSERTFAIL(
"PointCloudMesh: cannot approximiate edges");
366 template<
class VECTOR>
372 ASSERTFAIL(
"PointCloudMesh: cannot approximiate faces");
380 {
ASSERTFAIL(
"PointCloudMesh: get_center has not been implemented for edges"); }
382 {
ASSERTFAIL(
"PointCloudMesh: get_center has not been implemented for faces"); }
384 {
ASSERTFAIL(
"PointCloudMesh: get_center has not been implemented for cells"); }
410 { array.resize(0);
return (
false); }
422 template<
class ARRAY>
430 {
ASSERTFAIL(
"PointCloudField: get_weights for edges isn't supported"); }
432 {
ASSERTFAIL(
"PointCloudField: get_weights for faces isn't supported"); }
434 {
ASSERTFAIL(
"PointCloudField: get_weights for cells isn't supported"); }
446 {
ASSERTFAIL(
"PointCloudMesh: this mesh type does not have node normals."); }
447 template<
class VECTOR>
449 {
ASSERTFAIL(
"PointCloudMesh: this mesh type does not have element normals."); }
455 template <
class ARRAY>
458 return (static_cast<typename Elem::index_type>(a[0]));
474 template<
class VECTOR,
class INDEX>
484 template<
class VECTOR,
class INDEX>
493 template<
class VECTOR1,
class INDEX,
class VECTOR2>
494 void derivate(
const VECTOR1& , INDEX , VECTOR2 &J)
const
505 template<
class VECTOR,
class INDEX>
514 template<
class VECTOR,
class INDEX>
515 void jacobian(
const VECTOR& coords, INDEX idx,
double* J)
const
531 template<
class VECTOR,
class INDEX>
548 template<
class INDEX>
554 template<
class INDEX>
560 template<
class INDEX>
568 template <
class INDEX>
573 if (sz == 0)
return (
false);
576 if (node >= 0 && node < sz)
584 "PointCloudMesh::locate_node requires synchronize(NODE_LOCATE_E).")
593 grid_->unsafe_locate(bi, bj, bk, p);
596 if (bi > ni) bi =ni;
if (bi < 0) bi = 0;
597 if (bj > nj) bj =nj;
if (bj < 0) bj = 0;
598 if (bk > nk) bk =nk;
if (bk < 0) bk = 0;
604 double dmin = DBL_MAX;
614 if (i < 0 || i > ni)
continue;
617 if (j < 0 || j > nj)
continue;
620 if (k < 0 || k > nk)
continue;
621 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
623 if (
grid_->min_distance_squared(p, i, j, k) < dmin)
627 grid_->lookup_ijk(it, eit, i, j, k);
632 const double dist = (p-point).length2();
652 while ((!found)||(dmin == DBL_MAX)) ;
659 template <
class INDEX>
665 if (idx >= 0 && idx < sz)
671 "PointCloudMesh::locate requires synchronize(ELEM_LOCATE_E).")
674 if (
grid_->lookup(it, eit, p))
680 idx =
static_cast<INDEX
>(*it);
690 template <
class ARRAY>
695 "PointCloudMesh::locate_elems requires synchronize(ELEM_LOCATE_E).")
700 grid_->locate_clamp(is,js,ks,b.
min());
701 grid_->locate_clamp(ie,je,ke,b.
max());
707 grid_->lookup_ijk(it, eit, i, j, k);
711 for (;p<array.size();p++)
if (array[p] ==
typename ARRAY::value_type(*it))
break;
712 if (p == array.size()) array.push_back(
typename ARRAY::value_type(*it));
717 return (array.size() > 0);
722 template <
class INDEX>
731 template <
class INDEX>
735 if (maxdist < 0.0) maxdist = DBL_MAX;
else maxdist = maxdist*maxdist;
739 if(sz == 0)
return (
false);
741 if (node >= 0 && node < sz)
743 double dist = (p-
points_[node]).length2();
753 "PointCloudMesh::find_closest_node requires synchronize(NODE_LOCATE_E).")
762 grid_->unsafe_locate(bi, bj, bk, p);
765 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
766 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
767 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
769 ei = bi; ej = bj; ek = bk;
771 double dmin = maxdist;
773 bool found_one =
false;
783 if (i < 0 || i > ni)
continue;
786 if (j < 0 || j > nj)
continue;
789 if (k < 0 || k > nk)
continue;
790 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
792 if (
grid_->min_distance_squared(p, i, j, k) < dmin)
796 grid_->lookup_ijk(it, eit, i, j, k);
801 const double dist = (p-point).length2();
831 if (!found_one)
return (
false);
837 template <
class ARRAY>
843 "PointCloudMesh::find_closest_node requires synchronize(NODE_LOCATE_E).")
856 grid_->unsafe_locate(bi, bj, bk, min);
857 grid_->unsafe_locate(ei, ej, ek, max);
860 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
861 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
862 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
864 if (ei > ni) ei = ni;
if (ei < 0) ei = 0;
865 if (ej > nj) ej = nj;
if (ej < 0) ej = 0;
866 if (ek > nk) ek = nk;
if (ek < 0) ek = 0;
868 double maxdist2 = maxdist*maxdist;
876 if (
grid_->min_distance_squared(p, i, j, k) < maxdist2)
879 grid_->lookup_ijk(it, eit, i, j, k);
884 const double dist = (p-point).length2();
888 nodes.push_back(*it);
897 return(nodes.size() > 0);
901 template <
class ARRAY1,
class ARRAY2>
908 "PointCloudMesh::find_closest_node requires synchronize(NODE_LOCATE_E).")
921 grid_->unsafe_locate(bi, bj, bk, min);
922 grid_->unsafe_locate(ei, ej, ek, max);
925 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
926 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
927 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
929 if (ei > ni) ei = ni;
if (ei < 0) ei = 0;
930 if (ej > nj) ej = nj;
if (ej < 0) ej = 0;
931 if (ek > nk) ek = nk;
if (ek < 0) ek = 0;
933 double maxdist2 = maxdist*maxdist;
941 if (
grid_->min_distance_squared(p, i, j, k) < maxdist2)
944 grid_->lookup_ijk(it, eit, i, j, k);
949 const double dist = (p-point).length2();
953 nodes.push_back(*it);
954 distances.push_back(dist);
963 return(nodes.size() > 0);
967 template <
class INDEX,
class ARRAY>
978 template <
class INDEX,
class ARRAY>
984 double maxdist)
const
986 if (maxdist < 0.0) maxdist = DBL_MAX;
else maxdist = maxdist*maxdist;
992 if(sz == 0)
return (
false);
994 if (elem >= 0 && elem < sz)
996 double dist = (p-
points_[elem]).length2();
1006 "PointCloudMesh::find_closest_elem requires synchronize(ELEM_LOCATE_E).")
1015 grid_->unsafe_locate(bi, bj, bk, p);
1018 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
1019 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
1020 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
1022 ei = bi; ej = bj; ek = bk;
1024 double dmin = maxdist;
1026 bool found_one =
false;
1035 if (i < 0 || i > ni)
continue;
1038 if (j < 0 || j > nj)
continue;
1041 if (k < 0 || k > nk)
continue;
1042 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
1044 if (
grid_->min_distance_squared(p, i, j, k) < dmin)
1048 grid_->lookup_ijk(it,eit, i, j, k);
1053 const double dist = (p-point).length2();
1083 if (!found_one)
return (
false);
1089 template <
class INDEX>
1099 template <
class ARRAY>
1104 if (sz == 0)
return (
false);
1114 "PointCloudMesh::find_closest_elems requires synchronize(ELEM_LOCATE_E).")
1123 grid_->unsafe_locate(bi, bj, bk, p);
1126 if (bi > ni) bi = ni;
if (bi < 0) bi = 0;
1127 if (bj > nj) bj = nj;
if (bj < 0) bj = 0;
1128 if (bk > nk) bk = nk;
if (bk < 0) bk = 0;
1130 ei = bi; ej = bj; ek = bk;
1132 double dmin = DBL_MAX;
1143 if (i < 0 || i > ni)
continue;
1146 if (j < 0 || j > nj)
continue;
1149 if (k < 0 || k > nk)
continue;
1150 if (i == bi || i == ei || j == bj || j == ej || k == bk || k == ek)
1152 if (
grid_->min_distance_squared(p, i, j, k) < dmin)
1156 grid_->lookup_ijk(it,eit, i, j, k);
1161 const double dist = (p - point).length2();
1167 elems.push_back(
typename ARRAY::value_type(*it));
1173 elems.push_back(
typename ARRAY::value_type(*it));
1186 while ((!found)||(dmin == DBL_MAX)) ;
1205 static const std::string
type_name(
int n = -1);
1224 template <
class ARRAY,
class INDEX>
1227 nodes.resize(1); nodes[0] = idx;
1230 template <
class ARRAY,
class INDEX>
1236 template <
class ARRAY,
class INDEX>
1255 boost::shared_ptr<SearchGridT<index_type> >
grid_;
1271 template<
class Basis>
1273 synchronized_(ALL_ELEMENTS_E),
1274 synchronize_lock_(
"PointCloudMesh Lock"),
1283 template<
class Basis>
1286 points_(copy.points_),
1287 basis_(copy.basis_),
1288 synchronized_(copy.synchronized_),
1289 synchronize_lock_(
"PointCloudMesh Lock")
1298 lcopy.synchronize_lock_.lock();
1314 lcopy.synchronize_lock_.unlock();
1322 template<
class Basis>
1331 template <
class Basis>
1337 template <
class Basis>
1349 result.
extend(points_[*i]);
1354 if (points_.size() == 1)
1356 result.
extend(points_[0]);
1363 template <
class Basis>
1373 template <
class Basis>
1377 synchronize_lock_.lock();
1379 std::vector<Core::Geometry::Point>::iterator itr = points_.begin();
1380 std::vector<Core::Geometry::Point>::iterator eitr = points_.end();
1387 if (grid_) { grid_->transform(t); }
1389 synchronize_lock_.unlock();
1393 template <
class Basis>
1411 template <
class Basis>
1415 points_.push_back(p);
1416 return points_.size() - 1;
1420 #define PointCloudFieldMESH_VERSION 2
1422 template <
class Basis>
1431 Pio(stream, points_);
1444 template <
class Basis>
1448 ASSERT((n >= -1) && n <= 1);
1456 static const std::string nm(
"PointCloudMesh");
1466 template <
class Basis>
1474 template <
class Basis>
1478 itr =
static_cast<index_type>(points_.size());
1482 template <
class Basis>
1490 template <
class Basis>
1494 ASSERTFAIL(
"This mesh type does not have edges use \"elem\".");
1498 template <
class Basis>
1502 ASSERTFAIL(
"This mesh type does not have edges use \"elem\".");
1506 template <
class Basis>
1510 ASSERTFAIL(
"This mesh type does not have edges use \"elem\".");
1514 template <
class Basis>
1518 ASSERTFAIL(
"This mesh type does not have faces use \"elem\".");
1522 template <
class Basis>
1526 ASSERTFAIL(
"This mesh type does not have faces use \"elem\".");
1530 template <
class Basis>
1534 ASSERTFAIL(
"This mesh type does not have faces use \"elem\".");
1538 template <
class Basis>
1542 ASSERTFAIL(
"This mesh type does not have cells use \"elem\".");
1546 template <
class Basis>
1550 ASSERTFAIL(
"This mesh type does not have cells use \"elem\".");
1554 template <
class Basis>
1558 ASSERTFAIL(
"This mesh type does not have cells use \"elem\".");
1562 template<
class Basis>
1566 synchronize_lock_.lock();
1577 !(synchronized_ & Mesh::EPSILON_E))
1579 compute_epsilon(bb);
1584 !(synchronized_ & Mesh::LOCATE_E))
1590 synchronize_lock_.unlock();
1595 template<
class Basis>
1599 synchronize_lock_.lock();
1602 synchronize_lock_.unlock();
1607 template <
class Basis>
1611 synchronize_lock_.lock();
1618 synchronize_lock_.unlock();
1622 template <
class Basis>
1628 grid_->insert(ni,points_[ni]);
1632 template <
class Basis>
1636 grid_->remove(ni,points_[ni]);
1639 template <
class Basis>
1650 3*
static_cast<size_type>((ceil(pow(static_cast<double>(esz) , (1.0/3.0))))/2.0 + 1.0);
1653 double trace = (diag.
x()+diag.
y()+diag.
z());
1662 begin(ci); end(cie);
1665 insert_elem_into_grid(*ci);
1678 template<
class Basis>
1682 bb = get_bounding_box();
1684 epsilon2_ = epsilon_*epsilon_;
1688 template <
class Basis>
1699 std::string(__FILE__),
1707 template <
class Basis>
1708 const TypeDescription*
1715 template <
class Basis>
1725 std::string(__FILE__),
1733 template <
class Basis>
1743 std::string(__FILE__),
1751 template <
class Basis>
1761 std::string(__FILE__),
1769 template <
class Basis>
1779 std::string(__FILE__),
int get_weights(const Core::Geometry::Point &, typename Edge::array_type &, double *)
Definition: PointCloudMesh.h:429
double get_volume(typename Cell::index_type) const
Definition: PointCloudMesh.h:393
bool locate(typename Face::index_type &, const Core::Geometry::Point &) const
Definition: PointCloudMesh.h:417
Interface to statically allocated std::vector class.
index_type node0_index() const
Definition: PointCloudMesh.h:153
Definition: PointCloudMesh.h:124
void insert_elem_into_grid(typename Elem::index_type ci)
Definition: PointCloudMesh.h:1624
double det_jacobian(const VECTOR &coords, INDEX idx) const
Definition: PointCloudMesh.h:506
void get_elems(typename Elem::array_type &, typename Face::index_type) const
Definition: PointCloudMesh.h:335
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, INDEX &elem, const Core::Geometry::Point &p) const
Definition: PointCloudMesh.h:968
bool reading() const
Definition: Persistent.h:164
Distinct type for node FieldIterator.
Definition: FieldIterator.h:89
void get_edges_from_elem(ARRAY edges, INDEX idx)
Definition: PointCloudMesh.h:1231
virtual std::string dynamic_type_name() const
Definition: PointCloudMesh.h:1206
void get_edges(typename Edge::array_type &, typename Cell::index_type) const
Definition: PointCloudMesh.h:293
std::vector< index_type > array_type
Definition: PointCloudMesh.h:128
Definition: FieldRNG.h:37
virtual VMesh * vmesh()
Access point to virtual interface.
Definition: PointCloudMesh.h:186
std::string get_name(const std::string &type_sep_start="<", const std::string &type_sep_end="> ") const
Definition: TypeDescription.cc:135
Distinct type for face Iterator.
Definition: FieldIterator.h:121
void get_normal(Core::Geometry::Vector &, VECTOR &, typename Elem::index_type, unsigned int) const
Definition: PointCloudMesh.h:448
void get_edges(typename Edge::array_type &, typename Edge::index_type) const
Definition: PointCloudMesh.h:287
PointCloudMesh< Basis >::index_type index_type
Definition: PointCloudMesh.h:145
EdgeIterator< under_type > iterator
Definition: PointCloudMesh.h:112
Point max() const
Definition: BBox.h:195
double epsilon_
Definition: PointCloudMesh.h:1262
virtual bool has_normals() const
Has this mesh normals.
Definition: PointCloudMesh.h:223
#define ASSERTMSG(condition, message)
Definition: Exception.h:113
void pwl_approx_edge(VECTOR &, typename Elem::index_type, unsigned int, unsigned int) const
Definition: PointCloudMesh.h:358
Node::index_type add_node(const Core::Geometry::Point &p)
use these to build up a new PointCloudField mesh
Definition: PointCloudMesh.h:452
bool find_closest_nodes(ARRAY &nodes, const Core::Geometry::Point &p, double maxdist) const
Definition: PointCloudMesh.h:838
NodeIndex< under_type > index_type
Definition: PointCloudMesh.h:104
double get_length(typename Edge::index_type) const
Definition: PointCloudMesh.h:391
double get_size(typename Face::index_type) const
Definition: PointCloudMesh.h:389
Definition: Persistent.h:89
std::vector< index_type > array_type
Definition: PointCloudMesh.h:114
void get_delems(typename DElem::array_type &, typename Face::index_type) const
Definition: PointCloudMesh.h:348
SCIRun::index_type index_type
Definition: PointCloudMesh.h:95
virtual void get_canonical_transform(Core::Geometry::Transform &t) const
Definition: PointCloudMesh.h:1365
FaceIndex< under_type > size_type
Definition: PointCloudMesh.h:120
void jacobian(const VECTOR &coords, INDEX idx, double *J) const
Definition: PointCloudMesh.h:515
Definition: Persistent.h:187
void get_center(Core::Geometry::Point &, typename Edge::index_type) const
Definition: PointCloudMesh.h:379
BBox & extend(const Point &p)
Expand the bounding box to include point p.
Definition: BBox.h:98
void set_point(const Core::Geometry::Point &p, typename Node::index_type i)
Definition: PointCloudMesh.h:439
Definition: TypeDescription.h:50
virtual bool is_editable() const
Check whether mesh can be altered by adding nodes or elements.
Definition: PointCloudMesh.h:220
Definition: PointCloudMesh.h:63
Index and Iterator types required for Mesh Concept.
Definition: PointCloudMesh.h:103
void resize_elems(size_t s)
Definition: PointCloudMesh.h:464
Definition: TypeDescription.h:45
#define SCISHARE
Definition: share.h:39
std::vector< const TypeDescription * > td_vec
Definition: TypeDescription.h:56
Basis basis_type
Definition: PointCloudMesh.h:100
bool find_closest_node(double &pdist, Core::Geometry::Point &result, INDEX &node, const Core::Geometry::Point &p, double maxdist) const
Closest node and the location.
Definition: PointCloudMesh.h:732
void size(typename Node::size_type &) const
Get the iteration sizes.
Definition: PointCloudMesh.h:1484
Basis basis_
basis fns
Definition: PointCloudMesh.h:1253
boost::shared_ptr< Mesh > MeshHandle
Definition: DatatypeFwd.h:67
void get_nodes_from_elem(ARRAY nodes, INDEX idx)
Definition: PointCloudMesh.h:1225
Distinct type for cell Iterator.
Definition: FieldIterator.h:134
bool locate(typename Node::index_type &n, ARRAY &coords, const Core::Geometry::Point &p) const
Definition: PointCloudMesh.h:423
unsigned int mask_type
Definition: Types.h:45
void get_faces(typename Face::array_type &, typename Cell::index_type) const
Definition: PointCloudMesh.h:306
double inverse_jacobian(const VECTOR &, INDEX, double *Ji) const
Definition: PointCloudMesh.h:532
#define ASSERT(condition)
Definition: Assert.h:110
bool clear_synchronization()
Definition: PointCloudMesh.h:1609
StackVector< index_type, 1 > array_type
Definition: PointCloudMesh.h:107
virtual const TypeDescription * get_type_description() const
Definition: PointCloudMesh.h:1709
const Core::Geometry::Point & node0() const
Definition: PointCloudMesh.h:159
void get_edges(typename Edge::array_type &, typename Face::index_type) const
Definition: PointCloudMesh.h:290
void get_delems(typename DElem::array_type &, typename Edge::index_type) const
Definition: PointCloudMesh.h:345
virtual int begin_class(const std::string &name, int current_version)
Definition: Persistent.cc:143
FaceIterator< under_type > iterator
Definition: PointCloudMesh.h:119
void elem_reserve(size_t s)
Definition: PointCloudMesh.h:462
Core::Thread::Mutex synchronize_lock_
Lock to synchronize between threads.
Definition: PointCloudMesh.h:1260
void get_center(Core::Geometry::Point &, typename Face::index_type) const
Definition: PointCloudMesh.h:381
void get_center(Core::Geometry::Point &, typename Cell::index_type) const
Definition: PointCloudMesh.h:383
const string find_type_name(float *)
Definition: TypeName.cc:63
std::vector< index_type > array_type
Definition: PointCloudMesh.h:121
ElemData(const PointCloudMesh< Basis > &msh, const index_type ind)
Definition: PointCloudMesh.h:147
void get_elems(typename Elem::array_type &result, typename Node::index_type idx) const
get the parent element(s) of the given index
Definition: PointCloudMesh.h:325
void node_reserve(size_t s)
Definition: PointCloudMesh.h:461
bool valid() const
Definition: BBox.h:93
double scaled_jacobian_metric(INDEX idx) const
Definition: PointCloudMesh.h:549
std::vector< Core::Geometry::Point > points_
the nodes
Definition: PointCloudMesh.h:1250
bool get_coords(VECTOR &coords, const Core::Geometry::Point &, INDEX) const
Definition: PointCloudMesh.h:475
bool get_neighbor(typename Elem::index_type &, typename Elem::index_type, typename DElem::index_type) const
Definition: PointCloudMesh.h:400
bool locate_elem(INDEX &idx, const Core::Geometry::Point &p) const
Definition: PointCloudMesh.h:660
virtual void io(Piostream &)
Export this class using the old Pio system.
Definition: PointCloudMesh.h:1424
double jacobian_metric(INDEX idx) const
Definition: PointCloudMesh.h:555
void begin(typename Node::iterator &) const
begin/end iterators
Definition: PointCloudMesh.h:1468
void pwl_approx_face(VECTOR &, typename Elem::index_type, unsigned int, unsigned int) const
Definition: PointCloudMesh.h:367
Definition: VMeshShared.h:40
Definition: ParallelLinearAlgebraTests.cc:358
friend class VPointCloudMesh
Make sure the virtual interface has access.
Definition: PointCloudMesh.h:89
Node Elem
Definition: PointCloudMesh.h:134
virtual int dimensionality() const
Topological dimension.
Definition: PointCloudMesh.h:201
void end(typename Node::iterator &) const
Definition: PointCloudMesh.h:1476
Definition: SearchGridT.h:47
const char * name[]
Definition: BoostGraphExampleTests.cc:87
void get_delems(typename DElem::array_type &, typename Node::index_type) const
Definition: PointCloudMesh.h:342
Basis & get_basis()
Get the basis class.
Definition: PointCloudMesh.h:232
long long size_type
Definition: Types.h:40
double get_size(typename Node::array_type &) const
Definition: PointCloudMesh.h:395
bool find_closest_nodes(ARRAY1 &distances, ARRAY2 &nodes, const Core::Geometry::Point &p, double maxdist) const
Definition: PointCloudMesh.h:902
Definition: StackVector.h:50
Node::index_type add_point(const Core::Geometry::Point &p)
Definition: PointCloudMesh.h:1413
bool find_closest_node(double &pdist, Core::Geometry::Point &result, INDEX &node, const Core::Geometry::Point &p) const
Definition: PointCloudMesh.h:723
virtual bool unsynchronize(mask_type sync)
Definition: PointCloudMesh.h:1597
virtual int basis_order()
Definition: PointCloudMesh.h:195
void get_cells(typename Cell::array_type &, typename Node::index_type) const
Definition: PointCloudMesh.h:310
double get_area(typename Face::index_type) const
Definition: PointCloudMesh.h:392
Vector diagonal() const
Definition: BBox.h:198
void get_elems(typename Elem::array_type &, typename Cell::index_type) const
Definition: PointCloudMesh.h:338
void compute_epsilon(Core::Geometry::BBox &bb)
Definition: PointCloudMesh.h:1680
Persistent i/o for STL containers.
std::vector< INDEX >::iterator iterator
Definition: SearchGridT.h:53
std::string type
Definition: Persistent.h:72
VMesh * CreateVPointCloudMesh(MESH *)
Definition: PointCloudMesh.h:70
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, ARRAY &coords, INDEX &elem, const Core::Geometry::Point &p, double maxdist) const
Definition: PointCloudMesh.h:979
static PersistentTypeID pointcloud_typeid
These IDs are created as soon as this class will be instantiated.
Definition: PointCloudMesh.h:1203
virtual ~PointCloudMesh()
Destructor.
Definition: PointCloudMesh.h:1323
Point min() const
Definition: BBox.h:192
Distinct type for face index.
Definition: FieldIndex.h:90
void compute_grid(Core::Geometry::BBox &bb)
Definition: PointCloudMesh.h:1641
void get_cells(typename Cell::array_type &, typename Edge::index_type) const
Definition: PointCloudMesh.h:313
void remove_elem_from_grid(typename Elem::index_type ci)
Definition: PointCloudMesh.h:1634
virtual Core::Geometry::BBox get_bounding_box() const
Get the bounding box of the field.
Definition: PointCloudMesh.h:1339
void set_nodes_by_elem(ARRAY &array, INDEX idx)
Definition: PointCloudMesh.h:1237
void x(double)
Definition: Vector.h:175
CellIndex< under_type > index_type
Definition: PointCloudMesh.h:125
void get_normal(Core::Geometry::Vector &, typename Node::index_type) const
Definition: PointCloudMesh.h:445
void get_center(Core::Geometry::Point &p, typename Node::index_type i) const
get the center point (in object space) of an element
Definition: PointCloudMesh.h:377
void to_index(typename Face::index_type &index, index_type i) const
Definition: PointCloudMesh.h:260
void get_edges(typename Edge::array_type &, typename Node::index_type) const
Definition: PointCloudMesh.h:284
void get_faces(typename Face::array_type &, typename Edge::index_type) const
Definition: PointCloudMesh.h:300
virtual bool synchronize(mask_type sync)
Definition: PointCloudMesh.h:1564
int get_weights(const Core::Geometry::Point &, typename Face::array_type &, double *)
Definition: PointCloudMesh.h:431
static const TypeDescription * face_type_description()
Definition: PointCloudMesh.h:1753
static const std::string make_template_id(const std::string &templateName, const std::string &templateParam)
Definition: TypeName.h:62
bool locate(typename Node::index_type &n, const Core::Geometry::Point &p) const
Locate a point in a mesh, find which is the closest node.
Definition: PointCloudMesh.h:413
bool locate(typename Edge::index_type &, const Core::Geometry::Point &) const
Definition: PointCloudMesh.h:415
SCIRun::index_type under_type
Definition: PointCloudMesh.h:94
double epsilon2_
Definition: PointCloudMesh.h:1263
int get_weights(const Core::Geometry::Point &, typename Cell::array_type &, double *)
Definition: PointCloudMesh.h:433
PointCloudMesh()
Construct a new mesh.
Definition: PointCloudMesh.h:1272
void y(double)
Definition: Vector.h:185
void get_faces(typename Face::array_type &, typename Face::index_type) const
Definition: PointCloudMesh.h:303
static const TypeDescription * cell_type_description()
Definition: PointCloudMesh.h:1771
Distinct type for edge Iterator.
Definition: FieldIterator.h:105
#define ASSERTFAIL(string)
Definition: Assert.h:52
SCIRun::size_type size_type
Definition: PointCloudMesh.h:96
void Pio(Piostream &stream, Array1< T > &array)
Definition: Array1.h:65
FaceIndex< under_type > index_type
Definition: PointCloudMesh.h:118
Some convenient simple iterators for fields.
bool locate_node(INDEX &node, const Core::Geometry::Point &p) const
Definition: PointCloudMesh.h:569
SCIRun::mask_type mask_type
Definition: PointCloudMesh.h:97
void get_neighbors(std::vector< typename Node::index_type > &array, typename Node::index_type) const
Definition: PointCloudMesh.h:404
void get_nodes(typename Node::array_type &, typename Face::index_type) const
Definition: PointCloudMesh.h:276
double length() const
Definition: Vector.h:365
virtual void end_class()
Definition: Persistent.cc:178
CellIndex< under_type > size_type
Definition: PointCloudMesh.h:127
double get_size(typename Edge::index_type) const
Definition: PointCloudMesh.h:388
virtual PointCloudMesh * clone() const
Definition: PointCloudMesh.h:180
bool get_neighbors(std::vector< typename Elem::index_type > &array, typename Elem::index_type, typename DElem::index_type) const
Definition: PointCloudMesh.h:407
double get_epsilon() const
Definition: PointCloudMesh.h:1193
#define PointCloudFieldMESH_VERSION
Definition: PointCloudMesh.h:1420
long long index_type
Definition: Types.h:39
NodeIterator< under_type > iterator
Definition: PointCloudMesh.h:105
void resize_nodes(size_t s)
Definition: PointCloudMesh.h:463
void resize(size_t size, const value_type &val=value_type())
Definition: StackVector.h:61
Definition: PointCloudMesh.h:142
void interpolate(Core::Geometry::Point &pt, const VECTOR &, INDEX idx) const
Definition: PointCloudMesh.h:485
Definition: PointCloudMesh.h:117
NodeIndex< under_type > size_type
Definition: PointCloudMesh.h:106
void get_nodes(typename Node::array_type &a, typename Node::index_type i) const
Definition: PointCloudMesh.h:270
static const TypeDescription * edge_type_description()
Definition: PointCloudMesh.h:1735
void reset()
Definition: BBox.h:95
Definition: Persistent.h:64
Node DElem
Definition: PointCloudMesh.h:135
void get_cells(typename Cell::array_type &, typename Cell::index_type) const
Definition: PointCloudMesh.h:319
Distinct type for edge index.
Definition: FieldIndex.h:81
void to_index(typename Edge::index_type &index, index_type i) const
Definition: PointCloudMesh.h:258
int n
Definition: eab.py:9
bool find_closest_elems(double &pdist, Core::Geometry::Point &result, ARRAY &elems, const Core::Geometry::Point &p) const
Definition: PointCloudMesh.h:1100
void get_nodes(typename Node::array_type &, typename Cell::index_type) const
Definition: PointCloudMesh.h:279
virtual void transform(const Core::Geometry::Transform &t)
Core::Geometry::Transform a field (transform all nodes using this transformation matrix) ...
Definition: PointCloudMesh.h:1375
static const std::string type_name(int n=-1)
Core functionality for getting the name of a templated mesh class.
Definition: PointCloudMesh.h:1446
EdgeIndex< under_type > size_type
Definition: PointCloudMesh.h:113
void get_nodes(typename Node::array_type &, typename Edge::index_type) const
Definition: PointCloudMesh.h:273
double get_size(typename Node::index_type) const
Get the size of an elemnt (length, area, volume)
Definition: PointCloudMesh.h:387
double get_size(typename Cell::index_type) const
Definition: PointCloudMesh.h:390
double inscribed_circumscribed_radius_metric(INDEX idx) const
Definition: PointCloudMesh.h:561
#define DEBUG_CONSTRUCTOR(type)
Definition: Debug.h:64
void derivate(const VECTOR1 &, INDEX, VECTOR2 &J) const
Definition: PointCloudMesh.h:494
void io(Piostream &stream)
Persistent I/O.
Definition: Mesh.cc:387
EdgeIndex< under_type > index_type
Definition: PointCloudMesh.h:111
mask_type synchronized_
Record which parts of the mesh are synchronized.
Definition: PointCloudMesh.h:1258
bool locate_elems(ARRAY &array, const Core::Geometry::BBox &b) const
Definition: PointCloudMesh.h:691
static const TypeDescription * node_type_description()
Definition: PointCloudMesh.h:1717
boost::shared_ptr< VMesh > vmesh_
Virtual interface.
Definition: PointCloudMesh.h:1266
Definition: PointCloudMesh.h:110
virtual int topology_geometry() const
Definition: PointCloudMesh.h:206
bool locate(typename Cell::index_type &, const Core::Geometry::Point &) const
Definition: PointCloudMesh.h:419
void to_index(typename Node::index_type &index, index_type i) const
Definition: PointCloudMesh.h:256
void z(double)
Definition: Vector.h:195
void get_point(Core::Geometry::Point &p, typename Node::index_type i) const
Definition: PointCloudMesh.h:437
void get_random_point(Core::Geometry::Point &p, const typename Elem::index_type i, FieldRNG &) const
Definition: PointCloudMesh.h:441
boost::shared_ptr< MeshFacade< VMesh > > MeshFacadeHandle
Definition: MeshTraits.h:61
int get_weights(const Core::Geometry::Point &p, typename Node::array_type &l, double *w)
Definition: PointCloudMesh.h:1395
CellIterator< under_type > iterator
Definition: PointCloudMesh.h:126
static MeshHandle mesh_maker()
This function returns a handle for the virtual interface.
Definition: PointCloudMesh.h:1221
void get_cells(typename Cell::array_type &, typename Face::index_type) const
Definition: PointCloudMesh.h:316
Elem::index_type add_elem(ARRAY a)
Definition: PointCloudMesh.h:456
boost::shared_ptr< PointCloudMesh< Basis > > handle_type
Definition: PointCloudMesh.h:99
void to_index(typename Cell::index_type &index, index_type i) const
Definition: PointCloudMesh.h:262
static Persistent * maker()
This function returns a maker for Pio.
Definition: PointCloudMesh.h:1219
void get_elems(typename Elem::array_type &, typename Edge::index_type) const
Definition: PointCloudMesh.h:332
virtual MeshFacadeHandle getFacade() const
Definition: PointCloudMesh.h:188
boost::shared_ptr< SearchGridT< index_type > > grid_
Definition: PointCloudMesh.h:1255
static const TypeDescription * elem_type_description()
Definition: PointCloudMesh.h:1215
int size
Definition: eabLatVolData.py:2
bool find_closest_elem(double &pdist, Core::Geometry::Point &result, INDEX &elem, const Core::Geometry::Point &p) const
Definition: PointCloudMesh.h:1090
void get_faces(typename Face::array_type &, typename Node::index_type) const
Definition: PointCloudMesh.h:297
#define DEBUG_DESTRUCTOR(type)
Definition: Debug.h:65
void get_delems(typename DElem::array_type &, typename Cell::index_type) const
Definition: PointCloudMesh.h:351
const TypeDescription * get_type_description(Core::Basis::ConstantBasis< T > *)
Definition: Constant.h:209