// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// Extensively rewritten and refactored by James L. Hammons
-// (C) 2010 Underground Software
+// Portions copyright (C) 2001-2003 RibbonSoft
+// Copyright (C) 2010 Underground Software
+// See the README and GPLv2 files for licensing and warranty information
//
// JLH = James L. Hammons <jlhamm@acm.org>
//
#include "lineangleoptions.h"
-#include "rs_actiondrawlineangle.h"
+#include "actiondrawlineangle.h"
+#include "debug.h"
#include "settings.h"
LineAngleOptions::LineAngleOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
}
}
-void LineAngleOptions::setAction(RS_ActionInterface * a, bool update)
+void LineAngleOptions::setAction(ActionInterface * a, bool update)
{
- if (a != NULL && a->rtti() == RS2::ActionDrawLineAngle)
+ if (a && a->rtti() == RS2::ActionDrawLineAngle)
{
- action = (RS_ActionDrawLineAngle *)a;
+ action = (ActionDrawLineAngle *)a;
if (action->hasFixedAngle())
{
leAngle->hide();
}
- QString sa;
- QString sl;
+ QString sa, sl;
int sp;
// settings from action:
void LineAngleOptions::updateAngle(const QString & a)
{
- if (action != NULL && !action->hasFixedAngle())
+ if (action && !action->hasFixedAngle())
action->setAngle(RS_Math::deg2rad(RS_Math::eval(a)));
}
void LineAngleOptions::updateLength(const QString & l)
{
- if (action != NULL)
+ if (action)
action->setLength(RS_Math::eval(l));
}
void LineAngleOptions::updateSnapPoint(int sp)
{
- if (action != NULL)
+ if (action)
action->setSnapPoint(sp);
}