-// rs_actiondimradial.cpp
+// actiondimradial.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Added this text. :-)
//
-#include "rs_actiondimradial.h"
+#include "actiondimradial.h"
#include "rs_commandevent.h"
#include "rs_dialogfactory.h"
#include "graphicview.h"
#include "rs_preview.h"
-RS_ActionDimRadial::RS_ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionDimension("Draw Radial Dimensions",
- container, graphicView)
+ActionDimRadial::ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView):
+ ActionDimension("Draw Radial Dimensions", container, graphicView)
{
reset();
}
-RS_ActionDimRadial::~RS_ActionDimRadial()
+ActionDimRadial::~ActionDimRadial()
{
}
-/*virtual*/ RS2::ActionType RS_ActionDimRadial::rtti()
+/*virtual*/ RS2::ActionType ActionDimRadial::rtti()
{
return RS2::ActionDimRadial;
}
-void RS_ActionDimRadial::reset()
+void ActionDimRadial::reset()
{
- RS_ActionDimension::reset();
+ ActionDimension::reset();
- edata = RS_DimRadialData(Vector(false),
- 0.0);
+ edata = RS_DimRadialData(Vector(false), 0.0);
entity = NULL;
pos = Vector(false);
RS_DIALOGFACTORY->requestOptions(this, true, true);
}
-void RS_ActionDimRadial::trigger()
+void ActionDimRadial::trigger()
{
- RS_ActionDimension::trigger();
+ ActionDimension::trigger();
preparePreview();
- if (entity != NULL)
+ if (entity)
{
- RS_DimRadial * newEntity = NULL;
-
- newEntity = new RS_DimRadial(container,
- data,
- edata);
-
+ RS_DimRadial * newEntity = new RS_DimRadial(container, data, edata);
newEntity->setLayerToActive();
newEntity->setPenToActive();
newEntity->update();
container->addEntity(newEntity);
// upd. undo list:
- if (document != NULL)
+ if (document)
{
document->startUndoCycle();
document->addUndoable(newEntity);
document->endUndoCycle();
}
+
deleteSnapper();
Vector rz = graphicView->getRelativeZero();
graphicView->moveRelativeZero(Vector(0.0, 0.0));
//drawSnapper();
}
else
- RS_DEBUG->print("RS_ActionDimRadial::trigger:"
- " Entity is NULL\n");
+ RS_DEBUG->print("ActionDimRadial::trigger: Entity is NULL\n");
}
-void RS_ActionDimRadial::preparePreview()
+void ActionDimRadial::preparePreview()
{
if (entity != NULL)
{
}
}
-void RS_ActionDimRadial::mouseMoveEvent(QMouseEvent * e)
+void ActionDimRadial::mouseMoveEvent(QMouseEvent * e)
{
- RS_DEBUG->print("RS_ActionDimRadial::mouseMoveEvent begin");
-
- //Vector mouse(graphicView->toGraphX(e->x()),
- // graphicView->toGraphY(e->y()));
+ RS_DEBUG->print("ActionDimRadial::mouseMoveEvent begin");
switch (getStatus())
{
case SetPos:
- if (entity != NULL)
+ if (entity)
{
pos = snapPoint(e);
preparePreview();
- RS_DimRadial * d = new RS_DimRadial(preview, data, edata);
- d->update();
-
- deletePreview();
- clearPreview();
- preview->addEntity(d);
- drawPreview();
+// RS_DimRadial * d = new RS_DimRadial(preview, data, edata);
+// d->update();
+//
+// deletePreview();
+// clearPreview();
+// preview->addEntity(d);
+// drawPreview();
}
break;
break;
}
- RS_DEBUG->print("RS_ActionDimRadial::mouseMoveEvent end");
+ RS_DEBUG->print("ActionDimRadial::mouseMoveEvent end");
}
-void RS_ActionDimRadial::mouseReleaseEvent(QMouseEvent * e)
+void ActionDimRadial::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionDimRadial::coordinateEvent(Vector * e)
+void ActionDimRadial::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDimRadial::commandEvent(RS_CommandEvent * e)
+void ActionDimRadial::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDimRadial::getAvailableCommands()
+QStringList ActionDimRadial::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDimRadial::updateMouseButtonHints()
+void ActionDimRadial::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionDimRadial::showOptions()
+void ActionDimRadial::showOptions()
{
- RS_ActionInterface::showOptions();
+ ActionInterface::showOptions();
RS_DIALOGFACTORY->requestOptions(this, true);
//RS_DIALOGFACTORY->requestDimRadialOptions(edata, true);
}
-void RS_ActionDimRadial::hideOptions()
+void ActionDimRadial::hideOptions()
{
- RS_ActionInterface::hideOptions();
+ ActionInterface::hideOptions();
//RS_DIALOGFACTORY->requestDimRadialOptions(edata, false);
RS_DIALOGFACTORY->requestOptions(this, false);
}
-// EOF
+