Blender V4.3
Bezier.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include <vector>
13
14#include "Geom.h"
15
17
18#ifdef WITH_CXX_GUARDEDALLOC
19# include "MEM_guardedalloc.h"
20#endif
21
22namespace Freestyle {
23
24using namespace Geometry;
25
27 private:
28 std::vector<Vec2d> _ControlPolygon;
29 std::vector<Vec2d> _Vertices;
30
31 public:
33
34 void AddControlPoint(const Vec2d &iPoint);
35 void Build();
36
37 inline int size() const
38 {
39 return _ControlPolygon.size();
40 }
41
42 inline std::vector<Vec2d> &vertices()
43 {
44 return _Vertices;
45 }
46
47#ifdef WITH_CXX_GUARDEDALLOC
48 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BezierCurveSegment")
49#endif
50};
51
53 private:
54 std::vector<Vec2d> _ControlPolygon;
55 std::vector<BezierCurveSegment *> _Segments;
56 BezierCurveSegment *_currentSegment;
57
58 public:
60 BezierCurve(std::vector<Vec2d> &iPoints, double error = 4.0);
61 virtual ~BezierCurve();
62
63 void AddControlPoint(const Vec2d &iPoint);
64
65 std::vector<Vec2d> &controlPolygon()
66 {
67 return _ControlPolygon;
68 }
69
70 std::vector<BezierCurveSegment *> &segments()
71 {
72 return _Segments;
73 }
74
75#ifdef WITH_CXX_GUARDEDALLOC
76 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BezierCurve")
77#endif
78};
79
80} /* namespace Freestyle */
Configuration definitions.
Vectors and Matrices (useful type definitions)
Read Guarded memory(de)allocation.
std::vector< Vec2d > & vertices()
Definition Bezier.h:42
void AddControlPoint(const Vec2d &iPoint)
Definition Bezier.cpp:19
void AddControlPoint(const Vec2d &iPoint)
Definition Bezier.cpp:97
std::vector< Vec2d > & controlPolygon()
Definition Bezier.h:65
virtual ~BezierCurve()
Definition Bezier.cpp:86
std::vector< BezierCurveSegment * > & segments()
Definition Bezier.h:70
static void error(const char *str)
inherits from class Rep
Definition AppCanvas.cpp:20