1 // actioninfoinside.cpp
3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 06/04/2010 Added this text. :-)
17 #include "actioninfoinside.h"
19 #include "dialogfactory.h"
20 #include "graphicview.h"
21 #include "information.h"
23 ActionInfoInside::ActionInfoInside(RS_EntityContainer & container, GraphicView & graphicView):
24 ActionInterface("Info Inside", container, graphicView)
26 contour = new RS_EntityContainer(NULL, false);
28 for (RS_Entity * e = container.firstEntity(); e != NULL; e = container.nextEntity())
30 contour->addEntity(e);
33 ActionInfoInside::~ActionInfoInside()
38 void ActionInfoInside::trigger()
41 bool onContour = false;
43 if (RS_Information::isPointInsideContour(pt, contour, &onContour))
44 RS_DIALOGFACTORY->commandMessage(tr("Point is inside selected contour."));
46 RS_DIALOGFACTORY->commandMessage(tr("Point is outside selected contour."));
51 void ActionInfoInside::mouseMoveEvent(QMouseEvent * /*e*/)
55 void ActionInfoInside::mouseReleaseEvent(QMouseEvent * e)
57 if (e->button() == Qt::RightButton)
60 init(getStatus() - 1);
69 void ActionInfoInside::updateMouseButtonHints()
74 RS_DIALOGFACTORY->updateMouseWidget(tr("Specify point"), tr("Cancel"));
78 RS_DIALOGFACTORY->updateMouseWidget("", "");
83 void ActionInfoInside::updateMouseCursor()
85 graphicView->setMouseCursor(RS2::CadCursor);
88 void ActionInfoInside::updateToolBar()
91 RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
93 RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarInfo);