AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
Path.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_PATH_H
17#define AEONGUI_PATH_H
18#include <cstdint>
19#include <cstddef>
20#include <vector>
21#include "aeongui/Platform.hpp"
22#include "aeongui/DrawType.hpp"
23
24namespace AeonGUI
25{
27 struct PathPoint
28 {
29 double x;
30 double y;
31 double angle;
32 };
33
39 class Path
40 {
41 public:
46 virtual void Construct ( const std::vector<DrawType>& aCommands, size_t aPathDataHint = 0 ) = 0;
52 virtual void Construct ( const DrawType* aCommands, size_t aCommandCount, size_t aPathDataHint = 0 ) = 0;
56 virtual double GetTotalLength() const = 0;
61 virtual PathPoint GetPointAtLength ( double aDistance ) const = 0;
65 virtual bool IsClosed() const = 0;
67 DLL virtual ~Path() = 0;
68 };
69}
70#endif
Platform-specific DLL import/export macros and compiler helpers.
Abstract base class for renderable path data.
Definition Path.hpp:40
virtual void Construct(const std::vector< DrawType > &aCommands, size_t aPathDataHint=0)=0
Build the path from a vector of draw commands.
virtual PathPoint GetPointAtLength(double aDistance) const =0
Get the position and tangent angle at a distance along the path.
virtual void Construct(const DrawType *aCommands, size_t aCommandCount, size_t aPathDataHint=0)=0
Build the path from a raw array of draw commands.
virtual ~Path()=0
Virtual destructor.
virtual double GetTotalLength() const =0
Compute the total arc length of the path.
virtual bool IsClosed() const =0
Check whether the path contains a close-path command.
Result of querying a point along a path.
Definition Path.hpp:28
double y
Y coordinate.
Definition Path.hpp:30
double x
X coordinate.
Definition Path.hpp:29
double angle
Tangent angle in radians.
Definition Path.hpp:31