1 // rs_actioninfototallength.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_actioninfototallength.h"
17 #include "rs_dialogfactory.h"
19 RS_ActionInfoTotalLength::RS_ActionInfoTotalLength(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Info Total Length",
20 container, graphicView)
24 RS_ActionInfoTotalLength::~RS_ActionInfoTotalLength()
28 void RS_ActionInfoTotalLength::init(int status)
30 RS_ActionInterface::init(status);
34 void RS_ActionInfoTotalLength::trigger()
36 RS_DEBUG->print("RS_ActionInfoTotalLength::trigger()");
40 for (RS_Entity * e = container->firstEntity(RS2::ResolveNone);
42 e = container->nextEntity(RS2::ResolveNone))
44 if (e->isVisible() && e->isSelected())
46 double l = e->getLength();
58 RS_DIALOGFACTORY->commandMessage(
59 tr("Total Length of selected entities: %1").arg(len));
61 RS_DIALOGFACTORY->commandMessage(tr("At least one of the selected "
62 "entities cannot be measured."));
67 void RS_ActionInfoTotalLength::updateToolBar()
69 if (RS_DIALOGFACTORY != NULL)
72 RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarInfo);
74 RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);