summaryrefslogtreecommitdiff
path: root/vcl/inc/SceneGraphNodes.hxx
blob: 70e09218d8362d8eaa2d3a3ce94c033ee8ae5d18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 */

#ifndef VCL_INC_SCENEGRAPHNODES_HXX
#define VCL_INC_SCENEGRAPHNODES_HXX

#include <vcl/SceneGraph.hxx>

#include <glm/glm.hpp>
#include <basegfx/range/b2drange.hxx>

namespace vcl
{
namespace sg
{

class VCL_DLLPUBLIC ClippingNode : public Node
{
public:
    ClippingNode()
        : Node("ClippingNode", NodeType::CLIPPING)
    {}

    basegfx::B2DRange maClipBox;
};

class VCL_DLLPUBLIC TransformNode : public Node
{
public:
    glm::mat4 maMatrix;

    TransformNode(glm::mat4 aMatrix)
        : Node("TransformNode", NodeType::TRANSFORM)
        , maMatrix(aMatrix)
    {}
};

enum class GeometryNodeType
{
    RECTANGLE,
    POLYPOLYGON,
    BITMAP
};

class VCL_DLLPUBLIC GeometryNode : public Node
{
public:
    GeometryNodeType meGeometryType;

    GeometryNode(GeometryNodeType eGeometryType)
        : Node("GeometryNode", NodeType::GEOMETRY)
        , meGeometryType(eGeometryType)
    {}
};

class VCL_DLLPUBLIC RectangleNode : public GeometryNode
{
public:
    basegfx::B2DRange maRectangle;
    SalColor maLineColor;
    SalColor maFillColor;
    bool mbNormalized;

    RectangleNode(basegfx::B2DRange aRectangle, SalColor aLineColor = SALCOLOR_NONE, SalColor aFillColor = SALCOLOR_NONE)
        : GeometryNode(GeometryNodeType::RECTANGLE)
        , maRectangle(aRectangle)
        , maLineColor(aLineColor)
        , maFillColor(aFillColor)
        , mbNormalized(false)
    {}
};

class VCL_DLLPUBLIC PolyPolygonNode : public GeometryNode
{
public:
    basegfx::B2DPolyPolygon maPolyPolygon;
    SalColor maLineColor;
    SalColor maFillColor;
    bool mbNormalized;

    PolyPolygonNode(basegfx::B2DPolyPolygon aPolyPolygon, SalColor aLineColor = SALCOLOR_NONE, SalColor aFillColor = SALCOLOR_NONE)
        : GeometryNode(GeometryNodeType::POLYPOLYGON)
        , maPolyPolygon(aPolyPolygon)
        , maLineColor(aLineColor)
        , maFillColor(aFillColor)
        , mbNormalized(false)
    {}
};

class VCL_DLLPUBLIC BitmapNode : public GeometryNode
{
public:
    Bitmap maBitmap;
    basegfx::B2DRange maRectangle;

    BitmapNode(Bitmap aBitmap, basegfx::B2DRange aRectangle)
        : GeometryNode(GeometryNodeType::BITMAP)
        , maBitmap(aBitmap)
        , maRectangle(aRectangle)
    {}
};

}} // end vcl::sg namespace

#endif // INCLUDED_VCL_INC_SCENEGRAPH_HXX

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */