本文整理汇总了C++中Halfedge_handle::set_data方法的典型用法代码示例。如果您正苦于以下问题:C++ Halfedge_handle::set_data方法的具体用法?C++ Halfedge_handle::set_data怎么用?C++ Halfedge_handle::set_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Halfedge_handle
的用法示例。
在下文中一共展示了Halfedge_handle::set_data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: after_split_edge
virtual void after_split_edge (Halfedge_handle h1, Halfedge_handle h2)
{
std::string str = h1->data();
if (str.compare("") == 0)
str = h2->data();
if (str.compare("") == 0)
str = h1->twin()->data();
if (str.compare("") == 0)
str = h2->twin()->data();
h1->set_data(str);
h2->set_data(str);
h1->twin()->set_data(str);
h2->twin()->set_data(str);
}
示例2:
void Map_CreateWithLineData(
Pmwx& out_map,
const vector<Segment_2>& input_curves,
const vector<GIS_halfedge_data>& input_data)
{
DebugAssert(input_curves.size() == input_data.size());
out_map.clear();
int n;
vector<Curve_2> curves;
curves.resize(input_curves.size());
for(n = 0; n < input_curves.size(); ++n)
curves[n] = Curve_2(input_curves[n], n);
CGAL::insert(out_map, curves.begin(), curves.end());
for(Pmwx::Edge_iterator eit = out_map.edges_begin(); eit != out_map.edges_end(); ++eit)
{
DebugAssert(eit->curve().data().size() >= 1);
// CGAL maintains a lot of information for us that makes life easy:
// 1. The underlying curve of an edge is a sub-curve of the input curve - it is NEVER flipped. is_directed_right tells whether
// it is lex-right.*
// 2. Each half-edge's direction tells us if the half-edge is lex-right...strangely, "SMALLER" means lex-right.
// Putting these two things together, we can easily detect which of two half-edges is in the same vs. opposite direction of the input
// curve.
// * lex-right means lexicographically x-y larger...means target is to the right of source UNLESS it's vertical (then UP = true, down = false).
Halfedge_handle he = he_is_same_direction(eit) ? eit : eit->twin();
int cid = eit->curve().data().front();
DebugAssert(cid >= 0 && cid < input_data.size());
he->set_data(input_data[cid]);
// he->data().mDominant = true;
// he->twin()->data().mDominant = false;
// Do NOT leave the keys in the map...
eit->curve().data().clear();
}
}
示例3: create_edge
/*! Create an edge e that matches the edge e2, contained in the face f1. */
virtual void create_edge(Face_const_handle f1, Halfedge_const_handle e2,
Halfedge_handle e) const
{
e->set_data(f1->data() + e2->data());
e->twin()->set_data(f1->data() + e2->data());
}