#include "actionmodifytrimamount.h"
-#include "rs_commandevent.h"
-#include "rs_debug.h"
-#include "rs_dialogfactory.h"
-#include "rs_modification.h"
+#include "commandevent.h"
+#include "debug.h"
+#include "dialogfactory.h"
+#include "modification.h"
ActionModifyTrimAmount::ActionModifyTrimAmount(
- RS_EntityContainer & container, GraphicView & graphicView):
+ EntityContainer & container, GraphicView & graphicView):
ActionInterface("Trim Entity by a given amount",
container, graphicView)
{
void ActionModifyTrimAmount::trigger()
{
- RS_DEBUG->print("ActionModifyTrimAmount::trigger()");
+ DEBUG->print("ActionModifyTrimAmount::trigger()");
if (trimEntity != NULL && trimEntity->isAtomic())
{
- RS_Modification m(*container, graphicView);
- m.trimAmount(trimCoord, (RS_AtomicEntity *)trimEntity, distance);
+ Modification m(*container, graphicView);
+ m.trimAmount(trimCoord, (AtomicEntity *)trimEntity, distance);
trimEntity = NULL;
setStatus(ChooseTrimEntity);
- RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
+ DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}
}
else
{
if (trimEntity == NULL)
- RS_DIALOGFACTORY->commandMessage(
+ DIALOGFACTORY->commandMessage(
tr("No entity found. "));
else if (trimEntity->rtti() == RS2::EntityInsert)
- RS_DIALOGFACTORY->commandMessage(
+ DIALOGFACTORY->commandMessage(
tr("The chosen Entity is in a block. "
"Please edit the block."));
else
- RS_DIALOGFACTORY->commandMessage(
+ DIALOGFACTORY->commandMessage(
tr("The chosen Entity is not an atomic entity "
"or cannot be trimmed."));
}
}
}
-void ActionModifyTrimAmount::commandEvent(RS_CommandEvent * e)
+void ActionModifyTrimAmount::commandEvent(CommandEvent * e)
{
QString c = e->getCommand().toLower();
if (checkCommand("help", c))
{
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ getAvailableCommands().join(", "));
return;
}
{
case ChooseTrimEntity: {
bool ok;
- double d = RS_Math::eval(c, &ok);
+ double d = Math::eval(c, &ok);
if (ok == true)
distance = d;
else
- RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->commandMessage(tr("Not a valid expression"));
+ DIALOGFACTORY->requestOptions(this, true, true);
setStatus(ChooseTrimEntity);
}
break;
{
ActionInterface::showOptions();
- RS_DIALOGFACTORY->requestOptions(this, true);
+ DIALOGFACTORY->requestOptions(this, true);
}
void ActionModifyTrimAmount::hideOptions()
{
ActionInterface::hideOptions();
- RS_DIALOGFACTORY->requestOptions(this, false);
+ DIALOGFACTORY->requestOptions(this, false);
}
void ActionModifyTrimAmount::updateMouseButtonHints()
switch (getStatus())
{
case ChooseTrimEntity:
- RS_DIALOGFACTORY->updateMouseWidget(
+ DIALOGFACTORY->updateMouseWidget(
tr("Select entity to trim or enter distance:"), tr("Back"));
break;
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
void ActionModifyTrimAmount::updateToolBar()
{
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
}
double ActionModifyTrimAmount::getDistance()