Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Antares::Map::DrawingContext Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DrawingContext()

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.

Parameters
dcThe Device context (where to draw)
originThe origin point (where is (0,0) in the device context)
offsetThe offset for selected items
scrollThe scroll values, in pixels for the horiz and vert scrollbar
clientSizeThe client size

Member Function Documentation

◆ offsetForSelectedNodes()

const wxPoint & Antares::Map::DrawingContext::offsetForSelectedNodes ( ) const
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.


The documentation for this class was generated from the following files: