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