AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
SVGGeometryElement.hpp
1/*
2Copyright (C) 2020,2024,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_SVGGEOMETRYELEMENT_H
17#define AEONGUI_SVGGEOMETRYELEMENT_H
18
19#include <vector>
20#include <memory>
21#include "SVGGraphicsElement.hpp"
22#include "aeongui/Path.hpp"
23
24namespace AeonGUI
25{
26 namespace DOM
27 {
32 {
33 public:
39 SVGGeometryElement ( const DOMString& aTagName, AttributeMap&& aAttributes, Node* aParent );
45 void DrawStart ( Canvas& aCanvas ) const final;
49 const Path& GetPath() const
50 {
51 return *mPath;
52 }
53 protected:
59 virtual void RebuildAnimatedPath() const {}
60 mutable std::unique_ptr<Path> mPath;
61 };
62 }
63}
64#endif
Abstract 2D rendering surface.
Definition Canvas.hpp:40
Base class for all nodes in the DOM tree.
Definition Node.hpp:42
void DrawStart(Canvas &aCanvas) const final
Draw the geometry path onto the canvas.
Definition SVGGeometryElement.cpp:39
~SVGGeometryElement() override
Destructor.
virtual void RebuildAnimatedPath() const
Rebuild the cached path with animated attribute values.
Definition SVGGeometryElement.hpp:59
SVGGeometryElement(const DOMString &aTagName, AttributeMap &&aAttributes, Node *aParent)
Construct an SVGGeometryElement.
Definition SVGGeometryElement.cpp:29
const Path & GetPath() const
Get the path data for this geometry element.
Definition SVGGeometryElement.hpp:49
std::unique_ptr< Path > mPath
Cached path for this geometry.
Definition SVGGeometryElement.hpp:60
SVGGraphicsElement(const DOMString &aTagName, AttributeMap &&aAttributes, Node *aParent)
Construct an SVGGraphicsElement.
Definition SVGGraphicsElement.cpp:27
Abstract base class for renderable path data.
Definition Path.hpp:40