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(EntityContainer & container, GraphicView & graphicView):
24 ActionInterface("Info Inside", container, graphicView)
26 contour = new EntityContainer(NULL, false);
28 for (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 (Information::isPointInsideContour(pt, contour, &onContour))
44 DIALOGFACTORY->commandMessage(tr("Point is inside selected contour."));
46 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 DIALOGFACTORY->updateMouseWidget(tr("Specify point"), tr("Cancel"));
78 DIALOGFACTORY->updateMouseWidget("", "");
83 void ActionInfoInside::updateMouseCursor()
85 graphicView->setMouseCursor(RS2::CadCursor);
88 void ActionInfoInside::updateToolBar()
91 DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
93 DIALOGFACTORY->requestToolBar(RS2::ToolBarInfo);