/**
* Constructor.
*/
-ActionDrawImage::ActionDrawImage(RS_EntityContainer & container, GraphicView & graphicView):
+ActionDrawImage::ActionDrawImage(EntityContainer & container, GraphicView & graphicView):
ActionInterface("Image", container, graphicView)
{
}
reset();
- data.file = RS_DIALOGFACTORY->requestImageOpenDialog();
+ data.file = DIALOGFACTORY->requestImageOpenDialog();
graphicView->redraw();
if (!data.file.isEmpty())
{
finish();
updateToolBar();
- //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
+ //DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
}
}
void ActionDrawImage::reset()
{
- data = RS_ImageData(0,
+ data = ImageData(0,
Vector(0.0, 0.0),
Vector(1.0, 0.0),
Vector(0.0, 1.0),
if (!data.file.isEmpty())
{
- RS_Creation creation(container, graphicView);
+ Creation creation(container, graphicView);
creation.createImage(data);
}
// deletePreview();
// clearPreview();
-// RS_Line * line;
-// line = new RS_Line(preview, RS_LineData(Vector(0, 0), Vector(img.width(), 0)));
+// Line * line;
+// line = new Line(preview, LineData(Vector(0, 0), Vector(img.width(), 0)));
// preview->addEntity(line);
-// line = new RS_Line(preview,
-// RS_LineData(Vector(img.width(), 0), Vector(img.width(), img.height())));
+// line = new Line(preview,
+// LineData(Vector(img.width(), 0), Vector(img.width(), img.height())));
// preview->addEntity(line);
-// line = new RS_Line(preview,
-// RS_LineData(Vector(img.width(), img.height()), Vector(0, img.height())));
+// line = new Line(preview,
+// LineData(Vector(img.width(), img.height()), Vector(0, img.height())));
// preview->addEntity(line);
-// line = new RS_Line(preview, RS_LineData(Vector(0, img.height()), Vector(0, 0)));
+// line = new Line(preview, LineData(Vector(0, img.height()), Vector(0, 0)));
// preview->addEntity(line);
// preview->scale(Vector(0, 0), Vector(data.uVector.magnitude(), data.uVector.magnitude()));
// preview->rotate(Vector(0, 0), data.uVector.angle());
trigger();
}
-void ActionDrawImage::commandEvent(RS_CommandEvent * e)
+void ActionDrawImage::commandEvent(CommandEvent * e)
{
QString c = e->getCommand().toLower();
if (checkCommand("help", c))
{
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ getAvailableCommands().join(", "));
return;
}
case SetAngle:
{
bool ok;
- double a = RS_Math::eval(c, &ok);
+ double a = Math::eval(c, &ok);
if (ok)
- setAngle(RS_Math::deg2rad(a));
+ setAngle(Math::deg2rad(a));
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
case SetFactor:
{
bool ok;
- double f = RS_Math::eval(c, &ok);
+ double f = Math::eval(c, &ok);
if (ok)
setFactor(f);
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
break;
{
ActionInterface::showOptions();
- RS_DIALOGFACTORY->requestOptions(this, true);
+ DIALOGFACTORY->requestOptions(this, true);
}
void ActionDrawImage::hideOptions()
{
ActionInterface::hideOptions();
- RS_DIALOGFACTORY->requestOptions(this, false);
+ DIALOGFACTORY->requestOptions(this, false);
}
void ActionDrawImage::updateMouseButtonHints()
switch (getStatus())
{
case SetTargetPoint:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel"));
+ DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel"));
break;
case SetAngle:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter angle:"), "");
+ DIALOGFACTORY->updateMouseWidget(tr("Enter angle:"), "");
break;
case SetFactor:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter factor:"), "");
+ DIALOGFACTORY->updateMouseWidget(tr("Enter factor:"), "");
break;
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
void ActionDrawImage::updateToolBar()
{
if (!isFinished())
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
else
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
}
double ActionDrawImage::getAngle()