#include "dialogfactory.h"
#include "information.h"
-ActionModifyBevel::ActionModifyBevel(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Bevel Entities",
+ActionModifyBevel::ActionModifyBevel(EntityContainer & container, GraphicView & graphicView): ActionInterface("Bevel Entities",
container, graphicView)
{
entity1 = NULL;
void ActionModifyBevel::trigger()
{
- RS_DEBUG->print("ActionModifyBevel::trigger()");
+ DEBUG->print("ActionModifyBevel::trigger()");
if (entity1 && entity1->isAtomic()
&& entity2 && entity2->isAtomic())
{
- RS_Modification m(*container, graphicView);
- m.bevel(coord1, (RS_AtomicEntity *)entity1, coord2, (RS_AtomicEntity *)entity2, data);
+ Modification m(*container, graphicView);
+ m.bevel(coord1, (AtomicEntity *)entity1, coord2, (AtomicEntity *)entity2, data);
entity1 = NULL;
entity2 = NULL;
setStatus(SetEntity1);
- RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
+ DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}
}
void ActionModifyBevel::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("ActionModifyBevel::mouseMoveEvent begin");
+ DEBUG->print("ActionModifyBevel::mouseMoveEvent begin");
Vector mouse = graphicView->toGraph(e->x(), e->y());
- RS_Entity * se = catchEntity(e, RS2::ResolveAll);
+ Entity * se = catchEntity(e, RS2::ResolveAll);
switch (getStatus())
{
case SetEntity2:
- if (entity1 != NULL && RS_Information::isTrimmable(entity1))
+ if (entity1 != NULL && Information::isTrimmable(entity1))
{
coord2 = mouse;
entity2 = se;
break;
}
- RS_DEBUG->print("ActionModifyBevel::mouseMoveEvent end");
+ DEBUG->print("ActionModifyBevel::mouseMoveEvent end");
}
void ActionModifyBevel::mouseReleaseEvent(QMouseEvent * e)
case SetEntity2:
if (entity2 != NULL && entity2->isAtomic()
- && RS_Information::isTrimmable(entity1, entity2))
+ && Information::isTrimmable(entity1, entity2))
trigger();
break;
}
}
-void ActionModifyBevel::commandEvent(RS_CommandEvent * e)
+void ActionModifyBevel::commandEvent(CommandEvent * e)
{
QString c = e->getCommand().toLower();
if (checkCommand("help", c))
{
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ getAvailableCommands().join(", "));
return;
}
//lastStatus = (Status)getStatus();
//setStatus(SetTrim);
data.trim = !data.trim;
- RS_DIALOGFACTORY->requestOptions(this, true, true);
+ DIALOGFACTORY->requestOptions(this, true, true);
}
break;
case SetLength1: {
bool ok;
- double l = RS_Math::eval(c, &ok);
+ double l = Math::eval(c, &ok);
if (ok == true)
data.length1 = l;
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(lastStatus);
}
break;
case SetLength2: {
bool ok;
- double l = RS_Math::eval(c, &ok);
+ double l = Math::eval(c, &ok);
if (ok == true)
data.length2 = l;
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(lastStatus);
}
break;
} else if (c==cmdNo.toLower() || c==cmdNo2) {
data.trim = false;
} else {
- RS_DIALOGFACTORY->commandMessage(tr("Please enter 'Yes' "
+ DIALOGFACTORY->commandMessage(tr("Please enter 'Yes' "
"or 'No'"));
}
- 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 ActionModifyBevel::hideOptions()
{
ActionInterface::hideOptions();
- RS_DIALOGFACTORY->requestOptions(this, false);
+ DIALOGFACTORY->requestOptions(this, false);
}
void ActionModifyBevel::updateMouseButtonHints()
switch (getStatus())
{
case SetEntity1:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Select first entity"),
+ DIALOGFACTORY->updateMouseWidget(tr("Select first entity"),
tr("Cancel"));
break;
case SetEntity2:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Select second entity"),
+ DIALOGFACTORY->updateMouseWidget(tr("Select second entity"),
tr("Back"));
break;
case SetLength1:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter length 1:"),
+ DIALOGFACTORY->updateMouseWidget(tr("Enter length 1:"),
tr("Back"));
break;
case SetLength2:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Enter length 2:"),
+ DIALOGFACTORY->updateMouseWidget(tr("Enter length 2:"),
tr("Back"));
break;
/*case SetTrim:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Trim on? (yes/no):"),
+ DIALOGFACTORY->updateMouseWidget(tr("Trim on? (yes/no):"),
"");
break;*/
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
void ActionModifyBevel::updateToolBar()
{
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
}
void ActionModifyBevel::setLength1(double l1)