Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
drawingcontext.h
1/*
2** Copyright 2007-2024, RTE (https://www.rte-france.com)
3** See AUTHORS.txt
4** SPDX-License-Identifier: MPL-2.0
5** This file is part of Antares-Simulator,
6** Adequacy and Performance assessment for interconnected energy networks.
7**
8** Antares_Simulator is free software: you can redistribute it and/or modify
9** it under the terms of the Mozilla Public Licence 2.0 as published by
10** the Mozilla Foundation, either version 2 of the License, or
11** (at your option) any later version.
12**
13** Antares_Simulator is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16** Mozilla Public Licence 2.0 for more details.
17**
18** You should have received a copy of the Mozilla Public Licence 2.0
19** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20*/
21#ifndef __ANTARES_TOOLBOX_MAP_DRAWING_CONTEXT_H__
22#define __ANTARES_TOOLBOX_MAP_DRAWING_CONTEXT_H__
23
24#include <wx/dc.h>
25#include <map>
26#include "nodes/node.h"
27
28namespace Antares
29{
30namespace Map
31{
32// Forward declaration
33class Node;
34
43{
44public:
46
47
56 DrawingContext(wxDC& dc,
57 const wxPoint& origin,
58 const wxPoint& offset,
59 const wxPoint& scroll,
60 const wxPoint& clientSize,
61 const wxPoint& btRight,
62 const size_t& layer = -1,
63 bool forFileExport = false);
66 {
67 }
69
73 const wxPoint& origin() const
74 {
75 return pOrigin;
76 }
77
81 const size_t& getLayerId() const
82 {
83 return layerId;
84 }
85
90 {
91 return pForFileExport;
92 }
93
97 wxDC& device()
98 {
99 return pDC;
100 }
101
110 const wxPoint& offsetForSelectedNodes() const
111 {
112 return pOffsetForSelectedNodes;
113 }
114
118 const wxPoint& scroll() const
119 {
120 return pScroll;
121 }
122
126 const wxPoint& clientSize() const
127 {
128 return pClientSize;
129 }
130
134 const wxPoint& bottomRight() const
135 {
136 return pBottomRight;
137 }
138
139private:
141 wxDC& pDC;
143 const wxPoint& pOrigin;
145 const wxPoint& pOffsetForSelectedNodes;
147 const wxPoint& pScroll;
149 const wxPoint& pClientSize;
151 const wxPoint& pBottomRight;
153 const size_t& layerId;
155 bool pForFileExport;
156
157}; // class DrawingContext
158
159} // namespace Map
160} // namespace Antares
161
162#endif // __ANTARES_TOOLBOX_MAP_DRAWING_CONTEXT_H__
Drawing Context.
Definition drawingcontext.h:43
const wxPoint & origin() const
Get the origin point on the device context.
Definition drawingcontext.h:73
bool isForFileExport()
Get the device context.
Definition drawingcontext.h:89
const wxPoint & scroll() const
Get the scrolling values for the horizontal and the vertical scrollbars.
Definition drawingcontext.h:118
const size_t & getLayerId() const
Get the layer id of the device context.
Definition drawingcontext.h:81
const wxPoint & clientSize() const
Get the client size.
Definition drawingcontext.h:126
DrawingContext(wxDC &dc, const wxPoint &origin, const wxPoint &offset, const wxPoint &scroll, const wxPoint &clientSize, const wxPoint &btRight, const size_t &layer=-1, bool forFileExport=false)
Constructor.
Definition drawingcontext.cpp:28
wxDC & device()
Get the device context.
Definition drawingcontext.h:97
const wxPoint & bottomRight() const
Get the absolute position of the point at the bottom right.
Definition drawingcontext.h:134
const wxPoint & offsetForSelectedNodes() const
Get the offset for selected items.
Definition drawingcontext.h:110
~DrawingContext()
Destructor.
Definition drawingcontext.h:65