added source set functions

This commit is contained in:
Christina Vaz 2018-05-25 23:43:59 -04:00
parent aba4792ce7
commit b58b22e7cc
1 changed files with 46 additions and 9 deletions

View File

@ -17,7 +17,7 @@
// SPDX-License-Identifier: GPL-3.0+ // SPDX-License-Identifier: GPL-3.0+
// //
// //
// Author(s) : Christina Cruz, Keenan Crane, Andreas Fabri // Author(s) : Christina Vaz, Keenan Crane, Andreas Fabri
#ifndef CGAL_HEAT_METHOD_3_HEAT_METHOD_3_H #ifndef CGAL_HEAT_METHOD_3_HEAT_METHOD_3_H
#define CGAL_HEAT_METHOD_3_HEAT_METHOD_3_H #define CGAL_HEAT_METHOD_3_HEAT_METHOD_3_H
@ -42,7 +42,7 @@ namespace Heat_method_3 {
typedef Eigen::Matrix3d Matrix; typedef Eigen::Matrix3d Matrix;
}; };
/** /**
* Class `Heat_method_3` is a ... * Class `Heat_method_3` is a ...
* \tparam TriangleMesh a triangulated surface mesh, model of `FaceGraph` and `HalfedgeListGraph` * \tparam TriangleMesh a triangulated surface mesh, model of `FaceGraph` and `HalfedgeListGraph`
@ -72,13 +72,13 @@ namespace Heat_method_3 {
typedef typename LA::Matrix Matrix; typedef typename LA::Matrix Matrix;
public: public:
Heat_method_3(const TriangleMesh& tm) Heat_method_3(const TriangleMesh& tm)
: tm(tm), vpm(get(vertex_point,tm)) : tm(tm), vpm(get(vertex_point,tm))
{ {
build(); build();
} }
Heat_method_3(const TriangleMesh& tm, VertexPointMap vpm) Heat_method_3(const TriangleMesh& tm, VertexPointMap vpm)
: tm(tm), vpm(vpm) : tm(tm), vpm(vpm)
{ {
@ -94,13 +94,50 @@ namespace Heat_method_3 {
} }
/** /**
* get distance from the current source set to a vertex ` vd`. *remove 'vd' from the source set, returning 'true' if 'vd' was in the set
*/
bool remove_source(vertex_descriptor vd)
{
if(sources.find(vd))
{
sources.erase(vd);
return true;
}
else
{
return false;
}
}
vertex_descriptor getSources()
{
return sources;
}
void clearSources()
{
sources.clear();
return;
}
vertex_descriptor sourcesBegin()
{
return sources.begin();
}
vertex_descriptor sourcesEnd()
{
return sources.end();
}
/**
* get distance from the current source set to a vertex ` vd`.
*/ */
double distance(vertex_descriptor vd) double distance(vertex_descriptor vd)
{ {
return 0; return 0;
} }
private: private:
void build() void build()
@ -112,14 +149,14 @@ namespace Heat_method_3 {
} }
} }
} }
const TriangleMesh& tm; const TriangleMesh& tm;
VertexPointMap vpm; VertexPointMap vpm;
std::set<vertex_descriptor> sources; std::set<vertex_descriptor> sources;
Matrix m; Matrix m;
}; };
} // namespace Heat_method_3 } // namespace Heat_method_3
} // namespace CGAL } // namespace CGAL