#include "actiondimaligned.h"
-#include "rs_commandevent.h"
-#include "rs_constructionline.h"
-#include "rs_debug.h"
-#include "rs_dialogfactory.h"
+#include "commandevent.h"
+#include "constructionline.h"
+#include "debug.h"
+#include "dialogfactory.h"
#include "graphicview.h"
-#include "rs_preview.h"
-#include "rs_snapper.h"
+#include "preview.h"
+#include "snapper.h"
-ActionDimAligned::ActionDimAligned(RS_EntityContainer & container, GraphicView & graphicView): ActionDimension("Draw aligned dimensions",
+ActionDimAligned::ActionDimAligned(EntityContainer & container, GraphicView & graphicView): ActionDimension("Draw aligned dimensions",
container, graphicView)
{
reset();
void ActionDimAligned::reset()
{
ActionDimension::reset();
- edata = RS_DimAlignedData(Vector(false), Vector(false));
+ edata = DimAlignedData(Vector(false), Vector(false));
lastStatus = SetExtPoint1;
- if (RS_DIALOGFACTORY != NULL)
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ if (DIALOGFACTORY != NULL)
+ DIALOGFACTORY->requestOptions(this, true, true);
}
void ActionDimAligned::trigger()
graphicView->moveRelativeZero(data.definitionPoint);
//data.text = getText();
- RS_DimAligned * dim = new RS_DimAligned(container, data, edata);
+ DimAligned * dim = new DimAligned(container, data, edata);
dim->setLayerToActive();
dim->setPenToActive();
dim->update();
graphicView->moveRelativeZero(rz);
drawSnapper();
- RS_DEBUG->print("ActionDimAligned::trigger(): dim added: %d", dim->getId());
+ DEBUG->print("ActionDimAligned::trigger(): dim added: %d", dim->getId());
}
void ActionDimAligned::preparePreview()
{
Vector dirV;
dirV.setPolar(100.0, edata.extensionPoint1.angleTo(edata.extensionPoint2) + M_PI / 2.0);
- RS_ConstructionLine cl(NULL, RS_ConstructionLineData(edata.extensionPoint2,
+ ConstructionLine cl(NULL, ConstructionLineData(edata.extensionPoint2,
edata.extensionPoint2 + dirV));
data.definitionPoint = cl.getNearestPointOnEntity(data.definitionPoint);
}
void ActionDimAligned::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("ActionDimAligned::mouseMoveEvent begin");
+ DEBUG->print("ActionDimAligned::mouseMoveEvent begin");
Vector mouse = snapPoint(e);
switch (getStatus())
{
deletePreview();
clearPreview();
-// preview->addEntity(new RS_Line(preview, RS_LineData(edata.extensionPoint1, mouse)));
+// preview->addEntity(new Line(preview, LineData(edata.extensionPoint1, mouse)));
drawPreview();
}
break;
preparePreview();
//data.text = getText();
-// RS_DimAligned * dim = new RS_DimAligned(preview, data, edata);
+// DimAligned * dim = new DimAligned(preview, data, edata);
// dim->update();
// preview->addEntity(dim);
drawPreview();
break;
}
- RS_DEBUG->print("ActionDimAligned::mouseMoveEvent end");
+ DEBUG->print("ActionDimAligned::mouseMoveEvent end");
}
void ActionDimAligned::mouseReleaseEvent(QMouseEvent * e)
}
}
-void ActionDimAligned::commandEvent(RS_CommandEvent * e)
+void ActionDimAligned::commandEvent(CommandEvent * e)
{
QString c = e->getCommand().toLower();
if (checkCommand("help", c))
{
- if (RS_DIALOGFACTORY != NULL)
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ if (DIALOGFACTORY != NULL)
+ DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ getAvailableCommands().join(", "));
return;
case SetText:
setText(c);
- if (RS_DIALOGFACTORY != NULL)
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ if (DIALOGFACTORY != NULL)
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
graphicView->enableCoordinateInput();
void ActionDimAligned::updateMouseButtonHints()
{
- if (RS_DIALOGFACTORY != NULL)
+ if (DIALOGFACTORY != NULL)
{
switch (getStatus())
{
case SetExtPoint1:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify first extension line origin"), tr("Cancel"));
+ DIALOGFACTORY->updateMouseWidget(tr("Specify first extension line origin"), tr("Cancel"));
break;
case SetExtPoint2:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify second extension line origin"), tr("Back"));
+ DIALOGFACTORY->updateMouseWidget(tr("Specify second extension line origin"), tr("Back"));
break;
case SetDefPoint:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify dimension line location"), tr("Back"));
+ DIALOGFACTORY->updateMouseWidget(tr("Specify dimension line location"), tr("Back"));
break;
case SetText:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter dimension text:"), "");
+ DIALOGFACTORY->updateMouseWidget(tr("Enter dimension text:"), "");
break;
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
void ActionDimAligned::hideOptions()
{
- if (RS_DIALOGFACTORY != NULL)
- RS_DIALOGFACTORY->requestOptions(this, false);
+ if (DIALOGFACTORY != NULL)
+ DIALOGFACTORY->requestOptions(this, false);
ActionDimension::hideOptions();
}
{
ActionDimension::showOptions();
- if (RS_DIALOGFACTORY != NULL)
- RS_DIALOGFACTORY->requestOptions(this, true);
+ if (DIALOGFACTORY != NULL)
+ DIALOGFACTORY->requestOptions(this, true);
}