Antares Simulator
Power System Simulator
|
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
| |||||
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. | |||||
Node * | addNode (const wxString &id) | ||||
Add a new node with a given id. | |||||
Node * | addNode (const wxString &id, const wxString &caption, const int x, const int y) | ||||
Add a new node with a given id, caption and position. | |||||
Connection * | addConnection (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. | |||||
Item * | find (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. | |||||
Item * | find (const wxString &text) const | ||||
Find a node from its id or its caption. | |||||
Node * | find (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 Manager * | Instance () |
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) |
A convenient container for nodes on the graph.
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.
x1 | The X-Coordinate of the top-left point of the bouding box |
y1 | The Y-Coordinate of the top-left point of the bouding box |
x2 | The X-Coordinate of the bottom-right point of the bouding box |
y2 | The Y-Coordinate of the bottom-right point of the bouding box |
bool Antares::Map::Manager::loadFromStudy | ( | Data::Study & | study | ) |
Load the layout from an existing study.
All existing nodes/connections will be removed first
study | The real study |
uint Antares::Map::Manager::removeAllSelected | ( | ) |
Remove all selected items.