37 for (
int i = 0; i < M; i++)
46 for (
int i = 0; i < N; i++)
68 for (
int i = 0; i < N; i++)
70 delete (*vert_list_)[i];
71 (*vert_list_)[i] = NULL;
80 for (
int i = 0; i < M; i++)
82 delete (*edge_list_)[i];
83 (*edge_list_)[i] = NULL;
92 for (
int i = 0; i < F; i++)
94 delete (*face_list_)[i];
95 (*face_list_)[i] = NULL;
141 for (
int e_id = 0; e_id < Nd; e_id++)
172 for (
int i = 0; i < Md; i++)
174 delete (*edge_list_)[i];
192 for (
int i = 0; i < M; i++)
205 (*vert_list_)[i]->SetDualId(-1);
210 for (
int i = 0; i < N; i++)
218 (*face_list_)[i]->SetDualId(-1);
223 for (
int i = 0; i < N; i++)
232 while (edge->
pnext_ != NULL)
286 return (max(dual_u, dual_v));
323 (*vert_list_)[i]->SetDualId(
Nd_);
324 (*vert_list_)[j]->SetDualId(
Nd_);
325 (*vert_list_)[
Nd_]->SetOrigId(i);
333 int u = (*vert_list_)[e1->
ID()]->dual_id();
334 int v = (*vert_list_)[e2->
ID()]->dual_id();
336 if (u != -1 && v != -1)
349 (*face_list_)[
u]->SetDualId(
Fd_);
350 (*face_list_)[
Fd_]->SetOrigId(u);
356 (*face_list_)[
u]->SetDualId(
Fd_);
357 (*face_list_)[
Fd_]->SetOrigId(u);
362 int orig_v = (*face_list_)[dual_v]->orig_id();
364 (*face_list_)[
u]->SetDualId(dual_v);
365 (*face_list_)[dual_v]->SetOrigId(u);
367 (*face_list_)[orig_v]->SetDualId(
Fd_);
368 (*face_list_)[
Fd_]->SetOrigId(orig_v);
384 int ei = (*vert_list_)[i]->dual_id();
385 int dual_e =
Nd_ - 1;
386 int orig_e1 = (*vert_list_)[dual_e]->orig_id();
390 (*vert_list_)[i]->SetDualId(-1);
391 (*vert_list_)[j]->SetDualId(-1);
392 (*vert_list_)[orig_e1]->SetDualId(ei);
393 (*vert_list_)[orig_e1]->SetDualId(ei);
394 (*vert_list_)[ei]->SetOrigId(orig_e1);
395 (*vert_list_)[ei]->SetHeight((e_swap->
CenterPos()).
z());
403 int orig_u = p->
ID();
404 int dual_u = (*face_list_)[orig_u]->dual_id();
405 (*face_list_)[orig_u]->SetDualId(-1);
406 (*face_list_)[dual_u]->SetOrigId(-1);
408 for (
int i = dual_u; i <
Fd_ - 1; i++)
411 int orig_j = (*face_list_)[j]->orig_id();
412 (*face_list_)[orig_j]->SetDualId(i);
413 (*face_list_)[i]->SetOrigId(orig_j);
428 for (
int i = 0; i < M; i++)
433 printf(
"**********%d:\n", i);
434 printf(
"start vertex: %d\n", start_id);
435 printf(
"end vertex: %d\n", end_id);
436 int dual_id = (*vert_list_)[i]->dual_id();
437 printf(
"dual vertex: %d\n", dual_id);
438 printf(
"original vertex: %d\n", (*
vert_list_)[dual_id]->orig_id());
443 for (
int i = 0; i < N; i++)
446 printf(
"**********%d:\n", i);
447 int dual_id = (*face_list_)[i]->dual_id();
448 printf(
"dual vertex: %d\n", dual_id);
449 printf(
"original vertex: %d\n", (*
face_list_)[dual_id]->orig_id());
453 for (
int i = 0; i <
Md_; i++)
int GetDegree(int u) const
int DeleteFace(WF_vert *p)
WF_edge * GetNeighborEdge(int u)
int InsertFace(WF_vert *p)
vector< DualFace * > * face_list_
GLubyte GLubyte GLubyte GLubyte w
void DeleteVertex(WF_edge *e)
vector< DualEdge * > * edge_list_
int SizeOfVertList() const
void InsertEdge(WF_edge *e1, WF_edge *e2, double w, WF_vert *vert)
vector< bool > exist_edge_
vector< DualVertex * > * vert_list_
GLdouble GLdouble GLdouble z
int RemoveUpdation(WF_edge *e)
vector< int > exist_vert_
point GetPosition(int u) const
void InsertVertex(WF_edge *e)
void UpdateDualization(VectorXd *ptr_x)
int SizeOfEdgeList() const