Blender  V3.3
Curvature.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * The Original Code is:
3  * GTS - Library for the manipulation of triangulated surfaces
4  * Copyright 1999 Stephane Popinet
5  * and:
6  * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
7  * Copyright 2000-2003 Bruno Levy <levy@loria.fr> */
8 
9 #pragma once
10 
17 #include "../geometry/Geom.h"
18 
19 #include "../system/FreestyleConfig.h"
20 #include "../system/Precision.h"
21 
22 #ifdef WITH_CXX_GUARDEDALLOC
23 # include "MEM_guardedalloc.h"
24 #endif
25 
26 namespace Freestyle {
27 
28 using namespace Geometry;
29 
30 class WVertex;
31 
33  public:
35  {
36  K1 = 0.0;
37  K2 = 0.0;
38  e1 = Vec3r(0.0, 0.0, 0.0);
39  e2 = Vec3r(0.0, 0.0, 0.0);
40  Kr = 0.0;
41  dKr = 0.0;
42  er = Vec3r(0.0, 0.0, 0.0);
43  }
44 
45  CurvatureInfo(const CurvatureInfo &iBrother)
46  {
47  K1 = iBrother.K1;
48  K2 = iBrother.K2;
49  e1 = iBrother.e1;
50  e2 = iBrother.e2;
51  Kr = iBrother.Kr;
52  dKr = iBrother.dKr;
53  er = iBrother.er;
54  }
55 
57  {
58  K1 = ca.K1 + t * (cb.K1 - ca.K1);
59  K2 = ca.K2 + t * (cb.K2 - ca.K2);
60  e1 = ca.e1 + t * (cb.e1 - ca.e1);
61  e2 = ca.e2 + t * (cb.e2 - ca.e2);
62  Kr = ca.Kr + t * (cb.Kr - ca.Kr);
63  dKr = ca.dKr + t * (cb.dKr - ca.dKr);
64  er = ca.er + t * (cb.er - ca.er);
65  }
66 
67  real K1; // maximum curvature
68  real K2; // minimum curvature
69  Vec3r e1; // maximum curvature direction
70  Vec3r e2; // minimum curvature direction
71  real Kr; // radial curvature
72  real dKr; // radial curvature
73  Vec3r er; // radial curvature direction
74 
75 #ifdef WITH_CXX_GUARDEDALLOC
76  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:CurvatureInfo")
77 #endif
78 };
79 
81  public:
83  {
84  }
85 
87  {
88  for (vector<CurvatureInfo *>::iterator ci = vec_curvature_info.begin(),
89  ciend = vec_curvature_info.end();
90  ci != ciend;
91  ++ci) {
92  delete (*ci);
93  }
94  vec_curvature_info.clear();
95  }
96 
97  vector<CurvatureInfo *> vec_curvature_info;
98 
99 #ifdef WITH_CXX_GUARDEDALLOC
100  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Face_Curvature_Info")
101 #endif
102 };
103 
125 
142 
157 void gts_vertex_principal_curvatures(real Kh, real Kg, real *K1, real *K2);
158 
174 
175 namespace OGF {
176 
177 class NormalCycle;
178 
179 void compute_curvature_tensor(WVertex *start, double radius, NormalCycle &nc);
180 
181 void compute_curvature_tensor_one_ring(WVertex *start, NormalCycle &nc);
182 
183 } // namespace OGF
184 
185 } /* 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 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 GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v
CurvatureInfo(const CurvatureInfo &iBrother)
Definition: Curvature.h:45
CurvatureInfo(const CurvatureInfo &ca, const CurvatureInfo &cb, real t)
Definition: Curvature.h:56
vector< CurvatureInfo * > vec_curvature_info
Definition: Curvature.h:97
VecMat::Vec3< real > Vec3r
Definition: Geom.h:28
void compute_curvature_tensor(WVertex *start, real radius, NormalCycle &nc)
Definition: Curvature.cpp:518
void compute_curvature_tensor_one_ring(WVertex *start, NormalCycle &nc)
Definition: Curvature.cpp:560
inherits from class Rep
Definition: AppCanvas.cpp:18
void gts_vertex_principal_directions(WVertex *v, Vec3r Kh, real Kg, Vec3r &e1, Vec3r &e2)
Definition: Curvature.cpp:210
bool gts_vertex_gaussian_curvature(WVertex *v, real *Kg)
Definition: Curvature.cpp:136
bool gts_vertex_mean_curvature_normal(WVertex *v, Vec3r &Kh)
Definition: Curvature.cpp:86
void gts_vertex_principal_curvatures(real Kh, real Kg, real *K1, real *K2)
Definition: Curvature.cpp:171
double real
Definition: Precision.h:12