-// rs_actionselectwindow.cpp
+// actionselectwindow.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actionselectwindow.h"
+#include "actionselectwindow.h"
#include "rs_dialogfactory.h"
#include "rs_selection.h"
*
* @param select true: select window. false: deselect window
*/
-RS_ActionSelectWindow::RS_ActionSelectWindow(RS_EntityContainer & container,
+ActionSelectWindow::ActionSelectWindow(RS_EntityContainer & container,
GraphicView & graphicView, bool select):
- RS_PreviewActionInterface("Select Window", container, graphicView)
+ ActionInterface("Select Window", container, graphicView)
{
this->select = select;
}
-RS_ActionSelectWindow::~RS_ActionSelectWindow()
+ActionSelectWindow::~ActionSelectWindow()
{
}
-/*virtual*/ RS2::ActionType RS_ActionSelectWindow::rtti()
+/*virtual*/ RS2::ActionType ActionSelectWindow::rtti()
{
return RS2::ActionSelectWindow;
}
-void RS_ActionSelectWindow::init(int status)
+void ActionSelectWindow::init(int status)
{
- RS_PreviewActionInterface::init(status);
+ ActionInterface::init(status);
v1 = v2 = Vector(false);
- snapMode = RS2::SnapFree;
- snapRes = RS2::RestrictNothing;
+/* snapMode = RS2::SnapFree;
+ snapRes = RS2::RestrictNothing;*/
}
-void RS_ActionSelectWindow::trigger()
+void ActionSelectWindow::trigger()
{
- RS_PreviewActionInterface::trigger();
+ ActionInterface::trigger();
if (v1.valid && v2.valid)
{
if (graphicView->toGuiDX(v1.distanceTo(v2)) > 10)
{
deleteSnapper();
-
bool cross = (v2.y > v1.y);
-
RS_Selection s(*container, graphicView);
s.selectWindow(v1, v2, select, cross);
-
RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
-
init();
}
}
}
-void RS_ActionSelectWindow::mouseMoveEvent(QMouseEvent * e)
+void ActionSelectWindow::mouseMoveEvent(QMouseEvent * e)
{
if (getStatus() == SetCorner2 && v1.valid)
{
v2 = snapPoint(e);
deletePreview();
clearPreview();
+/* preview->addEntity(new RS_Line(preview,
+ RS_LineData(Vector(v1.x, v1.y), Vector(v2.x, v1.y))));
preview->addEntity(new RS_Line(preview,
- RS_LineData(Vector(v1.x, v1.y),
- Vector(v2.x, v1.y))));
+ RS_LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y))));
preview->addEntity(new RS_Line(preview,
- RS_LineData(Vector(v2.x, v1.y),
- Vector(v2.x, v2.y))));
+ RS_LineData(Vector(v2.x, v2.y), Vector(v1.x, v2.y))));
preview->addEntity(new RS_Line(preview,
- RS_LineData(Vector(v2.x, v2.y),
- Vector(v1.x, v2.y))));
- preview->addEntity(new RS_Line(preview,
- RS_LineData(Vector(v1.x, v2.y),
- Vector(v1.x, v1.y))));
+ RS_LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y))));*/
drawPreview();
}
}
-void RS_ActionSelectWindow::mousePressEvent(QMouseEvent * e)
+void ActionSelectWindow::mousePressEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
- RS_DEBUG->print("RS_ActionSelectWindow::mousePressEvent(): %f %f",
+ RS_DEBUG->print("ActionSelectWindow::mousePressEvent(): %f %f",
v1.x, v1.y);
}
-void RS_ActionSelectWindow::mouseReleaseEvent(QMouseEvent * e)
+void ActionSelectWindow::mouseReleaseEvent(QMouseEvent * e)
{
- RS_DEBUG->print("RS_ActionSelectWindow::mouseReleaseEvent()");
+ RS_DEBUG->print("ActionSelectWindow::mouseReleaseEvent()");
if (e->button() == Qt::LeftButton)
{
{
if (getStatus() == SetCorner2)
deletePreview();
+
deleteSnapper();
init(getStatus() - 1);
}
}
-void RS_ActionSelectWindow::updateMouseButtonHints()
+void ActionSelectWindow::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionSelectWindow::updateMouseCursor()
+void ActionSelectWindow::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::SelectCursor);
}
-void RS_ActionSelectWindow::updateToolBar()
+void ActionSelectWindow::updateToolBar()
{
if (!isFinished())
- //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect);
else
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect);
}
-
-// EOF