--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-04-26 15:40:02 +03:00
commit a23de6ab41
8 changed files with 13 additions and 8 deletions

View File

@ -8,5 +8,6 @@
<file>tapeicon/24x24/red_plus.png</file> <file>tapeicon/24x24/red_plus.png</file>
<file>tapeicon/24x24/padlock_locked.png</file> <file>tapeicon/24x24/padlock_locked.png</file>
<file>tapeicon/24x24/padlock_opened.png</file> <file>tapeicon/24x24/padlock_opened.png</file>
<file>tapeicon/24x24/mannequin.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

View File

@ -97,7 +97,7 @@ TMainWindow::TMainWindow(QWidget *parent)
labelGradationSizes(nullptr), labelGradationSizes(nullptr),
labelPatternUnit(nullptr), labelPatternUnit(nullptr),
actionDockDiagram(nullptr), actionDockDiagram(nullptr),
dockDiagramVisible(false), dockDiagramVisible(true),
isInitialized(false), isInitialized(false),
recentFileActs(), recentFileActs(),
separatorAct(nullptr) separatorAct(nullptr)
@ -1757,7 +1757,9 @@ void TMainWindow::SetupMenu()
actionDockDiagram = ui->dockWidgetDiagram->toggleViewAction(); actionDockDiagram = ui->dockWidgetDiagram->toggleViewAction();
actionDockDiagram->setMenuRole(QAction::NoRole); actionDockDiagram->setMenuRole(QAction::NoRole);
ui->menuMeasurements->addAction(actionDockDiagram); ui->menuMeasurements->addAction(actionDockDiagram);
ui->mainToolBar->addAction(actionDockDiagram);
actionDockDiagram->setEnabled(false); actionDockDiagram->setEnabled(false);
actionDockDiagram->setIcon(QIcon("://tapeicon/24x24/mannequin.png"));
// Window // Window
connect(ui->menuWindow, &QMenu::aboutToShow, this, &TMainWindow::AboutToShowWindowMenu); connect(ui->menuWindow, &QMenu::aboutToShow, this, &TMainWindow::AboutToShowWindowMenu);

View File

@ -31,6 +31,7 @@
#include <QPainterPath> #include <QPainterPath>
#include <QDebug> #include <QDebug>
#include <QtCore/qmath.h>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VAbstractCubicBezier::VAbstractCubicBezier(const GOType &type, const quint32 &idObject, const Draw &mode) VAbstractCubicBezier::VAbstractCubicBezier(const GOType &type, const quint32 &idObject, const Draw &mode)

View File

@ -123,7 +123,7 @@ VArc::~VArc()
*/ */
qreal VArc::GetLength() const qreal VArc::GetLength() const
{ {
qreal length = (M_PI * d->radius)/180 * AngleArc(); qreal length = d->radius * qDegreesToRadians(AngleArc());
if (d->isFlipped) if (d->isFlipped)
{ {
length *= -1; length *= -1;
@ -232,7 +232,7 @@ QVector<QPointF> VArc::GetPoints() const
for (int i = 0; i < sectionAngle.size(); ++i) for (int i = 0; i < sectionAngle.size(); ++i)
{ {
const qreal lDistance = GetRadius() * 4.0/3.0 * qTan(M_PI/180.0 * sectionAngle.at(i) * 0.25); const qreal lDistance = GetRadius() * 4.0/3.0 * qTan(qDegreesToRadians(sectionAngle.at(i)) * 0.25);
const QPointF center = GetCenter().toQPointF(); const QPointF center = GetCenter().toQPointF();
@ -297,7 +297,8 @@ QPointF VArc::CutArc(const qreal &length, VArc &arc1, VArc &arc2) const
len = length; len = length;
} }
qreal n = (len*180)/(M_PI*d->radius); // n - is angle in degrees qreal n = qRadiansToDegrees(len/d->radius); // n - is angle in degrees
QLineF line(GetCenter().toQPointF(), GetP1()); QLineF line(GetCenter().toQPointF(), GetP1());
line.setAngle(line.angle()+n); line.setAngle(line.angle()+n);
@ -374,7 +375,7 @@ void VArc::FindF2(qreal length)
length = MaxLength(); length = MaxLength();
} }
qreal arcAngle = (qAbs(length)*180)/(M_PI*d->radius); qreal arcAngle = qAbs(qRadiansToDegrees(length/d->radius));
if (d->isFlipped) if (d->isFlipped)
{ {

View File

@ -30,7 +30,7 @@
#define VDRAWTOOL_H #define VDRAWTOOL_H
#include "../vabstracttool.h" #include "../vabstracttool.h"
#include "../../dialogs/tools/dialogtool.h" #include "dialogs/tools/dialogtool.h"
#include "../vwidgets/vmaingraphicsview.h" #include "../vwidgets/vmaingraphicsview.h"
#include <QMenu> #include <QMenu>

View File

@ -33,7 +33,7 @@
#include "../ifc/xml/vabstractpattern.h" #include "../ifc/xml/vabstractpattern.h"
#include "../vmisc/vabstractapplication.h" #include "../vmisc/vabstractapplication.h"
#include "../vwidgets/vmaingraphicsscene.h" #include "../vwidgets/vmaingraphicsscene.h"
#include "../visualization/visualization.h" #include "visualization/visualization.h"
class QDomElement; class QDomElement;
class QLineF; class QLineF;

View File

@ -29,7 +29,7 @@
#ifndef VDATATOOL_H #ifndef VDATATOOL_H
#define VDATATOOL_H #define VDATATOOL_H
#include "../../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../vmisc/logging.h" #include "../vmisc/logging.h"
Q_DECLARE_LOGGING_CATEGORY(vTool) Q_DECLARE_LOGGING_CATEGORY(vTool)