Antares Simulator
Power System Simulator
drawingcontext.h
1 /*
2  * Copyright 2007-2025, 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 
28 namespace Antares::Map
29 {
30 // Forward declaration
31 class Node;
32 
41 {
42 public:
44 
45 
54  DrawingContext(wxDC& dc,
55  const wxPoint& origin,
56  const wxPoint& offset,
57  const wxPoint& scroll,
58  const wxPoint& clientSize,
59  const wxPoint& btRight,
60  const size_t& layer = -1,
61  bool forFileExport = false);
62 
65  {
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 
139 private:
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 Antares::Map
160 
161 #endif // __ANTARES_TOOLBOX_MAP_DRAWING_CONTEXT_H__
Drawing Context.
Definition: drawingcontext.h:41
wxDC & device()
Get the device context.
Definition: drawingcontext.h:97
const wxPoint & clientSize() const
Get the client size.
Definition: drawingcontext.h:126
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
bool isForFileExport()
Get the device context.
Definition: drawingcontext.h:89
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:26
const size_t & getLayerId() const
Get the layer id of the device context.
Definition: drawingcontext.h:81
const wxPoint & scroll() const
Get the scrolling values for the horizontal and the vertical scrollbars.
Definition: drawingcontext.h:118
~DrawingContext()
Destructor.
Definition: drawingcontext.h:64
const wxPoint & origin() const
Get the origin point on the device context.
Definition: drawingcontext.h:73