Loading [MathJax]/jax/input/TeX/config.js
Antares Simulator
Power System Simulator
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages Concepts
Antares::Map::Item Class Referenceabstract
Inheritance diagram for Antares::Map::Item:
Antares::Map::BindingConstraint Antares::Map::Connection Antares::Map::Node

Classes

struct  SetCompare
 

Public Types

enum  Type { tyUnknown , tyNode , tyConnection , tyBindingConstraint }
 
using Vector = std::vector<Item*>
 
using Set = std::set<Item*, SetCompare>
 
using Links = std::map<Item*, bool>
 

Public Member Functions

Constructor & Destructor
 Item (Manager &manager, const int zPos=0)
 Constructor.
 
virtual ~Item ()
 Destructor.
 
virtual Type type () const
 Type.
 
Manager
Managermanager ()
 Get the manager.
 
const Managermanager () const
 
layerVisibility
virtual bool isVisibleOnLayer (const size_t &) const
 Get the visivility for a layerId.
 
Caption
const wxString & caption () const
 
void caption (const wxString &v)
 
X-Coordinate
int x () const
 
void x (const int v)
 
Y-Coordinate
int y () const
 
void y (const int v)
 
virtual wxPoint absolutePosition (DrawingContext &dc) const
 
Color
const wxColour & color () const
 
void color (const wxColour &c)
 
void color (const wxString &s)
 
void color (const int r, const int g, const int b)
 
void color (const int r, const int g, const int b, const int alpha)
 
Selection
virtual bool selected () const
 
virtual void selected (bool v)
 
Z-Position
int zPosition () const
 
Cache
virtual void refreshCache (wxDC &dc)=0
 Refresh the cache (even if not invalidated)
 
void forceReload ()
 Mark the node as invalidated (to force its refresh for the next canvas update)
 
bool isInvalidated () const
 Get the node is invalidated.
 
Misc
virtual bool contains (const int x, const int y, double &distance)=0
 Get if the drawing representation of the node contains the point (x,y)
 
virtual bool isContained (const int x1, const int y1, const int x2, const int y2) const =0
 Get if the drawing representation of the node is contained inside a bounding box.
 
virtual void draw (DrawingContext &dc)=0
 Draw the node.
 
virtual void drawExternalDrawer (DrawingContext &)
 
virtual void move (const int x, const int y)
 
virtual void extendBoundingBox (wxPoint &topLeft, wxPoint &bottomRight)=0
 Extends the bounding box.
 

Mouse handling

ManagerpManager
 
wxColour pColor
 Color.
 
bool pSelected
 Selected.
 
bool pInvalidated
 invalidated
 
int pX
 Y-Coordinate.
 
int pY
 X-Coordinate.
 
wxString pCaption
 Caption.
 
Links * pLinks
 Linked with other items.
 
int pZPosition
 
class ::Antares::Map::Manager
 
class ::Antares::Map::Connection
 
class ::Antares::Map::BindingConstraint
 
virtual void mouseDblClick ()
 Mouse double click.
 
void internalClearAllLinks ()
 
virtual void captionHasChanged ()
 
virtual void positionHasChanged ()
 
virtual void colorHasChanged ()
 

Member Function Documentation

◆ contains()

virtual bool Antares::Map::Item::contains ( const int x,
const int y,
double & distance )
pure virtual

Get if the drawing representation of the node contains the point (x,y)

This method is used to know if the mouse if over a node or not

Implemented in Antares::Map::BindingConstraint, Antares::Map::Connection, and Antares::Map::Node.

◆ draw()

virtual void Antares::Map::Item::draw ( DrawingContext & dc)
pure virtual

◆ extendBoundingBox()

virtual void Antares::Map::Item::extendBoundingBox ( wxPoint & topLeft,
wxPoint & bottomRight )
pure virtual

Extends the bounding box.

Implemented in Antares::Map::BindingConstraint, Antares::Map::Connection, and Antares::Map::Node.

◆ isContained()

virtual bool Antares::Map::Item::isContained ( const int x1,
const int y1,
const int x2,
const int y2 ) const
pure virtual

Get if the drawing representation of the node is contained inside a bounding box.

This method is used to know if the mouse if over a node or not

Implemented in Antares::Map::BindingConstraint, Antares::Map::Connection, and Antares::Map::Node.

◆ isVisibleOnLayer()

virtual bool Antares::Map::Item::isVisibleOnLayer ( const size_t & ) const
inlinevirtual

Get the visivility for a layerId.

Reimplemented in Antares::Map::Connection, and Antares::Map::Node.

◆ move()

void Antares::Map::Item::move ( const int x,
const int y )
virtual

Reimplemented in Antares::Map::Node.

◆ refreshCache()

virtual void Antares::Map::Item::refreshCache ( wxDC & dc)
pure virtual

Refresh the cache (even if not invalidated)

Implemented in Antares::Map::BindingConstraint, Antares::Map::Connection, and Antares::Map::Node.

◆ selected() [1/2]

virtual bool Antares::Map::Item::selected ( ) const
inlinevirtual

Reimplemented in Antares::Map::Connection.

◆ selected() [2/2]

void Antares::Map::Item::selected ( bool v)
virtual

Reimplemented in Antares::Map::Connection.

◆ type()

virtual Type Antares::Map::Item::type ( ) const
inlinevirtual

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