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

A node in a map. More...

#include <node.h>

Inheritance diagram for Antares::Map::Node:
Antares::Map::Item

Public Member Functions

Constructors & Destructor
 Node (Manager &manager)
 Default constructor.
 
 Node (Manager &manager, const wxString &id)
 Constructor with a given id.
 
virtual ~Node ()
 Destructor.
 
layerVisibility
bool isVisibleOnLayer (const size_t &layerID) const
 Get the visivility for a layerId.
 
virtual Type type () const
 Type.
 
ID
const wxString & id () const
 
void position (const int x, const int y)
 
virtual void move (const int x, const int y)
 Move the node.
 
Cache
virtual void refreshCache (wxDC &dc)
 Refresh the cache (even if not invalidated)
 
const wxPoint & cachedPosition () const
 Get the cached position.
 
const wxPoint & cachedSize () const
 Get the cached size.
 
- Public Member Functions inherited from Antares::Map::Item
 Item (Manager &manager, const int zPos=0)
 Constructor.
 
virtual ~Item ()
 Destructor.
 
Managermanager ()
 Get the manager.
 
const Managermanager () const
 
const wxString & caption () const
 
void caption (const wxString &v)
 
int x () const
 
void x (const int v)
 
int y () const
 
void y (const int v)
 
virtual wxPoint absolutePosition (DrawingContext &dc) const
 
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)
 
virtual bool selected () const
 
virtual void selected (bool v)
 
int zPosition () const
 
void forceReload ()
 Mark the node as invalidated (to force its refresh for the next canvas update)
 
bool isInvalidated () const
 Get the node is invalidated.
 
virtual void drawExternalDrawer (DrawingContext &)
 
virtual void mouseDblClick ()
 Mouse double click.
 

Misc

virtual bool contains (const int x, const int y, double &distance)
 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
 Get if the drawing representation of the node is contained inside a bounding box.
 
virtual void draw (DrawingContext &dc)
 Draw the node.
 
virtual void extendBoundingBox (wxPoint &topLeft, wxPoint &bottomRight)
 Extends the bounding box.
 
Data::AreaattachedArea () const
 
void attachedArea (Data::Area *a)
 
void addLayerVisibility (size_t id=0)
 make this node visible/invisible in a layer
 
void removeLayerVisibility (size_t id)
 
virtual void captionHasChanged ()
 
virtual void positionHasChanged ()
 
virtual void colorHasChanged ()
 
void createANewAreaIfNotAlreadyAttached ()
 

Additional Inherited Members

- Public Types inherited from Antares::Map::Item
enum  Type { tyUnknown , tyNode , tyConnection , tyBindingConstraint }
 
using Vector = std::vector<Item*>
 
using Set = std::set<Item*, SetCompare>
 
using Links = std::map<Item*, bool>
 
- Protected Member Functions inherited from Antares::Map::Item
void internalClearAllLinks ()
 
- Protected Attributes inherited from Antares::Map::Item
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
 

Detailed Description

A node in a map.

Member Function Documentation

◆ captionHasChanged()

void Antares::Map::Node::captionHasChanged ( )
protectedvirtual

Reimplemented from Antares::Map::Item.

◆ colorHasChanged()

void Antares::Map::Node::colorHasChanged ( )
protectedvirtual

Reimplemented from Antares::Map::Item.

◆ contains()

bool Antares::Map::Node::contains ( const int x,
const int y,
double & distance )
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

Implements Antares::Map::Item.

◆ draw()

void Antares::Map::Node::draw ( DrawingContext & dc)
virtual

Draw the node.

Implements Antares::Map::Item.

◆ extendBoundingBox()

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

Extends the bounding box.

Implements Antares::Map::Item.

◆ isContained()

bool Antares::Map::Node::isContained ( const int x1,
const int y1,
const int x2,
const int y2 ) const
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

Implements Antares::Map::Item.

◆ isVisibleOnLayer()

bool Antares::Map::Node::isVisibleOnLayer ( const size_t & layerID) const
virtual

Get the visivility for a layerId.

Reimplemented from Antares::Map::Item.

◆ move()

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

Move the node.

Parameters
xA relative X-coordinate
yA relative Y-coordinate

Reimplemented from Antares::Map::Item.

◆ positionHasChanged()

void Antares::Map::Node::positionHasChanged ( )
protectedvirtual

Reimplemented from Antares::Map::Item.

◆ refreshCache()

void Antares::Map::Node::refreshCache ( wxDC & dc)
virtual

Refresh the cache (even if not invalidated)

Implements Antares::Map::Item.

◆ type()

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

Type.

Reimplemented from Antares::Map::Item.


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