Go to the documentation of this file.
33 #ifndef TTA_MACHINE_CANVAS_HH
34 #define TTA_MACHINE_CANVAS_HH
37 #include <wx/scrolwin.h>
38 #include <wx/docmdi.h>
69 virtual void OnDraw(wxDC& dc);
88 std::vector<EditPart*>& found);
100 #if wxCHECK_VERSION(3, 0, 0)
101 bool saveSVG(
const std::string& filename);
104 const std::string& filename,
105 const std::string& title,
106 const std::string& creator =
"");
109 bool savePNG(
const std::string& filename);
145 DECLARE_EVENT_TABLE()
wxSize getFigureSize() const
EditPart * findEditPart(int x, int y)
void onMouseEvent(wxMouseEvent &event)
MachineCanvasOptions options_
void setZoomFactor(double factor)
TTAMachine::Machine * machine
the architecture definition of the estimated processor
void refreshLogicalRect(const wxRect &rectangle)
wxRect toolBounds_
Bounding box of the last tool figure drawn.
EditPart * selection_
Pointer to the the selected component.
EditPolicyFactory * editPolicyFactory_
EditPolicyFactory which creates edit policies for machine components.
ChildFrame * parent_
Parent frame which holds the MachineCanvas.
bool saveEPS(const std::string &filename, const std::string &title, const std::string &creator="")
double zoomFactor_
Zoom factor of the canvas.
void setTool(MachineCanvasTool *tool)
TTAMachine::Machine * machine_
Machine to draw on the canvas.
MachineCanvasTool * tool_
Tool which handles mouse events on the MachineCanvas.
MachineCanvas(wxWindow *parent, EditPolicyFactory *policyFactory, ChildFrame *parentFrame=nullptr)
MachineCanvasTool * tool()
std::vector< Figure * > moveFigures_
Move figures to be drawn on the canvas.
void select(EditPart *part)
MachineCanvasOptions & options()
RootEditPart * root_
Root of the machine EditPart hierarchy.
void setMachine(TTAMachine::Machine *machine)
int findEditPartsInRange(int x, int y, int range, std::vector< EditPart * > &found)
void addMove(const TTAMachine::Bus *bus, const TTAMachine::Port *source, const TTAMachine::Port *target)
void highlight(TTAMachine::MachinePart *model, const wxColour &colour)
bool savePNG(const std::string &filename)
bool dirty_
Tells if the figures need to be laid out before next draw.
virtual void OnDraw(wxDC &dc)
bool hasEditPart(const EditPart *part) const