Skip to content

Commit 391a8a9

Browse files
committed
edge and edges to compas namespace
1 parent e93d240 commit 391a8a9

5 files changed

+10
-13
lines changed

include/compas.h

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ namespace compas
2424
using Mesh = CGAL::Surface_mesh<Point>;
2525
using RowMatrixXd = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
2626
using RowMatrixXi = Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
27+
using Edge = std::tuple<std::vector<double>, std::vector<double>>;
28+
using Edges = std::list<Edge>;
2729

2830
Polyhedron polyhedron_from_vertices_and_faces(const RowMatrixXd &V, const RowMatrixXi &F);
2931

src/skeletonization.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct Split_polylines
3939
}
4040
};
4141

42-
Edges pmp_mesh_skeleton(
42+
compas::Edges pmp_mesh_skeleton(
4343
Eigen::Ref<const compas::RowMatrixXd> &V,
4444
Eigen::Ref<const compas::RowMatrixXi> &F)
4545
{
@@ -63,7 +63,7 @@ Edges pmp_mesh_skeleton(
6363
// Split_polylines splitter(skeleton, polylines);
6464
// CGAL::split_graph_into_polylines(skeleton, splitter);
6565

66-
Edges edgelist;
66+
compas::Edges edgelist;
6767

6868
for (Skeleton_edge e : CGAL::make_range(edges(skeleton)))
6969
{
@@ -72,7 +72,7 @@ Edges pmp_mesh_skeleton(
7272

7373
std::vector<double> s_vec = {s.x(), s.y(), s.z()};
7474
std::vector<double> t_vec = {t.x(), t.y(), t.z()};
75-
Edge edge = std::make_tuple(s_vec, t_vec);
75+
compas::Edge edge = std::make_tuple(s_vec, t_vec);
7676

7777
edgelist.push_back(edge);
7878
}

src/skeletonization.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33

44
#include <compas.h>
55

6-
typedef std::tuple<std::vector<double>, std::vector<double>> Edge;
7-
typedef std::list<Edge> Edges;
8-
9-
Edges pmp_mesh_skeleton(
6+
compas::Edges pmp_mesh_skeleton(
107
Eigen::Ref<const compas::RowMatrixXd> &V,
118
Eigen::Ref<const compas::RowMatrixXi> &F);
129

src/straight_skeleton_2.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ typedef boost::shared_ptr<Ss> SsPtr;
1111
typedef CGAL::Straight_skeleton_2<K>::Halfedge_const_handle Halfedge_const_handle;
1212
typedef CGAL::Straight_skeleton_2<K>::Vertex_const_handle Vertex_const_handle;
1313

14-
Edges pmp_create_interior_straight_skeleton(
14+
compas::Edges pmp_create_interior_straight_skeleton(
1515
Eigen::Ref<const compas::RowMatrixXd> &V)
1616
{
1717
Polygon_2 poly;
@@ -20,7 +20,7 @@ Edges pmp_create_interior_straight_skeleton(
2020
poly.push_back(Point(V(i, 0), V(i, 1)));
2121
}
2222
SsPtr iss = CGAL::create_interior_straight_skeleton_2(poly.vertices_begin(), poly.vertices_end());
23-
Edges edgelist;
23+
compas::Edges edgelist;
2424
for(auto hit = iss->halfedges_begin(); hit != iss->halfedges_end(); ++hit){
2525
const Halfedge_const_handle h = hit;
2626
if(!h->is_bisector()){
@@ -31,7 +31,7 @@ Edges pmp_create_interior_straight_skeleton(
3131
if(&*v1 < &*v2){
3232
std::vector<double> s_vec = {v1->point().x(), v1->point().y(), 0};
3333
std::vector<double> t_vec = {v2->point().x(), v2->point().y(), 0};
34-
Edge edge = std::make_tuple(s_vec, t_vec);
34+
compas::Edge edge = std::make_tuple(s_vec, t_vec);
3535
edgelist.push_back(edge);
3636
}
3737

src/straight_skeleton_2.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
#include <compas.h>
55

6-
typedef std::tuple<std::vector<double>, std::vector<double>> Edge;
7-
typedef std::list<Edge> Edges;
86

9-
Edges pmp_create_interior_straight_skeleton(
7+
compas::Edges pmp_create_interior_straight_skeleton(
108
Eigen::Ref<const compas::RowMatrixXd> &V);
119

1210
#endif /* COMPAS_STRAIGHT_SKELETON_2_H */

0 commit comments

Comments
 (0)