1 // rs_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 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 06/04/2010 Added this text. :-)
15 #include "rs_actioninfoinside.h"
17 #include "rs_dialogfactory.h"
18 #include "graphicview.h"
19 #include "rs_information.h"
21 RS_ActionInfoInside::RS_ActionInfoInside(RS_EntityContainer & container, GraphicView & graphicView):
22 RS_ActionInterface("Info Inside", container, graphicView)
24 contour = new RS_EntityContainer(NULL, false);
26 for (RS_Entity * e = container.firstEntity(); e != NULL; e = container.nextEntity())
28 contour->addEntity(e);
31 RS_ActionInfoInside::~RS_ActionInfoInside()
36 void RS_ActionInfoInside::trigger()
39 bool onContour = false;
41 if (RS_Information::isPointInsideContour(pt, contour, &onContour))
42 RS_DIALOGFACTORY->commandMessage(tr("Point is inside selected contour."));
44 RS_DIALOGFACTORY->commandMessage(tr("Point is outside selected contour."));
49 void RS_ActionInfoInside::mouseMoveEvent(QMouseEvent * /*e*/)
51 //Vector mouse = snapPoint(e);
52 //bool onContour = false;
53 /*if (RS_Information::isPointInsideContour(mouse, contour, &onContour)) {
58 void RS_ActionInfoInside::mouseReleaseEvent(QMouseEvent * e)
60 if (e->button() == Qt::RightButton)
63 init(getStatus() - 1);
72 void RS_ActionInfoInside::updateMouseButtonHints()
77 RS_DIALOGFACTORY->updateMouseWidget(tr("Specify point"), tr("Cancel"));
81 RS_DIALOGFACTORY->updateMouseWidget("", "");
86 void RS_ActionInfoInside::updateMouseCursor()
88 graphicView->setMouseCursor(RS2::CadCursor);
91 void RS_ActionInfoInside::updateToolBar()
94 RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
96 RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarInfo);