21 #ifndef __ANTARES_TOOLBOX_MAP_ITEM_H__
22 #define __ANTARES_TOOLBOX_MAP_ITEM_H__
27 #include <wx/gdicmn.h>
28 #include <wx/colour.h>
31 namespace Antares::Map
36 class BindingConstraint;
43 bool operator()(
const Item* s1,
const Item* s2)
const
49 using Vector = std::vector<Item*>;
51 using Set = std::set<Item*, SetCompare>;
53 using Links = std::map<Item*, bool>;
116 const wxString& caption()
const
121 void caption(
const wxString& v)
141 positionHasChanged();
157 positionHasChanged();
162 virtual wxPoint absolutePosition(DrawingContext& dc)
const;
166 const wxColour& color()
const
171 void color(
const wxColour& c);
172 void color(
const wxString& s);
173 void color(
const int r,
const int g,
const int b);
174 void color(
const int r,
const int g,
const int b,
const int alpha);
180 virtual bool selected()
const
185 virtual void selected(
bool v);
191 int zPosition()
const
227 virtual bool contains(
const int x,
const int y,
double& distance) = 0;
234 virtual bool isContained(
const int x1,
const int y1,
const int x2,
const int y2)
const = 0;
247 virtual void move(
const int x,
const int y);
266 void internalClearAllLinks();
268 virtual void captionHasChanged()
272 virtual void positionHasChanged()
276 virtual void colorHasChanged()
302 friend class ::Antares::Map::Manager;
303 friend class ::Antares::Map::Connection;
304 friend class ::Antares::Map::BindingConstraint;
309 #include "../drawingcontext.h"
310 #include "../manager.h"
311 #include "connection.h"
Drawing Context.
Definition: drawingcontext.h:41
Manager & manager()
Get the manager.
Definition: item.h:90
virtual ~Item()
Destructor.
Definition: item.cpp:42
virtual void mouseDblClick()
Mouse double click.
Definition: item.h:259
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 extendBoundingBox(wxPoint &topLeft, wxPoint &bottomRight)=0
Extends the bounding box.
bool pSelected
Selected.
Definition: item.h:285
virtual void refreshCache(wxDC &dc)=0
Refresh the cache (even if not invalidated)
int pY
X-Coordinate.
Definition: item.h:292
virtual void draw(DrawingContext &dc)=0
Draw the node.
int pX
Y-Coordinate.
Definition: item.h:290
Links * pLinks
Linked with other items.
Definition: item.h:297
wxColour pColor
Color.
Definition: item.h:283
virtual Type type() const
Type.
Definition: item.h:80
virtual bool isVisibleOnLayer(const size_t &) const
Get the visivility for a layerId.
Definition: item.h:107
Item(Manager &manager, const int zPos=0)
Constructor.
Definition: item.cpp:28
wxString pCaption
Caption.
Definition: item.h:294
void forceReload()
Mark the node as invalidated (to force its refresh for the next canvas update)
Definition: item.cpp:142
bool pInvalidated
invalidated
Definition: item.h:287
bool isInvalidated() const
Get the node is invalidated.
Definition: item.h:213
A convenient container for nodes on the graph.
Definition: manager.h:44