Blender  V3.3
WXEdge.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include "Curvature.h"
11 #include "Nature.h"
12 #include "WEdge.h"
13 
14 #ifdef WITH_CXX_GUARDEDALLOC
15 # include "MEM_guardedalloc.h"
16 #endif
17 
18 namespace Freestyle {
19 
21 
22 /**********************************
23  * *
24  * *
25  * WXVertex *
26  * *
27  * *
28  **********************************/
29 
30 class WXVertex : public WVertex {
31  private:
32  // Curvature info
33  CurvatureInfo *_curvatures;
34 
35  public:
36  inline WXVertex(const Vec3f &v) : WVertex(v)
37  {
38  _curvatures = NULL;
39  }
40 
42  WXVertex(WXVertex &iBrother) : WVertex(iBrother)
43  {
44  _curvatures = new CurvatureInfo(*iBrother._curvatures);
45  }
46 
47  virtual WVertex *duplicate()
48  {
49  WXVertex *clone = new WXVertex(*this);
50  return clone;
51  }
52 
53  virtual ~WXVertex()
54  {
55  if (_curvatures) {
56  delete _curvatures;
57  }
58  }
59 
60  virtual void Reset()
61  {
62  if (_curvatures) {
63  _curvatures->Kr = 0.0;
64  }
65  }
66 
67  inline void setCurvatures(CurvatureInfo *ci)
68  {
69  _curvatures = ci;
70  }
71 
72  inline bool isFeature();
73 
75  {
76  return _curvatures;
77  }
78 
79 #ifdef WITH_CXX_GUARDEDALLOC
80  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:WXVertex")
81 #endif
82 };
83 
84 /**********************************
85  * *
86  * *
87  * WXEdge *
88  * *
89  * *
90  **********************************/
91 
92 class WXEdge : public WEdge {
93  private:
94  // flag to indicate whether the edge is a silhouette edge or not
95  WXNature _nature;
96  // 0: the order doesn't matter. 1: the order is the original one. -1: the order is not good
97  short _order;
98  // A front facing edge is an edge for which the bording face which is the nearest from the
99  // viewpoint is front. A back facing edge is the opposite.
100  bool _front;
101 
102  public:
103  inline WXEdge() : WEdge()
104  {
105  _nature = Nature::NO_FEATURE;
106  _front = false;
107  _order = 0;
108  }
109 
110  inline WXEdge(WOEdge *iOEdge) : WEdge(iOEdge)
111  {
112  _nature = Nature::NO_FEATURE;
113  _front = false;
114  _order = 0;
115  }
116 
117  inline WXEdge(WOEdge *iaOEdge, WOEdge *ibOEdge) : WEdge(iaOEdge, ibOEdge)
118  {
119  _nature = Nature::NO_FEATURE;
120  _front = false;
121  _order = 0;
122  }
123 
125  inline WXEdge(WXEdge &iBrother) : WEdge(iBrother)
126  {
127  _nature = iBrother.nature();
128  _front = iBrother._front;
129  _order = iBrother._order;
130  }
131 
132  virtual WEdge *duplicate()
133  {
134  WXEdge *clone = new WXEdge(*this);
135  return clone;
136  }
137 
138  virtual ~WXEdge()
139  {
140  }
141 
142  virtual void Reset()
143  {
144  _nature = _nature & ~Nature::SILHOUETTE;
145  _nature = _nature & ~Nature::SUGGESTIVE_CONTOUR;
146  }
147 
149  inline WXNature nature()
150  {
151  return _nature;
152  }
153 
154  inline bool front()
155  {
156  return _front;
157  }
158 
159  inline short order() const
160  {
161  return _order;
162  }
163 
165  inline void setFront(bool iFront)
166  {
167  _front = iFront;
168  }
169 
170  inline void setNature(WXNature iNature)
171  {
172  _nature = iNature;
173  }
174 
175  inline void AddNature(WXNature iNature)
176  {
177  _nature = _nature | iNature;
178  }
179 
180  inline void setOrder(int i)
181  {
182  _order = i;
183  }
184 
185 #ifdef WITH_CXX_GUARDEDALLOC
186  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:WXEdge")
187 #endif
188 };
189 
190 /**********************************
191  * *
192  * *
193  * WXFace *
194  * *
195  * *
196  **********************************/
197 
200  public:
201  typedef unsigned short Configuration;
202  static const Configuration EDGE_EDGE = 1;
203  static const Configuration VERTEX_EDGE = 2;
204  static const Configuration EDGE_VERTEX = 3;
205 
206  WOEdge *_woea; // Oriented edge from which the silhouette edge starts
207  WOEdge *_woeb; // Oriented edge where the silhouette edge ends
208  float _ta; // The silhouette starting point's coordinates are : _woea[0]+ta*(_woea[1]-_woea[0])
209  float _tb; // The silhouette ending point's coordinates are : _woeb[0]+ta*(_woeb[1]-_woeb[0])
210  bool _front;
212 
214  {
215  _woea = NULL;
216  _woeb = NULL;
217  _ta = 0.0f;
218  _tb = 0.0f;
219  _front = false;
220  _config = EDGE_EDGE;
221  }
222 
223  WXSmoothEdge(const WXSmoothEdge &iBrother)
224  {
225  _woea = iBrother._woea;
226  _woeb = iBrother._woeb;
227  _ta = iBrother._ta;
228  _tb = iBrother._tb;
229  _config = iBrother._config;
230  _front = iBrother._front;
231  }
232 
234  {
235  }
236 
237  inline WOEdge *woea()
238  {
239  return _woea;
240  }
241 
242  inline WOEdge *woeb()
243  {
244  return _woeb;
245  }
246 
247  inline float ta() const
248  {
249  return _ta;
250  }
251 
252  inline float tb() const
253  {
254  return _tb;
255  }
256 
257  inline bool front() const
258  {
259  return _front;
260  }
261 
263  {
264  return _config;
265  }
266 
268  inline void setWOeA(WOEdge *iwoea)
269  {
270  _woea = iwoea;
271  }
272 
273  inline void setWOeB(WOEdge *iwoeb)
274  {
275  _woeb = iwoeb;
276  }
277 
278  inline void setTa(float ta)
279  {
280  _ta = ta;
281  }
282 
283  inline void setTb(float tb)
284  {
285  _tb = tb;
286  }
287 
288  inline void setFront(bool iFront)
289  {
290  _front = iFront;
291  }
292 
293  inline void setConfiguration(Configuration iConf)
294  {
295  _config = iConf;
296  }
297 
298 #ifdef WITH_CXX_GUARDEDALLOC
299  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:WXSmoothEdge")
300 #endif
301 };
302 
303 /* Class to store a value per vertex and a smooth edge.
304  * The WXFace stores a list of these
305  */
306 class WXFace;
307 
308 class WXFaceLayer {
309  public:
310  void *userdata;
312  // in case of silhouette: the values obtained when computing the normal-view direction dot
313  // product. _DotP[i] is this value for the vertex i for that face.
314  vector<float> _DotP;
317 
318  // oldtmp values
319  // count the number of positive dot products for vertices.
320  // if this number is != 0 and !=_DotP.size() -> it is a silhouette fac
321  unsigned _nPosDotP;
322 
323  unsigned _nNullDotP; // count the number of null dot products for vertices.
326 
327  WXFaceLayer(WXFace *iFace, WXNature iNature, bool viewDependant)
328  {
329  _pWXFace = iFace;
330  _pSmoothEdge = NULL;
331  _nPosDotP = 0;
332  _nNullDotP = 0;
333  _Nature = iNature;
334  _viewDependant = viewDependant;
335  userdata = NULL;
336  }
337 
338  WXFaceLayer(const WXFaceLayer &iBrother)
339  {
340  _pWXFace = iBrother._pWXFace;
341  _pSmoothEdge = NULL;
342  _DotP = iBrother._DotP;
343  _nPosDotP = iBrother._nPosDotP;
344  _nNullDotP = iBrother._nNullDotP;
345  _Nature = iBrother._Nature;
346  if (iBrother._pSmoothEdge) { // XXX ? It's set to null a few lines above!
347  _pSmoothEdge = new WXSmoothEdge(*(iBrother._pSmoothEdge));
348  }
349  _viewDependant = iBrother._viewDependant;
350  userdata = NULL;
351  }
352 
353  virtual ~WXFaceLayer()
354  {
355  if (!_DotP.empty()) {
356  _DotP.clear();
357  }
358  if (_pSmoothEdge) {
359  delete _pSmoothEdge;
360  _pSmoothEdge = NULL;
361  }
362  }
363 
364  inline const float dotP(int i) const
365  {
366  return _DotP[i];
367  }
368 
369  inline unsigned nPosDotP() const
370  {
371  return _nPosDotP;
372  }
373 
374  inline unsigned nNullDotP() const
375  {
376  return _nNullDotP;
377  }
378 
379  inline int closestPointIndex() const
380  {
381  return _ClosestPointIndex;
382  }
383 
384  inline WXNature nature() const
385  {
386  return _Nature;
387  }
388 
389  inline bool hasSmoothEdge() const
390  {
391  if (_pSmoothEdge) {
392  return true;
393  }
394  return false;
395  }
396 
397  inline WXFace *getFace()
398  {
399  return _pWXFace;
400  }
401 
403  {
404  return _pSmoothEdge;
405  }
406 
407  inline bool isViewDependant() const
408  {
409  return _viewDependant;
410  }
411 
412  inline void setClosestPointIndex(int iIndex)
413  {
414  _ClosestPointIndex = iIndex;
415  }
416 
417  inline void removeSmoothEdge()
418  {
419  if (!_DotP.empty()) {
420  _DotP.clear();
421  }
422  if (_pSmoothEdge) {
423  delete _pSmoothEdge;
424  _pSmoothEdge = NULL;
425  }
426  }
427 
430  unsigned int Get0VertexIndex() const;
431 
434  unsigned int GetSmoothEdgeIndex() const;
435 
439  void RetrieveCuspEdgesIndices(vector<int> &oCuspEdges);
440 
442 
443  inline void setDotP(const vector<float> &iDotP)
444  {
445  _DotP = iDotP;
446  }
447 
448  inline void PushDotP(float iDotP)
449  {
450  _DotP.push_back(iDotP);
451  if (iDotP > 0.0f) {
452  ++_nPosDotP;
453  }
454  if (iDotP == 0.0f) { // TODO: this comparison is weak, check if it actually works
455  ++_nNullDotP;
456  }
457  }
458 
459  inline void ReplaceDotP(unsigned int index, float newDotP)
460  {
461  _DotP[index] = newDotP;
462  updateDotPInfos();
463  }
464 
465  inline void updateDotPInfos()
466  {
467  _nPosDotP = 0;
468  _nNullDotP = 0;
469  for (vector<float>::iterator d = _DotP.begin(), dend = _DotP.end(); d != dend; ++d) {
470  if ((*d) > 0.0f) {
471  ++_nPosDotP;
472  }
473  if ((*d) == 0.0f) { // TODO: ditto
474  ++_nNullDotP;
475  }
476  }
477  }
478 
479 #ifdef WITH_CXX_GUARDEDALLOC
480  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:WXFaceLayer")
481 #endif
482 }; // namespace Freestyle
483 
484 class WXFace : public WFace {
485  protected:
486  Vec3f _center; // center of the face
487  float _Z; // distance from viewpoint to the center of the face
488  bool _front; // flag to tell whether the face is front facing or back facing
489  float _dotp; // value obtained when computing the normal-viewpoint dot product
490 
491  vector<WXFaceLayer *> _SmoothLayers; // The data needed to store one or several smooth edges
492  // that traverse the face
493 
494  public:
495  inline WXFace() : WFace()
496  {
497  _Z = 0.0f;
498  _front = false;
499  }
500 
502  WXFace(WXFace &iBrother) : WFace(iBrother)
503  {
504  _center = iBrother.center();
505  _Z = iBrother.Z();
506  _front = iBrother.front();
507  for (vector<WXFaceLayer *>::iterator wxf = iBrother._SmoothLayers.begin(),
508  wxfend = iBrother._SmoothLayers.end();
509  wxf != wxfend;
510  ++wxf) {
511  _SmoothLayers.push_back(new WXFaceLayer(**wxf));
512  }
513  }
514 
515  virtual WFace *duplicate()
516  {
517  WXFace *clone = new WXFace(*this);
518  return clone;
519  }
520 
521  virtual ~WXFace()
522  {
523  if (!_SmoothLayers.empty()) {
524  for (vector<WXFaceLayer *>::iterator wxf = _SmoothLayers.begin(),
525  wxfend = _SmoothLayers.end();
526  wxf != wxfend;
527  ++wxf) {
528  delete (*wxf);
529  }
530  _SmoothLayers.clear();
531  }
532  }
533 
535  virtual WEdge *instanciateEdge() const
536  {
537  return new WXEdge;
538  }
539 
541  inline Vec3f &center()
542  {
543  return _center;
544  }
545 
546  inline float Z()
547  {
548  return _Z;
549  }
550 
551  inline bool front()
552  {
553  return _front;
554  }
555 
556  inline float dotp()
557  {
558  return _dotp;
559  }
560 
561  inline bool hasSmoothEdges() const
562  {
563  for (vector<WXFaceLayer *>::const_iterator wxf = _SmoothLayers.begin(),
564  wxfend = _SmoothLayers.end();
565  wxf != wxfend;
566  ++wxf) {
567  if ((*wxf)->hasSmoothEdge()) {
568  return true;
569  }
570  }
571  return false;
572  }
573 
574  vector<WXFaceLayer *> &getSmoothLayers()
575  {
576  return _SmoothLayers;
577  }
578 
580  void retrieveSmoothEdges(WXNature iNature, vector<WXSmoothEdge *> &oSmoothEdges)
581  {
582  for (vector<WXFaceLayer *>::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end();
583  wxf != wxfend;
584  ++wxf) {
585  if ((*wxf)->hasSmoothEdge() && ((*wxf)->_Nature & iNature)) {
586  oSmoothEdges.push_back((*wxf)->_pSmoothEdge);
587  }
588  }
589  }
590 
591  void retrieveSmoothEdgesLayers(WXNature iNature, vector<WXFaceLayer *> &oSmoothEdgesLayers)
592  {
593  for (vector<WXFaceLayer *>::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end();
594  wxf != wxfend;
595  ++wxf) {
596  if ((*wxf)->hasSmoothEdge() && ((*wxf)->_Nature & iNature)) {
597  oSmoothEdgesLayers.push_back((*wxf));
598  }
599  }
600  }
601 
602  void retrieveSmoothLayers(WXNature iNature, vector<WXFaceLayer *> &oSmoothLayers)
603  {
604  for (vector<WXFaceLayer *>::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end();
605  wxf != wxfend;
606  ++wxf) {
607  if ((*wxf)->_Nature & iNature) {
608  oSmoothLayers.push_back(*wxf);
609  }
610  }
611  }
612 
614  inline void setCenter(const Vec3f &iCenter)
615  {
616  _center = iCenter;
617  }
618 
619  void ComputeCenter();
620 
621  inline void setZ(float z)
622  {
623  _Z = z;
624  }
625 
626  inline void setFront(bool iFront)
627  {
628  _front = iFront;
629  }
630 
631  inline void setDotP(float iDotP)
632  {
633  _dotp = iDotP;
634  if (_dotp > 0.0f) {
635  _front = true;
636  }
637  else {
638  _front = false;
639  }
640  }
641 
642  inline void AddSmoothLayer(WXFaceLayer *iLayer)
643  {
644  _SmoothLayers.push_back(iLayer);
645  }
646 
647  inline void Reset()
648  {
649  vector<WXFaceLayer *> layersToKeep;
650  for (vector<WXFaceLayer *>::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end();
651  wxf != wxfend;
652  ++wxf) {
653  if ((*wxf)->isViewDependant()) {
654  delete (*wxf);
655  }
656  else {
657  layersToKeep.push_back(*wxf);
658  }
659  }
660  _SmoothLayers = layersToKeep;
661  }
662 
664  inline void Clear()
665  {
666  for (vector<WXFaceLayer *>::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end();
667  wxf != wxfend;
668  ++wxf) {
669  delete (*wxf);
670  }
671  _SmoothLayers.clear();
672  }
673 
674  virtual void ResetUserData()
675  {
677  for (vector<WXFaceLayer *>::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end();
678  wxf != wxfend;
679  ++wxf) {
680  (*wxf)->userdata = NULL;
681  }
682  }
683 
684 #ifdef WITH_CXX_GUARDEDALLOC
685  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:WXFace")
686 #endif
687 };
688 
689 /**********************************
690  * *
691  * *
692  * WXShape *
693  * *
694  * *
695  **********************************/
696 
697 class WXShape : public WShape {
698 #if 0
699  public:
700  typedef WXShape type_name;
701 #endif
702 
703  protected:
704  bool _computeViewIndependent; // flag to indicate whether the view independent stuff must be
705  // computed or not
706 
707  public:
708  inline WXShape() : WShape()
709  {
711  }
712 
714  inline WXShape(WXShape &iBrother) : WShape(iBrother)
715  {
717  }
718 
719  virtual WShape *duplicate()
720  {
721  WXShape *clone = new WXShape(*this);
722  return clone;
723  }
724 
725  virtual ~WXShape()
726  {
727  }
728 
729  inline bool getComputeViewIndependentFlag() const
730  {
732  }
733 
734  inline void setComputeViewIndependentFlag(bool iFlag)
735  {
736  _computeViewIndependent = iFlag;
737  }
738 
740  virtual WFace *instanciateFace() const
741  {
742  return new WXFace;
743  }
744 
753  virtual WFace *MakeFace(vector<WVertex *> &iVertexList,
754  vector<bool> &iFaceEdgeMarksList,
755  unsigned iMaterialIndex);
756 
775  virtual WFace *MakeFace(vector<WVertex *> &iVertexList,
776  vector<Vec3f> &iNormalsList,
777  vector<Vec2f> &iTexCoordsList,
778  vector<bool> &iFaceEdgeMarksList,
779  unsigned iMaterialIndex);
780 
782  virtual void Reset()
783  {
784  // Reset Edges
785  vector<WEdge *> &wedges = getEdgeList();
786  for (vector<WEdge *>::iterator we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
787  ((WXEdge *)(*we))->Reset();
788  }
789 
790  // Reset faces:
791  vector<WFace *> &wfaces = GetFaceList();
792  for (vector<WFace *>::iterator wf = wfaces.begin(), wfend = wfaces.end(); wf != wfend; ++wf) {
793  ((WXFace *)(*wf))->Reset();
794  }
795  }
798 #ifdef WITH_CXX_GUARDEDALLOC
799  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:WXShape")
800 #endif
801 };
802 
803 /*
804  * #############################################
805  * #############################################
806  * #############################################
807  * ###### ######
808  * ###### I M P L E M E N T A T I O N ######
809  * ###### ######
810  * #############################################
811  * #############################################
812  * #############################################
813  */
814 /* for inline functions */
815 
817 {
818  int counter = 0;
819  vector<WEdge *> &vedges = GetEdges();
820  for (vector<WEdge *>::iterator ve = vedges.begin(), vend = vedges.end(); ve != vend; ++ve) {
821  if (((WXEdge *)(*ve))->nature() != Nature::NO_FEATURE) {
822  counter++;
823  }
824  }
825 
826  if ((counter == 1) || (counter > 2)) {
827  return true;
828  }
829  return false;
830 }
831 
832 } /* namespace Freestyle */
GTS - Library for the manipulation of triangulated surfaces.
_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 GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
Read Guarded memory(de)allocation.
Different natures for both vertices and edges.
Classes to define a Winged Edge data structure.
ATTR_WARN_UNUSED_RESULT const BMVert * v
virtual void ResetUserData()
Definition: WEdge.h:967
vector< WEdge * > & getEdgeList()
Definition: WEdge.h:1045
vector< WFace * > & GetFaceList()
Definition: WEdge.h:1055
vector< WEdge * > & GetEdges()
Definition: WEdge.h:78
virtual ~WXEdge()
Definition: WXEdge.h:138
virtual WEdge * duplicate()
Definition: WXEdge.h:132
WXEdge(WOEdge *iaOEdge, WOEdge *ibOEdge)
Definition: WXEdge.h:117
short order() const
Definition: WXEdge.h:159
bool front()
Definition: WXEdge.h:154
virtual void Reset()
Definition: WXEdge.h:142
WXNature nature()
Definition: WXEdge.h:149
void setNature(WXNature iNature)
Definition: WXEdge.h:170
void setOrder(int i)
Definition: WXEdge.h:180
void AddNature(WXNature iNature)
Definition: WXEdge.h:175
WXEdge(WXEdge &iBrother)
Definition: WXEdge.h:125
void setFront(bool iFront)
Definition: WXEdge.h:165
WXEdge(WOEdge *iOEdge)
Definition: WXEdge.h:110
unsigned int Get0VertexIndex() const
Definition: WXEdge.cpp:21
bool hasSmoothEdge() const
Definition: WXEdge.h:389
const float dotP(int i) const
Definition: WXEdge.h:364
void setClosestPointIndex(int iIndex)
Definition: WXEdge.h:412
WXFaceLayer(const WXFaceLayer &iBrother)
Definition: WXEdge.h:338
void PushDotP(float iDotP)
Definition: WXEdge.h:448
WXFaceLayer(WXFace *iFace, WXNature iNature, bool viewDependant)
Definition: WXEdge.h:327
void setDotP(const vector< float > &iDotP)
Definition: WXEdge.h:443
unsigned nNullDotP() const
Definition: WXEdge.h:374
unsigned _nPosDotP
Definition: WXEdge.h:321
void updateDotPInfos()
Definition: WXEdge.h:465
unsigned _ClosestPointIndex
Definition: WXEdge.h:324
void RetrieveCuspEdgesIndices(vector< int > &oCuspEdges)
Definition: WXEdge.cpp:44
void ReplaceDotP(unsigned int index, float newDotP)
Definition: WXEdge.h:459
int closestPointIndex() const
Definition: WXEdge.h:379
WXNature nature() const
Definition: WXEdge.h:384
unsigned nPosDotP() const
Definition: WXEdge.h:369
WXFace * getFace()
Definition: WXEdge.h:397
WXSmoothEdge * getSmoothEdge()
Definition: WXEdge.h:402
unsigned int GetSmoothEdgeIndex() const
Definition: WXEdge.cpp:32
bool isViewDependant() const
Definition: WXEdge.h:407
void removeSmoothEdge()
Definition: WXEdge.h:417
vector< float > _DotP
Definition: WXEdge.h:314
unsigned _nNullDotP
Definition: WXEdge.h:323
WXSmoothEdge * BuildSmoothEdge()
Definition: WXEdge.cpp:56
WXSmoothEdge * _pSmoothEdge
Definition: WXEdge.h:315
virtual ~WXFaceLayer()
Definition: WXEdge.h:353
void setDotP(float iDotP)
Definition: WXEdge.h:631
void Clear()
Definition: WXEdge.h:664
virtual void ResetUserData()
Definition: WXEdge.h:674
vector< WXFaceLayer * > _SmoothLayers
Definition: WXEdge.h:491
void retrieveSmoothLayers(WXNature iNature, vector< WXFaceLayer * > &oSmoothLayers)
Definition: WXEdge.h:602
void setFront(bool iFront)
Definition: WXEdge.h:626
bool front()
Definition: WXEdge.h:551
void setCenter(const Vec3f &iCenter)
Definition: WXEdge.h:614
vector< WXFaceLayer * > & getSmoothLayers()
Definition: WXEdge.h:574
void retrieveSmoothEdgesLayers(WXNature iNature, vector< WXFaceLayer * > &oSmoothEdgesLayers)
Definition: WXEdge.h:591
void AddSmoothLayer(WXFaceLayer *iLayer)
Definition: WXEdge.h:642
bool hasSmoothEdges() const
Definition: WXEdge.h:561
void setZ(float z)
Definition: WXEdge.h:621
float dotp()
Definition: WXEdge.h:556
WXFace(WXFace &iBrother)
Definition: WXEdge.h:502
void Reset()
Definition: WXEdge.h:647
virtual WFace * duplicate()
Definition: WXEdge.h:515
void ComputeCenter()
Definition: WXEdge.cpp:236
void retrieveSmoothEdges(WXNature iNature, vector< WXSmoothEdge * > &oSmoothEdges)
Definition: WXEdge.h:580
virtual WEdge * instanciateEdge() const
Definition: WXEdge.h:535
virtual ~WXFace()
Definition: WXEdge.h:521
Vec3f & center()
Definition: WXEdge.h:541
virtual WShape * duplicate()
Definition: WXEdge.h:719
bool _computeViewIndependent
Definition: WXEdge.h:704
virtual void Reset()
Definition: WXEdge.h:782
virtual WFace * MakeFace(vector< WVertex * > &iVertexList, vector< bool > &iFaceEdgeMarksList, unsigned iMaterialIndex)
Definition: WXEdge.cpp:258
bool getComputeViewIndependentFlag() const
Definition: WXEdge.h:729
virtual ~WXShape()
Definition: WXEdge.h:725
WXShape(WXShape &iBrother)
Definition: WXEdge.h:714
void setComputeViewIndependentFlag(bool iFlag)
Definition: WXEdge.h:734
virtual WFace * instanciateFace() const
Definition: WXEdge.h:740
void setWOeA(WOEdge *iwoea)
Definition: WXEdge.h:268
void setWOeB(WOEdge *iwoeb)
Definition: WXEdge.h:273
bool front() const
Definition: WXEdge.h:257
unsigned short Configuration
Definition: WXEdge.h:201
Configuration configuration() const
Definition: WXEdge.h:262
WXSmoothEdge(const WXSmoothEdge &iBrother)
Definition: WXEdge.h:223
static const Configuration VERTEX_EDGE
Definition: WXEdge.h:203
void setConfiguration(Configuration iConf)
Definition: WXEdge.h:293
void setTb(float tb)
Definition: WXEdge.h:283
void setFront(bool iFront)
Definition: WXEdge.h:288
float ta() const
Definition: WXEdge.h:247
static const Configuration EDGE_VERTEX
Definition: WXEdge.h:204
Configuration _config
Definition: WXEdge.h:211
void setTa(float ta)
Definition: WXEdge.h:278
float tb() const
Definition: WXEdge.h:252
static const Configuration EDGE_EDGE
Definition: WXEdge.h:202
bool isFeature()
Definition: WXEdge.h:816
virtual void Reset()
Definition: WXEdge.h:60
void setCurvatures(CurvatureInfo *ci)
Definition: WXEdge.h:67
virtual ~WXVertex()
Definition: WXEdge.h:53
WXVertex(const Vec3f &v)
Definition: WXEdge.h:36
CurvatureInfo * curvatures()
Definition: WXEdge.h:74
WXVertex(WXVertex &iBrother)
Definition: WXEdge.h:42
virtual WVertex * duplicate()
Definition: WXEdge.h:47
ccl_gpu_kernel_postfix ccl_global int * counter
static const EdgeNature NO_FEATURE
Definition: Nature.h:34
unsigned short EdgeNature
Definition: Nature.h:32
static const EdgeNature SILHOUETTE
Definition: Nature.h:36
static const EdgeNature SUGGESTIVE_CONTOUR
Definition: Nature.h:46
inherits from class Rep
Definition: AppCanvas.cpp:18
Nature::EdgeNature WXNature
Definition: WXEdge.h:20