Antares Simulator
Power System Simulator
|
Drawing Context. More...
#include <drawingcontext.h>
Constructor & Destructor | |
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. | |
~DrawingContext () | |
Destructor. | |
const wxPoint & | origin () const |
Get the origin point on the device context. | |
const size_t & | getLayerId () const |
Get the layer id of the device context. | |
bool | isForFileExport () |
Get the device context. | |
wxDC & | device () |
Get the device context. | |
const wxPoint & | offsetForSelectedNodes () const |
Get the offset for selected items. | |
const wxPoint & | scroll () const |
Get the scrolling values for the horizontal and the vertical scrollbars. | |
const wxPoint & | clientSize () const |
Get the client size. | |
const wxPoint & | bottomRight () const |
Get the absolute position of the point at the bottom right. | |
Drawing Context.
This structure is used when drawing the entire map on screen. It is a temporary structure, which is only used to broadcast the required informations to properly draw each component.
Antares::Map::DrawingContext::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.
dc | The Device context (where to draw) |
origin | The origin point (where is (0,0) in the device context) |
offset | The offset for selected items |
scroll | The scroll values, in pixels for the horiz and vert scrollbar |
clientSize | The client size |
|
inline |
Get the offset for selected items.
When an item is selected, the user may move it. This offset must be added to the original position of the item to have its real position. Note that offset is temporary, and will become null again at the next mouse release.