Blender
V3.3
source
blender
freestyle
intern
geometry
FitCurve.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3
#pragma once
4
11
#include <vector>
12
13
#include "
Geom.h
"
14
15
#include "../system/FreestyleConfig.h"
16
17
namespace
Freestyle
{
18
19
using namespace
Geometry
;
20
21
/* 2d point */
22
typedef
struct
Point2Struct
{
23
double
coordinates[2];
24
25
Point2Struct
()
26
{
27
coordinates[0] = 0;
28
coordinates[1] = 0;
29
}
30
31
inline
double
operator[]
(
const
int
i)
const
32
{
33
return
coordinates[i];
34
}
35
36
inline
double
&
operator[]
(
const
int
i)
37
{
38
return
coordinates[i];
39
}
40
41
inline
double
x
()
const
42
{
43
return
coordinates[0];
44
}
45
46
inline
double
y
()
const
47
{
48
return
coordinates[1];
49
}
50
}
Point2
;
51
52
typedef
Point2
Vector2
;
53
54
class
FitCurveWrapper
{
55
private
:
56
std::vector<Vector2> _vertices;
57
58
public
:
59
~
FitCurveWrapper
();
60
70
void
FitCurve(std::vector<Vec2d> &
data
, std::vector<Vec2d> &oCurve,
double
error
);
71
72
protected
:
73
/* Vec2d *d; Array of digitized points
74
* int nPts; Number of digitized points
75
* double error; User-defined error squared
76
*/
77
void
FitCurve(
Vector2
*d,
int
nPts,
double
error
);
78
85
void
DrawBezierCurve(
int
n,
Vector2
*
curve
);
86
87
/* Vec2d *d; Array of digitized points
88
* int first, last; Indices of first and last pts in region
89
* Vec2d tHat1, tHat2; Unit tangent vectors at endpoints
90
* double error; User-defined error squared
91
*/
92
void
FitCubic(
Vector2
*d,
int
first,
int
last,
Vector2
tHat1,
Vector2
tHat2,
double
error
);
93
};
94
95
}
/* namespace Freestyle */
Geom.h
Vectors and Matrices (useful type definitions)
data
data
Definition:
bmesh_operator_api_inline.h:157
Freestyle::FitCurveWrapper
Definition:
FitCurve.h:54
Geometry
Definition:
scene/geometry.h:37
curve
Curve curve
Definition:
deg_eval_copy_on_write.cc:100
error
static void error(const char *str)
Definition:
meshlaplacian.c:51
Freestyle
inherits from class Rep
Definition:
AppCanvas.cpp:18
Freestyle::Point2
struct Freestyle::Point2Struct Point2
Freestyle::Vector2
Point2 Vector2
Definition:
FitCurve.h:52
Freestyle::Point2Struct
Definition:
FitCurve.h:22
Freestyle::Point2Struct::x
double x() const
Definition:
FitCurve.h:41
Freestyle::Point2Struct::operator[]
double & operator[](const int i)
Definition:
FitCurve.h:36
Freestyle::Point2Struct::operator[]
double operator[](const int i) const
Definition:
FitCurve.h:31
Freestyle::Point2Struct::Point2Struct
Point2Struct()
Definition:
FitCurve.h:25
Freestyle::Point2Struct::y
double y() const
Definition:
FitCurve.h:46
Generated on Sat Jul 27 2024 14:57:55 for Blender by
doxygen
1.9.1