Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Antares::Map::Manager Class Referencefinal

A convenient container for nodes on the graph. More...

#include <manager.h>

Public Member Functions

Constructor & Destructor
 Manager (Component &component)
 Default Constructor.
 
 ~Manager ()
 Destructor.
 
Study
void attachStudy (Data::Study::Ptr study)
 Attach this map to an existing study.
 
Data::Study::Ptr study () const
 Get the attached study to this map.
 
Bounding box
BoundingBox boundingBox (const size_t &layerID) const
 Get the 2D-Bounding box wich contains all nodes.
 
BoundingBox boundingBoxOfSelectedNodes (const size_t &layerID) const
 Get the 2D-Bounding box wich contains all nodes.
 
Node manipulation

Recentre all nodes to the origin point

Parameters
offsetXAn additional offset for the X-axis
offsetYAn additional offset for the Y-axis
bool loadFromStudy (Data::Study &study)
 Load the layout from an existing study.
 
bool loadFromAttachedStudy ()
 Load the layout from the attached study.
 
template<class T >
T * add ()
 Add a new node in the map.
 
NodeaddNode (const wxString &id)
 Add a new node with a given id.
 
NodeaddNode (const wxString &id, const wxString &caption, const int x, const int y)
 Add a new node with a given id, caption and position.
 
ConnectionaddConnection (Item *a, Item *b)
 Add a connection between two items.
 
void addConnectionFromEachSelectedItem (Item *to, Item::Vector *results=NULL)
 Add a connection for each selected item to a item.
 
bool remove (const wxString &text)
 Remove a node from its id or its caption.
 
uint removeAllSelected ()
 Remove all selected items.
 
void hideAllSelected (size_t id)
 Hide all selected items from a layer.
 
void showAllSelected (size_t id)
 Show all selected items from a layer.
 
void clear ()
 Clear (and destroy) all nodes.
 
Itemfind (const int x, const int y) const
 Find a node from its position.
 
Item::Vector * find (const int x1, const int y1, const int x2, const int y2) const
 Get the list of node which are contained inside a bounding box.
 
Itemfind (const wxString &text) const
 Find a node from its id or its caption.
 
Nodefind (const Data::Area *area)
 
void moveAllSelected (const int x, const int y)
 Moved all selected nodes.
 
void invalidateAllNodes ()
 Invalidate all nodes.
 
void refreshCacheForAllNodes (wxDC &dc)
 Update the cache for all nodes.
 

Static Public Member Functions

static ManagerInstance ()
 Get the instance of the main window.
 

Selection

bool mouseSelectionArea
 
bool mouseSelectionLinks
 
bool mouseSelectionPlants
 
bool mouseSelectionConstraints
 
class ::Antares::Map::Item
 
class ::Antares::Map::Node
 
class ::Antares::Map::Connection
 
class ::Antares::Map::BindingConstraint
 
void selectOnly (Item *item)
 Select a single item (a node or an interconnection)
 
void changeItemSelectionState (Item *item)
 
void selectOnly (const Item::Vector &item)
 
void selectOnly (const Data::Area::Vector &areas)
 
void selectOnly (const Data::Area::Vector &areas, const Data::AreaLink::Vector &links)
 
void selectAllNodes (size_t layerID)
 Select all nodes.
 
void selectAllItems (size_t layerID)
 Select all items, without any distinction.
 
void selectAllAreas (size_t layerID)
 Select all areas only.
 
void selectAllLinks (size_t layerID)
 Select all links.
 
void unselectAll ()
 Unselect all nodes.
 
void reverseSelection ()
 Reverse the selection.
 
void selectFromBoundingBox (const wxPoint &a, const wxPoint &b, const size_t layerID=0)
 Select all nodes which are contained in a bounding box.
 
uint selectedItemsCount () const
 Get the count of nodes that are selected.
 
uint selectedItemsAsConnectionCount () const
 
void getAllSelectedItems (std::vector< Item * > &list)
 
Data::AreaName findNewCaption (Data::AreaName="") const
 
void beginUpdate ()
 
void endUpdate ()
 
void draw (DrawingContext &dc)
 Draw all items.
 
void drawExternalDrawer (DrawingContext &dc)
 
bool hasChanges () const
 
void setChangesFlag (bool v)
 
uint areasCount (const size_t &layerID) const
 Get how many area we have.
 
void removeLayerVisibility (const size_t &layerID)
 remove layer visibility for all nodes
 
size_t getActiveLayerId ()
 
uint connectionsCount (const size_t &layerID) const
 Get how many connections we have.
 
void pendingDeleteArea (Data::Area *area)
 
void pendingDeleteLink (Data::AreaLink *lnk)
 

Detailed Description

A convenient container for nodes on the graph.

Member Function Documentation

◆ find()

Item::Vector * Antares::Map::Manager::find ( const int x1,
const int y1,
const int x2,
const int y2 ) const

Get the list of node which are contained inside a bounding box.

The returned list must be deleted.

Parameters
x1The X-Coordinate of the top-left point of the bouding box
y1The Y-Coordinate of the top-left point of the bouding box
x2The X-Coordinate of the bottom-right point of the bouding box
y2The Y-Coordinate of the bottom-right point of the bouding box
Returns
A valid pointer to a list of nodes. The list may be empty.

◆ loadFromStudy()

bool Antares::Map::Manager::loadFromStudy ( Data::Study & study)

Load the layout from an existing study.

All existing nodes/connections will be removed first

Parameters
studyThe real study

◆ removeAllSelected()

uint Antares::Map::Manager::removeAllSelected ( )

Remove all selected items.

Returns
The number of removed items

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