AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
CairoPath.hpp
1/*
2Copyright (C) 2019,2020,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGUI_CAIROPATH_H
17#define AEONGUI_CAIROPATH_H
18#include <cairo.h>
19#include "aeongui/CairoCanvas.hpp"
20#include "aeongui/Path.hpp"
21
22namespace AeonGUI
23{
29 class CairoPath : public Path
30 {
31 public:
38 void Construct ( const std::vector<DrawType>& aCommands, size_t aPathDataHint = 0 ) final;
44 void Construct ( const DrawType* aCommands, size_t aCommandCount, size_t aPathDataHint = 0 ) final;
50 const cairo_path_t* GetCairoPath() const;
51 DLL double GetTotalLength() const final;
52 PathPoint GetPointAtLength ( double aDistance ) const final;
53 bool IsClosed() const final;
54 private:
55 cairo_path_t mPath{};
56 std::vector<cairo_path_data_t> mPathData;
57 };
58}
59#endif
CairoPath()
Default constructor.
double GetTotalLength() const final
Compute the total arc length of the path.
Definition CairoPath.cpp:494
PathPoint GetPointAtLength(double aDistance) const final
Get the position and tangent angle at a distance along the path.
Definition CairoPath.cpp:531
void Construct(const std::vector< DrawType > &aCommands, size_t aPathDataHint=0) final
Build the Cairo path from a vector of draw commands.
Definition CairoPath.cpp:192
const cairo_path_t * GetCairoPath() const
Get the underlying Cairo path structure.
Definition CairoPath.cpp:187
bool IsClosed() const final
Check whether the path contains a close-path command.
Definition CairoPath.cpp:622
Abstract base class for renderable path data.
Definition Path.hpp:40
Result of querying a point along a path.
Definition Path.hpp:28