Blender V5.0
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
11
12#include <vector>
13
14#include "Geom.h"
15
17
18#include "MEM_guardedalloc.h"
19
20namespace Freestyle {
21
22using namespace Geometry;
23
25 private:
26 std::vector<Vec2d> _ControlPolygon;
27 std::vector<Vec2d> _Vertices;
28
29 public:
31
32 void AddControlPoint(const Vec2d &iPoint);
33 void Build();
34
35 inline int size() const
36 {
37 return _ControlPolygon.size();
38 }
39
40 inline std::vector<Vec2d> &vertices()
41 {
42 return _Vertices;
43 }
44
45 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BezierCurveSegment")
46};
47
49 private:
50 std::vector<Vec2d> _ControlPolygon;
51 std::vector<BezierCurveSegment *> _Segments;
52 BezierCurveSegment *_currentSegment;
53
54 public:
56 BezierCurve(std::vector<Vec2d> &iPoints, double error = 4.0);
57 virtual ~BezierCurve();
58
59 void AddControlPoint(const Vec2d &iPoint);
60
61 std::vector<Vec2d> &controlPolygon()
62 {
63 return _ControlPolygon;
64 }
65
66 std::vector<BezierCurveSegment *> &segments()
67 {
68 return _Segments;
69 }
70
71 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:BezierCurve")
72};
73
74} /* namespace Freestyle */
Configuration definitions.
Vectors and Matrices (useful type definitions).
Read Guarded memory(de)allocation.
std::vector< Vec2d > & vertices()
Definition Bezier.h:40
void AddControlPoint(const Vec2d &iPoint)
Definition Bezier.cpp:19
BezierCurve(std::vector< Vec2d > &iPoints, double error=4.0)
void AddControlPoint(const Vec2d &iPoint)
Definition Bezier.cpp:97
std::vector< Vec2d > & controlPolygon()
Definition Bezier.h:61
virtual ~BezierCurve()
Definition Bezier.cpp:86
std::vector< BezierCurveSegment * > & segments()
Definition Bezier.h:66
static void error(const char *str)
VecMat::Vec2< double > Vec2d
Definition Geom.h:23
inherits from class Rep
Definition AppCanvas.cpp:20