AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
SVGAnimateMotionElement.hpp
1/*
2Copyright (C) 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_SVGANIMATEMOTIONELEMENT_H
17#define AEONGUI_SVGANIMATEMOTIONELEMENT_H
18
19#include "SVGAnimationElement.hpp"
20#include <vector>
21
22namespace AeonGUI
23{
24 namespace DOM
25 {
32 {
33 public:
39 SVGAnimateMotionElement ( const DOMString& aTagName, AttributeMap&& aAttributes, Node* aParent );
45 void ApplyToCanvas ( Canvas& aCanvas ) const override;
46 private:
47 struct PathPoint
48 {
49 double x;
50 double y;
51 double cumulativeLength;
52 };
53 void LinearizePath ( const std::string& aPathData );
54 std::vector<PathPoint> mPathPoints;
55 double mTotalLength{0.0};
56 };
57 }
58}
59#endif
Abstract 2D rendering surface.
Definition Canvas.hpp:40
Base class for all nodes in the DOM tree.
Definition Node.hpp:42
void ApplyToCanvas(Canvas &aCanvas) const override
Apply the motion translation to the canvas.
Definition SVGAnimateMotionElement.cpp:227
SVGAnimateMotionElement(const DOMString &aTagName, AttributeMap &&aAttributes, Node *aParent)
Construct an SVGAnimateMotionElement.
Definition SVGAnimateMotionElement.cpp:28
~SVGAnimateMotionElement() override
Destructor.
SVGAnimationElement(const DOMString &aTagName, AttributeMap &&aAttributes, Node *aParent)
Construct an SVGAnimationElement.
Definition SVGAnimationElement.cpp:26