#include "graphicview.h"
#include "preview.h"
-ActionDrawArcTangential::ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw arcs tangential",
+ActionDrawArcTangential::ActionDrawArcTangential(EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw arcs tangential",
container, graphicView)
{
reset();
if (point.valid == false || baseEntity == NULL)
{
- RS_DEBUG->print("ActionDrawArcTangential::trigger: "
+ DEBUG->print("ActionDrawArcTangential::trigger: "
"conditions not met");
return;
}
preparePreview();
- RS_Arc * arc = new RS_Arc(container, data);
+ Arc * arc = new Arc(container, data);
arc->setLayerToActive();
arc->setPenToActive();
container->addEntity(arc);
if (isStartPoint)
{
startPoint = baseEntity->getStartpoint();
- direction = RS_Math::correctAngle(baseEntity->getDirection1() + M_PI);
+ direction = Math::correctAngle(baseEntity->getDirection1() + M_PI);
}
else
{
startPoint = baseEntity->getEndpoint();
- direction = RS_Math::correctAngle(baseEntity->getDirection2() + M_PI);
+ direction = Math::correctAngle(baseEntity->getDirection2() + M_PI);
}
- RS_Arc arc(NULL, RS_ArcData());
+ Arc arc(NULL, ArcData());
bool suc = arc.createFrom2PDirectionRadius(startPoint, point, direction, data.radius);
if (suc)
if (data.isValid())
{
-// RS_Arc * arc = new RS_Arc(preview, data);
+// Arc * arc = new Arc(preview, data);
// deletePreview();
// clearPreview();
// preview->addEntity(arc);
case SetBaseEntity:
{
Vector coord = graphicView->toGraph(e->x(), e->y());
- RS_Entity * entity = catchEntity(coord, RS2::ResolveAll);
+ Entity * entity = catchEntity(coord, RS2::ResolveAll);
if (entity != NULL)
{
if (entity->isAtomic())
{
- baseEntity = (RS_AtomicEntity *)entity;
+ baseEntity = (AtomicEntity *)entity;
if (baseEntity->getStartpoint().distanceTo(coord)
< baseEntity->getEndpoint().distanceTo(coord))
}
}
-void ActionDrawArcTangential::commandEvent(RS_CommandEvent * e)
+void ActionDrawArcTangential::commandEvent(CommandEvent * e)
{
QString c = e->getCommand().toLower();
if (checkCommand("help", c))
{
- RS_DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ DIALOGFACTORY->commandMessage(msgAvailableCommands()
+ getAvailableCommands().join(", "));
return;
}
{
ActionInterface::showOptions();
- if (RS_DIALOGFACTORY != NULL)
- RS_DIALOGFACTORY->requestOptions(this, true);
+ if (DIALOGFACTORY != NULL)
+ DIALOGFACTORY->requestOptions(this, true);
updateMouseButtonHints();
}
{
ActionInterface::hideOptions();
- if (RS_DIALOGFACTORY != NULL)
- RS_DIALOGFACTORY->requestOptions(this, false);
+ if (DIALOGFACTORY != NULL)
+ DIALOGFACTORY->requestOptions(this, false);
}
void ActionDrawArcTangential::updateMouseButtonHints()
switch (getStatus())
{
case SetBaseEntity:
- RS_DIALOGFACTORY->updateMouseWidget(
+ DIALOGFACTORY->updateMouseWidget(
tr("Specify base entity"),
tr("Cancel"));
break;
case SetEndAngle:
- RS_DIALOGFACTORY->updateMouseWidget(
+ DIALOGFACTORY->updateMouseWidget(
tr("Specify end angle"), tr("Back"));
break;
default:
- RS_DIALOGFACTORY->updateMouseWidget("", "");
+ DIALOGFACTORY->updateMouseWidget("", "");
break;
}
}
void ActionDrawArcTangential::updateToolBar()
{
if (!isFinished())
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
else
- RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarArcs);
+ DIALOGFACTORY->requestToolBar(RS2::ToolBarArcs);
}
void ActionDrawArcTangential::setRadius(double r)