Blender  V2.93
Curvature.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is:
17  * GTS - Library for the manipulation of triangulated surfaces
18  * Copyright (C) 1999 Stephane Popinet
19  * and:
20  * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
21  * Copyright (C) 2000-2003 Bruno Levy
22  * Contact: Bruno Levy <levy@loria.fr>
23  * ISA Project
24  * LORIA, INRIA Lorraine,
25  * Campus Scientifique, BP 239
26  * 54506 VANDOEUVRE LES NANCY CEDEX
27  * FRANCE
28  */
29 
30 #pragma once
31 
38 #include "../geometry/Geom.h"
39 
40 #include "../system/FreestyleConfig.h"
41 #include "../system/Precision.h"
42 
43 #ifdef WITH_CXX_GUARDEDALLOC
44 # include "MEM_guardedalloc.h"
45 #endif
46 
47 namespace Freestyle {
48 
49 using namespace Geometry;
50 
51 class WVertex;
52 
54  public:
56  {
57  K1 = 0.0;
58  K2 = 0.0;
59  e1 = Vec3r(0.0, 0.0, 0.0);
60  e2 = Vec3r(0.0, 0.0, 0.0);
61  Kr = 0.0;
62  dKr = 0.0;
63  er = Vec3r(0.0, 0.0, 0.0);
64  }
65 
66  CurvatureInfo(const CurvatureInfo &iBrother)
67  {
68  K1 = iBrother.K1;
69  K2 = iBrother.K2;
70  e1 = iBrother.e1;
71  e2 = iBrother.e2;
72  Kr = iBrother.Kr;
73  dKr = iBrother.dKr;
74  er = iBrother.er;
75  }
76 
78  {
79  K1 = ca.K1 + t * (cb.K1 - ca.K1);
80  K2 = ca.K2 + t * (cb.K2 - ca.K2);
81  e1 = ca.e1 + t * (cb.e1 - ca.e1);
82  e2 = ca.e2 + t * (cb.e2 - ca.e2);
83  Kr = ca.Kr + t * (cb.Kr - ca.Kr);
84  dKr = ca.dKr + t * (cb.dKr - ca.dKr);
85  er = ca.er + t * (cb.er - ca.er);
86  }
87 
88  real K1; // maximum curvature
89  real K2; // minimum curvature
90  Vec3r e1; // maximum curvature direction
91  Vec3r e2; // minimum curvature direction
92  real Kr; // radial curvature
93  real dKr; // radial curvature
94  Vec3r er; // radial curvature direction
95 
96 #ifdef WITH_CXX_GUARDEDALLOC
97  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:CurvatureInfo")
98 #endif
99 };
100 
102  public:
104  {
105  }
106 
108  {
109  for (vector<CurvatureInfo *>::iterator ci = vec_curvature_info.begin(),
110  ciend = vec_curvature_info.end();
111  ci != ciend;
112  ++ci) {
113  delete (*ci);
114  }
115  vec_curvature_info.clear();
116  }
117 
118  vector<CurvatureInfo *> vec_curvature_info;
119 
120 #ifdef WITH_CXX_GUARDEDALLOC
121  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Face_Curvature_Info")
122 #endif
123 };
124 
126 
128 
129 void gts_vertex_principal_curvatures(real Kh, real Kg, real *K1, real *K2);
130 
132 
133 namespace OGF {
134 
135 class NormalCycle;
136 
137 void compute_curvature_tensor(WVertex *start, double radius, NormalCycle &nc);
138 
139 void compute_curvature_tensor_one_ring(WVertex *start, NormalCycle &nc);
140 
141 } // namespace OGF
142 
143 } /* 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:66
CurvatureInfo(const CurvatureInfo &ca, const CurvatureInfo &cb, real t)
Definition: Curvature.h:77
vector< CurvatureInfo * > vec_curvature_info
Definition: Curvature.h:118
VecMat::Vec3< real > Vec3r
Definition: Geom.h:42
void compute_curvature_tensor(WVertex *start, real radius, NormalCycle &nc)
Definition: Curvature.cpp:605
void compute_curvature_tensor_one_ring(WVertex *start, NormalCycle &nc)
Definition: Curvature.cpp:647
inherits from class Rep
Definition: AppCanvas.cpp:32
void gts_vertex_principal_directions(WVertex *v, Vec3r Kh, real Kg, Vec3r &e1, Vec3r &e2)
Definition: Curvature.cpp:297
bool gts_vertex_gaussian_curvature(WVertex *v, real *Kg)
Definition: Curvature.cpp:194
bool gts_vertex_mean_curvature_normal(WVertex *v, Vec3r &Kh)
Definition: Curvature.cpp:128
void gts_vertex_principal_curvatures(real Kh, real Kg, real *K1, real *K2)
Definition: Curvature.cpp:243
double real
Definition: Precision.h:26