21#ifndef __ANTARES_TOOLBOX_MAP_ITEM_H__
22#define __ANTARES_TOOLBOX_MAP_ITEM_H__
38class BindingConstraint;
45 bool operator()(
const Item* s1,
const Item* s2)
const
51 using Vector = std::vector<Item*>;
53 using Set = std::set<Item*, SetCompare>;
55 using Links = std::map<Item*, bool>;
114 const wxString& caption()
const
118 void caption(
const wxString& v)
136 positionHasChanged();
150 positionHasChanged();
154 virtual wxPoint absolutePosition(DrawingContext& dc)
const;
158 const wxColour& color()
const
162 void color(
const wxColour& c);
163 void color(
const wxString& s);
164 void color(
const int r,
const int g,
const int b);
165 void color(
const int r,
const int g,
const int b,
const int alpha);
170 virtual bool selected()
const
174 virtual void selected(
bool v);
179 int zPosition()
const
213 virtual bool contains(
const int x,
const int y,
double& distance) = 0;
220 virtual bool isContained(
const int x1,
const int y1,
const int x2,
const int y2)
const = 0;
232 virtual void move(
const int x,
const int y);
250 void internalClearAllLinks();
252 virtual void captionHasChanged()
255 virtual void positionHasChanged()
258 virtual void colorHasChanged()
284 friend class ::Antares::Map::Manager;
285 friend class ::Antares::Map::Connection;
286 friend class ::Antares::Map::BindingConstraint;
292#include "../drawingcontext.h"
293#include "../manager.h"
294#include "connection.h"
Drawing Context.
Definition drawingcontext.h:43
Manager & manager()
Get the manager.
Definition item.h:91
virtual ~Item()
Destructor.
Definition item.cpp:44
virtual void mouseDblClick()
Mouse double click.
Definition item.h:244
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:267
virtual void refreshCache(wxDC &dc)=0
Refresh the cache (even if not invalidated)
int pY
X-Coordinate.
Definition item.h:274
virtual void draw(DrawingContext &dc)=0
Draw the node.
int pX
Y-Coordinate.
Definition item.h:272
Links * pLinks
Linked with other items.
Definition item.h:279
wxColour pColor
Color.
Definition item.h:265
virtual Type type() const
Type.
Definition item.h:81
virtual bool isVisibleOnLayer(const size_t &) const
Get the visivility for a layerId.
Definition item.h:106
Item(Manager &manager, const int zPos=0)
Constructor.
Definition item.cpp:30
wxString pCaption
Caption.
Definition item.h:276
void forceReload()
Mark the node as invalidated (to force its refresh for the next canvas update)
Definition item.cpp:136
bool pInvalidated
invalidated
Definition item.h:269
bool isInvalidated() const
Get the node is invalidated.
Definition item.h:200
A convenient container for nodes on the graph.
Definition manager.h:46