This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
neofx-zoomedit/ToolAddPolygon.h

72 lines
1.5 KiB
C
Raw Normal View History

2007-12-04 21:35:01 +00:00
#ifndef TOOLADDPOLYGON_H_
#define TOOLADDPOLYGON_H_
#include "Tool.h"
#include "EditManager.h"
#include "SidebarAdd.h"
#include "LevelVertex.h"
2007-12-04 21:35:01 +00:00
class ToolAddPolygon : public Tool, private EventHandler, private Renderer {
2007-12-04 21:35:01 +00:00
private:
GtkWidget *image;
EditManager *editManager;
SidebarAdd sidebar;
Room newRoom;
2007-12-04 21:35:01 +00:00
// prevent shallow copy
ToolAddPolygon(const ToolAddPolygon &t);
const ToolAddPolygon& operator=(const ToolAddPolygon &t);
public:
ToolAddPolygon(EditManager *editManager);
virtual ~ToolAddPolygon();
virtual void activate();
virtual void deactivate();
2007-12-04 21:35:01 +00:00
2007-12-14 22:03:00 +00:00
virtual const char *getType() const {
return "ToolAddPolygon";
}
virtual const char *getName() const {
return "Add polygonal room";
2007-12-04 21:35:01 +00:00
}
virtual bool isSensitive() {
return TRUE;
2007-12-04 21:35:01 +00:00
}
2007-12-14 22:03:00 +00:00
virtual GtkWidget *getImage() {
return image;
}
virtual bool hoverFilter(const LevelObject &object) const {
if(!object.isOfType("LevelVertex"))
return false;
return ((LevelVertex*)&object)->canConnect();
}
virtual EventHandler* getEventHandler() {
return this;
}
virtual Renderer *getRenderer() {
return this;
}
virtual void render(const Level &level, const Rectangle &rect, float scale);
2008-02-15 22:44:03 +00:00
virtual bool buttonPress(unsigned int button, const Vertex *v);
virtual Sidebar* getSidebar() {
return &sidebar;
}
2007-12-04 21:35:01 +00:00
};
#endif /*TOOLADDPOLYGON_H_*/