47 #ifndef _MIRA_POLYGONTOOL_H_ 48 #define _MIRA_POLYGONTOOL_H_ 51 #include <OGRE/OgreRenderWindow.h> 52 #include <OGRE/OgreSceneManager.h> 76 template<
typename Reflector>
80 r.property(
"Outline Color", mOutlineColor,
86 virtual void onMouseReleased(QMouseEvent* e);
89 virtual void onMouseMoved(QMouseEvent* e);
94 virtual void activate();
97 virtual void deactivate();
104 virtual void onNewPolygon(
const Polygon2f& polygon) = 0;
107 virtual void onNewPolygons(
const std::vector<Polygon2f>& polygons) = 0;
110 void setPolygon(
const Polygon2f& polygon);
113 void setOutlineColor(
const Ogre::ColourValue& color);
117 std::pair<std::string, Ogre::Vector3> getIntersection(
float x,
float y,
118 const std::string& mask=
"");
121 void finishPolygon(
bool last =
true);
122 bool isNearFirstPoint(QMouseEvent* e,
const Ogre::Vector3& p);
126 std::string mSelectedObject;
129 boost::shared_ptr<PolygonObject<float>> mPolygonObject;
133 boost::shared_ptr<PolygonObject<float>> mPolygonsObject;
134 std::vector<Polygon2f> mPolygons;
136 Ogre::ColourValue mOutlineColor;
The interface of a Visualization3DSite.
Definition: Visualization3D.h:84
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
#define MIRA_REFLECT_BASE(reflector, BaseClass)
Macro that can be used to reflect the base class easily.
Definition: ReflectorInterface.h:912
#define MIRA_GUI_VISUALIZATION_EXPORT
Definition: GuiVisualizationExports.h:61
Simple Wrapper for Boost::geometry polygon.
const RGB Green(0.0f, 1.0f, 0.0f)
Definition: ImageObject.h:60
Non intrusive reflect for OGRE color class.
boost::geometry::model::ring< Point2f > Polygon2f
A 2D polygon with 32 bit floating precision.
Definition: Polygon.h:131
Declaration of PolygonObject.