-// rs_actionlibraryinsert.cpp
+// actionlibraryinsert.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actionlibraryinsert.h"
+#include "actionlibraryinsert.h"
#include "rs_commandevent.h"
#include "rs_dialogfactory.h"
/**
* Constructor.
*/
-RS_ActionLibraryInsert::RS_ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView):
- RS_PreviewActionInterface("Library Insert", container, graphicView)
+ActionLibraryInsert::ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView):
+ ActionInterface("Library Insert", container, graphicView)
{
}
-RS_ActionLibraryInsert::~RS_ActionLibraryInsert()
+ActionLibraryInsert::~ActionLibraryInsert()
{
}
-/*virtual*/ RS2::ActionType RS_ActionLibraryInsert::rtti()
+/*virtual*/ RS2::ActionType ActionLibraryInsert::rtti()
{
return RS2::ActionLibraryInsert;
}
-void RS_ActionLibraryInsert::init(int status)
+void ActionLibraryInsert::init(int status)
{
- RS_PreviewActionInterface::init(status);
+ ActionInterface::init(status);
reset();
//trigger();
}
-void RS_ActionLibraryInsert::setFile(const QString & file)
+void ActionLibraryInsert::setFile(const QString & file)
{
data.file = file;
RS_DIALOGFACTORY->commandMessage(tr("Cannot open file '%1'").arg(file));
}
-void RS_ActionLibraryInsert::reset()
+void ActionLibraryInsert::reset()
{
/*data = RS_InsertData("",
Vector(0.0,0.0),
data.angle = 0.0;
}
-void RS_ActionLibraryInsert::trigger()
+void ActionLibraryInsert::trigger()
{
deleteSnapper();
deletePreview();
graphicView->redraw();
}
-void RS_ActionLibraryInsert::mouseMoveEvent(QMouseEvent * e)
+void ActionLibraryInsert::mouseMoveEvent(QMouseEvent * e)
{
switch (getStatus())
{
case SetTargetPoint:
data.insertionPoint = snapPoint(e);
- //if (block!=NULL) {
deletePreview();
clearPreview();
- preview->addAllFrom(prev);
- preview->move(data.insertionPoint);
- preview->scale(data.insertionPoint,
- Vector(data.factor, data.factor));
+// preview->addAllFrom(prev);
+// preview->move(data.insertionPoint);
+// preview->scale(data.insertionPoint, Vector(data.factor, data.factor));
// unit conversion:
- if (graphic != NULL)
+ if (graphic)
{
double uf = RS_Units::convert(1.0, prev.getUnit(), graphic->getUnit());
- preview->scale(data.insertionPoint, Vector(uf, uf));
+// preview->scale(data.insertionPoint, Vector(uf, uf));
}
- preview->rotate(data.insertionPoint, data.angle);
- // too slow:
- //RS_Creation creation(preview, NULL, false);
- //creation.createInsert(data);
+// preview->rotate(data.insertionPoint, data.angle);
drawPreview();
- //}
break;
default:
}
}
-void RS_ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e)
+void ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionLibraryInsert::coordinateEvent(Vector * e)
+void ActionLibraryInsert::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
trigger();
}
-void RS_ActionLibraryInsert::commandEvent(RS_CommandEvent * e)
+void ActionLibraryInsert::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionLibraryInsert::getAvailableCommands()
+QStringList ActionLibraryInsert::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionLibraryInsert::showOptions()
+void ActionLibraryInsert::showOptions()
{
- RS_ActionInterface::showOptions();
+ ActionInterface::showOptions();
RS_DIALOGFACTORY->requestOptions(this, true);
}
-void RS_ActionLibraryInsert::hideOptions()
+void ActionLibraryInsert::hideOptions()
{
- RS_ActionInterface::hideOptions();
+ ActionInterface::hideOptions();
RS_DIALOGFACTORY->requestOptions(this, false);
}
-void RS_ActionLibraryInsert::updateMouseButtonHints()
+void ActionLibraryInsert::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionLibraryInsert::updateMouseCursor()
+void ActionLibraryInsert::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionLibraryInsert::updateToolBar()
+void ActionLibraryInsert::updateToolBar()
{
if (!isFinished())
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
}
-double RS_ActionLibraryInsert::getAngle()
+double ActionLibraryInsert::getAngle()
{
return data.angle;
}
-void RS_ActionLibraryInsert::setAngle(double a)
+void ActionLibraryInsert::setAngle(double a)
{
data.angle = a;
}
-double RS_ActionLibraryInsert::getFactor()
+double ActionLibraryInsert::getFactor()
{
return data.factor;
}
-void RS_ActionLibraryInsert::setFactor(double f)
+void ActionLibraryInsert::setFactor(double f)
{
data.factor = f;
}
-