Blender  V3.3
WEdge.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 #include <iostream>
9 
10 #include "WEdge.h"
11 
12 namespace Freestyle {
13 
15 class vertexdata {
16  public:
18 };
19 
20 class oedgedata {
21  public:
23 };
24 
25 class edgedata {
26  public:
28 };
29 
30 class facedata {
31  public:
33 };
34 
35 /**********************************
36  * *
37  * *
38  * WVertex *
39  * *
40  * *
41  **********************************/
42 
44 {
45  _Id = iBrother._Id;
46  _Vertex = iBrother._Vertex;
47  _EdgeList = iBrother._EdgeList;
48 
49  _Shape = iBrother._Shape;
50  _Smooth = iBrother._Smooth;
51  _Border = iBrother._Border;
52  userdata = nullptr;
53  iBrother.userdata = new vertexdata;
54  ((vertexdata *)(iBrother.userdata))->_copy = this;
55 }
56 
58 {
59  WVertex *clone = new WVertex(*this);
60  return clone;
61 }
62 
64 {
65  return _current;
66 }
67 
69 {
70  WOEdge *twin = _current->twin();
71  if (!twin) {
72  // we reached a hole
73  _current = nullptr;
74  return;
75  }
76  WOEdge *next = twin->getPrevOnFace();
77  if (next == _begin) {
78  next = nullptr;
79  }
80  _current = next;
81 }
82 
84 {
85  WOEdge *woedge = *_edge_it;
86  if (!woedge) {
87  return nullptr;
88  }
89  return (woedge)->GetbFace();
90 }
91 
92 #if 0
93 bool WVertex::isBoundary() const
94 {
95  return _Border;
96 }
97 #endif
99 {
100  if (_Border == 1) {
101  return true;
102  }
103  if (_Border == 0) {
104  return false;
105  }
106 
107  vector<WEdge *>::const_iterator it;
108  for (it = _EdgeList.begin(); it != _EdgeList.end(); it++) {
109  if ((*it)->GetNumberOfOEdges() == 1) {
110  _Border = 1;
111  return true;
112  }
113  }
114 #if 0
115  if (!(*it)->GetaOEdge()->GetaFace()) {
116  return true;
117  }
118 #endif
119  _Border = 0;
120  return false;
121 }
122 
124 {
125  _EdgeList.push_back(iEdge);
126 }
127 
129 {
130  WOEdge *begin;
131  WEdge *wedge = _EdgeList.front();
132  WOEdge *aOEdge = wedge->GetaOEdge();
133  if (aOEdge->GetbVertex() == this) {
134  begin = aOEdge;
135  }
136  else {
137  begin = _EdgeList.front()->GetbOEdge();
138  }
139  return incoming_edge_iterator(this, begin, begin);
140 }
141 
143 {
144  WOEdge *begin;
145  WOEdge *aOEdge = _EdgeList.front()->GetaOEdge();
146  if (aOEdge->GetbVertex() == this) {
147  begin = aOEdge;
148  }
149  else {
150  begin = _EdgeList.front()->GetbOEdge();
151  }
152  return incoming_edge_iterator(this, begin, nullptr);
153 }
154 #if 0
155 WOEdge **WVertex::incoming_edge_iterator::operator->()
156 {
157  WOEdge **ppaOEdge = (*_iter)->GetaOEdge();
158  if (aOEdge->GetbVertex() == _vertex) {
159  return ppaOEdge;
160  }
161  else {
162  WOEdge *bOEdge = (*_iter)->GetbOEdge();
163  return &bOEdge;
164  }
165 }
166 #endif
167 
168 /**********************************
169  * *
170  * *
171  * WOEdge *
172  * *
173  * *
174  **********************************/
175 
177 {
178  _paVertex = iBrother.GetaVertex();
179  _pbVertex = iBrother.GetbVertex();
180  _paFace = iBrother.GetaFace();
181  _pbFace = iBrother.GetbFace();
182  _pOwner = iBrother.GetOwner();
183  userdata = nullptr;
184  iBrother.userdata = new oedgedata;
185  ((oedgedata *)(iBrother.userdata))->_copy = this;
186 
187  _vec = iBrother._vec;
188  _angle = iBrother._angle;
189 }
190 
192 {
193  WOEdge *clone = new WOEdge(*this);
194  return clone;
195 }
196 
198 {
199  return GetOwner()->GetOtherOEdge(this);
200 }
201 
203 {
204  return _pbFace->GetPrevOEdge(this);
205 }
206 
207 /**********************************
208  * *
209  * *
210  * WEdge *
211  * *
212  * *
213  **********************************/
214 
215 WEdge::WEdge(WEdge &iBrother)
216 {
217  _paOEdge = nullptr;
218  _pbOEdge = nullptr;
219  WOEdge *aoedge = iBrother.GetaOEdge();
220  WOEdge *boedge = iBrother.GetbOEdge();
221  userdata = nullptr;
222 
223  if (aoedge) {
224  //_paOEdge = new WOEdge(*aoedge);
225  _paOEdge = aoedge->duplicate();
226  }
227  if (boedge) {
228  //_pbOEdge = new WOEdge(*boedge);
229  _pbOEdge = boedge->duplicate();
230  }
231 
232  _nOEdges = iBrother.GetNumberOfOEdges();
233  _Id = iBrother.GetId();
234  iBrother.userdata = new edgedata;
235  ((edgedata *)(iBrother.userdata))->_copy = this;
236 }
237 
239 {
240  WEdge *clone = new WEdge(*this);
241  return clone;
242 }
243 
244 /**********************************
245  * *
246  * *
247  * WFace *
248  * *
249  * *
250  **********************************/
251 
252 WFace::WFace(WFace &iBrother)
253 {
254  _OEdgeList = iBrother.getEdgeList();
255  _Normal = iBrother.GetNormal();
256  _VerticesNormals = iBrother._VerticesNormals;
257  _VerticesTexCoords = iBrother._VerticesTexCoords;
258  _Id = iBrother.GetId();
259  _FrsMaterialIndex = iBrother._FrsMaterialIndex;
260  _Mark = iBrother._Mark;
261  userdata = nullptr;
262  iBrother.userdata = new facedata;
263  ((facedata *)(iBrother.userdata))->_copy = this;
264 }
265 
267 {
268  WFace *clone = new WFace(*this);
269  return clone;
270 }
271 
273 {
274  return getShape()->frs_material(_FrsMaterialIndex);
275 }
276 
278 {
279  // First check whether the same oriented edge already exists or not:
280  vector<WEdge *> &v1Edges = v1->GetEdges();
281  for (vector<WEdge *>::iterator it1 = v1Edges.begin(), end = v1Edges.end(); it1 != end; it1++) {
282  WEdge *we = (*it1);
283  WOEdge *woea = we->GetaOEdge();
284 
285  if ((woea->GetaVertex() == v1) && (woea->GetbVertex() == v2)) {
286  // The oriented edge already exists
287  cerr << "Warning: edge " << v1->GetId() << " - " << v2->GetId()
288  << " appears twice, correcting" << endl;
289  // Adds the edge to the face
290  AddEdge(woea);
291  (*it1)->setNumberOfOEdges((*it1)->GetNumberOfOEdges() + 1);
292  // sets these vertices as border:
293  v1->setBorder(true);
294  v2->setBorder(true);
295  return woea;
296  }
297 
298  WOEdge *woeb = we->GetbOEdge();
299  if (woeb && (woeb->GetaVertex() == v1) && (woeb->GetbVertex() == v2)) {
300  // The oriented edge already exists
301  cerr << "Warning: edge " << v1->GetId() << " - " << v2->GetId()
302  << " appears twice, correcting" << endl;
303  // Adds the edge to the face
304  AddEdge(woeb);
305  (*it1)->setNumberOfOEdges((*it1)->GetNumberOfOEdges() + 1);
306  // sets these vertices as border:
307  v1->setBorder(true);
308  v2->setBorder(true);
309  return woeb;
310  }
311  }
312 
313  // the oriented edge we're about to build
314  WOEdge *pOEdge = new WOEdge;
315  // The edge containing the oriented edge.
316  WEdge *edge;
317 
318  // checks whether this edge already exists or not
319  // If it exists, it points outward v2
320  bool exist = false;
321  WOEdge *pInvertEdge = nullptr; // The inverted edge if it exists
322  vector<WEdge *> &v2Edges = v2->GetEdges();
323  vector<WEdge *>::iterator it;
324  for (it = v2Edges.begin(); it != v2Edges.end(); it++) {
325  if ((*it)->GetbVertex() == v1) {
326  // The invert edge already exists
327  exist = true;
328  pInvertEdge = (*it)->GetaOEdge();
329  break;
330  }
331  }
332 
333  // DEBUG:
334  if (true == exist) { // The invert edge already exists
335  // Retrieves the corresponding edge
336  edge = pInvertEdge->GetOwner();
337 
338  // Sets the a Face (retrieved from pInvertEdge
339  pOEdge->setaFace(pInvertEdge->GetbFace());
340 
341  // Updates the invert edge:
342  pInvertEdge->setaFace(this);
343  }
344  else { // The invert edge does not exist yet
345  // we must create a new edge
346  // edge = new WEdge;
347  edge = instanciateEdge();
348 
349  // updates the a,b vertex edges list:
350  v1->AddEdge(edge);
351  v2->AddEdge(edge);
352  }
353 
354  pOEdge->setOwner(edge);
355  // Add the vertices:
356  pOEdge->setaVertex(v1);
357  pOEdge->setbVertex(v2);
358 
359  // Debug:
360  if (v1->GetId() == v2->GetId()) {
361  cerr << "Warning: edge " << this << " null with vertex " << v1->GetId() << endl;
362  }
363 
364  edge->AddOEdge(pOEdge);
365  // edge->setNumberOfOEdges(edge->GetNumberOfOEdges() + 1);
366 
367  // Add this face (the b face)
368  pOEdge->setbFace(this);
369 
370  // Adds the edge to the face
371  AddEdge(pOEdge);
372 
373  return pOEdge;
374 }
375 
377 {
378  if (_OEdgeList.size() != 3) {
379  return false;
380  }
381 
382  vector<WOEdge *>::iterator it;
383  e = nullptr;
384  for (it = _OEdgeList.begin(); it != _OEdgeList.end(); it++) {
385  if ((*it)->GetaVertex() == v) {
386  e = *it;
387  }
388  }
389  if (!e) {
390  return false;
391  }
392  e = nullptr;
393  for (it = _OEdgeList.begin(); it != _OEdgeList.end(); it++) {
394  if (((*it)->GetaVertex() != v) && ((*it)->GetbVertex() != v)) {
395  e = *it;
396  }
397  }
398  if (!e) {
399  return false;
400  }
401 
402  return true;
403 }
404 
406 {
407  vector<WOEdge *>::iterator it;
408  Vec3f origin = (*(_OEdgeList.begin()))->GetaVertex()->GetVertex();
409  it = _OEdgeList.begin();
410  float a = 0;
411  for (it = it++; it != _OEdgeList.end(); it++) {
412  Vec3f v1 = Vec3f((*it)->GetaVertex()->GetVertex() - origin);
413  Vec3f v2 = Vec3f((*it)->GetbVertex()->GetVertex() - origin);
414  a += (v1 ^ v2).norm() / 2.0f;
415  }
416  return a;
417 }
418 
420 {
421  vector<WOEdge *>::iterator woe, woend, woefirst;
422  woefirst = _OEdgeList.begin();
423  woend = _OEdgeList.end();
424  WOEdge *prev = *woefirst;
425  woe = woefirst;
426  ++woe;
427  for (; woe != woend; woe++) {
428  if ((*woe) == iOEdge) {
429  return prev;
430  }
431  prev = *woe;
432  }
433  // We left the loop. That means that the first OEdge was the good one:
434  if ((*woefirst) == iOEdge) {
435  return prev;
436  }
437 
438  return nullptr;
439 }
440 
442 {
443  return GetVertex(0)->shape();
444 }
445 
446 /**********************************
447  * *
448  * *
449  * WShape *
450  * *
451  * *
452  **********************************/
453 
454 unsigned WShape::_SceneCurrentId = 0;
455 
457 {
458  WShape *clone = new WShape(*this);
459  return clone;
460 }
461 
463 {
464  _Id = iBrother.GetId();
465  _Name = iBrother._Name;
466  _LibraryPath = iBrother._LibraryPath;
467  _FrsMaterials = iBrother._FrsMaterials;
468 #if 0
469  _meanEdgeSize = iBrother._meanEdgeSize;
470  iBrother.bbox(_min, _max);
471 #endif
472  vector<WVertex *> &vertexList = iBrother.getVertexList();
473  vector<WVertex *>::iterator v = vertexList.begin(), vend = vertexList.end();
474  for (; v != vend; ++v) {
475  // WVertex *newVertex = new WVertex(*(*v));
476  WVertex *newVertex = (*v)->duplicate();
477 
478  newVertex->setShape(this);
479  AddVertex(newVertex);
480  }
481 
482  vector<WEdge *> &edgeList = iBrother.getEdgeList();
483  vector<WEdge *>::iterator e = edgeList.begin(), eend = edgeList.end();
484  for (; e != eend; ++e) {
485  // WEdge *newEdge = new WEdge(*(*e));
486  WEdge *newEdge = (*e)->duplicate();
487  AddEdge(newEdge);
488  }
489 
490  vector<WFace *> &faceList = iBrother.GetFaceList();
491  vector<WFace *>::iterator f = faceList.begin(), fend = faceList.end();
492  for (; f != fend; ++f) {
493  // WFace *newFace = new WFace(*(*f));
494  WFace *newFace = (*f)->duplicate();
495  AddFace(newFace);
496  }
497 
498  // update all pointed addresses thanks to the newly created objects:
499  vend = _VertexList.end();
500  for (v = _VertexList.begin(); v != vend; ++v) {
501  const vector<WEdge *> &vedgeList = (*v)->GetEdges();
502  vector<WEdge *> newvedgelist;
503  unsigned int i;
504  for (i = 0; i < vedgeList.size(); i++) {
505  WEdge *current = vedgeList[i];
506  edgedata *currentvedata = (edgedata *)current->userdata;
507  newvedgelist.push_back(currentvedata->_copy);
508  }
509  (*v)->setEdges(newvedgelist);
510  }
511 
512  eend = _EdgeList.end();
513  for (e = _EdgeList.begin(); e != eend; ++e) {
514  // update aOedge:
515  WOEdge *aoEdge = (*e)->GetaOEdge();
516  aoEdge->setaVertex(((vertexdata *)(aoEdge->GetaVertex()->userdata))->_copy);
517  aoEdge->setbVertex(((vertexdata *)(aoEdge->GetbVertex()->userdata))->_copy);
518  if (aoEdge->GetaFace()) {
519  aoEdge->setaFace(((facedata *)(aoEdge->GetaFace()->userdata))->_copy);
520  }
521  aoEdge->setbFace(((facedata *)(aoEdge->GetbFace()->userdata))->_copy);
522  aoEdge->setOwner(((edgedata *)(aoEdge->GetOwner()->userdata))->_copy);
523 
524  // update bOedge:
525  WOEdge *boEdge = (*e)->GetbOEdge();
526  if (boEdge) {
527  boEdge->setaVertex(((vertexdata *)(boEdge->GetaVertex()->userdata))->_copy);
528  boEdge->setbVertex(((vertexdata *)(boEdge->GetbVertex()->userdata))->_copy);
529  if (boEdge->GetaFace()) {
530  boEdge->setaFace(((facedata *)(boEdge->GetaFace()->userdata))->_copy);
531  }
532  boEdge->setbFace(((facedata *)(boEdge->GetbFace()->userdata))->_copy);
533  boEdge->setOwner(((edgedata *)(boEdge->GetOwner()->userdata))->_copy);
534  }
535  }
536 
537  fend = _FaceList.end();
538  for (f = _FaceList.begin(); f != fend; ++f) {
539  unsigned int i;
540  const vector<WOEdge *> &oedgeList = (*f)->getEdgeList();
541  vector<WOEdge *> newoedgelist;
542 
543  unsigned int n = oedgeList.size();
544  for (i = 0; i < n; i++) {
545  WOEdge *current = oedgeList[i];
546  oedgedata *currentoedata = (oedgedata *)current->userdata;
547  newoedgelist.push_back(currentoedata->_copy);
548  // oedgeList[i] = currentoedata->_copy;
549  // oedgeList[i] = ((oedgedata *)(oedgeList[i]->userdata))->_copy;
550  }
551  (*f)->setEdgeList(newoedgelist);
552  }
553 
554  // Free all memory (arghh!)
555  // Vertex
556  vend = iBrother.getVertexList().end();
557  for (v = iBrother.getVertexList().begin(); v != vend; ++v) {
558  delete (vertexdata *)((*v)->userdata);
559  (*v)->userdata = nullptr;
560  }
561 
562  // Edges and OEdges:
563  eend = iBrother.getEdgeList().end();
564  for (e = iBrother.getEdgeList().begin(); e != eend; ++e) {
565  delete (edgedata *)((*e)->userdata);
566  (*e)->userdata = nullptr;
567  // OEdge a:
568  delete (oedgedata *)((*e)->GetaOEdge()->userdata);
569  (*e)->GetaOEdge()->userdata = nullptr;
570  // OEdge b:
571  WOEdge *oedgeb = (*e)->GetbOEdge();
572  if (oedgeb) {
573  delete (oedgedata *)(oedgeb->userdata);
574  oedgeb->userdata = nullptr;
575  }
576  }
577 
578  // Faces
579  fend = iBrother.GetFaceList().end();
580  for (f = iBrother.GetFaceList().begin(); f != fend; ++f) {
581  delete (facedata *)((*f)->userdata);
582  (*f)->userdata = nullptr;
583  }
584 }
585 
586 WFace *WShape::MakeFace(vector<WVertex *> &iVertexList,
587  vector<bool> &iFaceEdgeMarksList,
588  unsigned iMaterial)
589 {
590  // allocate the new face
591  WFace *face = instanciateFace();
592 
593  WFace *result = MakeFace(iVertexList, iFaceEdgeMarksList, iMaterial, face);
594  if (!result) {
595  delete face;
596  }
597  return result;
598 }
599 
600 WFace *WShape::MakeFace(vector<WVertex *> &iVertexList,
601  vector<Vec3f> &iNormalsList,
602  vector<Vec2f> &iTexCoordsList,
603  vector<bool> &iFaceEdgeMarksList,
604  unsigned iMaterial)
605 {
606  // allocate the new face
607  WFace *face = MakeFace(iVertexList, iFaceEdgeMarksList, iMaterial);
608 
609  if (!face) {
610  return nullptr;
611  }
612 
613  // set the list of per-vertex normals
614  face->setNormalList(iNormalsList);
615  // set the list of per-vertex tex coords
616  face->setTexCoordsList(iTexCoordsList);
617 
618  return face;
619 }
620 
621 WFace *WShape::MakeFace(vector<WVertex *> &iVertexList,
622  vector<bool> &iFaceEdgeMarksList,
623  unsigned iMaterial,
624  WFace *face)
625 {
626  int id = _FaceList.size();
627 
628  face->setFrsMaterialIndex(iMaterial);
629 
630  // Check whether we have a degenerated face:
631 
632  // LET'S HACK IT FOR THE TRIANGLE CASE:
633 
634  if (3 == iVertexList.size()) {
635  if ((iVertexList[0] == iVertexList[1]) || (iVertexList[0] == iVertexList[2]) ||
636  (iVertexList[2] == iVertexList[1])) {
637  cerr << "Warning: degenerated triangle detected, correcting" << endl;
638  return nullptr;
639  }
640  }
641 
642  vector<WVertex *>::iterator it;
643 
644  // compute the face normal (v1v2 ^ v1v3)
645  // Double precision numbers are used here to avoid truncation errors [T47705]
646  Vec3r v1, v2, v3;
647  it = iVertexList.begin();
648  v1 = (*it)->GetVertex();
649  it++;
650  v2 = (*it)->GetVertex();
651  it++;
652  v3 = (*it)->GetVertex();
653 
654  Vec3r vector1(v2 - v1);
655  Vec3r vector2(v3 - v1);
656 
657  Vec3r normal(vector1 ^ vector2);
658  normal.normalize();
659  face->setNormal(normal);
660 
661  vector<bool>::iterator mit = iFaceEdgeMarksList.begin();
662  face->setMark(*mit);
663  mit++;
664 
665  // vertex pointers used to build each edge
666  vector<WVertex *>::iterator va, vb;
667 
668  va = iVertexList.begin();
669  vb = va;
670  for (; va != iVertexList.end(); va = vb) {
671  ++vb;
672  // Adds va to the vertex list:
673  // face->AddVertex(*va);
674 
675  WOEdge *oedge;
676  if (*va == iVertexList.back()) {
677  oedge = face->MakeEdge(*va, iVertexList.front()); // for the last (closing) edge
678  }
679  else {
680  oedge = face->MakeEdge(*va, *vb);
681  }
682 
683  if (!oedge) {
684  return nullptr;
685  }
686 
687  WEdge *edge = oedge->GetOwner();
688  if (1 == edge->GetNumberOfOEdges()) {
689  // means that we just created a new edge and that we must add it to the shape's edges list
690  edge->setId(_EdgeList.size());
691  AddEdge(edge);
692 #if 0
693  // compute the mean edge value:
694  _meanEdgeSize += edge->GetaOEdge()->GetVec().norm();
695 #endif
696  }
697 
698  edge->setMark(*mit);
699  ++mit;
700  }
701 
702  // Add the face to the shape's faces list:
703  face->setId(id);
704  AddFace(face);
705 
706  return face;
707 }
708 
710 {
711  real meanEdgeSize = 0.0;
712  for (vector<WEdge *>::const_iterator it = _EdgeList.begin(), itend = _EdgeList.end();
713  it != itend;
714  it++) {
715  meanEdgeSize += (*it)->GetaOEdge()->GetVec().norm();
716  }
717  return meanEdgeSize / (real)_EdgeList.size();
718 }
719 
720 } /* namespace Freestyle */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Classes to define a Winged Edge data structure.
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
Definition: btVector3.h:263
short GetNumberOfOEdges()
Definition: WEdge.h:586
int GetId()
Definition: WEdge.h:596
WOEdge * GetbOEdge()
Definition: WEdge.h:581
void * userdata
Definition: WEdge.h:509
virtual WEdge * duplicate()
Definition: WEdge.cpp:238
WOEdge * GetaOEdge()
Definition: WEdge.h:576
void * userdata
Definition: WEdge.h:703
float getArea()
Definition: WEdge.cpp:405
void setMark(bool iMark)
Definition: WEdge.h:933
vector< Vec2f > _VerticesTexCoords
Definition: WEdge.h:696
void setNormal(const Vec3f &iNormal)
Definition: WEdge.h:908
void setFrsMaterialIndex(unsigned iMaterialIndex)
Definition: WEdge.h:928
int GetId()
Definition: WEdge.h:733
const FrsMaterial & frs_material()
Definition: WEdge.cpp:272
Vec3f & GetNormal()
Definition: WEdge.h:728
unsigned _FrsMaterialIndex
Definition: WEdge.h:699
WOEdge * GetPrevOEdge(WOEdge *iOEdge)
Definition: WEdge.cpp:419
virtual WOEdge * MakeEdge(WVertex *v1, WVertex *v2)
Definition: WEdge.cpp:277
virtual WFace * duplicate()
Definition: WEdge.cpp:266
void setId(int id)
Definition: WEdge.h:923
bool getOppositeEdge(const WVertex *v, WOEdge *&e)
Definition: WEdge.cpp:376
WShape * getShape()
Definition: WEdge.cpp:441
void setNormalList(const vector< Vec3f > &iNormalsList)
Definition: WEdge.h:913
void setTexCoordsList(const vector< Vec2f > &iTexCoordsList)
Definition: WEdge.h:918
const vector< WOEdge * > & getEdgeList()
Definition: WEdge.h:718
vector< Vec3f > _VerticesNormals
Definition: WEdge.h:695
void setbVertex(WVertex *pv)
Definition: WEdge.h:453
void setbFace(WFace *pf)
Definition: WEdge.h:465
void setaFace(WFace *pf)
Definition: WEdge.h:459
void setOwner(WEdge *pe)
Definition: WEdge.h:471
WFace * GetbFace()
Definition: WEdge.h:402
virtual WOEdge * duplicate()
Definition: WEdge.cpp:191
WVertex * GetaVertex()
Definition: WEdge.h:387
WOEdge * twin()
Definition: WEdge.cpp:197
void setaVertex(WVertex *pv)
Definition: WEdge.h:447
WEdge * GetOwner()
Definition: WEdge.h:407
WFace * GetaFace()
Definition: WEdge.h:397
float _angle
Definition: WEdge.h:337
void * userdata
Definition: WEdge.h:340
WOEdge * getPrevOnFace()
Definition: WEdge.cpp:202
WVertex * GetbVertex()
Definition: WEdge.h:392
vector< WEdge * > & getEdgeList()
Definition: WEdge.h:1045
real ComputeMeanEdgeSize() const
Definition: WEdge.cpp:709
vector< FrsMaterial > _FrsMaterials
Definition: WEdge.h:998
string _LibraryPath
Definition: WEdge.h:992
virtual WShape * duplicate()
Definition: WEdge.cpp:456
static unsigned _SceneCurrentId
Definition: WEdge.h:993
virtual WFace * MakeFace(vector< WVertex * > &iVertexList, vector< bool > &iFaceEdgeMarksList, unsigned iMaterialIndex)
Definition: WEdge.cpp:586
vector< WVertex * > & getVertexList()
Definition: WEdge.h:1050
string _Name
Definition: WEdge.h:991
vector< WFace * > & GetFaceList()
Definition: WEdge.h:1055
unsigned GetId()
Definition: WEdge.h:1060
virtual WFace * operator*()
Definition: WEdge.cpp:83
bool isBoundary()
Definition: WEdge.cpp:98
Vec3f & GetVertex()
Definition: WEdge.h:73
WShape * _Shape
Definition: WEdge.h:49
virtual incoming_edge_iterator incoming_edges_begin()
Definition: WEdge.cpp:128
void * userdata
Definition: WEdge.h:54
WVertex(const Vec3f &v)
Definition: WEdge.h:55
vector< WEdge * > _EdgeList
Definition: WEdge.h:48
virtual incoming_edge_iterator incoming_edges_end()
Definition: WEdge.cpp:142
Vec3f _Vertex
Definition: WEdge.h:47
void setShape(WShape *iShape)
Definition: WEdge.h:116
void AddEdge(WEdge *iEdge)
Definition: WEdge.cpp:123
short _Border
Definition: WEdge.h:51
virtual WVertex * duplicate()
Definition: WEdge.cpp:57
WOEdge * _copy
Definition: WEdge.cpp:22
WVertex * _copy
Definition: WEdge.cpp:17
struct Vec3f Vec3f
IconTextureDrawCall normal
static ulong * next
inherits from class Rep
Definition: AppCanvas.cpp:18
static unsigned a[3]
Definition: RandGen.cpp:78
double real
Definition: Precision.h:12
SymEdge< T > * prev(const SymEdge< T > *se)
Definition: delaunay_2d.cc:105