Remove empty statement.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-12-20 20:57:20 +02:00
parent 86330282be
commit ffab000e0f
149 changed files with 849 additions and 849 deletions

View File

@ -54,7 +54,7 @@ TapePathPage::TapePathPage(QWidget *parent)
pathGroup(nullptr)
{
QGroupBox *pathGroup = PathGroup();
SCASSERT(pathGroup != nullptr);
SCASSERT(pathGroup != nullptr)
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(pathGroup);
@ -76,7 +76,7 @@ void TapePathPage::DefaultPath()
{
const int row = pathTable->currentRow();
QTableWidgetItem *item = pathTable->item(row, 1);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
switch (row)
{
@ -102,7 +102,7 @@ void TapePathPage::EditPath()
{
const int row = pathTable->currentRow();
QTableWidgetItem *item = pathTable->item(row, 1);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
QString path;
switch (row)

View File

@ -112,7 +112,7 @@ void DialogAboutTape::showEvent(QShowEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void DialogAboutTape::FontPointSize(QWidget *w, int pointSize)
{
SCASSERT(w != nullptr);
SCASSERT(w != nullptr)
QFont font = w->font();
font.setPointSize(pointSize);

View File

@ -56,7 +56,7 @@ DialogExportToCSV::DialogExportToCSV(QWidget *parent)
SetSeparator(qApp->TapeSettings()->GetCSVSeparator());
QPushButton *bDefaults = ui->buttonBox->button(QDialogButtonBox::RestoreDefaults);
SCASSERT(bDefaults != nullptr);
SCASSERT(bDefaults != nullptr)
connect(bDefaults, &QPushButton::clicked, [this]()
{
ui->checkBoxWithHeader->setChecked(qApp->TapeSettings()->GetDefCSVWithHeader());

View File

@ -479,7 +479,7 @@ void MApplication::OpenSettings()
//---------------------------------------------------------------------------------------------------------------------
VTapeSettings *MApplication::TapeSettings()
{
SCASSERT(settings != nullptr);
SCASSERT(settings != nullptr)
return qobject_cast<VTapeSettings *>(settings);
}

View File

@ -1446,8 +1446,8 @@ void TMainWindow::ShowMDiagram(const QString &name)
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::DeployFormula()
{
SCASSERT(ui->plainTextEditFormula != nullptr);
SCASSERT(ui->pushButtonGrow != nullptr);
SCASSERT(ui->plainTextEditFormula != nullptr)
SCASSERT(ui->pushButtonGrow != nullptr)
const QTextCursor cursor = ui->plainTextEditFormula->textCursor();
@ -1844,7 +1844,7 @@ void TMainWindow::SetupMenu()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::InitWindow()
{
SCASSERT(m != nullptr);
SCASSERT(m != nullptr)
ui->labelToolTip->setVisible(false);
ui->tabWidget->setVisible(true);
ui->dockWidgetDiagram->setVisible(dockDiagramVisible);
@ -2052,7 +2052,7 @@ void TMainWindow::ShowUnits()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::ShowHeaderUnits(QTableWidget *table, int column, const QString &unit)
{
SCASSERT(table != nullptr);
SCASSERT(table != nullptr)
QString header = table->horizontalHeaderItem(column)->text();
const int index = header.indexOf(QLatin1String("("));
@ -2819,7 +2819,7 @@ void TMainWindow::UpdateRecentFileActions()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::CreateWindowMenu(QMenu *menu)
{
SCASSERT(menu != nullptr);
SCASSERT(menu != nullptr)
QAction *action = menu->addAction(tr("&New Window"));
connect(action, &QAction::triggered, [this]()
@ -2990,7 +2990,7 @@ void TMainWindow::InitUnits()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::InitComboBoxUnits()
{
SCASSERT(comboBoxUnits != nullptr);
SCASSERT(comboBoxUnits != nullptr)
comboBoxUnits->addItem(VDomDocument::UnitsToStr(Unit::Cm, true), QVariant(static_cast<int>(Unit::Cm)));
comboBoxUnits->addItem(VDomDocument::UnitsToStr(Unit::Mm, true), QVariant(static_cast<int>(Unit::Mm)));
comboBoxUnits->addItem(VDomDocument::UnitsToStr(Unit::Inch, true), QVariant(static_cast<int>(Unit::Inch)));
@ -2999,7 +2999,7 @@ void TMainWindow::InitComboBoxUnits()
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::InitGender(QComboBox *gender)
{
SCASSERT(gender != nullptr);
SCASSERT(gender != nullptr)
gender->addItem(tr("unknown", "gender"), QVariant(static_cast<int>(GenderType::Unknown)));
gender->addItem(tr("male", "gender"), QVariant(static_cast<int>(GenderType::Male)));
gender->addItem(tr("female", "gender"), QVariant(static_cast<int>(GenderType::Female)));

View File

@ -683,7 +683,7 @@ void VApplication::OpenSettings()
//---------------------------------------------------------------------------------------------------------------------
VSettings *VApplication::ValentinaSettings()
{
SCASSERT(settings != nullptr);
SCASSERT(settings != nullptr)
return qobject_cast<VSettings *>(settings);
}

View File

@ -873,7 +873,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property)
const QString id = propertyToId[property];
VToolEndLine *i = qgraphicsitem_cast<VToolEndLine *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -906,7 +906,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property)
const QString id = propertyToId[property];
VToolAlongLine *i = qgraphicsitem_cast<VToolAlongLine *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -936,7 +936,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property)
const QString id = propertyToId[property];
VToolArc *i = qgraphicsitem_cast<VToolArc *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 8: // AttrRadius
@ -966,7 +966,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *propert
const QString id = propertyToId[property];
VToolArcWithLength *i = qgraphicsitem_cast<VToolArcWithLength *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 8: // AttrRadius
@ -996,7 +996,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property)
const QString id = propertyToId[property];
VToolBisector *i = qgraphicsitem_cast<VToolBisector *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1048,7 +1048,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property)
const QString id = propertyToId[property];
VToolCutArc *i = qgraphicsitem_cast<VToolCutArc *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1072,7 +1072,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property)
const QString id = propertyToId[property];
VToolCutSpline *i = qgraphicsitem_cast<VToolCutSpline *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1096,7 +1096,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *propert
const QString id = propertyToId[property];
VToolCutSplinePath *i = qgraphicsitem_cast<VToolCutSplinePath *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1120,7 +1120,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property)
const QString id = propertyToId[property];
VToolHeight *i = qgraphicsitem_cast<VToolHeight *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1147,7 +1147,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property)
const QString id = propertyToId[property];
VToolLine *i = qgraphicsitem_cast<VToolLine *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 3: // AttrTypeLine
@ -1190,7 +1190,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property)
const QString id = propertyToId[property];
VToolNormal *i = qgraphicsitem_cast<VToolNormal *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 4: // AttrLength
@ -1223,7 +1223,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *proper
const QString id = propertyToId[property];
VToolPointOfContact *i = qgraphicsitem_cast<VToolPointOfContact *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 8: // AttrRadius
@ -1291,7 +1291,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProp
const QString id = propertyToId[property];
VToolPointOfIntersectionCircles *i = qgraphicsitem_cast<VToolPointOfIntersectionCircles *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1355,7 +1355,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPrope
const QString id = propertyToId[property];
VToolPointFromCircleAndTangent *i = qgraphicsitem_cast<VToolPointFromCircleAndTangent *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1410,7 +1410,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *propert
const QString id = propertyToId[property];
VToolShoulderPoint *i = qgraphicsitem_cast<VToolShoulderPoint *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 4: // AttrLength
@ -1440,7 +1440,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property)
const QString id = propertyToId[property];
auto i = qgraphicsitem_cast<VToolSpline *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
VSpline spl = i->getSpline();
const VFormula f = value.value<VFormula>();
@ -1496,7 +1496,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VProperty *property)
const QString id = propertyToId[property];
auto i = qgraphicsitem_cast<VToolCubicBezier *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
@ -1521,7 +1521,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property)
const QString id = propertyToId[property];
VToolSplinePath *i = qgraphicsitem_cast<VToolSplinePath *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1545,7 +1545,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VProperty *prope
const QString id = propertyToId[property];
VToolCubicBezierPath *i = qgraphicsitem_cast<VToolCubicBezierPath *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1588,7 +1588,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *pro
const QString id = propertyToId[property];
VToolLineIntersectAxis *i = qgraphicsitem_cast<VToolLineIntersectAxis *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1618,7 +1618,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *pr
const QString id = propertyToId[property];
VToolCurveIntersectAxis *i = qgraphicsitem_cast<VToolCurveIntersectAxis *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 0: // AttrName
@ -1648,7 +1648,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VProperty *property)
const QString id = propertyToId[property];
VToolRotation *i = qgraphicsitem_cast<VToolRotation *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 38: // AttrSuffix
@ -1672,7 +1672,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolMove(VProperty *property)
const QString id = propertyToId[property];
VToolMove *i = qgraphicsitem_cast<VToolMove *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 38: // AttrSuffix
@ -1743,7 +1743,7 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VProperty *propert
const QString id = propertyToId[property];
VToolEllipticalArc *i = qgraphicsitem_cast<VToolEllipticalArc *>(currentItem);
SCASSERT(i != nullptr);
SCASSERT(i != nullptr)
switch (PropertiesList().indexOf(id))
{
case 40://AttrRadius1

View File

@ -106,7 +106,7 @@ void ConfigurationPage::Apply()
settings->SetAutosaveTime(autoTime->value());
QTimer *autoSaveTimer = qApp->getAutoSaveTimer();
SCASSERT(autoSaveTimer);
SCASSERT(autoSaveTimer)
autoSaveCheck->isChecked() ? autoSaveTimer->start(autoTime->value()*60000) : autoSaveTimer->stop();

View File

@ -51,7 +51,7 @@ PathPage::PathPage(QWidget *parent)
: QWidget(parent), defaultButton(nullptr), editButton(nullptr), pathTable(nullptr), pathGroup(nullptr)
{
QGroupBox *pathGroup = PathGroup();
SCASSERT(pathGroup != nullptr);
SCASSERT(pathGroup != nullptr)
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(pathGroup);
@ -75,7 +75,7 @@ void PathPage::DefaultPath()
{
const int row = pathTable->currentRow();
QTableWidgetItem *item = pathTable->item(row, 1);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
switch (row)
{
@ -103,7 +103,7 @@ void PathPage::EditPath()
{
const int row = pathTable->currentRow();
QTableWidgetItem *item = pathTable->item(row, 1);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
QString path;
switch (row)

View File

@ -110,7 +110,7 @@ void DialogAboutApp::showEvent(QShowEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void DialogAboutApp::FontPointSize(QWidget *w, int pointSize)
{
SCASSERT(w != nullptr);
SCASSERT(w != nullptr)
QFont font = w->font();
font.setPointSize(pointSize);

View File

@ -190,7 +190,7 @@ void DialogHistory::FillTable()
{
cursorRow = CursorRow();
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setIcon(QIcon("://icon/32x32/put_after.png"));
}
ui->tableWidget->resizeColumnsToContents();
@ -270,25 +270,25 @@ QString DialogHistory::Record(const VToolRecord &tool)
case Tool::Spline:
{
const QSharedPointer<VSpline> spl = data->GeometricObject<VSpline>(tool.getId());
SCASSERT(not spl.isNull());
SCASSERT(not spl.isNull())
return spl->NameForHistory(tr("Curve"));
}
case Tool::CubicBezier:
{
const QSharedPointer<VCubicBezier> spl = data->GeometricObject<VCubicBezier>(tool.getId());
SCASSERT(not spl.isNull());
SCASSERT(not spl.isNull())
return spl->NameForHistory(tr("Cubic bezier curve"));
}
case Tool::Arc:
{
const QSharedPointer<VArc> arc = data->GeometricObject<VArc>(tool.getId());
SCASSERT(not arc.isNull());
SCASSERT(not arc.isNull())
return arc->NameForHistory(tr("Arc"));
}
case Tool::ArcWithLength:
{
const QSharedPointer<VArc> arc = data->GeometricObject<VArc>(tool.getId());
SCASSERT(not arc.isNull());
SCASSERT(not arc.isNull())
return tr("%1 with length %2")
.arg(arc->NameForHistory(tr("Arc")))
.arg(arc->GetLength());
@ -296,13 +296,13 @@ QString DialogHistory::Record(const VToolRecord &tool)
case Tool::SplinePath:
{
const QSharedPointer<VSplinePath> splPath = data->GeometricObject<VSplinePath>(tool.getId());
SCASSERT(not splPath.isNull());
SCASSERT(not splPath.isNull())
return splPath->NameForHistory(tr("Spline path"));
}
case Tool::CubicBezierPath:
{
const QSharedPointer<VCubicBezierPath> splPath = data->GeometricObject<VCubicBezierPath>(tool.getId());
SCASSERT(not splPath.isNull());
SCASSERT(not splPath.isNull())
return splPath->NameForHistory(tr("Cubic bezier curve path"));
}
case Tool::PointOfContact:
@ -330,7 +330,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
case Tool::CutArc:
{
const QSharedPointer<VArc> arc = data->GeometricObject<VArc>(AttrUInt(domElem, AttrArc));
SCASSERT(not arc.isNull());
SCASSERT(not arc.isNull())
return tr("%1 - cut %2")
.arg(PointName(tool.getId()))
.arg(arc->NameForHistory(tr("arc")));
@ -339,7 +339,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
{
const quint32 splineId = AttrUInt(domElem, VToolCutSpline::AttrSpline);
const QSharedPointer<VAbstractCubicBezier> spl = data->GeometricObject<VAbstractCubicBezier>(splineId);
SCASSERT(not spl.isNull());
SCASSERT(not spl.isNull())
return tr("%1 - cut %2")
.arg(PointName(tool.getId()))
.arg(spl->NameForHistory(tr("curve")));
@ -349,7 +349,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
const quint32 splinePathId = AttrUInt(domElem, VToolCutSplinePath::AttrSplinePath);
const QSharedPointer<VAbstractCubicBezierPath> splPath =
data->GeometricObject<VAbstractCubicBezierPath>(splinePathId);
SCASSERT(not splPath.isNull());
SCASSERT(not splPath.isNull())
return tr("%1 - cut %2")
.arg(PointName(tool.getId()))
.arg(splPath->NameForHistory(tr("curve path")));
@ -382,7 +382,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
case Tool::EllipticalArc:
{
const QSharedPointer<VEllipticalArc> elArc = data->GeometricObject<VEllipticalArc>(tool.getId());
SCASSERT(not elArc.isNull());
SCASSERT(not elArc.isNull())
return tr("%1 with length %2")
.arg(elArc->NameForHistory(tr("Elliptical arc")))
.arg(elArc->GetLength());
@ -497,7 +497,7 @@ void DialogHistory::RetranslateUi()
UpdateHistory();
QTableWidgetItem *item = ui->tableWidget->item(cursorRow, 0);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setIcon(QIcon(""));
cursorRow = currentRow;

View File

@ -184,7 +184,7 @@ void DialogIncrements::FillIncrements()
template <typename T>
void DialogIncrements::FillTable(const QMap<QString, T> &varTable, QTableWidget *table)
{
SCASSERT(table != nullptr);
SCASSERT(table != nullptr)
qint32 currentRow = -1;
QMapIterator<QString, T> i(varTable);
@ -270,7 +270,7 @@ void DialogIncrements::ShowUnits()
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column, const QString &unit)
{
SCASSERT(table != nullptr);
SCASSERT(table != nullptr)
const QString header = table->horizontalHeaderItem(column)->text();
const QString unitHeader = QString("%1 (%2)").arg(header).arg(unit);
@ -280,7 +280,7 @@ void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column, const QS
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::AddCell(QTableWidget *table, const QString &text, int row, int column, int aligment, bool ok)
{
SCASSERT(table != nullptr);
SCASSERT(table != nullptr)
QTableWidgetItem *item = new QTableWidgetItem(text);
item->setTextAlignment(aligment);
@ -664,8 +664,8 @@ void DialogIncrements::SaveIncrFormula()
//---------------------------------------------------------------------------------------------------------------------
void DialogIncrements::DeployFormula()
{
SCASSERT(ui->plainTextEditFormula != nullptr);
SCASSERT(ui->pushButtonGrow != nullptr);
SCASSERT(ui->plainTextEditFormula != nullptr)
SCASSERT(ui->pushButtonGrow != nullptr)
const QTextCursor cursor = ui->plainTextEditFormula->textCursor();

View File

@ -54,7 +54,7 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent)
movie->start ();
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
SCASSERT(bCancel != nullptr);
SCASSERT(bCancel != nullptr)
connect(bCancel, &QPushButton::clicked, [this](){emit Abort();});
setModal(true);

View File

@ -85,7 +85,7 @@ void DialogNewPattern::CheckState()
}
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagName);
}

View File

@ -69,7 +69,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
ui->lineEditAuthor->setClearButtonEnabled(true);
#endif
SCASSERT(doc != nullptr);
SCASSERT(doc != nullptr)
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
@ -108,7 +108,7 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
&DialogPatternProperties::Apply);
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
SCASSERT(bCancel != nullptr);
SCASSERT(bCancel != nullptr)
connect(bCancel, &QPushButton::clicked, this, &DialogPatternProperties::close);
ui->tabWidget->setCurrentIndex(0);
@ -689,7 +689,7 @@ void DialogPatternProperties::SetOptions(const QMap<GVal, bool> &option)
template<typename GVal>
void DialogPatternProperties::InitComboBox(QComboBox *box, const QMap<GVal, bool> &option)
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->clear();

View File

@ -130,7 +130,7 @@ bool DialogPatternXmlEdit::ApplyNodeChange(QDomNode domElement, QString name, QS
bool DialogPatternXmlEdit::ApplyNodeAdd(QDomNode domElement, VXMLTreeElement* treeElement, QString name, QString value)
{
QDomElement newnode = domElement.ownerDocument().createElement(name);
//SCASSERT(newnode != nullptr);
//SCASSERT(newnode != nullptr)
newnode.setNodeValue(value);
domElement.appendChild(newnode);
treeElement->SetDocNode(newnode);
@ -285,7 +285,7 @@ bool DialogPatternXmlEdit::DeleteNodeAndSons(VXMLTreeElement * currentNode, bool
}
if (index < 0)
{
SCASSERT(index==0);
SCASSERT(index==0)
return false;
}
parent->removeRow(index);
@ -321,7 +321,7 @@ DialogPatternXmlEdit::ChangesStackElement* DialogPatternXmlEdit::CreateStackElem
//---------------------------------------------------------------------------------------------------------------------
bool DialogPatternXmlEdit::UndoChange(DialogPatternXmlEdit::ChangesStackElement* current)
{
SCASSERT(current != nullptr);
SCASSERT(current != nullptr)
VXMLTreeElement * currentNode = current->element;
@ -374,7 +374,7 @@ bool DialogPatternXmlEdit::UndoChange(DialogPatternXmlEdit::ChangesStackElement*
}
if (index < 0)
{
SCASSERT(index==0);
SCASSERT(index==0)
return false;
}
parent->removeRow(index);
@ -612,7 +612,7 @@ void DialogPatternXmlEdit::RemoveChangeStackElement(ChangesStackElement* elmt)
}
if (index->next == nullptr)
{
SCASSERT(index->next != nullptr);
SCASSERT(index->next != nullptr)
return;
}
delete index->next->newText;
@ -813,7 +813,7 @@ void DialogPatternXmlEdit::ButtonSetClicked()
{ // If node was created or edited previously, rewrite
if (this->currentNodeEditedStatus == DialogPatternXmlEdit::ChangeTypeDelete)
{ // You shouldn't be able to edit a deleted node...
SCASSERT(this->currentNodeEditedStatus != DialogPatternXmlEdit::ChangeTypeDelete);
SCASSERT(this->currentNodeEditedStatus != DialogPatternXmlEdit::ChangeTypeDelete)
ClearEditData();
return;
}
@ -933,7 +933,7 @@ void DialogPatternXmlEdit::BaseSelectionChanged(int value)
ui->pushButton_Apply_Changes->setEnabled(false);
index = ui->comboBox_Base_Selection->itemData(value).toInt(); //.convert(QVariant::Int);
SCASSERT(value < rootBasesNum);
SCASSERT(value < rootBasesNum)
// QMessageBox::information(this, "test", QString("%1:%2").arg(value).arg(index));
// Clear all tree info and nodes

View File

@ -59,7 +59,7 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget *
qApp->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(false);
#if QT_VERSION > QT_VERSION_CHECK(5, 1, 0)
@ -229,7 +229,7 @@ void DialogSaveLayout::Save()
void DialogSaveLayout::PathChanged(const QString &text)
{
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
QPalette palette = ui->lineEditPath->palette();

View File

@ -550,7 +550,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons
dialogTool = new Dialog(pattern, 0, this);
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(currentScene);
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
connect(scene, &VMainGraphicsScene::ChoosedObject, dialogTool.data(), &DialogTool::ChosenObject);
connect(scene, &VMainGraphicsScene::SelectedObject, dialogTool.data(), &DialogTool::SelectedObject);
@ -609,7 +609,7 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur
}
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(currentScene);
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
connect(scene, &VMainGraphicsScene::ChoosedObject, dialogTool.data(), &DialogTool::ChosenObject);
connect(scene, &VMainGraphicsScene::SelectedObject, dialogTool.data(), &DialogTool::SelectedObject);
@ -635,11 +635,11 @@ void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cur
template <typename DrawTool>
void MainWindow::ClosedDialog(int result)
{
SCASSERT(not dialogTool.isNull());
SCASSERT(not dialogTool.isNull())
if (result == QDialog::Accepted)
{
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(currentScene);
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
QGraphicsItem *tool = dynamic_cast<QGraphicsItem *>(DrawTool::Create(dialogTool, scene, doc, pattern));
ui->view->itemClicked(tool);
@ -655,14 +655,14 @@ void MainWindow::ClosedDialog(int result)
template <typename DrawTool>
void MainWindow::ClosedDialogWithApply(int result)
{
SCASSERT(not dialogTool.isNull());
SCASSERT(not dialogTool.isNull())
if (result == QDialog::Accepted)
{
// Only create tool if not already created with apply
if (dialogTool->GetAssociatedTool() == nullptr)
{
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(currentScene);
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
dialogTool->SetAssociatedTool(
dynamic_cast<VAbstractTool * > (DrawTool::Create(dialogTool, scene, doc, pattern)));
@ -673,7 +673,7 @@ void MainWindow::ClosedDialogWithApply(int result)
vtool->FullUpdateFromGuiApply();
}
}
SCASSERT(not dialogTool.isNull());
SCASSERT(not dialogTool.isNull())
QGraphicsItem *tool = dynamic_cast<QGraphicsItem *>(dialogTool->GetAssociatedTool());
ui->view->itemClicked(tool);
if (dialogTool->GetAssociatedTool() != nullptr)
@ -701,13 +701,13 @@ void MainWindow::ClosedDialogWithApply(int result)
template <typename DrawTool>
void MainWindow::ApplyDialog()
{
SCASSERT(not dialogTool.isNull());
SCASSERT(not dialogTool.isNull())
// Only create tool if not already created with apply
if (dialogTool->GetAssociatedTool() == nullptr)
{
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(currentScene);
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
dialogTool->SetAssociatedTool(
static_cast<VAbstractTool * > (DrawTool::Create(dialogTool, scene, doc, pattern)));
@ -715,7 +715,7 @@ void MainWindow::ApplyDialog()
else
{ // Or update associated tool with data
VDrawTool * vtool= static_cast<VDrawTool *>(dialogTool->GetAssociatedTool());
SCASSERT(vtool != nullptr);
SCASSERT(vtool != nullptr)
vtool->FullUpdateFromGuiApply();
}
}
@ -1091,11 +1091,11 @@ void MainWindow::ToolMove(bool checked)
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::ClosedDialogGroup(int result)
{
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
if (result == QDialog::Accepted)
{
DialogGroup *dialog = qobject_cast<DialogGroup*>(dialogTool);
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
const QDomElement group = doc->CreateGroup(pattern->getNextId(), dialog->GetName(), dialog->GetGroup());
if (not group.isNull())
{
@ -2039,7 +2039,7 @@ void MainWindow::SaveCurrentScene()
if (mode == Draw::Calculation || mode == Draw::Modeling)
{
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(currentScene);
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
/*Save transform*/
scene->setTransform(ui->view->transform());
@ -2058,7 +2058,7 @@ void MainWindow::SaveCurrentScene()
void MainWindow::RestoreCurrentScene()
{
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(currentScene);
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
/*Set transform for current scene*/
ui->view->setTransform(scene->transform());

View File

@ -1153,7 +1153,7 @@ bool MainWindowsNoGUI::IsPagesFit(const QSizeF &printPaper) const
// On previous stage already was checked if pages have uniform size
// Enough will be to check only one page
QGraphicsRectItem *p = qgraphicsitem_cast<QGraphicsRectItem *>(papers.at(0));
SCASSERT(p != nullptr);
SCASSERT(p != nullptr)
const QSizeF pSize = p->rect().size();
if (pSize.height() <= printPaper.height() && pSize.width() <= printPaper.width())
{
@ -1182,7 +1182,7 @@ int MainWindowsNoGUI::ContinueIfLayoutStale()
msgBox.setDefaultButton(QMessageBox::No);
QSpacerItem* horizontalSpacer = new QSpacerItem(500, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
QGridLayout* layout = static_cast<QGridLayout*>(msgBox.layout());
SCASSERT(layout != nullptr);
SCASSERT(layout != nullptr)
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
msgBox.exec();
return msgBox.result();

View File

@ -67,8 +67,8 @@ VPattern::VPattern(VContainer *data, Draw *mode, VMainGraphicsScene *sceneDraw,
VMainGraphicsScene *sceneDetail, QObject *parent)
: VAbstractPattern(parent), data(data), mode(mode), sceneDraw(sceneDraw), sceneDetail(sceneDetail)
{
SCASSERT(sceneDraw != nullptr);
SCASSERT(sceneDetail != nullptr);
SCASSERT(sceneDraw != nullptr)
SCASSERT(sceneDetail != nullptr)
}
//---------------------------------------------------------------------------------------------------------------------
@ -134,8 +134,8 @@ void VPattern::Parse(const Document &parse)
break;
}
SCASSERT(sceneDraw != nullptr);
SCASSERT(sceneDetail != nullptr);
SCASSERT(sceneDraw != nullptr)
SCASSERT(sceneDetail != nullptr)
QStringList tags = QStringList() << TagDraw << TagIncrements << TagAuthor << TagDescription << TagNotes
<< TagMeasurements << TagVersion << TagGradation << TagImage << TagUnit
<< TagPatternName << TagPatternNum << TagCompanyName << TagCustomerName
@ -314,10 +314,10 @@ void VPattern::setCurrentData()
void VPattern::UpdateToolData(const quint32 &id, VContainer *data)
{
Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0"); //-V712 //-V654
SCASSERT(data != nullptr);
SCASSERT(data != nullptr)
ToolExists(id);
VDataTool *tool = tools.value(id);
SCASSERT(tool != nullptr);
SCASSERT(tool != nullptr)
tool->VDataTool::setData(data);
}
@ -548,8 +548,8 @@ void VPattern::ParseDrawElement(const QDomNode &node, const Document &parse)
*/
void VPattern::ParseDrawMode(const QDomNode &node, const Document &parse, const Draw &mode)
{
SCASSERT(sceneDraw != nullptr);
SCASSERT(sceneDetail != nullptr);
SCASSERT(sceneDraw != nullptr)
SCASSERT(sceneDetail != nullptr)
VMainGraphicsScene *scene = nullptr;
if (mode == Draw::Calculation)
{
@ -820,7 +820,7 @@ void VPattern::PointsCommonAttributes(const QDomElement &domElement, quint32 &id
void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse, const QString &type)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of point is empty");
@ -934,7 +934,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, QDomElement &domElem
void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
{
@ -1053,7 +1053,7 @@ QString VPattern::GetLabelBase(quint32 index) const
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolBasePoint(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
VToolBasePoint *spoint = nullptr;
@ -1084,7 +1084,7 @@ void VPattern::ParseToolBasePoint(VMainGraphicsScene *scene, const QDomElement &
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1134,7 +1134,7 @@ void VPattern::ParseToolEndLine(VMainGraphicsScene *scene, QDomElement &domEleme
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolAlongLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1179,7 +1179,7 @@ void VPattern::ParseToolAlongLine(VMainGraphicsScene *scene, QDomElement &domEle
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolShoulderPoint(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1225,7 +1225,7 @@ void VPattern::ParseToolShoulderPoint(VMainGraphicsScene *scene, QDomElement &do
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolNormal(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1271,7 +1271,7 @@ void VPattern::ParseToolNormal(VMainGraphicsScene *scene, QDomElement &domElemen
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolBisector(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1317,7 +1317,7 @@ void VPattern::ParseToolBisector(VMainGraphicsScene *scene, QDomElement &domElem
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolLineIntersect(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1347,7 +1347,7 @@ void VPattern::ParseToolLineIntersect(VMainGraphicsScene *scene, const QDomEleme
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolPointOfContact(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1426,7 +1426,7 @@ void VPattern::ParseNodePoint(const QDomElement &domElement, const Document &par
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolHeight(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1457,7 +1457,7 @@ void VPattern::ParseToolHeight(VMainGraphicsScene *scene, const QDomElement &dom
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolTriangle(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1488,7 +1488,7 @@ void VPattern::ParseToolTriangle(VMainGraphicsScene *scene, const QDomElement &d
void VPattern::ParseToolPointOfIntersection(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1516,7 +1516,7 @@ void VPattern::ParseToolPointOfIntersection(VMainGraphicsScene *scene, const QDo
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCutSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1557,7 +1557,7 @@ void VPattern::ParseToolCutSpline(VMainGraphicsScene *scene, QDomElement &domEle
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCutSplinePath(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1599,7 +1599,7 @@ void VPattern::ParseToolCutSplinePath(VMainGraphicsScene *scene, QDomElement &do
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCutArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1641,7 +1641,7 @@ void VPattern::ParseToolCutArc(VMainGraphicsScene *scene, QDomElement &domElemen
void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1692,7 +1692,7 @@ void VPattern::ParseToolLineIntersectAxis(VMainGraphicsScene *scene, QDomElement
void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1741,7 +1741,7 @@ void VPattern::ParseToolCurveIntersectAxis(VMainGraphicsScene *scene, QDomElemen
void VPattern::ParseToolPointOfIntersectionArcs(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1773,7 +1773,7 @@ void VPattern::ParseToolPointOfIntersectionArcs(VMainGraphicsScene *scene, const
void VPattern::ParseToolPointOfIntersectionCircles(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1816,7 +1816,7 @@ void VPattern::ParseToolPointOfIntersectionCircles(VMainGraphicsScene *scene, QD
void VPattern::ParseToolPointOfIntersectionCurves(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1847,7 +1847,7 @@ void VPattern::ParseToolPointOfIntersectionCurves(VMainGraphicsScene *scene, QDo
void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1888,7 +1888,7 @@ void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDo
void VPattern::ParseToolPointFromArcAndTangent(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1919,7 +1919,7 @@ void VPattern::ParseToolPointFromArcAndTangent(VMainGraphicsScene *scene, const
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -1962,7 +1962,7 @@ void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement &
// TODO. Delete if minimal supported version is 0.2.7
void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -2002,7 +2002,7 @@ void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement &
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -2034,7 +2034,7 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen
if (spl != nullptr)
{
VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
SCASSERT(window != nullptr)
connect(spl, &VToolSpline::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
}
@ -2066,7 +2066,7 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -2106,7 +2106,7 @@ void VPattern::ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -2167,7 +2167,7 @@ void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomEleme
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -2223,7 +2223,7 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
if (spl != nullptr)
{
VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
SCASSERT(window != nullptr)
connect(spl, &VToolSplinePath::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
}
@ -2265,7 +2265,7 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolCubicBezierPath(VMainGraphicsScene *scene, const QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
try
@ -2408,7 +2408,7 @@ void VPattern::ParseNodeSplinePath(const QDomElement &domElement, const Document
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@ -2453,7 +2453,7 @@ void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement,
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolEllipticalArc(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@ -2575,7 +2575,7 @@ void VPattern::ParseNodeArc(const QDomElement &domElement, const Document &parse
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@ -2621,7 +2621,7 @@ void VPattern::ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &do
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolRotation(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@ -2664,7 +2664,7 @@ void VPattern::ParseToolRotation(VMainGraphicsScene *scene, QDomElement &domElem
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolFlippingByLine(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@ -2694,7 +2694,7 @@ void VPattern::ParseToolFlippingByLine(VMainGraphicsScene *scene, QDomElement &d
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolFlippingByAxis(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@ -2724,7 +2724,7 @@ void VPattern::ParseToolFlippingByAxis(VMainGraphicsScene *scene, QDomElement &d
//---------------------------------------------------------------------------------------------------------------------
void VPattern::ParseToolMove(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
try
@ -2876,7 +2876,7 @@ void VPattern::GarbageCollector()
void VPattern::ParseSplineElement(VMainGraphicsScene *scene, QDomElement &domElement,
const Document &parse, const QString &type)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty");
@ -2939,7 +2939,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, QDomElement &domEle
void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
const QString &type)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of arc is empty");
@ -2975,7 +2975,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, QDomElement &domElemen
void VPattern::ParseEllipticalArcElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
const QString &type)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of elliptical arc is empty");
@ -3007,7 +3007,7 @@ void VPattern::ParseEllipticalArcElement(VMainGraphicsScene *scene, QDomElement
void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &domElement,
const Document &parse, const QString &type)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(type.isEmpty() == false, Q_FUNC_INFO, "type of spline is empty");
@ -3044,7 +3044,7 @@ void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &d
void VPattern::ParseOperationElement(VMainGraphicsScene *scene, QDomElement &domElement, const Document &parse,
const QString &type)
{
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
Q_ASSERT_X(not domElement.isNull(), Q_FUNC_INFO, "domElement is null");
Q_ASSERT_X(not type.isEmpty(), Q_FUNC_INFO, "type of operation is empty");
@ -3527,8 +3527,8 @@ void VPattern::SetReadOnly(bool rOnly)
//---------------------------------------------------------------------------------------------------------------------
void VPattern::PrepareForParse(const Document &parse)
{
SCASSERT(sceneDraw != nullptr);
SCASSERT(sceneDetail != nullptr);
SCASSERT(sceneDraw != nullptr)
SCASSERT(sceneDetail != nullptr)
if (parse == Document::FullParse)
{
TestUniqueId();
@ -3723,7 +3723,7 @@ QRectF VPattern::ToolBoundingRect(const QRectF &rec, const quint32 &id) const
if (tools.contains(id))
{
const T *vTool = qobject_cast<T *>(tools.value(id));
SCASSERT(vTool != nullptr);
SCASSERT(vTool != nullptr)
QRectF childrenRect = vTool->childrenBoundingRect();
//map to scene coordinate.
@ -3749,7 +3749,7 @@ void VPattern::IncrementReferens(quint32 id) const
Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0");
ToolExists(id);
VDataTool *tool = tools.value(id);
SCASSERT(tool != nullptr);
SCASSERT(tool != nullptr)
tool->incrementReferens();
}
@ -3763,6 +3763,6 @@ void VPattern::DecrementReferens(quint32 id) const
Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0");
ToolExists(id);
VDataTool *tool = tools.value(id);
SCASSERT(tool != nullptr);
SCASSERT(tool != nullptr)
tool->decrementReferens();
}

View File

@ -535,14 +535,14 @@ VDataTool *VAbstractPattern::getTool(const quint32 &id)
void VAbstractPattern::AddTool(const quint32 &id, VDataTool *tool)
{
Q_ASSERT_X(id != 0, Q_FUNC_INFO, "id == 0");
SCASSERT(tool != nullptr);
SCASSERT(tool != nullptr)
tools.insert(id, tool);
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::AddToolOnRemove(VDataTool *tool)
{
SCASSERT(tool != nullptr);
SCASSERT(tool != nullptr)
toolsOnRemove.append(tool);
}

View File

@ -101,7 +101,7 @@ VMeasurements::VMeasurements(Unit unit, VContainer *data)
data(data),
type(MeasurementsType::Individual)
{
SCASSERT(data != nullptr);
SCASSERT(data != nullptr)
CreateEmptyIndividualFile(unit);
}
@ -112,7 +112,7 @@ VMeasurements::VMeasurements(Unit unit, int baseSize, int baseHeight, VContainer
data(data),
type(MeasurementsType::Standard)
{
SCASSERT(data != nullptr);
SCASSERT(data != nullptr)
CreateEmptyStandardFile(unit, baseSize, baseHeight);
}

View File

@ -249,8 +249,8 @@ PosterData VPoster::Cut(int i, int j, const QRect &imageRect) const
const int x = j*PageRect().width() - j*static_cast<int>(allowence);
const int y = i*PageRect().height() - i*static_cast<int>(allowence);
SCASSERT(x <= imageRect.width());
SCASSERT(y <= imageRect.height());
SCASSERT(x <= imageRect.width())
SCASSERT(y <= imageRect.height())
PosterData data;
data.row = static_cast<quint32>(i);

View File

@ -1071,7 +1071,7 @@ void InitPMSystems(QComboBox *systemCombo)
// * The default option (blank field or 'None') should appear at the top of the list.
// * The list should be sorted alphabetically so users can find their system easily.
SCASSERT(systemCombo != nullptr);
SCASSERT(systemCombo != nullptr)
systemCombo->addItem(qApp->TrVars()->PMSystemName(listSystems.at(listSystems.size()-1)),
listSystems.at(listSystems.size()-1));
@ -1150,7 +1150,7 @@ QStringList ListPMSystems()
//---------------------------------------------------------------------------------------------------------------------
QStringList ListNumbers(const VTranslateMeasurements *trM, const QStringList &listMeasurements)
{
SCASSERT(trM != nullptr);
SCASSERT(trM != nullptr)
QStringList numbers;
for (int i=0; i < listMeasurements.size(); ++i)

View File

@ -283,7 +283,7 @@ void VAbstractApplication::setPatternUnit(const Unit &patternUnit)
*/
VCommonSettings *VAbstractApplication::Settings()
{
SCASSERT(settings != nullptr);
SCASSERT(settings != nullptr)
return settings;
}

View File

@ -48,7 +48,7 @@ VTableSearch::VTableSearch(QTableWidget *table, QObject *parent)
//---------------------------------------------------------------------------------------------------------------------
void VTableSearch::Clear()
{
SCASSERT(table != nullptr);
SCASSERT(table != nullptr)
for(int i = 0; i < table->rowCount(); ++i)
{
@ -96,7 +96,7 @@ void VTableSearch::ShowNext(int newIndex)
//---------------------------------------------------------------------------------------------------------------------
void VTableSearch::Find(const QString &term)
{
SCASSERT(table != nullptr);
SCASSERT(table != nullptr)
Clear();
@ -194,7 +194,7 @@ void VTableSearch::AddRow(int row)
//---------------------------------------------------------------------------------------------------------------------
void VTableSearch::RefreshList(const QString &term)
{
SCASSERT(table != nullptr);
SCASSERT(table != nullptr)
if (term.isEmpty())
{

View File

@ -46,7 +46,7 @@ VArcRadius::VArcRadius()
VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc, Unit patternUnit)
:VCurveVariable(id, parentId)
{
SCASSERT(arc != nullptr);
SCASSERT(arc != nullptr)
SetType(VarType::ArcRadius);
SetName(QString(radius_V+"%1").arg(arc->name()));

View File

@ -49,7 +49,7 @@ VCurveAngle::VCurveAngle(const quint32 &id, const quint32 &parentId, const VAbst
:VCurveVariable(id, parentId)
{
SetType(VarType::CurveAngle);
SCASSERT(curve != nullptr);
SCASSERT(curve != nullptr)
if (angle == CurveAngle::StartAngle)
{
SetValue(curve->GetStartAngle());

View File

@ -50,7 +50,7 @@ VCurveCLength::VCurveCLength(const quint32 &id, const quint32 &parentId, const V
: VCurveVariable(id, parentId)
{
SetType(VarType::CurveCLength);
SCASSERT(curve != nullptr);
SCASSERT(curve != nullptr)
if (cType == CurveCLength::C1)
{
SetValue(FromPixel(curve->GetC1Length(), patternUnit));

View File

@ -48,7 +48,7 @@ VCurveLength::VCurveLength(const quint32 &id, const quint32 &parentId, const VAb
:VCurveVariable(id, parentId)
{
SetType(VarType::CurveLength);
SCASSERT(curve != nullptr);
SCASSERT(curve != nullptr)
SetName(curve->name());
SetValue(FromPixel(curve->GetLength(), patternUnit));
}

View File

@ -45,7 +45,7 @@ VEllipticalArcRadius::VEllipticalArcRadius()
VEllipticalArcRadius::VEllipticalArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc,
const int numberRadius, Unit patternUnit) : VCurveVariable(id, parentId)
{
SCASSERT(elArc != nullptr);
SCASSERT(elArc != nullptr)
SetType(VarType::ArcRadius);
SetName(QString(radius_V+"%1"+"%2").arg(numberRadius).arg(elArc->name()));

View File

@ -53,8 +53,8 @@ VLineAngle::VLineAngle(const VPointF *p1, const quint32 &p1Id, const VPointF *p2
{
SetType(VarType::LineAngle);
SCASSERT(p1 != nullptr);
SCASSERT(p2 != nullptr);
SCASSERT(p1 != nullptr)
SCASSERT(p2 != nullptr)
SetName(QString(angleLine_+"%1_%2").arg(p1->name(), p2->name()));
SetValue(p1, p2);
@ -90,8 +90,8 @@ bool VLineAngle::Filter(quint32 id)
//---------------------------------------------------------------------------------------------------------------------
void VLineAngle::SetValue(const VPointF *p1, const VPointF *p2)
{
SCASSERT(p1 != nullptr);
SCASSERT(p2 != nullptr);
SCASSERT(p1 != nullptr)
SCASSERT(p2 != nullptr)
//Correct angle. Try avoid results like 6,7563e-15.
const qreal angle = qFloor(QLineF(*p1, *p2).angle() * 100000.) / 100000.;
VInternalVariable::SetValue(angle);

View File

@ -50,8 +50,8 @@ VLengthLine::VLengthLine(const VPointF *p1, const quint32 &p1Id, const VPointF *
Unit patternUnit)
:VInternalVariable(), d(new VLengthLineData(p1Id, p2Id, patternUnit))
{
SCASSERT(p1 != nullptr);
SCASSERT(p2 != nullptr);
SCASSERT(p1 != nullptr)
SCASSERT(p2 != nullptr)
SetType(VarType::LineLength);
SetName(QString(line_+"%1_%2").arg(p1->name(), p2->name()));
@ -88,8 +88,8 @@ bool VLengthLine::Filter(quint32 id)
//---------------------------------------------------------------------------------------------------------------------
void VLengthLine::SetValue(const VPointF *p1, const VPointF *p2)
{
SCASSERT(p1 != nullptr);
SCASSERT(p2 != nullptr);
SCASSERT(p1 != nullptr)
SCASSERT(p2 != nullptr)
VInternalVariable::SetValue(FromPixel(QLineF(*p1, *p2).length(), d->patternUnit));
}

View File

@ -176,7 +176,7 @@ const VDetail VContainer::GetDetail(quint32 id) const
*/
quint32 VContainer::AddGObject(VGObject *obj)
{
SCASSERT(obj != nullptr);
SCASSERT(obj != nullptr)
QSharedPointer<VGObject> pointer(obj);
uniqueNames.insert(obj->name());
return AddObject(d->gObjects, pointer);
@ -243,7 +243,7 @@ template <typename val>
void VContainer::UpdateObject(QHash<quint32, val> &obj, const quint32 &id, val point)
{
Q_ASSERT_X(id != NULL_ID, Q_FUNC_INFO, "id == 0"); //-V654 //-V712
SCASSERT(point.isNull() == false);
SCASSERT(point.isNull() == false)
point->setId(id);
if (d->gObjects.contains(id))
{
@ -483,7 +483,7 @@ void VContainer::RemoveVariable(const QString &name)
template <typename key, typename val>
quint32 VContainer::AddObject(QHash<key, val> &obj, val value)
{
SCASSERT(value != nullptr);
SCASSERT(value != nullptr)
const quint32 id = getNextId();
value->setId(id);
obj[id] = value;
@ -498,7 +498,7 @@ quint32 VContainer::AddObject(QHash<key, val> &obj, val value)
*/
void VContainer::UpdateGObject(quint32 id, VGObject* obj)
{
SCASSERT(obj != nullptr);
SCASSERT(obj != nullptr)
QSharedPointer<VGObject> pointer(obj);
UpdateObject(d->gObjects, id, pointer);
uniqueNames.insert(obj->name());

View File

@ -251,7 +251,7 @@ const QSharedPointer<T> VContainer::GeometricObject(const quint32 &id) const
try
{
QSharedPointer<T> obj = qSharedPointerDynamicCast<T>(gObj);
SCASSERT(obj.isNull() == false);
SCASSERT(obj.isNull() == false)
return obj;
}
catch (const std::bad_alloc &)
@ -270,13 +270,13 @@ const QSharedPointer<T> VContainer::GeometricObject(const quint32 &id) const
template <typename T>
QSharedPointer<T> VContainer::GetVariable(QString name) const
{
SCASSERT(name.isEmpty()==false);
SCASSERT(name.isEmpty()==false)
if (d->variables.contains(name))
{
try
{
QSharedPointer<T> value = qSharedPointerDynamicCast<T>(d->variables.value(name));
SCASSERT(value.isNull() == false);
SCASSERT(value.isNull() == false)
return value;
}
catch (const std::bad_alloc &)

View File

@ -154,8 +154,8 @@ void DialogEditWrongFormula::DeployFormulaTextEdit()
//---------------------------------------------------------------------------------------------------------------------
void DialogEditWrongFormula::EvalFormula()
{
SCASSERT(plainTextEditFormula != nullptr);
SCASSERT(labelResultCalculation != nullptr);
SCASSERT(plainTextEditFormula != nullptr)
SCASSERT(labelResultCalculation != nullptr)
Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix, checkZero);
}
@ -252,7 +252,7 @@ void DialogEditWrongFormula::PutHere()
*/
void DialogEditWrongFormula::PutVal(QTableWidgetItem *item)
{
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
QTextCursor cursor = ui->plainTextEditFormula->textCursor();
cursor.insertText(ui->tableWidget->item(item->row(), ColumnName)->text());
ui->plainTextEditFormula->setTextCursor(cursor);
@ -339,7 +339,7 @@ void DialogEditWrongFormula::Functions()
//---------------------------------------------------------------------------------------------------------------------
void DialogEditWrongFormula::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagFormula);
}

View File

@ -180,7 +180,7 @@ void DialogAlongLine::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolAlongLine *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
const QString toolTip = tr("Select second point of line");
switch (number)
@ -229,7 +229,7 @@ void DialogAlongLine::SaveData()
formula.replace("\n", " ");
VisToolAlongLine *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId());
line->setObject2Id(GetSecondPointId());
@ -269,7 +269,7 @@ void DialogAlongLine::SetSecondPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolAlongLine *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject2Id(value);
}
@ -292,7 +292,7 @@ void DialogAlongLine::SetFirstPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolAlongLine *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -312,7 +312,7 @@ void DialogAlongLine::SetFormula(const QString &value)
ui->plainTextEditFormula->setPlainText(formula);
VisToolAlongLine *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);

View File

@ -155,7 +155,7 @@ void DialogArc::SetF2(const QString &value)
ui->plainTextEditF2->setPlainText(f2);
VisToolArc *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setF2(f2);
MoveCursorToEnd(ui->plainTextEditF2);
@ -189,7 +189,7 @@ void DialogArc::SetF1(const QString &value)
ui->plainTextEditF1->setPlainText(f1);
VisToolArc *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setF1(f1);
MoveCursorToEnd(ui->plainTextEditF1);
@ -211,7 +211,7 @@ void DialogArc::SetRadius(const QString &value)
ui->plainTextEditFormula->setPlainText(radius);
VisToolArc *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setRadius(radius);
MoveCursorToEnd(ui->plainTextEditFormula);
@ -257,7 +257,7 @@ void DialogArc::SaveData()
f2.replace("\n", " ");
VisToolArc *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(GetCenter());
path->setRadius(radius);
@ -357,9 +357,9 @@ void DialogArc::FXF2()
*/
void DialogArc::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagRadius && flagF1 && flagF2);
SCASSERT(bApply != nullptr);
SCASSERT(bApply != nullptr)
bApply->setEnabled(flagRadius && flagF1 && flagF2);
}

View File

@ -136,7 +136,7 @@ void DialogArcWithLength::SetRadius(const QString &value)
ui->plainTextEditRadius->setPlainText(radius);
VisToolArcWithLength *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setRadius(radius);
MoveCursorToEnd(ui->plainTextEditRadius);
@ -159,7 +159,7 @@ void DialogArcWithLength::SetF1(const QString &value)
ui->plainTextEditF1->setPlainText(f1);
VisToolArcWithLength *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setF1(f1);
MoveCursorToEnd(ui->plainTextEditF1);
@ -183,7 +183,7 @@ void DialogArcWithLength::SetLength(const QString &value)
ui->plainTextEditLength->setPlainText(length);
VisToolArcWithLength *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setLength(radius);
MoveCursorToEnd(ui->plainTextEditLength);
@ -308,7 +308,7 @@ void DialogArcWithLength::FXLength()
//---------------------------------------------------------------------------------------------------------------------
void DialogArcWithLength::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagRadius && flagF1 && flagLength);
// In case dialog hasn't apply button
if ( bApply != nullptr)
@ -336,7 +336,7 @@ void DialogArcWithLength::SaveData()
length.replace("\n", " ");
VisToolArcWithLength *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(GetCenter());
path->setRadius(radius);

View File

@ -175,7 +175,7 @@ void DialogBisector::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolBisector *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -262,7 +262,7 @@ void DialogBisector::SetFormula(const QString &value)
ui->plainTextEditFormula->setPlainText(formula);
VisToolBisector *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
@ -278,7 +278,7 @@ void DialogBisector::SetFirstPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolBisector *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -292,7 +292,7 @@ void DialogBisector::SetSecondPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolBisector *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject2Id(value);
}
@ -306,7 +306,7 @@ void DialogBisector::SetThirdPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxThirdPoint, value);
VisToolBisector *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject3Id(value);
}
@ -331,7 +331,7 @@ void DialogBisector::SaveData()
formula.replace("\n", " ");
VisToolBisector *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId());
line->setObject2Id(GetSecondPointId());

View File

@ -99,7 +99,7 @@ void DialogCubicBezier::SetSpline(const VCubicBezier &spline)
ui->lineEditSplineName->setText(spl.name());
auto path = qobject_cast<VisToolCubicBezier *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(spl.GetP1().id());
path->setObject2Id(spl.GetP2().id());
@ -127,7 +127,7 @@ void DialogCubicBezier::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
auto *path = qobject_cast<VisToolCubicBezier *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
switch (number)
{
@ -239,7 +239,7 @@ void DialogCubicBezier::SaveData()
newDuplicate <= -1 ? spl.SetDuplicate(d) : spl.SetDuplicate(static_cast<quint32>(newDuplicate));
auto path = qobject_cast<VisToolCubicBezier *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(p1->id());
path->setObject2Id(p2->id());

View File

@ -104,7 +104,7 @@ void DialogCubicBezierPath::SetPath(const VCubicBezierPath &value)
ui->lineEditSplPathName->setText(path.name());
auto visPath = qobject_cast<VisToolCubicBezierPath *>(vis);
SCASSERT(visPath != nullptr);
SCASSERT(visPath != nullptr)
visPath->setPath(path);
ui->listWidget->blockSignals(false);
@ -142,14 +142,14 @@ void DialogCubicBezierPath::ChosenObject(quint32 id, const SceneObject &type)
SavePath();
auto visPath = qobject_cast<VisToolCubicBezierPath *>(vis);
SCASSERT(visPath != nullptr);
SCASSERT(visPath != nullptr)
visPath->setPath(path);
if (path.CountPoints() == 1)
{
visPath->VisualMode(NULL_ID);
VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
SCASSERT(window != nullptr)
connect(visPath, &VisToolCubicBezierPath::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
}
else
@ -196,7 +196,7 @@ void DialogCubicBezierPath::SaveData()
newDuplicate <= -1 ? path.SetDuplicate(d) : path.SetDuplicate(static_cast<quint32>(newDuplicate));
auto visPath = qobject_cast<VisToolCubicBezierPath *>(vis);
SCASSERT(visPath != nullptr);
SCASSERT(visPath != nullptr)
visPath->setPath(path);
visPath->SetMode(Mode::Show);
visPath->RefreshGeometry();

View File

@ -137,7 +137,7 @@ void DialogCurveIntersectAxis::SetAngle(const QString &value)
ui->plainTextEditFormula->setPlainText(formulaAngle);
VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->SetAngle(formulaAngle);
MoveCursorToEnd(ui->plainTextEditFormula);
@ -155,7 +155,7 @@ void DialogCurveIntersectAxis::SetBasePointId(const quint32 &value)
setCurrentPointId(ui->comboBoxAxisPoint, value);
VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setAxisPointId(value);
}
@ -171,7 +171,7 @@ void DialogCurveIntersectAxis::setCurveId(const quint32 &value)
setCurrentCurveId(ui->comboBoxCurve, value);
VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -196,7 +196,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click)
{
/*We will ignore click if poinet is in point circle*/
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
QLineF line = QLineF(*point, scene->getScenePos());
@ -209,7 +209,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click)
}
VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
this->SetAngle(line->Angle());//Show in dialog angle what user choose
emit ToolTip("");
@ -224,7 +224,7 @@ void DialogCurveIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
if (prepare == false)// After first choose we ignore all objects
{
VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -239,7 +239,7 @@ void DialogCurveIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
number++;
line->VisualMode(id);
VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
SCASSERT(window != nullptr)
connect(line, &VisToolCurveIntersectAxis::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
}
@ -309,7 +309,7 @@ void DialogCurveIntersectAxis::SaveData()
formulaAngle.replace("\n", " ");
VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(getCurveId());
line->setAxisPointId(GetBasePointId());

View File

@ -153,7 +153,7 @@ void DialogCutArc::SaveData()
formula.replace("\n", " ");
VisToolCutArc *path = qobject_cast<VisToolCutArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(getArcId());
path->setLength(formula);
@ -177,7 +177,7 @@ void DialogCutArc::setArcId(const quint32 &value)
setCurrentArcId(ui->comboBoxArc, value);
VisToolCutArc *path = qobject_cast<VisToolCutArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(value);
}
@ -197,7 +197,7 @@ void DialogCutArc::SetFormula(const QString &value)
ui->plainTextEditFormula->setPlainText(formula);
VisToolCutArc *path = qobject_cast<VisToolCutArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);

View File

@ -118,7 +118,7 @@ void DialogCutSpline::SetFormula(const QString &value)
ui->plainTextEditFormula->setPlainText(formula);
VisToolCutSpline *path = qobject_cast<VisToolCutSpline *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
@ -134,7 +134,7 @@ void DialogCutSpline::setSplineId(const quint32 &value)
setCurrentSplineId(ui->comboBoxSpline, value);
VisToolCutSpline *path = qobject_cast<VisToolCutSpline *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(value);
}
@ -169,7 +169,7 @@ void DialogCutSpline::SaveData()
formula.replace("\n", " ");
VisToolCutSpline *path = qobject_cast<VisToolCutSpline *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(getSplineId());
path->setLength(formula);

View File

@ -118,7 +118,7 @@ void DialogCutSplinePath::SetFormula(const QString &value)
ui->plainTextEditFormula->setPlainText(formula);
VisToolCutSplinePath *path = qobject_cast<VisToolCutSplinePath *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
@ -134,7 +134,7 @@ void DialogCutSplinePath::setSplinePathId(const quint32 &value)
setCurrentSplinePathId(ui->comboBoxSplinePath, value);
VisToolCutSplinePath *path = qobject_cast<VisToolCutSplinePath *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(value);
}
@ -169,7 +169,7 @@ void DialogCutSplinePath::SaveData()
formula.replace("\n", " ");
VisToolCutSplinePath *path = qobject_cast<VisToolCutSplinePath *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(getSplinePathId());
path->setLength(formula);

View File

@ -104,10 +104,10 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge
ui.doubleSpinBoxSeams->setValue(UnitConvertor(1, Unit::Cm, qApp->patternUnit()));
bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted);
QPushButton *bCancel = ui.buttonBox->button(QDialogButtonBox::Cancel);
SCASSERT(bCancel != nullptr);
SCASSERT(bCancel != nullptr)
connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
flagName = true;//We have default name of detail.
@ -235,7 +235,7 @@ void DialogDetail::SaveData()
//---------------------------------------------------------------------------------------------------------------------
void DialogDetail::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagFormula && flagName && flagError && flagWidth);
// In case dialog hasn't apply button
if ( bApply != nullptr)
@ -321,7 +321,7 @@ void DialogDetail::AddUpdate()
else
{
int iR = ui.listWidgetMCP->currentRow();
SCASSERT(iR >= 0);
SCASSERT(iR >= 0)
m_conMCP[iR] = mcp;
SetAddMode();
}
@ -340,7 +340,7 @@ void DialogDetail::Cancel()
void DialogDetail::Remove()
{
int iR = ui.listWidgetMCP->currentRow();
SCASSERT(iR >= 0);
SCASSERT(iR >= 0)
m_conMCP.removeAt(iR);
UpdateList();
ClearFields();
@ -350,7 +350,7 @@ void DialogDetail::Remove()
//---------------------------------------------------------------------------------------------------------------------
void DialogDetail::NameDetailChanged()
{
SCASSERT(labelEditNamePoint != nullptr);
SCASSERT(labelEditNamePoint != nullptr)
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
if (edit)
{
@ -391,7 +391,7 @@ void DialogDetail::MaterialChanged()
void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode,
qreal mx, qreal my, bool reverse)
{
SCASSERT(id > NULL_ID);
SCASSERT(id > NULL_ID)
QString name;
switch (typeTool)
{
@ -524,7 +524,7 @@ void DialogDetail::EnableObjectGUI(bool value)
quint32 DialogDetail::RowId(int i) const
{
const QListWidgetItem *rowItem = ui.listWidget->item(i);
SCASSERT(rowItem != nullptr);
SCASSERT(rowItem != nullptr)
const VNodeDetail rowNode = qvariant_cast<VNodeDetail>(rowItem->data(Qt::UserRole));
return rowNode.getId();
}
@ -589,7 +589,7 @@ void DialogDetail::BiasXChanged(qreal d)
{
qint32 row = ui.listWidget->currentRow();
QListWidgetItem *item = ui.listWidget->item( row );
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
node.setMx(qApp->toPixel(d));
item->setData(Qt::UserRole, QVariant::fromValue(node));
@ -604,7 +604,7 @@ void DialogDetail::BiasYChanged(qreal d)
{
qint32 row = ui.listWidget->currentRow();
QListWidgetItem *item = ui.listWidget->item( row );
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
node.setMy(qApp->toPixel(d));
item->setData(Qt::UserRole, QVariant::fromValue(node));
@ -668,7 +668,7 @@ void DialogDetail::ClickedReverse(bool checked)
{
qint32 row = ui.listWidget->currentRow();
QListWidgetItem *item = ui.listWidget->item( row );
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
node.setReverse(checked);
item->setData(Qt::UserRole, QVariant::fromValue(node));
@ -687,7 +687,7 @@ void DialogDetail::ObjectChanged(int row)
return;
}
const QListWidgetItem *item = ui.listWidget->item( row );
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
const VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));

View File

@ -196,7 +196,7 @@ void DialogEllipticalArc::SetRadius1(const QString &value)
ui->plainTextEditRadius1->setPlainText(radius1);
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setRadius1(radius1);
MoveCursorToEnd(ui->plainTextEditRadius1);
@ -228,7 +228,7 @@ void DialogEllipticalArc::SetRadius2(const QString &value)
ui->plainTextEditRadius2->setPlainText(radius2);
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setRadius2(radius2);
MoveCursorToEnd(ui->plainTextEditRadius2);
@ -260,7 +260,7 @@ void DialogEllipticalArc::SetF1(const QString &value)
ui->plainTextEditF1->setPlainText(f1);
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setF1(f1);
MoveCursorToEnd(ui->plainTextEditF1);
@ -292,7 +292,7 @@ void DialogEllipticalArc::SetF2(const QString &value)
ui->plainTextEditF2->setPlainText(f2);
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setF2(f2);
MoveCursorToEnd(ui->plainTextEditF2);
@ -324,7 +324,7 @@ void DialogEllipticalArc::SetRotationAngle(const QString &value)
ui->plainTextEditRotationAngle->setPlainText(rotationAngle);
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setRotationAngle(rotationAngle);
MoveCursorToEnd(ui->plainTextEditRotationAngle);
@ -612,9 +612,9 @@ void DialogEllipticalArc::ChosenObject(quint32 id, const SceneObject &type)
*/
void DialogEllipticalArc::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagRadius1 && flagRadius2 && flagF1 && flagF2 && flagRotationAngle);
SCASSERT(bApply != nullptr);
SCASSERT(bApply != nullptr)
bApply->setEnabled(flagRadius1 && flagRadius2 && flagF1 && flagF2 && flagRotationAngle);
}
@ -639,7 +639,7 @@ void DialogEllipticalArc::SaveData()
rotationAngle.replace("\n", " ");
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(GetCenter());
path->setRadius1(radius1);

View File

@ -188,7 +188,7 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type)
{
vis->VisualMode(id);
VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
SCASSERT(window != nullptr)
connect(vis.data(), &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
prepare = true;
}
@ -235,7 +235,7 @@ void DialogEndLine::SetFormula(const QString &value)
ui->plainTextEditFormula->setPlainText(formulaLength);
VisToolEndLine *line = qobject_cast<VisToolEndLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLength(formulaLength);
MoveCursorToEnd(ui->plainTextEditFormula);
@ -258,7 +258,7 @@ void DialogEndLine::SetAngle(const QString &value)
ui->plainTextEditAngle->setPlainText(formulaAngle);
VisToolEndLine *line = qobject_cast<VisToolEndLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->SetAngle(formulaAngle);
MoveCursorToEnd(ui->plainTextEditAngle);
@ -274,7 +274,7 @@ void DialogEndLine::SetBasePointId(const quint32 &value)
setCurrentPointId(ui->comboBoxBasePoint, value);
VisToolEndLine *line = qobject_cast<VisToolEndLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -303,7 +303,7 @@ void DialogEndLine::ShowDialog(bool click)
{
/*We will ignore click if pointer is in point circle*/
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
QLineF line = QLineF(*point, scene->getScenePos());
@ -317,7 +317,7 @@ void DialogEndLine::ShowDialog(bool click)
this->setModal(true);
VisToolEndLine *line = qobject_cast<VisToolEndLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
this->SetAngle(line->Angle());//Show in dialog angle what user choose
this->SetFormula(line->Length());
@ -345,7 +345,7 @@ void DialogEndLine::SaveData()
formulaAngle.replace("\n", " ");
VisToolEndLine *line = qobject_cast<VisToolEndLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetBasePointId());
line->setLength(formulaLength);

View File

@ -101,7 +101,7 @@ void DialogFlippingByAxis::SetOriginPointId(quint32 value)
{
ChangeCurrentData(ui->comboBoxOriginPoint, value);
VisToolFlippingByAxis *operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetOriginPointId(value);
}
@ -120,7 +120,7 @@ void DialogFlippingByAxis::SetAxisType(AxisType type)
ui->comboBoxAxisType->setCurrentIndex(index);
auto operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetAxisType(type);
}
}
@ -157,11 +157,11 @@ void DialogFlippingByAxis::ShowDialog(bool click)
stage1 = false;
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
scene->clearSelection();
VisToolFlippingByAxis *operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetObjects(objects.toVector());
operation->VisualMode();
@ -201,7 +201,7 @@ void DialogFlippingByAxis::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxOriginPoint, ""))
{
VisToolFlippingByAxis *operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetOriginPointId(id);
operation->RefreshGeometry();
@ -274,9 +274,9 @@ void DialogFlippingByAxis::SuffixChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogFlippingByAxis::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagError && flagName);
SCASSERT(bApply != nullptr);
SCASSERT(bApply != nullptr)
bApply->setEnabled(bOk->isEnabled());
}
@ -292,7 +292,7 @@ void DialogFlippingByAxis::SaveData()
m_suffix = ui->lineEditSuffix->text();
VisToolFlippingByAxis *operation = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetObjects(objects.toVector());
operation->SetOriginPointId(GetOriginPointId());
@ -321,7 +321,7 @@ void DialogFlippingByAxis::PointChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogFlippingByAxis::FillComboBoxAxisType(QComboBox *box)
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->addItem(tr("Vertical axis"), QVariant(static_cast<int>(AxisType::VerticalAxis)));
box->addItem(tr("Horizontal axis"), QVariant(static_cast<int>(AxisType::HorizontalAxis)));

View File

@ -105,7 +105,7 @@ void DialogFlippingByLine::SetFirstLinePointId(quint32 value)
{
ChangeCurrentData(ui->comboBoxFirstLinePoint, value);
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetFirstLinePointId(value);
}
@ -156,11 +156,11 @@ void DialogFlippingByLine::ShowDialog(bool click)
stage1 = false;
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
scene->clearSelection();
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetObjects(objects.toVector());
operation->VisualMode();
@ -204,7 +204,7 @@ void DialogFlippingByLine::ChosenObject(quint32 id, const SceneObject &type)
{
number++;
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetFirstLinePointId(id);
operation->RefreshGeometry();
}
@ -226,7 +226,7 @@ void DialogFlippingByLine::ChosenObject(quint32 id, const SceneObject &type)
prepare = true;
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetSecondLinePointId(id);
operation->RefreshGeometry();
}
@ -303,9 +303,9 @@ void DialogFlippingByLine::SuffixChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogFlippingByLine::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagError && flagName);
SCASSERT(bApply != nullptr);
SCASSERT(bApply != nullptr)
bApply->setEnabled(bOk->isEnabled());
}
@ -321,7 +321,7 @@ void DialogFlippingByLine::SaveData()
m_suffix = ui->lineEditSuffix->text();
VisToolFlippingByLine *operation = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetObjects(objects.toVector());
operation->SetFirstLinePointId(GetFirstLinePointId());

View File

@ -129,7 +129,7 @@ void DialogHeight::SetBasePointId(const quint32 &value)
setCurrentPointId(ui->comboBoxBasePoint, value);
VisToolHeight *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -143,7 +143,7 @@ void DialogHeight::SetP1LineId(const quint32 &value)
setCurrentPointId(ui->comboBoxP1Line, value);
VisToolHeight *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLineP1Id(value);
}
@ -157,7 +157,7 @@ void DialogHeight::SetP2LineId(const quint32 &value)
setCurrentPointId(ui->comboBoxP2Line, value);
VisToolHeight *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLineP2Id(value);
}
@ -186,7 +186,7 @@ void DialogHeight::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolHeight *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -240,7 +240,7 @@ void DialogHeight::SaveData()
pointName = ui->lineEditNamePoint->text();
VisToolHeight *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetBasePointId());
line->setLineP1Id(GetP1LineId());

View File

@ -92,7 +92,7 @@ void DialogLine::SetSecondPoint(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolLine *line = qobject_cast<VisToolLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setPoint2Id(value);
}
@ -129,7 +129,7 @@ void DialogLine::SetFirstPoint(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolLine *line = qobject_cast<VisToolLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -162,7 +162,7 @@ void DialogLine::ShowVisualization()
void DialogLine::SaveData()
{
VisToolLine *line = qobject_cast<VisToolLine *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPoint());
line->setPoint2Id(GetSecondPoint());

View File

@ -109,7 +109,7 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -194,7 +194,7 @@ void DialogLineIntersect::SaveData()
pointName = ui->lineEditNamePoint->text();
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetP1Line1());
line->setLine1P2Id(GetP2Line1());
@ -267,7 +267,7 @@ void DialogLineIntersect::ShowVisualization()
*/
void DialogLineIntersect::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagName && flagPoint);
}
@ -307,7 +307,7 @@ void DialogLineIntersect::SetP2Line2(const quint32 &value)
setCurrentPointId(ui->comboBoxP2Line2, value);
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLine2P2Id(value);
}
@ -321,7 +321,7 @@ void DialogLineIntersect::SetP1Line2(const quint32 &value)
setCurrentPointId(ui->comboBoxP1Line2, value);
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLine2P1Id(value);
}
@ -335,7 +335,7 @@ void DialogLineIntersect::SetP2Line1(const quint32 &value)
setCurrentPointId(ui->comboBoxP2Line1, value);
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLine1P2Id(value);
}
@ -349,7 +349,7 @@ void DialogLineIntersect::SetP1Line1(const quint32 &value)
setCurrentPointId(ui->comboBoxP1Line1, value);
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}

View File

@ -150,7 +150,7 @@ void DialogLineIntersectAxis::SetAngle(const QString &value)
ui->plainTextEditFormula->setPlainText(formulaAngle);
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->SetAngle(formulaAngle);
MoveCursorToEnd(ui->plainTextEditFormula);
@ -168,7 +168,7 @@ void DialogLineIntersectAxis::SetBasePointId(const quint32 &value)
setCurrentPointId(ui->comboBoxAxisPoint, value);
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setAxisPointId(value);
}
@ -184,7 +184,7 @@ void DialogLineIntersectAxis::SetFirstPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstLinePoint, value);
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -200,7 +200,7 @@ void DialogLineIntersectAxis::SetSecondPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondLinePoint, value);
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setPoint2Id(value);
}
@ -225,7 +225,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click)
{
/*We will ignore click if poinet is in point circle*/
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
QLineF line = QLineF(*point, scene->getScenePos());
@ -238,7 +238,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click)
}
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
this->SetAngle(line->Angle());//Show in dialog angle what user choose
emit ToolTip("");
@ -255,7 +255,7 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -265,7 +265,7 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
number++;
line->VisualMode(id);
VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
SCASSERT(window != nullptr)
connect(line, &VisToolLineIntersectAxis::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
}
break;
@ -377,7 +377,7 @@ void DialogLineIntersectAxis::SaveData()
formulaAngle.replace("\n", " ");
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId());
line->setPoint2Id(GetSecondPointId());

View File

@ -137,7 +137,7 @@ void DialogMove::SetAngle(const QString &value)
ui->plainTextEditAngle->setPlainText(formulaAngle);
VisToolMove *operation = qobject_cast<VisToolMove *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetAngle(formulaAngle);
MoveCursorToEnd(ui->plainTextEditAngle);
@ -161,7 +161,7 @@ void DialogMove::SetLength(const QString &value)
ui->plainTextEditLength->setPlainText(formulaLength);
VisToolMove *operation = qobject_cast<VisToolMove *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetLength(formulaLength);
MoveCursorToEnd(ui->plainTextEditLength);
@ -200,16 +200,16 @@ void DialogMove::ShowDialog(bool click)
prepare = true;
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
scene->clearSelection();
VisToolMove *operation = qobject_cast<VisToolMove *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetObjects(objects.toVector());
operation->VisualMode();
VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
SCASSERT(window != nullptr)
connect(operation, &VisToolMove::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
scene->ToggleArcSelection(false);
@ -225,7 +225,7 @@ void DialogMove::ShowDialog(bool click)
else if (not stage1 && prepare && click)
{
VisToolMove *operation = qobject_cast<VisToolMove *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
if (operation->LengthValue() > 0)
{
@ -367,9 +367,9 @@ void DialogMove::SuffixChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogMove::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagAngle && flagLength && flagName);
SCASSERT(bApply != nullptr);
SCASSERT(bApply != nullptr)
bApply->setEnabled(bOk->isEnabled());
}
@ -391,7 +391,7 @@ void DialogMove::SaveData()
formulaLength.replace("\n", " ");
VisToolMove *operation = qobject_cast<VisToolMove *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetObjects(objects.toVector());
operation->SetAngle(formulaAngle);

View File

@ -168,7 +168,7 @@ void DialogNormal::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolNormal *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -208,7 +208,7 @@ void DialogNormal::SaveData()
angle = ui->doubleSpinBoxAngle->value();
VisToolNormal *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId());
line->setObject2Id(GetSecondPointId());
@ -235,7 +235,7 @@ void DialogNormal::SetSecondPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolNormal *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject2Id(value);
}
@ -261,7 +261,7 @@ void DialogNormal::SetFirstPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolNormal *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -276,7 +276,7 @@ void DialogNormal::SetAngle(const qreal &value)
ui->doubleSpinBoxAngle->setValue(angle);
VisToolNormal *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->SetAngle(angle);
}
@ -296,7 +296,7 @@ void DialogNormal::SetFormula(const QString &value)
ui->plainTextEditFormula->setPlainText(formula);
VisToolNormal *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);

View File

@ -92,7 +92,7 @@ void DialogPointFromArcAndTangent::SetArcId(const quint32 &value)
setCurrentArcId(ui->comboBoxArc, value);
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setArcId(value);
}
@ -108,7 +108,7 @@ void DialogPointFromArcAndTangent::SetTangentPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxTangentPoint, value);
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject1Id(value);
}
@ -127,7 +127,7 @@ void DialogPointFromArcAndTangent::SetCrossCirclesPoint(const CrossCirclesPoint
ui->comboBoxResult->setCurrentIndex(index);
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setCrossPoint(p);
}
}
@ -140,7 +140,7 @@ void DialogPointFromArcAndTangent::ChosenObject(quint32 id, const SceneObject &t
if (type == SceneObject::Point || type == SceneObject::Arc)
{
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
switch (number)
{
@ -186,7 +186,7 @@ void DialogPointFromArcAndTangent::SaveData()
pointName = ui->lineEditNamePoint->text();
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject1Id(GetTangentPointId());
point->setArcId(GetArcId());

View File

@ -126,7 +126,7 @@ void DialogPointFromCircleAndTangent::SetCircleCenterId(const quint32 &value)
setCurrentPointId(ui->comboBoxCircleCenter, value);
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject2Id(value);
}
@ -149,7 +149,7 @@ void DialogPointFromCircleAndTangent::SetCircleRadius(const QString &value)
ui->plainTextEditRadius->setPlainText(formula);
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setCRadius(formula);
MoveCursorToEnd(ui->plainTextEditRadius);
@ -167,7 +167,7 @@ void DialogPointFromCircleAndTangent::SetTangentPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxTangentPoint, value);
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject1Id(value);
}
@ -186,7 +186,7 @@ void DialogPointFromCircleAndTangent::SetCrossCirclesPoint(const CrossCirclesPoi
ui->comboBoxResult->setCurrentIndex(index);
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setCrossPoint(p);
}
}
@ -199,7 +199,7 @@ void DialogPointFromCircleAndTangent::ChosenObject(quint32 id, const SceneObject
if (type == SceneObject::Point)
{
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
switch (number)
{
@ -313,7 +313,7 @@ void DialogPointFromCircleAndTangent::SaveData()
radius.replace("\n", " ");
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject1Id(GetTangentPointId());
point->setObject2Id(GetCircleCenterId());
@ -332,7 +332,7 @@ void DialogPointFromCircleAndTangent::closeEvent(QCloseEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void DialogPointFromCircleAndTangent::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagFormula && flagName && flagError && flagCircleRadius);
// In case dialog hasn't apply button
if ( bApply != nullptr)

View File

@ -172,7 +172,7 @@ void DialogPointOfContact::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -229,7 +229,7 @@ void DialogPointOfContact::SaveData()
radius.replace("\n", " ");
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPoint());
line->setLineP2Id(GetSecondPoint());
@ -255,7 +255,7 @@ void DialogPointOfContact::SetSecondPoint(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLineP2Id(value);
}
@ -269,7 +269,7 @@ void DialogPointOfContact::SetFirstPoint(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -283,7 +283,7 @@ void DialogPointOfContact::setCenter(const quint32 &value)
setCurrentPointId(ui->comboBoxCenter, value);
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setRadiusId(value);
}
@ -303,7 +303,7 @@ void DialogPointOfContact::setRadius(const QString &value)
ui->plainTextEditFormula->setPlainText(radius);
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setRadius(radius);
MoveCursorToEnd(ui->plainTextEditFormula);

View File

@ -95,7 +95,7 @@ void DialogPointOfIntersection::SetSecondPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setPoint2Id(value);
}
@ -112,7 +112,7 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type
if (type == SceneObject::Point)
{
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -149,7 +149,7 @@ void DialogPointOfIntersection::SaveData()
pointName = ui->lineEditNamePoint->text();
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId());
line->setPoint2Id(GetSecondPointId());
@ -191,7 +191,7 @@ void DialogPointOfIntersection::SetFirstPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}

View File

@ -98,7 +98,7 @@ void DialogPointOfIntersectionArcs::SetFirstArcId(const quint32 &value)
setCurrentArcId(ui->comboBoxArc1, value);
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setArc1Id(value);
}
@ -114,7 +114,7 @@ void DialogPointOfIntersectionArcs::SetSecondArcId(const quint32 &value)
setCurrentArcId(ui->comboBoxArc2, value);
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setArc2Id(value);
}
@ -133,7 +133,7 @@ void DialogPointOfIntersectionArcs::SetCrossArcPoint(const CrossCirclesPoint &p)
ui->comboBoxResult->setCurrentIndex(index);
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setCrossPoint(p);
}
}
@ -146,7 +146,7 @@ void DialogPointOfIntersectionArcs::ChosenObject(quint32 id, const SceneObject &
if (type == SceneObject::Arc)
{
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
switch (number)
{
@ -208,7 +208,7 @@ void DialogPointOfIntersectionArcs::SaveData()
pointName = ui->lineEditNamePoint->text();
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setArc1Id(GetFirstArcId());
point->setArc2Id(GetSecondArcId());

View File

@ -142,7 +142,7 @@ void DialogPointOfIntersectionCircles::SetFirstCircleCenterId(const quint32 &val
setCurrentPointId(ui->comboBoxCircle1Center, value);
VisToolPointOfIntersectionCircles *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject1Id(value);
}
@ -158,7 +158,7 @@ void DialogPointOfIntersectionCircles::SetSecondCircleCenterId(const quint32 &va
setCurrentPointId(ui->comboBoxCircle2Center, value);
VisToolPointOfIntersectionCircles *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject2Id(value);
}
@ -181,7 +181,7 @@ void DialogPointOfIntersectionCircles::SetFirstCircleRadius(const QString &value
ui->plainTextEditCircle1Radius->setPlainText(formula);
VisToolPointOfIntersectionCircles *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setC1Radius(formula);
MoveCursorToEnd(ui->plainTextEditCircle1Radius);
@ -206,7 +206,7 @@ void DialogPointOfIntersectionCircles::SetSecondCircleRadius(const QString &valu
ui->plainTextEditCircle2Radius->setPlainText(formula);
VisToolPointOfIntersectionCircles *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setC2Radius(formula);
MoveCursorToEnd(ui->plainTextEditCircle2Radius);
@ -227,7 +227,7 @@ void DialogPointOfIntersectionCircles::SetCrossCirclesPoint(const CrossCirclesPo
ui->comboBoxResult->setCurrentIndex(index);
VisToolPointOfIntersectionCircles *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setCrossPoint(p);
}
}
@ -240,7 +240,7 @@ void DialogPointOfIntersectionCircles::ChosenObject(quint32 id, const SceneObjec
if (type == SceneObject::Point)
{
VisToolPointOfIntersectionCircles *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
switch (number)
{
@ -405,7 +405,7 @@ void DialogPointOfIntersectionCircles::SaveData()
c2Radius.replace("\n", " ");
VisToolPointOfIntersectionCircles *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject1Id(GetFirstCircleCenterId());
point->setObject2Id(GetSecondCircleCenterId());
@ -426,7 +426,7 @@ void DialogPointOfIntersectionCircles::closeEvent(QCloseEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void DialogPointOfIntersectionCircles::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagFormula && flagName && flagError && flagCircle1Radius && flagCircle2Radius);
// In case dialog hasn't apply button
if ( bApply != nullptr)

View File

@ -101,7 +101,7 @@ void DialogPointOfIntersectionCurves::SetFirstCurveId(const quint32 &value)
setCurrentCurveId(ui->comboBoxCurve1, value);
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject1Id(value);
}
@ -117,7 +117,7 @@ void DialogPointOfIntersectionCurves::SetSecondCurveId(const quint32 &value)
setCurrentCurveId(ui->comboBoxCurve2, value);
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject2Id(value);
}
@ -136,7 +136,7 @@ void DialogPointOfIntersectionCurves::SetVCrossPoint(const VCrossCurvesPoint &vP
ui->comboBoxVCorrection->setCurrentIndex(index);
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setVCrossPoint(vP);
}
}
@ -156,7 +156,7 @@ void DialogPointOfIntersectionCurves::SetHCrossPoint(const HCrossCurvesPoint &hP
ui->comboBoxHCorrection->setCurrentIndex(index);
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setHCrossPoint(hP);
}
}
@ -172,7 +172,7 @@ void DialogPointOfIntersectionCurves::ChosenObject(quint32 id, const SceneObject
|| type == SceneObject::SplinePath)
{
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
switch (number)
{
@ -215,7 +215,7 @@ void DialogPointOfIntersectionCurves::SaveData()
pointName = ui->lineEditNamePoint->text();
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
point->setObject1Id(GetFirstCurveId());
point->setObject2Id(GetSecondCurveId());
@ -227,7 +227,7 @@ void DialogPointOfIntersectionCurves::SaveData()
//---------------------------------------------------------------------------------------------------------------------
void DialogPointOfIntersectionCurves::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagName && flagError);
// In case dialog hasn't apply button
if ( bApply != nullptr)

View File

@ -121,7 +121,7 @@ void DialogRotation::SetOrigPointId(const quint32 &value)
{
ChangeCurrentData(ui->comboBoxOriginPoint, value);
VisToolRotation *operation = qobject_cast<VisToolRotation *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetOriginPointId(value);
}
@ -143,7 +143,7 @@ void DialogRotation::SetAngle(const QString &value)
ui->plainTextEditFormula->setPlainText(formulaAngle);
VisToolRotation *operation = qobject_cast<VisToolRotation *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetAngle(formulaAngle);
MoveCursorToEnd(ui->plainTextEditFormula);
@ -181,11 +181,11 @@ void DialogRotation::ShowDialog(bool click)
stage1 = false;
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
scene->clearSelection();
VisToolRotation *operation = qobject_cast<VisToolRotation *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetObjects(objects.toVector());
operation->VisualMode();
@ -205,7 +205,7 @@ void DialogRotation::ShowDialog(bool click)
{
/*We will ignore click if pointer is in point circle*/
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetOrigPointId());
const QLineF line = QLineF(*point, scene->getScenePos());
@ -217,7 +217,7 @@ void DialogRotation::ShowDialog(bool click)
}
VisToolRotation *operation = qobject_cast<VisToolRotation *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
SetAngle(operation->Angle());//Show in dialog angle that a user choose
setModal(true);
@ -243,9 +243,9 @@ void DialogRotation::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxOriginPoint, ""))
{
VisToolRotation *operation = qobject_cast<VisToolRotation *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
SCASSERT(window != nullptr)
connect(operation, &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
operation->SetOriginPointId(id);
@ -348,9 +348,9 @@ void DialogRotation::SuffixChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogRotation::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagAngle && flagName && flagError);
SCASSERT(bApply != nullptr);
SCASSERT(bApply != nullptr)
bApply->setEnabled(bOk->isEnabled());
}
@ -369,7 +369,7 @@ void DialogRotation::SaveData()
formulaAngle.replace("\n", " ");
VisToolRotation *operation = qobject_cast<VisToolRotation *>(vis);
SCASSERT(operation != nullptr);
SCASSERT(operation != nullptr)
operation->SetObjects(objects.toVector());
operation->SetOriginPointId(GetOrigPointId());

View File

@ -176,7 +176,7 @@ void DialogShoulderPoint::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolShoulderPoint *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -233,7 +233,7 @@ void DialogShoulderPoint::SaveData()
formula.replace("\n", " ");
VisToolShoulderPoint *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetP3());
line->setLineP1Id(GetP1Line());
@ -260,7 +260,7 @@ void DialogShoulderPoint::SetP3(const quint32 &value)
setCurrentPointId(ui->comboBoxP3, value);
VisToolShoulderPoint *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}
@ -286,7 +286,7 @@ void DialogShoulderPoint::SetP2Line(const quint32 &value)
setCurrentPointId(ui->comboBoxP2Line, value);
VisToolShoulderPoint *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLineP2Id(value);
}
@ -300,7 +300,7 @@ void DialogShoulderPoint::SetP1Line(const quint32 &value)
setCurrentPointId(ui->comboBoxP1Line, value);
VisToolShoulderPoint *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLineP1Id(value);
}
@ -320,7 +320,7 @@ void DialogShoulderPoint::SetFormula(const QString &value)
ui->plainTextEditFormula->setPlainText(formula);
VisToolShoulderPoint *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setLength(formula);
MoveCursorToEnd(ui->plainTextEditFormula);
}

View File

@ -132,10 +132,10 @@ DialogSpline::DialogSpline(const VContainer *data, const quint32 &toolId, QWidge
vis = new VisToolSpline(data);
auto path = qobject_cast<VisToolSpline *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
auto scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
connect(scene, &VMainGraphicsScene::MouseLeftPressed, path, &VisToolSpline::MouseLeftPressed);
connect(scene, &VMainGraphicsScene::MouseLeftReleased, path, &VisToolSpline::MouseLeftReleased);
}
@ -159,7 +159,7 @@ void DialogSpline::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
auto *path = qobject_cast<VisToolSpline *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
switch (number)
{
@ -201,7 +201,7 @@ void DialogSpline::SaveData()
newDuplicate <= -1 ? spl.SetDuplicate(d) : spl.SetDuplicate(static_cast<quint32>(newDuplicate));
auto path = qobject_cast<VisToolSpline *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(GetP1()->id());
path->setObject4Id(GetP4()->id());
@ -523,7 +523,7 @@ void DialogSpline::ShowDialog(bool click)
if (prepare && click)
{
auto *path = qobject_cast<VisToolSpline *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
spl = VSpline(*GetP1(), path->GetP2(), path->GetP3(), *GetP4());
@ -553,7 +553,7 @@ void DialogSpline::ShowDialog(bool click)
//---------------------------------------------------------------------------------------------------------------------
void DialogSpline::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagAngle1 && flagAngle2 && flagLength1 && flagLength2 && flagError);
// In case dialog hasn't apply button
if ( bApply != nullptr)
@ -600,7 +600,7 @@ void DialogSpline::SetSpline(const VSpline &spline)
ui->lineEditSplineName->setText(spl.name());
auto path = qobject_cast<VisToolSpline *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
path->setObject1Id(spl.GetP1().id());
path->setObject4Id(spl.GetP4().id());

View File

@ -127,10 +127,10 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, const quint32 &toolId
vis = new VisToolSplinePath(data);
auto path = qobject_cast<VisToolSplinePath *>(vis);
SCASSERT(path != nullptr);
SCASSERT(path != nullptr)
auto scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
connect(scene, &VMainGraphicsScene::MouseLeftPressed, path, &VisToolSplinePath::MouseLeftPressed);
connect(scene, &VMainGraphicsScene::MouseLeftReleased, path, &VisToolSplinePath::MouseLeftReleased);
}
@ -164,7 +164,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
ui->lineEditSplPathName->setText(path.name());
auto visPath = qobject_cast<VisToolSplinePath *>(vis);
SCASSERT(visPath != nullptr);
SCASSERT(visPath != nullptr)
visPath->setPath(path);
ui->listWidget->blockSignals(false);
}
@ -205,14 +205,14 @@ void DialogSplinePath::ChosenObject(quint32 id, const SceneObject &type)
SavePath();
auto visPath = qobject_cast<VisToolSplinePath *>(vis);
SCASSERT(visPath != nullptr);
SCASSERT(visPath != nullptr)
visPath->setPath(path);
if (path.CountPoints() == 1)
{
visPath->VisualMode(NULL_ID);
VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow());
SCASSERT(window != nullptr);
SCASSERT(window != nullptr)
connect(visPath, &VisToolSplinePath::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
connect(visPath, &VisToolSplinePath::PathChanged, this, &DialogSplinePath::PathUpdated);
@ -235,7 +235,7 @@ void DialogSplinePath::SaveData()
newDuplicate <= -1 ? path.SetDuplicate(d) : path.SetDuplicate(static_cast<quint32>(newDuplicate));
auto visPath = qobject_cast<VisToolSplinePath *>(vis);
SCASSERT(visPath != nullptr);
SCASSERT(visPath != nullptr)
visPath->setPath(path);
visPath->SetMode(Mode::Show);
visPath->RefreshGeometry();
@ -244,7 +244,7 @@ void DialogSplinePath::SaveData()
//---------------------------------------------------------------------------------------------------------------------
void DialogSplinePath::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bool fAngle1 = true, fAngle2 = true, fLength1 = true, fLength2 = true;
@ -310,7 +310,7 @@ void DialogSplinePath::Angle1Changed()
if (row != 0)
{
QListWidgetItem *item = ui->listWidget->item(row);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VSplinePoint p = qvariant_cast<VSplinePoint>(item->data(Qt::UserRole));
const QString angle1F = ui->plainTextEditAngle1F->toPlainText().replace("\n", " ");
@ -353,7 +353,7 @@ void DialogSplinePath::Angle2Changed()
if (row != ui->listWidget->count()-1)
{
QListWidgetItem *item = ui->listWidget->item(row);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VSplinePoint p = qvariant_cast<VSplinePoint>(item->data(Qt::UserRole));
const QString angle2F = ui->plainTextEditAngle2F->toPlainText().replace("\n", " ");
@ -396,7 +396,7 @@ void DialogSplinePath::Length1Changed()
if (row != 0)
{
QListWidgetItem *item = ui->listWidget->item(row);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VSplinePoint p = qvariant_cast<VSplinePoint>(item->data(Qt::UserRole));
const QString length1F = ui->plainTextEditLength1F->toPlainText().replace("\n", " ");
@ -430,7 +430,7 @@ void DialogSplinePath::Length2Changed()
if (row != ui->listWidget->count()-1)
{
QListWidgetItem *item = ui->listWidget->item(row);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VSplinePoint p = qvariant_cast<VSplinePoint>(item->data(Qt::UserRole));
const QString length2F = ui->plainTextEditLength2F->toPlainText().replace("\n", " ");
@ -565,7 +565,7 @@ void DialogSplinePath::EvalAngle1()
Eval(ui->plainTextEditAngle1F->toPlainText(), flagAngle1[row], ui->labelResultAngle1, degreeSymbol, false);
QListWidgetItem *item = ui->listWidget->item(row);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VSplinePoint p = qvariant_cast<VSplinePoint>(item->data(Qt::UserRole));
ShowPointIssue(p.P().name());
@ -584,7 +584,7 @@ void DialogSplinePath::EvalAngle2()
Eval(ui->plainTextEditAngle2F->toPlainText(), flagAngle2[row], ui->labelResultAngle2, degreeSymbol, false);
QListWidgetItem *item = ui->listWidget->item(row);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VSplinePoint p = qvariant_cast<VSplinePoint>(item->data(Qt::UserRole));
ShowPointIssue(p.P().name());
@ -615,7 +615,7 @@ void DialogSplinePath::EvalLength1()
}
QListWidgetItem *item = ui->listWidget->item(row);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VSplinePoint p = qvariant_cast<VSplinePoint>(item->data(Qt::UserRole));
ShowPointIssue(p.P().name());
@ -646,7 +646,7 @@ void DialogSplinePath::EvalLength2()
}
QListWidgetItem *item = ui->listWidget->item(row);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
VSplinePoint p = qvariant_cast<VSplinePoint>(item->data(Qt::UserRole));
ShowPointIssue(p.P().name());
@ -959,7 +959,7 @@ void DialogSplinePath::ShowPointIssue(const QString &pName)
}
QListWidgetItem *item = ui->listWidget->item(row);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
if (flagAngle1.at(row) && flagAngle2.at(row) && flagLength1.at(row) && flagLength2.at(row))
{

View File

@ -93,7 +93,7 @@ DialogTool::DialogTool(const VContainer *data, const quint32 &toolId, QWidget *p
okColor(QColor(76, 76, 76)), errorColor(Qt::red), associatedTool(nullptr),
toolId(toolId), prepare(false), pointName(QString()), number(0), vis(nullptr)
{
SCASSERT(data != nullptr);
SCASSERT(data != nullptr)
timerFormula = new QTimer(this);
connect(timerFormula, &QTimer::timeout, this, &DialogTool::EvalFormula);
}
@ -165,7 +165,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, FillComboBox rule, const quint
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::FillComboBoxSplines(QComboBox *box) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->blockSignals(true);
const auto objs = data->DataGObjects();
@ -189,7 +189,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box) const
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::FillComboBoxSplinesPath(QComboBox *box) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->blockSignals(true);
const auto objs = data->DataGObjects();
@ -213,7 +213,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box) const
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::FillComboBoxCurves(QComboBox *box) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
const auto objs = data->DataGObjects();
QMap<QString, quint32> list;
QHash<quint32, QSharedPointer<VGObject> >::const_iterator i;
@ -243,7 +243,7 @@ void DialogTool::FillComboBoxCurves(QComboBox *box) const
*/
void DialogTool::FillComboBoxTypeLine(QComboBox *box, const QMap<QString, QIcon> &stylesPics) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
QMap<QString, QIcon>::const_iterator i = stylesPics.constBegin();
while (i != stylesPics.constEnd())
{
@ -257,7 +257,7 @@ void DialogTool::FillComboBoxTypeLine(QComboBox *box, const QMap<QString, QIcon>
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::FillComboBoxLineColors(QComboBox *box) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->clear();
int size = box->iconSize().height();
@ -280,7 +280,7 @@ void DialogTool::FillComboBoxLineColors(QComboBox *box) const
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::FillComboBoxCrossCirclesPoints(QComboBox *box) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->addItem(tr("First point"), QVariant(static_cast<int>(CrossCirclesPoint::FirstPoint)));
box->addItem(tr("Second point"), QVariant(static_cast<int>(CrossCirclesPoint::SecondPoint)));
@ -289,7 +289,7 @@ void DialogTool::FillComboBoxCrossCirclesPoints(QComboBox *box) const
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::FillComboBoxVCrossCurvesPoint(QComboBox *box) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->addItem(tr("Highest point"), QVariant(static_cast<int>(VCrossCurvesPoint::HighestPoint)));
box->addItem(tr("Lowest point"), QVariant(static_cast<int>(VCrossCurvesPoint::LowestPoint)));
@ -298,7 +298,7 @@ void DialogTool::FillComboBoxVCrossCurvesPoint(QComboBox *box) const
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::FillComboBoxHCrossCurvesPoint(QComboBox *box) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->addItem(tr("Leftmost point"), QVariant(static_cast<int>(HCrossCurvesPoint::LeftmostPoint)));
box->addItem(tr("Rightmost point"), QVariant(static_cast<int>(HCrossCurvesPoint::RightmostPoint)));
@ -340,7 +340,7 @@ void DialogTool::ChangeCurrentData(QComboBox *box, const QVariant &value) const
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::MoveCursorToEnd(QPlainTextEdit *plainTextEdit)
{
SCASSERT(plainTextEdit != nullptr);
SCASSERT(plainTextEdit != nullptr)
QTextCursor cursor = plainTextEdit->textCursor();
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
plainTextEdit->setTextCursor(cursor);
@ -411,10 +411,10 @@ bool DialogTool::IsSplinePath(const QSharedPointer<VGObject> &obj) const
*/
void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer, const QString& postfix)
{
SCASSERT(edit != nullptr);
SCASSERT(timer != nullptr);
SCASSERT(labelEditFormula != nullptr);
SCASSERT(labelResultCalculation != nullptr);
SCASSERT(edit != nullptr)
SCASSERT(timer != nullptr)
SCASSERT(labelEditFormula != nullptr)
SCASSERT(labelResultCalculation != nullptr)
if (edit->text().isEmpty())
{
flag = false;
@ -436,10 +436,10 @@ void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer, c
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer *timer, const QString& postfix)
{
SCASSERT(edit != nullptr);
SCASSERT(timer != nullptr);
SCASSERT(labelEditFormula != nullptr);
SCASSERT(labelResultCalculation != nullptr);
SCASSERT(edit != nullptr)
SCASSERT(timer != nullptr)
SCASSERT(labelEditFormula != nullptr)
SCASSERT(labelResultCalculation != nullptr)
if (edit->toPlainText().isEmpty())
{
flag = false;
@ -473,9 +473,9 @@ void DialogTool::ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer *tim
qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QString& postfix, bool checkZero)
{
qDebug() << "Eval started";
SCASSERT(label != nullptr);
SCASSERT(label != nullptr)
qDebug() << "Label ok";
SCASSERT(labelEditFormula != nullptr);
SCASSERT(labelEditFormula != nullptr)
qDebug() << "lef ok";
qreal result = INT_MIN;//Value can be 0, so use max imposible value
@ -548,7 +548,7 @@ qreal DialogTool::Eval(const QString &text, bool &flag, QLabel *label, const QSt
void DialogTool::setCurrentPointId(QComboBox *box, const quint32 &value, FillComboBox rule,
const quint32 &ch1, const quint32 &ch2) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->blockSignals(true);
@ -564,7 +564,7 @@ void DialogTool::setCurrentPointId(QComboBox *box, const quint32 &value, FillCom
*/
void DialogTool::setCurrentSplineId(QComboBox *box, const quint32 &value) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
FillComboBoxSplines(box);
ChangeCurrentData(box, value);
}
@ -576,7 +576,7 @@ void DialogTool::setCurrentSplineId(QComboBox *box, const quint32 &value) const
void DialogTool::setCurrentArcId(QComboBox *box, const quint32 &value, FillComboBox rule,
const quint32 &ch1, const quint32 &ch2) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
FillComboBoxArcs(box, rule, ch1, ch2);
ChangeCurrentData(box, value);
}
@ -589,7 +589,7 @@ void DialogTool::setCurrentArcId(QComboBox *box, const quint32 &value, FillCombo
*/
void DialogTool::setCurrentSplinePathId(QComboBox *box, const quint32 &value) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
FillComboBoxSplinesPath(box);
ChangeCurrentData(box, value);
}
@ -597,7 +597,7 @@ void DialogTool::setCurrentSplinePathId(QComboBox *box, const quint32 &value) co
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::setCurrentCurveId(QComboBox *box, const quint32 &value) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
FillComboBoxCurves(box);
ChangeCurrentData(box, value);
}
@ -610,7 +610,7 @@ void DialogTool::setCurrentCurveId(QComboBox *box, const quint32 &value) const
*/
quint32 DialogTool::getCurrentObjectId(QComboBox *box) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
qint32 index = box->currentIndex();
if (index != -1)
{
@ -625,7 +625,7 @@ quint32 DialogTool::getCurrentObjectId(QComboBox *box) const
//---------------------------------------------------------------------------------------------------------------------
bool DialogTool::SetObject(const quint32 &id, QComboBox *box, const QString &toolTip)
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
const qint32 index = box->findData(id);
if ( index != -1 )
{ // -1 for not found
@ -643,8 +643,8 @@ bool DialogTool::SetObject(const quint32 &id, QComboBox *box, const QString &too
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight)
{
SCASSERT(formula != nullptr);
SCASSERT(buttonGrowLength != nullptr);
SCASSERT(formula != nullptr)
SCASSERT(buttonGrowLength != nullptr)
const QTextCursor cursor = formula->textCursor();
@ -687,7 +687,7 @@ void DialogTool::DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowL
*/
void DialogTool::FillList(QComboBox *box, const QMap<QString, quint32> &list) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->clear();
QMapIterator<QString, quint32> iter(list);
@ -703,7 +703,7 @@ template <typename T>
void DialogTool::PrepareList(QMap<QString, quint32> &list, quint32 id) const
{
const auto obj = data->GeometricObject<T>(id);
SCASSERT(obj != nullptr);
SCASSERT(obj != nullptr)
QString newName = obj->name();
int bias = 0;
@ -730,7 +730,7 @@ bool DialogTool::IsSpline(const QSharedPointer<VGObject> &obj) const
*/
void DialogTool::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagFormula && flagName && flagError);
// In case dialog hasn't apply button
if ( bApply != nullptr)
@ -765,7 +765,7 @@ void DialogTool::SelectedObject(bool selected, quint32 object, quint32 tool)
*/
void DialogTool::NamePointChanged()
{
SCASSERT(labelEditNamePoint != nullptr);
SCASSERT(labelEditNamePoint != nullptr)
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
if (edit)
{
@ -789,7 +789,7 @@ void DialogTool::NamePointChanged()
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::ChangeColor(QWidget *widget, const QColor &color)
{
SCASSERT(widget != nullptr);
SCASSERT(widget != nullptr)
QPalette palette = widget->palette();
palette.setColor(widget->foregroundRole(), color);
widget->setPalette(palette);
@ -849,7 +849,7 @@ void DialogTool::FormulaChangedPlainText() //-V524
*/
void DialogTool::ArrowUp()
{
SCASSERT(spinBoxAngle != nullptr);
SCASSERT(spinBoxAngle != nullptr)
spinBoxAngle->setValue(90);
}
@ -859,7 +859,7 @@ void DialogTool::ArrowUp()
*/
void DialogTool::ArrowDown()
{
SCASSERT(spinBoxAngle != nullptr);
SCASSERT(spinBoxAngle != nullptr)
spinBoxAngle->setValue(270);
}
@ -869,7 +869,7 @@ void DialogTool::ArrowDown()
*/
void DialogTool::ArrowLeft()
{
SCASSERT(spinBoxAngle != nullptr);
SCASSERT(spinBoxAngle != nullptr)
spinBoxAngle->setValue(180);
}
@ -879,7 +879,7 @@ void DialogTool::ArrowLeft()
*/
void DialogTool::ArrowRight()
{
SCASSERT(spinBoxAngle != nullptr);
SCASSERT(spinBoxAngle != nullptr)
spinBoxAngle->setValue(0);
}
@ -889,7 +889,7 @@ void DialogTool::ArrowRight()
*/
void DialogTool::ArrowLeftUp()
{
SCASSERT(spinBoxAngle != nullptr);
SCASSERT(spinBoxAngle != nullptr)
spinBoxAngle->setValue(135);
}
@ -899,7 +899,7 @@ void DialogTool::ArrowLeftUp()
*/
void DialogTool::ArrowLeftDown()
{
SCASSERT(spinBoxAngle != nullptr);
SCASSERT(spinBoxAngle != nullptr)
spinBoxAngle->setValue(225);
}
@ -909,7 +909,7 @@ void DialogTool::ArrowLeftDown()
*/
void DialogTool::ArrowRightUp()
{
SCASSERT(spinBoxAngle != nullptr);
SCASSERT(spinBoxAngle != nullptr)
spinBoxAngle->setValue(45);
}
@ -919,7 +919,7 @@ void DialogTool::ArrowRightUp()
*/
void DialogTool::ArrowRightDown()
{
SCASSERT(spinBoxAngle != nullptr);
SCASSERT(spinBoxAngle != nullptr)
spinBoxAngle->setValue(315);
}
@ -929,8 +929,8 @@ void DialogTool::ArrowRightDown()
*/
void DialogTool::EvalFormula()
{
SCASSERT(plainTextEditFormula != nullptr);
SCASSERT(labelResultCalculation != nullptr);
SCASSERT(plainTextEditFormula != nullptr)
SCASSERT(labelResultCalculation != nullptr)
const QString postfix = VDomDocument::UnitsToStr(qApp->patternUnit());//Show unit in dialog lable (cm, mm or inch)
Eval(plainTextEditFormula->toPlainText(), flagFormula, labelResultCalculation, postfix, false);
}
@ -986,7 +986,7 @@ template <typename GObject>
void DialogTool::FillCombo(QComboBox *box, GOType gType, FillComboBox rule, const quint32 &ch1,
const quint32 &ch2) const
{
SCASSERT(box != nullptr);
SCASSERT(box != nullptr)
box->blockSignals(true);
const QHash<quint32, QSharedPointer<VGObject> > *objs = data->DataGObjects();

View File

@ -300,7 +300,7 @@ inline VAbstractTool *DialogTool::GetAssociatedTool()
template <typename T>
inline void DialogTool::InitArrow(T *ui)
{
SCASSERT(ui != nullptr);
SCASSERT(ui != nullptr)
spinBoxAngle = ui->doubleSpinBoxAngle;
connect(ui->toolButtonArrowDown, &QPushButton::clicked, this, &DialogTool::ArrowDown);
connect(ui->toolButtonArrowUp, &QPushButton::clicked, this, &DialogTool::ArrowUp);
@ -322,7 +322,7 @@ inline void DialogTool::InitOkCancelApply(T *ui)
{
InitOkCancel(ui);
bApply = ui->buttonBox->button(QDialogButtonBox::Apply);
SCASSERT(bApply != nullptr);
SCASSERT(bApply != nullptr)
connect(bApply, &QPushButton::clicked, this, &DialogTool::DialogApply);
}
@ -335,11 +335,11 @@ template <typename T>
inline void DialogTool::InitOkCancel(T *ui)
{
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
connect(bOk, &QPushButton::clicked, this, &DialogTool::DialogAccepted);
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
SCASSERT(bCancel != nullptr);
SCASSERT(bCancel != nullptr)
connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
qApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale::c());
@ -365,10 +365,10 @@ inline void DialogTool::AddVisualization()
if (prepare == false)
{
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
SCASSERT(scene != nullptr);
SCASSERT(scene != nullptr)
T *toolVis = qobject_cast<T *>(vis);
SCASSERT(toolVis != nullptr);
SCASSERT(toolVis != nullptr)
if (not scene->items().contains(toolVis))
{

View File

@ -103,7 +103,7 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
switch (number)
{
@ -176,7 +176,7 @@ void DialogTriangle::SaveData()
pointName = ui->lineEditNamePoint->text();
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(GetAxisP1Id());
line->setObject2Id(GetAxisP2Id());
@ -239,7 +239,7 @@ void DialogTriangle::SetSecondPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondPoint, value);
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setHypotenuseP2Id(value);
}
@ -253,7 +253,7 @@ void DialogTriangle::SetFirstPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstPoint, value);
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setHypotenuseP1Id(value);
}
@ -267,7 +267,7 @@ void DialogTriangle::SetAxisP2Id(const quint32 &value)
setCurrentPointId(ui->comboBoxAxisP2, value);
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject2Id(value);
}
@ -281,7 +281,7 @@ void DialogTriangle::SetAxisP1Id(const quint32 &value)
setCurrentPointId(ui->comboBoxAxisP1, value);
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr);
SCASSERT(line != nullptr)
line->setObject1Id(value);
}

View File

@ -145,7 +145,7 @@ void DialogTrueDarts::SetFirstBasePointId(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstBasePoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr);
SCASSERT(points != nullptr)
points->setObject1Id(value);
}
@ -161,7 +161,7 @@ void DialogTrueDarts::SetSecondBasePointId(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondBasePoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr);
SCASSERT(points != nullptr)
points->setObject2Id(value);
}
@ -177,7 +177,7 @@ void DialogTrueDarts::SetFirstDartPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxFirstDartPoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr);
SCASSERT(points != nullptr)
points->setD1PointId(value);
}
@ -193,7 +193,7 @@ void DialogTrueDarts::SetSecondDartPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxSecondDartPoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr);
SCASSERT(points != nullptr)
points->setD2PointId(value);
}
@ -209,7 +209,7 @@ void DialogTrueDarts::SetThirdDartPointId(const quint32 &value)
setCurrentPointId(ui->comboBoxThirdDartPoint, value, FillComboBox::NoChildren, ch1, ch2);
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr);
SCASSERT(points != nullptr)
points->setD3PointId(value);
}
@ -229,7 +229,7 @@ void DialogTrueDarts::ChosenObject(quint32 id, const SceneObject &type)
if (type == SceneObject::Point)
{
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr);
SCASSERT(points != nullptr)
switch (number)
{
@ -370,7 +370,7 @@ void DialogTrueDarts::SaveData()
d2PointName = ui->lineEditSecondNewDartPoint->text();
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr);
SCASSERT(points != nullptr)
points->setObject1Id(GetFirstBasePointId());
points->setObject2Id(GetSecondBasePointId());
@ -383,7 +383,7 @@ void DialogTrueDarts::SaveData()
//---------------------------------------------------------------------------------------------------------------------
void DialogTrueDarts::CheckState()
{
SCASSERT(bOk != nullptr);
SCASSERT(bOk != nullptr)
bOk->setEnabled(flagName1 && flagName2 && flagError);
// In case dialog hasn't apply button
if ( bApply != nullptr)
@ -396,8 +396,8 @@ void DialogTrueDarts::CheckState()
void DialogTrueDarts::NameChanged(QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name,
QLineEdit* secondPointName, bool &flagName)
{
SCASSERT(labelEditNamePoint != nullptr);
SCASSERT(secondPointName != nullptr);
SCASSERT(labelEditNamePoint != nullptr)
SCASSERT(secondPointName != nullptr)
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
if (edit)
{
@ -420,9 +420,9 @@ void DialogTrueDarts::FillComboBoxs(const quint32 &ch1, const quint32 &ch2)
void DialogTrueDarts::CheckName(QLineEdit *edit, QLabel *labelEditNamePoint, const QString &pointD1Name,
const QString &pointD2Name, QLineEdit *secondPointName, bool &flagName)
{
SCASSERT(labelEditNamePoint != nullptr);
SCASSERT(secondPointName != nullptr);
SCASSERT(edit != nullptr);
SCASSERT(labelEditNamePoint != nullptr)
SCASSERT(secondPointName != nullptr)
SCASSERT(edit != nullptr)
const QString name = edit->text();
const QString secondName = secondPointName->text();

View File

@ -79,9 +79,9 @@ VToolFlippingByAxis::~VToolFlippingByAxis()
//---------------------------------------------------------------------------------------------------------------------
void VToolFlippingByAxis::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogFlippingByAxis *dialogTool = qobject_cast<DialogFlippingByAxis*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
dialogTool->SetOriginPointId(m_originPointId);
dialogTool->SetAxisType(m_axisType);
dialogTool->SetSuffix(suffix);
@ -91,9 +91,9 @@ void VToolFlippingByAxis::setDialog()
VToolFlippingByAxis *VToolFlippingByAxis::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogFlippingByAxis *dialogTool = qobject_cast<DialogFlippingByAxis*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const quint32 originPointId = dialogTool->GetOriginPointId();
const AxisType axisType = dialogTool->GetAxisType();
const QString suffix = dialogTool->GetSuffix();
@ -177,7 +177,7 @@ void VToolFlippingByAxis::SetVisualization()
if (not vis.isNull())
{
VisToolFlippingByAxis *visual = qobject_cast<VisToolFlippingByAxis *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->SetObjects(source);
visual->SetOriginPointId(m_originPointId);
@ -189,9 +189,9 @@ void VToolFlippingByAxis::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
void VToolFlippingByAxis::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogFlippingByAxis *dialogTool = qobject_cast<DialogFlippingByAxis*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOriginPointId()));
doc->SetAttribute(domElement, AttrAxisType, QString().setNum(static_cast<int>(dialogTool->GetAxisType())));

View File

@ -79,9 +79,9 @@ VToolFlippingByLine::~VToolFlippingByLine()
//---------------------------------------------------------------------------------------------------------------------
void VToolFlippingByLine::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogFlippingByLine *dialogTool = qobject_cast<DialogFlippingByLine*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
dialogTool->SetFirstLinePointId(m_firstLinePointId);
dialogTool->SetSecondLinePointId(m_secondLinePointId);
dialogTool->SetSuffix(suffix);
@ -91,9 +91,9 @@ void VToolFlippingByLine::setDialog()
VToolFlippingByLine *VToolFlippingByLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogFlippingByLine *dialogTool = qobject_cast<DialogFlippingByLine*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const quint32 firstLinePointId = dialogTool->GetFirstLinePointId();
const quint32 secondLinePointId = dialogTool->GetSecondLinePointId();
const QString suffix = dialogTool->GetSuffix();
@ -157,7 +157,7 @@ void VToolFlippingByLine::SetVisualization()
if (not vis.isNull())
{
VisToolFlippingByLine *visual = qobject_cast<VisToolFlippingByLine *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->SetObjects(source);
visual->SetFirstLinePointId(m_firstLinePointId);
@ -169,9 +169,9 @@ void VToolFlippingByLine::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
void VToolFlippingByLine::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogFlippingByLine *dialogTool = qobject_cast<DialogFlippingByLine*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstLinePointId()));
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondLinePointId()));

View File

@ -75,13 +75,13 @@ void VAbstractOperation::GroupVisibility(quint32 object, bool visible)
if (obj->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(obj);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setVisible(visible);
}
else
{
VSimpleCurve *item = qobject_cast<VSimpleCurve *>(obj);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setVisible(visible);
}
}
@ -149,13 +149,13 @@ void VAbstractOperation::FullUpdateFromFile()
if (i.value()->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->RefreshGeometry(*VAbstractTool::data.GeometricObject<VPointF>(i.key()));
}
else
{
VSimpleCurve *item = qobject_cast<VSimpleCurve *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->RefreshGeometry(VAbstractTool::data.GeometricObject<VAbstractCurve>(i.key()));
}
}
@ -173,13 +173,13 @@ void VAbstractOperation::SetFactor(qreal factor)
if (i.value()->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->RefreshGeometry(*VAbstractTool::data.GeometricObject<VPointF>(i.key()));
}
else
{
VSimpleCurve *item = qobject_cast<VSimpleCurve *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->RefreshGeometry(VAbstractTool::data.GeometricObject<VAbstractCurve>(i.key()));
}
}
@ -195,13 +195,13 @@ void VAbstractOperation::AllowHover(bool enabled)
if (i.value()->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setAcceptHoverEvents(enabled);
}
else
{
VSimpleCurve *item = qobject_cast<VSimpleCurve *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setAcceptHoverEvents(enabled);
}
}
@ -217,13 +217,13 @@ void VAbstractOperation::AllowSelecting(bool enabled)
if (i.value()->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setFlag(QGraphicsItem::ItemIsSelectable, enabled);
}
else
{
VSimpleCurve *item = qobject_cast<VSimpleCurve *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setFlag(QGraphicsItem::ItemIsSelectable, enabled);
}
}
@ -239,7 +239,7 @@ void VAbstractOperation::AllowPointHover(bool enabled)
if (i.value()->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setAcceptHoverEvents(enabled);
}
}
@ -255,7 +255,7 @@ void VAbstractOperation::AllowPointSelecting(bool enabled)
if (i.value()->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->setFlag(QGraphicsItem::ItemIsSelectable, enabled);
}
}
@ -271,7 +271,7 @@ void VAbstractOperation::AllowPointLabelHover(bool enabled)
if (i.value()->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->AllowLabelHover(enabled);
}
}
@ -287,7 +287,7 @@ void VAbstractOperation::AllowPointLabelSelecting(bool enabled)
if (i.value()->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->AllowLabelSelecting(enabled);
}
}
@ -384,7 +384,7 @@ void VAbstractOperation::LabelChangePosition(const QPointF &pos, quint32 labelId
if (obj->GetType() == GOType::Point)
{
VSimplePoint *item = qobject_cast<VSimplePoint *>(obj);
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
ChangePosition(item, labelId, pos);
}
}
@ -496,7 +496,7 @@ void VAbstractOperation::DoChangePosition(quint32 id, qreal mx, qreal my)
VAbstractTool::data.UpdateGObject(id, point);
VSimplePoint *item = qobject_cast<VSimplePoint *>(operatedObjects.value(id));
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
item->RefreshGeometry(*point);
}
@ -512,7 +512,7 @@ void VAbstractOperation::AllowCurveHover(bool enabled, GOType type)
if (i.value()->GetType() != GOType::Point)
{
VSimpleCurve *item = qobject_cast<VSimpleCurve *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
if (item->GetType() == type)
{
item->setAcceptHoverEvents(enabled);
@ -531,7 +531,7 @@ void VAbstractOperation::AllowCurveSelecting(bool enabled, GOType type)
if (i.value()->GetType() != GOType::Point)
{
VSimpleCurve *item = qobject_cast<VSimpleCurve *>(i.value());
SCASSERT(item != nullptr);
SCASSERT(item != nullptr)
if (item->GetType() == type)
{
item->setFlag(QGraphicsItem::ItemIsSelectable, enabled);

View File

@ -182,8 +182,8 @@ void VAbstractOperation::ShowToolVisualization(bool show)
template <typename T>
void VAbstractOperation::InitOperationToolConnections(VMainGraphicsScene *scene, T *tool)
{
SCASSERT(scene != nullptr);
SCASSERT(tool != nullptr);
SCASSERT(scene != nullptr)
SCASSERT(tool != nullptr)
InitDrawToolConnections(scene, tool);

View File

@ -87,9 +87,9 @@ VToolMove::~VToolMove()
//---------------------------------------------------------------------------------------------------------------------
void VToolMove::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogMove *dialogTool = qobject_cast<DialogMove*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
dialogTool->SetAngle(formulaAngle);
dialogTool->SetLength(formulaLength);
dialogTool->SetSuffix(suffix);
@ -99,9 +99,9 @@ void VToolMove::setDialog()
VToolMove *VToolMove::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogMove *dialogTool = qobject_cast<DialogMove*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
QString angle = dialogTool->GetAngle();
QString length = dialogTool->GetLength();
const QString suffix = dialogTool->GetSuffix();
@ -300,7 +300,7 @@ void VToolMove::SetVisualization()
if (not vis.isNull())
{
VisToolMove *visual = qobject_cast<VisToolMove *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->SetObjects(source);
visual->SetAngle(qApp->TrVars()->FormulaToUser(formulaAngle, qApp->Settings()->GetOsSeparator()));
@ -312,9 +312,9 @@ void VToolMove::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
void VToolMove::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogMove *dialogTool = qobject_cast<DialogMove*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
QString length = dialogTool->GetLength();

View File

@ -99,9 +99,9 @@ VToolRotation::~VToolRotation()
//---------------------------------------------------------------------------------------------------------------------
void VToolRotation::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogRotation *dialogTool = qobject_cast<DialogRotation*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
dialogTool->SetOrigPointId(origPointId);
dialogTool->SetAngle(formulaAngle);
dialogTool->SetSuffix(suffix);
@ -111,9 +111,9 @@ void VToolRotation::setDialog()
VToolRotation *VToolRotation::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogRotation *dialogTool = qobject_cast<DialogRotation*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const quint32 originPointId = dialogTool->GetOrigPointId();
QString angle = dialogTool->GetAngle();
const QString suffix = dialogTool->GetSuffix();
@ -289,7 +289,7 @@ void VToolRotation::SetVisualization()
if (not vis.isNull())
{
VisToolRotation *visual = qobject_cast<VisToolRotation *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->SetObjects(source);
visual->SetOriginPointId(origPointId);
@ -301,9 +301,9 @@ void VToolRotation::SetVisualization()
//---------------------------------------------------------------------------------------------------------------------
void VToolRotation::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogRotation *dialogTool = qobject_cast<DialogRotation*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOrigPointId()));
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());

View File

@ -183,8 +183,8 @@ inline void VAbstractSpline::ShowToolVisualization(bool show)
template <typename T>
void VAbstractSpline::InitSplineToolConnections(VMainGraphicsScene *scene, T *tool)
{
SCASSERT(scene != nullptr);
SCASSERT(tool != nullptr);
SCASSERT(scene != nullptr)
SCASSERT(tool != nullptr)
InitDrawToolConnections(scene, tool);
QObject::connect(scene, &VMainGraphicsScene::EnableSplineItemHover, tool, &T::AllowHover);
@ -195,8 +195,8 @@ void VAbstractSpline::InitSplineToolConnections(VMainGraphicsScene *scene, T *to
template <typename T>
void VAbstractSpline::InitSplinePathToolConnections(VMainGraphicsScene *scene, T *tool)
{
SCASSERT(scene != nullptr);
SCASSERT(tool != nullptr);
SCASSERT(scene != nullptr)
SCASSERT(tool != nullptr)
InitDrawToolConnections(scene, tool);
QObject::connect(scene, &VMainGraphicsScene::EnableSplinePathItemHover, tool, &T::AllowHover);
@ -207,8 +207,8 @@ void VAbstractSpline::InitSplinePathToolConnections(VMainGraphicsScene *scene, T
template <typename T>
void VAbstractSpline::InitArcToolConnections(VMainGraphicsScene *scene, T *tool)
{
SCASSERT(scene != nullptr);
SCASSERT(tool != nullptr);
SCASSERT(scene != nullptr)
SCASSERT(tool != nullptr)
InitDrawToolConnections(scene, tool);
QObject::connect(scene, &VMainGraphicsScene::EnableArcItemHover, tool, &T::AllowHover);
@ -219,8 +219,8 @@ void VAbstractSpline::InitArcToolConnections(VMainGraphicsScene *scene, T *tool)
template <typename T>
void VAbstractSpline::InitElArcToolConnections(VMainGraphicsScene *scene, T *tool)
{
SCASSERT(scene != nullptr);
SCASSERT(tool != nullptr);
SCASSERT(scene != nullptr)
SCASSERT(tool != nullptr)
InitDrawToolConnections(scene, tool);
QObject::connect(scene, &VMainGraphicsScene::EnableElArcItemHover, tool, &T::AllowHover);

View File

@ -89,9 +89,9 @@ VToolArc::VToolArc(VAbstractPattern *doc, VContainer *data, quint32 id, const So
*/
void VToolArc::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogArc *dialogTool = qobject_cast<DialogArc*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
dialogTool->SetCenter(arc->GetCenter().id());
dialogTool->SetF1(arc->GetFormulaF1());
@ -110,9 +110,9 @@ void VToolArc::setDialog()
*/
VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogArc *dialogTool = qobject_cast<DialogArc*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const quint32 center = dialogTool->GetCenter();
QString radius = dialogTool->GetRadius();
QString f1 = dialogTool->GetF1();
@ -193,7 +193,7 @@ QString VToolArc::getTagName() const
quint32 VToolArc::getCenter() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
return arc->GetCenter().id();
}
@ -216,7 +216,7 @@ void VToolArc::setCenter(const quint32 &value)
VFormula VToolArc::GetFormulaRadius() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
VFormula radius(arc->GetFormulaRadius(), getData());
radius.setCheckZero(true);
@ -244,7 +244,7 @@ void VToolArc::SetFormulaRadius(const VFormula &value)
VFormula VToolArc::GetFormulaF1() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
VFormula f1(arc->GetFormulaF1(), getData());
f1.setCheckZero(false);
@ -273,7 +273,7 @@ void VToolArc::SetFormulaF1(const VFormula &value)
VFormula VToolArc::GetFormulaF2() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
VFormula f2(arc->GetFormulaF2(), getData());
f2.setCheckZero(false);
@ -337,9 +337,9 @@ void VToolArc::RemoveReferens()
*/
void VToolArc::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogArc *dialogTool = qobject_cast<DialogArc*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter()));
doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius());
doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1());
@ -353,7 +353,7 @@ void VToolArc::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
VAbstractSpline::SaveOptions(tag, obj);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
doc->SetAttribute(tag, AttrType, ToolType);
doc->SetAttribute(tag, AttrCenter, arc->GetCenter().id());
@ -369,7 +369,7 @@ void VToolArc::SetVisualization()
{
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
VisToolArc *visual = qobject_cast<VisToolArc *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
const VTranslateVars *trVars = qApp->TrVars();
visual->setObject1Id(arc->GetCenter().id());

View File

@ -78,9 +78,9 @@ VToolArcWithLength::VToolArcWithLength(VAbstractPattern *doc, VContainer *data,
//---------------------------------------------------------------------------------------------------------------------
void VToolArcWithLength::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogArcWithLength *dialogTool = qobject_cast<DialogArcWithLength*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
dialogTool->SetCenter(arc->GetCenter().id());
dialogTool->SetF1(arc->GetFormulaF1());
@ -93,9 +93,9 @@ void VToolArcWithLength::setDialog()
VToolArcWithLength *VToolArcWithLength::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogArcWithLength *dialogTool = qobject_cast<DialogArcWithLength*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const quint32 center = dialogTool->GetCenter();
QString radius = dialogTool->GetRadius();
QString f1 = dialogTool->GetF1();
@ -163,7 +163,7 @@ QString VToolArcWithLength::getTagName() const
quint32 VToolArcWithLength::getCenter() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
return arc->GetCenter().id();
}
@ -186,7 +186,7 @@ void VToolArcWithLength::setCenter(const quint32 &value)
VFormula VToolArcWithLength::GetFormulaRadius() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
VFormula radius(arc->GetFormulaRadius(), getData());
radius.setCheckZero(true);
@ -214,7 +214,7 @@ void VToolArcWithLength::SetFormulaRadius(const VFormula &value)
VFormula VToolArcWithLength::GetFormulaF1() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
VFormula f1(arc->GetFormulaF1(), getData());
f1.setCheckZero(false);
@ -243,7 +243,7 @@ void VToolArcWithLength::SetFormulaF1(const VFormula &value)
VFormula VToolArcWithLength::GetFormulaLength() const
{
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
VFormula radius(arc->GetFormulaLength(), getData());
radius.setCheckZero(true);
@ -294,9 +294,9 @@ void VToolArcWithLength::RemoveReferens()
//---------------------------------------------------------------------------------------------------------------------
void VToolArcWithLength::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogArcWithLength *dialogTool = qobject_cast<DialogArcWithLength*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter()));
doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius());
doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1());
@ -310,7 +310,7 @@ void VToolArcWithLength::SaveOptions(QDomElement &tag, QSharedPointer<VGObject>
VAbstractSpline::SaveOptions(tag, obj);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
SCASSERT(arc.isNull() == false);
SCASSERT(arc.isNull() == false)
doc->SetAttribute(tag, AttrType, ToolType);
doc->SetAttribute(tag, AttrCenter, arc->GetCenter().id());
@ -326,7 +326,7 @@ void VToolArcWithLength::SetVisualization()
{
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
VisToolArcWithLength *visual = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
const VTranslateVars *trVars = qApp->TrVars();
visual->setObject1Id(arc->GetCenter().id());

View File

@ -81,9 +81,9 @@ VToolCubicBezier::~VToolCubicBezier()
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezier::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
auto dialogTool = qobject_cast<DialogCubicBezier*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const auto spl = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
dialogTool->SetSpline(*spl);
dialogTool->SetColor(spl->GetColor());
@ -93,9 +93,9 @@ void VToolCubicBezier::setDialog()
VToolCubicBezier *VToolCubicBezier::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
auto dialogTool = qobject_cast<DialogCubicBezier*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
auto spl = Create(0, new VCubicBezier(dialogTool->GetSpline()), dialogTool->GetColor(), scene, doc, data,
Document::FullParse, Source::FromGui);
@ -193,9 +193,9 @@ void VToolCubicBezier::RemoveReferens()
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezier::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
auto dialogTool = qobject_cast<DialogCubicBezier*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const VCubicBezier spl = dialogTool->GetSpline();
@ -209,7 +209,7 @@ void VToolCubicBezier::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &o
VAbstractSpline::SaveOptions(tag, obj);
auto spl = qSharedPointerDynamicCast<VCubicBezier>(obj);
SCASSERT(spl.isNull() == false);
SCASSERT(spl.isNull() == false)
SetSplineAttributes(tag, *spl);
}
@ -219,7 +219,7 @@ void VToolCubicBezier::SetVisualization()
if (not vis.isNull())
{
auto visual = qobject_cast<VisToolCubicBezier *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
const QSharedPointer<VCubicBezier> spl = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
visual->setObject1Id(spl->GetP1().id());
@ -252,7 +252,7 @@ void VToolCubicBezier::RefreshGeometry()
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezier::SetSplineAttributes(QDomElement &domElement, const VCubicBezier &spl)
{
SCASSERT(doc != nullptr);
SCASSERT(doc != nullptr)
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id());

View File

@ -83,9 +83,9 @@ VToolCubicBezierPath::~VToolCubicBezierPath()
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezierPath::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
auto dialogTool = qobject_cast<DialogCubicBezierPath*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(id);
dialogTool->SetPath(*splPath);
dialogTool->SetColor(splPath->GetColor());
@ -95,9 +95,9 @@ void VToolCubicBezierPath::setDialog()
VToolCubicBezierPath *VToolCubicBezierPath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
auto dialogTool = qobject_cast<DialogCubicBezierPath*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
auto path = new VCubicBezierPath(dialogTool->GetPath());
const QString color = dialogTool->GetColor();
for (qint32 i = 0; i < path->CountPoints(); ++i)
@ -204,9 +204,9 @@ void VToolCubicBezierPath::RemoveReferens()
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezierPath::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
const auto dialogTool = qobject_cast<DialogCubicBezierPath*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor());
SetSplinePathAttributes(domElement, dialogTool->GetPath());
@ -218,7 +218,7 @@ void VToolCubicBezierPath::SaveOptions(QDomElement &tag, QSharedPointer<VGObject
VAbstractSpline::SaveOptions(tag, obj);
QSharedPointer<VCubicBezierPath> splPath = qSharedPointerDynamicCast<VCubicBezierPath>(obj);
SCASSERT(splPath.isNull() == false);
SCASSERT(splPath.isNull() == false)
SetSplinePathAttributes(tag, *splPath);
}
@ -229,7 +229,7 @@ void VToolCubicBezierPath::SetVisualization()
if (not vis.isNull())
{
auto visual = qobject_cast<VisToolCubicBezierPath *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(id);
visual->setPath(*splPath.data());
@ -253,7 +253,7 @@ void VToolCubicBezierPath::RefreshGeometry()
//---------------------------------------------------------------------------------------------------------------------
void VToolCubicBezierPath::AddPathPoint(VAbstractPattern *doc, QDomElement &domElement, const VPointF &splPoint)
{
SCASSERT(doc != nullptr);
SCASSERT(doc != nullptr)
QDomElement pathPoint = doc->createElement(AttrPathPoint);
doc->SetAttribute(pathPoint, AttrPSpline, splPoint.id());
domElement.appendChild(pathPoint);

View File

@ -89,9 +89,9 @@ VToolEllipticalArc::VToolEllipticalArc(VAbstractPattern *doc, VContainer *data,
*/
void VToolEllipticalArc::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogEllipticalArc *dialogTool = qobject_cast<DialogEllipticalArc*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
dialogTool->SetCenter(elArc->GetCenter().id());
dialogTool->SetF1(elArc->GetFormulaF1());
@ -114,9 +114,9 @@ void VToolEllipticalArc::setDialog()
VToolEllipticalArc* VToolEllipticalArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogEllipticalArc *dialogTool = qobject_cast<DialogEllipticalArc*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const quint32 center = dialogTool->GetCenter();
QString radius1 = dialogTool->GetRadius1();
@ -208,7 +208,7 @@ QString VToolEllipticalArc::getTagName() const
quint32 VToolEllipticalArc::getCenter() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
SCASSERT(elArc.isNull() == false);
SCASSERT(elArc.isNull() == false)
return elArc->GetCenter().id();
}
@ -231,7 +231,7 @@ void VToolEllipticalArc::setCenter(const quint32 &value)
VFormula VToolEllipticalArc::GetFormulaRadius1() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
SCASSERT(elArc.isNull() == false);
SCASSERT(elArc.isNull() == false)
VFormula radius1(elArc->GetFormulaRadius1(), getData());
radius1.setCheckZero(true);
@ -259,7 +259,7 @@ void VToolEllipticalArc::SetFormulaRadius1(const VFormula &value)
VFormula VToolEllipticalArc::GetFormulaRadius2() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
SCASSERT(elArc.isNull() == false);
SCASSERT(elArc.isNull() == false)
VFormula radius2(elArc->GetFormulaRadius2(), getData());
radius2.setCheckZero(true);
@ -287,7 +287,7 @@ void VToolEllipticalArc::SetFormulaRadius2(const VFormula &value)
VFormula VToolEllipticalArc::GetFormulaF1() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
SCASSERT(elArc.isNull() == false);
SCASSERT(elArc.isNull() == false)
VFormula f1(elArc->GetFormulaF1(), getData());
f1.setCheckZero(false);
@ -316,7 +316,7 @@ void VToolEllipticalArc::SetFormulaF1(const VFormula &value)
VFormula VToolEllipticalArc::GetFormulaF2() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
SCASSERT(elArc.isNull() == false);
SCASSERT(elArc.isNull() == false)
VFormula f2(elArc->GetFormulaF2(), getData());
f2.setCheckZero(false);
@ -344,7 +344,7 @@ void VToolEllipticalArc::SetFormulaF2(const VFormula &value)
VFormula VToolEllipticalArc::GetFormulaRotationAngle() const
{
QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
SCASSERT(elArc.isNull() == false);
SCASSERT(elArc.isNull() == false)
VFormula rotationAngle(elArc->GetFormulaRotationAngle(), getData());
rotationAngle.setCheckZero(false);
@ -405,9 +405,9 @@ void VToolEllipticalArc::RemoveReferens()
*/
void VToolEllipticalArc::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogEllipticalArc *dialogTool = qobject_cast<DialogEllipticalArc*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter()));
doc->SetAttribute(domElement, AttrRadius1, dialogTool->GetRadius1());
doc->SetAttribute(domElement, AttrRadius2, dialogTool->GetRadius2());
@ -423,7 +423,7 @@ void VToolEllipticalArc::SaveOptions(QDomElement &tag, QSharedPointer<VGObject>
VAbstractSpline::SaveOptions(tag, obj);
QSharedPointer<VEllipticalArc> elArc = qSharedPointerDynamicCast<VEllipticalArc>(obj);
SCASSERT(elArc.isNull() == false);
SCASSERT(elArc.isNull() == false)
doc->SetAttribute(tag, AttrType, ToolType);
doc->SetAttribute(tag, AttrCenter, elArc->GetCenter().id());
@ -441,7 +441,7 @@ void VToolEllipticalArc::SetVisualization()
{
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
VisToolEllipticalArc *visual = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
const VTranslateVars *trVars = qApp->TrVars();
visual->setObject1Id(elArc->GetCenter().id());

View File

@ -141,9 +141,9 @@ VToolSpline::~VToolSpline()
*/
void VToolSpline::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogSpline *dialogTool = qobject_cast<DialogSpline*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(id);
dialogTool->SetSpline(*spl);
dialogTool->SetColor(spl->GetColor());
@ -160,9 +160,9 @@ void VToolSpline::setDialog()
*/
VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
auto dialogTool = qobject_cast<DialogSpline*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
VSpline *spline = new VSpline(dialogTool->GetSpline());
@ -327,9 +327,9 @@ void VToolSpline::RemoveReferens()
*/
void VToolSpline::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
auto dialogTool = qobject_cast<DialogSpline*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const VSpline spl = dialogTool->GetSpline();
@ -352,7 +352,7 @@ void VToolSpline::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
VAbstractSpline::SaveOptions(tag, obj);
auto spl = qSharedPointerDynamicCast<VSpline>(obj);
SCASSERT(spl.isNull() == false);
SCASSERT(spl.isNull() == false)
SetSplineAttributes(tag, *spl);
}
@ -458,7 +458,7 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if (QGraphicsView *view = viewList.at(0))
{
VMainGraphicsScene *currentScene = qobject_cast<VMainGraphicsScene *>(scene());
SCASSERT(currentScene);
SCASSERT(currentScene)
const QPointF cursorPosition = currentScene->getScenePos();
view->ensureVisible(QRectF(cursorPosition.x()-5, cursorPosition.y()-5, 10, 10));
}
@ -503,7 +503,7 @@ void VToolSpline::SetVisualization()
if (not vis.isNull())
{
VisToolSpline *visual = qobject_cast<VisToolSpline *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
const QSharedPointer<VSpline> spl = VAbstractTool::data.GeometricObject<VSpline>(id);
visual->setObject1Id(spl->GetP1().id());
@ -589,7 +589,7 @@ void VToolSpline::RefreshGeometry()
//---------------------------------------------------------------------------------------------------------------------
void VToolSpline::SetSplineAttributes(QDomElement &domElement, const VSpline &spl)
{
SCASSERT(doc != nullptr);
SCASSERT(doc != nullptr)
doc->SetAttribute(domElement, AttrType, ToolType);
doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id());

View File

@ -151,9 +151,9 @@ VToolSplinePath::~VToolSplinePath()
*/
void VToolSplinePath::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogSplinePath *dialogTool = qobject_cast<DialogSplinePath*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
dialogTool->SetPath(*splPath);
dialogTool->SetColor(splPath->GetColor());
@ -170,9 +170,9 @@ void VToolSplinePath::setDialog()
VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogSplinePath *dialogTool = qobject_cast<DialogSplinePath*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
VSplinePath *path = new VSplinePath(dialogTool->GetPath());
for (qint32 i = 0; i < path->CountPoints(); ++i)
{
@ -390,7 +390,7 @@ void VToolSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
*/
void VToolSplinePath::AddPathPoint(VAbstractPattern *doc, QDomElement &domElement, const VSplinePoint &splPoint)
{
SCASSERT(doc != nullptr);
SCASSERT(doc != nullptr)
QDomElement pathPoint = doc->createElement(AttrPathPoint);
doc->SetAttribute(pathPoint, AttrPSpline, splPoint.P().id());
@ -436,9 +436,9 @@ void VToolSplinePath::RemoveReferens()
*/
void VToolSplinePath::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogSplinePath *dialogTool = qobject_cast<DialogSplinePath*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const VSplinePath splPath = dialogTool->GetPath();
for (qint32 i = 1; i <= splPath.CountSubSpl(); ++i)
@ -466,7 +466,7 @@ void VToolSplinePath::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &ob
VAbstractSpline::SaveOptions(tag, obj);
QSharedPointer<VSplinePath> splPath = qSharedPointerDynamicCast<VSplinePath>(obj);
SCASSERT(splPath.isNull() == false);
SCASSERT(splPath.isNull() == false)
SetSplinePathAttributes(tag, *splPath);
}
@ -578,7 +578,7 @@ void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if (QGraphicsView *view = viewList.at(0))
{
VMainGraphicsScene *currentScene = qobject_cast<VMainGraphicsScene *>(scene());
SCASSERT(currentScene);
SCASSERT(currentScene)
const QPointF cursorPosition = currentScene->getScenePos();
view->ensureVisible(QRectF(cursorPosition.x()-5, cursorPosition.y()-5, 10, 10));
}
@ -624,7 +624,7 @@ void VToolSplinePath::SetVisualization()
if (not vis.isNull())
{
VisToolSplinePath *visual = qobject_cast<VisToolSplinePath *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
visual->setPath(*splPath.data());

View File

@ -354,7 +354,7 @@ void VToolDoublePoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &o
if (obj->id() == p1id)
{
QSharedPointer<VPointF> point = qSharedPointerDynamicCast<VPointF>(obj);
SCASSERT(point.isNull() == false);
SCASSERT(point.isNull() == false)
doc->SetAttribute(tag, AttrName1, point->name());
doc->SetAttribute(tag, AttrMx1, qApp->fromPixel(point->mx()));
@ -363,7 +363,7 @@ void VToolDoublePoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &o
else if (obj->id() == p2id)
{
QSharedPointer<VPointF> point = qSharedPointerDynamicCast<VPointF>(obj);
SCASSERT(point.isNull() == false);
SCASSERT(point.isNull() == false)
doc->SetAttribute(tag, AttrName2, point->name());
doc->SetAttribute(tag, AttrMx2, qApp->fromPixel(point->mx()));

View File

@ -107,9 +107,9 @@ void VToolTrueDarts::FindPoint(const QPointF &baseLineP1, const QPointF &baseLin
//---------------------------------------------------------------------------------------------------------------------
void VToolTrueDarts::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogTrueDarts *dialogTool = qobject_cast<DialogTrueDarts*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p1 = VAbstractTool::data.GeometricObject<VPointF>(p1id);
const QSharedPointer<VPointF> p2 = VAbstractTool::data.GeometricObject<VPointF>(p2id);
@ -127,9 +127,9 @@ void VToolTrueDarts::setDialog()
VToolTrueDarts *VToolTrueDarts::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogTrueDarts *dialogTool = qobject_cast<DialogTrueDarts*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QString point1Name = dialogTool->GetFirstNewDartPointName();
const QString point2Name = dialogTool->GetSecondNewDartPointName();
@ -337,9 +337,9 @@ void VToolTrueDarts::RemoveReferens()
//---------------------------------------------------------------------------------------------------------------------
void VToolTrueDarts::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogTrueDarts *dialogTool = qobject_cast<DialogTrueDarts*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName1, dialogTool->GetFirstNewDartPointName());
doc->SetAttribute(domElement, AttrName2, dialogTool->GetSecondNewDartPointName());
@ -379,7 +379,7 @@ void VToolTrueDarts::SetVisualization()
if (not vis.isNull())
{
VisToolTrueDarts *visual = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(baseLineP1Id);
visual->setObject2Id(baseLineP2Id);

View File

@ -83,9 +83,9 @@ VToolCutArc::VToolCutArc(VAbstractPattern *doc, VContainer *data, const quint32
*/
void VToolCutArc::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetFormula(formula);
dialogTool->setArcId(curveCutId);
@ -102,9 +102,9 @@ void VToolCutArc::setDialog()
*/
VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QString pointName = dialogTool->getPointName();
QString formula = dialogTool->GetFormula();
const quint32 arcId = dialogTool->getArcId();
@ -213,9 +213,9 @@ void VToolCutArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
*/
void VToolCutArc::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId()));
@ -244,7 +244,7 @@ void VToolCutArc::SetVisualization()
if (not vis.isNull())
{
VisToolCutArc *visual = qobject_cast<VisToolCutArc *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(curveCutId);
visual->setLength(qApp->TrVars()->FormulaToUser(formula, qApp->Settings()->GetOsSeparator()));

View File

@ -86,9 +86,9 @@ VToolCutSpline::VToolCutSpline(VAbstractPattern *doc, VContainer *data, const qu
*/
void VToolCutSpline::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetFormula(formula);
dialogTool->setSplineId(curveCutId);
@ -106,9 +106,9 @@ void VToolCutSpline::setDialog()
VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene,
VAbstractPattern *doc, VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QString pointName = dialogTool->getPointName();
QString formula = dialogTool->GetFormula();
const quint32 splineId = dialogTool->getSplineId();
@ -213,9 +213,9 @@ void VToolCutSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
*/
void VToolCutSpline::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId()));
@ -244,7 +244,7 @@ void VToolCutSpline::SetVisualization()
if (not vis.isNull())
{
VisToolCutSpline *visual = qobject_cast<VisToolCutSpline *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(curveCutId);
visual->setLength(qApp->TrVars()->FormulaToUser(formula, qApp->Settings()->GetOsSeparator()));

View File

@ -90,9 +90,9 @@ VToolCutSplinePath::VToolCutSplinePath(VAbstractPattern *doc, VContainer *data,
*/
void VToolCutSplinePath::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetFormula(formula);
dialogTool->setSplinePathId(curveCutId);
@ -110,9 +110,9 @@ void VToolCutSplinePath::setDialog()
VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QString pointName = dialogTool->getPointName();
QString formula = dialogTool->GetFormula();
const quint32 splinePathId = dialogTool->getSplinePathId();
@ -146,7 +146,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString
VContainer *data, const Document &parse, const Source &typeCreation)
{
const auto splPath = data->GeometricObject<VAbstractCubicBezierPath>(splinePathId);
SCASSERT(splPath != nullptr);
SCASSERT(splPath != nullptr)
const qreal result = CheckFormula(_id, formula, data);
@ -155,9 +155,9 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString
VSplinePath *splPath2 = nullptr;
VPointF *p = VToolCutSplinePath::CutSplinePath(qApp->toPixel(result), splPath, pointName, &splPath1, &splPath2);
SCASSERT(splPath1 != nullptr);
SCASSERT(splPath2 != nullptr);
SCASSERT(p != nullptr);
SCASSERT(splPath1 != nullptr)
SCASSERT(splPath2 != nullptr)
SCASSERT(p != nullptr)
p->setMx(mx);
p->setMy(my);
@ -205,7 +205,7 @@ void VToolCutSplinePath::ShowVisualization(bool show)
VPointF *VToolCutSplinePath::CutSplinePath(qreal length, const QSharedPointer<VAbstractCubicBezierPath> &splPath,
const QString &pName, VSplinePath **splPath1, VSplinePath **splPath2)
{
SCASSERT(splPath != nullptr);
SCASSERT(splPath != nullptr)
QPointF spl1p2, spl1p3, spl2p2, spl2p3;
qint32 p1 = 0, p2 = 0;
@ -301,9 +301,9 @@ void VToolCutSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
*/
void VToolCutSplinePath::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId()));
@ -332,7 +332,7 @@ void VToolCutSplinePath::SetVisualization()
if (not vis.isNull())
{
VisToolCutSplinePath *visual = qobject_cast<VisToolCutSplinePath *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(curveCutId);
visual->setLength(qApp->TrVars()->FormulaToUser(formula, qApp->Settings()->GetOsSeparator()));

View File

@ -129,9 +129,9 @@ void VToolAlongLine::RemoveReferens()
*/
void VToolAlongLine::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
@ -208,7 +208,7 @@ void VToolAlongLine::setDialog()
{
SCASSERT(dialog != nullptr);
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetTypeLine(typeLine);
dialogTool->SetLineColor(lineColor);
@ -229,9 +229,9 @@ void VToolAlongLine::setDialog()
VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
QString formula = dialogTool->GetFormula();
const quint32 firstPointId = dialogTool->GetFirstPointId();
const quint32 secondPointId = dialogTool->GetSecondPointId();

View File

@ -127,9 +127,9 @@ QPointF VToolBisector::FindPoint(const QPointF &firstPoint, const QPointF &secon
*/
void VToolBisector::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetTypeLine(typeLine);
dialogTool->SetLineColor(lineColor);
@ -151,9 +151,9 @@ void VToolBisector::setDialog()
VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
QString formula = dialogTool->GetFormula();
const quint32 firstPointId = dialogTool->GetFirstPointId();
const quint32 secondPointId = dialogTool->GetSecondPointId();
@ -282,9 +282,9 @@ void VToolBisector::RemoveReferens()
*/
void VToolBisector::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
@ -323,7 +323,7 @@ void VToolBisector::SetVisualization()
if (not vis.isNull())
{
VisToolBisector *visual = qobject_cast<VisToolBisector *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(firstPointId);
visual->setObject2Id(basePointId);

View File

@ -91,10 +91,10 @@ VToolCurveIntersectAxis::~VToolCurveIntersectAxis()
//---------------------------------------------------------------------------------------------------------------------
void VToolCurveIntersectAxis::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
dialog->setModal(true);
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetTypeLine(typeLine);
dialogTool->SetLineColor(lineColor);
@ -109,9 +109,9 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMa
VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
SCASSERT(dialogTool);
SCASSERT(dialogTool)
const QString pointName = dialogTool->getPointName();
const QString typeLine = dialogTool->GetTypeLine();
const QString lineColor = dialogTool->GetLineColor();
@ -279,9 +279,9 @@ void VToolCurveIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *e
//---------------------------------------------------------------------------------------------------------------------
void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
@ -317,7 +317,7 @@ void VToolCurveIntersectAxis::SetVisualization()
if (not vis.isNull())
{
VisToolCurveIntersectAxis *visual = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(curveId);
visual->setAxisPointId(basePointId);
@ -446,8 +446,8 @@ void VToolCurveIntersectAxis::InitSegments(const GOType &curveType, qreal segLen
delete pC;
}
SCASSERT(splPath1 != nullptr);
SCASSERT(splPath2 != nullptr);
SCASSERT(splPath1 != nullptr)
SCASSERT(splPath2 != nullptr)
if (not VFuzzyComparePossibleNulls(segLength, -1))
{

View File

@ -91,10 +91,10 @@ VToolEndLine::~VToolEndLine()
*/
void VToolEndLine::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
dialog->setModal(true);
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetTypeLine(typeLine);
dialogTool->SetLineColor(lineColor);
@ -116,9 +116,9 @@ void VToolEndLine::setDialog()
VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
SCASSERT(dialogTool);
SCASSERT(dialogTool)
const QString pointName = dialogTool->getPointName();
const QString typeLine = dialogTool->GetTypeLine();
const QString lineColor = dialogTool->GetLineColor();
@ -219,9 +219,9 @@ void VToolEndLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
*/
void VToolEndLine::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
@ -257,7 +257,7 @@ void VToolEndLine::SetVisualization()
if (not vis.isNull())
{
VisToolEndLine *visual = qobject_cast<VisToolEndLine *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(basePointId);
visual->setLength(qApp->TrVars()->FormulaToUser(formulaLength, qApp->Settings()->GetOsSeparator()));

View File

@ -84,9 +84,9 @@ VToolHeight::VToolHeight(VAbstractPattern *doc, VContainer *data, const quint32
*/
void VToolHeight::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetTypeLine(typeLine);
dialogTool->SetLineColor(lineColor);
@ -107,9 +107,9 @@ void VToolHeight::setDialog()
*/
VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QString pointName = dialogTool->getPointName();
const QString typeLine = dialogTool->GetTypeLine();
const QString lineColor = dialogTool->GetLineColor();
@ -226,9 +226,9 @@ void VToolHeight::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
*/
void VToolHeight::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
@ -264,7 +264,7 @@ void VToolHeight::SetVisualization()
if (not vis.isNull())
{
VisToolHeight *visual = qobject_cast<VisToolHeight *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(basePointId);
visual->setLineP1Id(p1LineId);

View File

@ -77,10 +77,10 @@ VToolLineIntersectAxis::~VToolLineIntersectAxis()
//---------------------------------------------------------------------------------------------------------------------
void VToolLineIntersectAxis::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
dialog->setModal(true);
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetTypeLine(typeLine);
dialogTool->SetLineColor(lineColor);
@ -96,9 +96,9 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMain
VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
SCASSERT(dialogTool);
SCASSERT(dialogTool)
const QString pointName = dialogTool->getPointName();
const QString typeLine = dialogTool->GetTypeLine();
const QString lineColor = dialogTool->GetLineColor();
@ -275,9 +275,9 @@ void VToolLineIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *ev
//---------------------------------------------------------------------------------------------------------------------
void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
@ -316,7 +316,7 @@ void VToolLineIntersectAxis::SetVisualization()
if (not vis.isNull())
{
VisToolLineIntersectAxis *visual = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(firstPointId);
visual->setPoint2Id(secondPointId);

View File

@ -90,9 +90,9 @@ VToolNormal::VToolNormal(VAbstractPattern *doc, VContainer *data, const quint32
*/
void VToolNormal::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetTypeLine(typeLine);
dialogTool->SetFormula(formulaLength);
@ -112,9 +112,9 @@ void VToolNormal::setDialog()
*/
VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
QString formula = dialogTool->GetFormula();
const quint32 firstPointId = dialogTool->GetFirstPointId();
const quint32 secondPointId = dialogTool->GetSecondPointId();
@ -257,9 +257,9 @@ void VToolNormal::RemoveReferens()
*/
void VToolNormal::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
@ -298,7 +298,7 @@ void VToolNormal::SetVisualization()
if (not vis.isNull())
{
VisToolNormal *visual = qobject_cast<VisToolNormal *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(basePointId);
visual->setObject2Id(secondPointId);

View File

@ -92,9 +92,9 @@ VToolShoulderPoint::VToolShoulderPoint(VAbstractPattern *doc, VContainer *data,
*/
void VToolShoulderPoint::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetTypeLine(typeLine);
dialogTool->SetLineColor(lineColor);
@ -154,9 +154,9 @@ QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Li
VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
VContainer *data)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
SCASSERT(dialogTool);
SCASSERT(dialogTool)
QString formula = dialogTool->GetFormula();
const quint32 p1Line = dialogTool->GetP1Line();
const quint32 p2Line = dialogTool->GetP2Line();
@ -288,9 +288,9 @@ void VToolShoulderPoint::RemoveReferens()
*/
void VToolShoulderPoint::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
@ -329,7 +329,7 @@ void VToolShoulderPoint::SetVisualization()
if (not vis.isNull())
{
VisToolShoulderPoint *visual = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(visual != nullptr);
SCASSERT(visual != nullptr)
visual->setObject1Id(pShoulder);
visual->setLineP1Id(basePointId);

View File

@ -109,9 +109,9 @@ VToolBasePoint::~VToolBasePoint()
*/
void VToolBasePoint::setDialog()
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetData(p->name(), *p);
}
@ -121,7 +121,7 @@ VToolBasePoint *VToolBasePoint::Create(quint32 _id, const QString &nameActivPP,
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
const Document &parse, const Source &typeCreation)
{
SCASSERT(point != nullptr);
SCASSERT(point != nullptr)
quint32 id = _id;
if (typeCreation == Source::FromGui)
@ -229,7 +229,7 @@ QVariant VToolBasePoint::itemChange(QGraphicsItem::GraphicsItemChange change, co
{
// Ensure visible only small rect around a cursor
VMainGraphicsScene *currentScene = qobject_cast<VMainGraphicsScene *>(scene());
SCASSERT(currentScene);
SCASSERT(currentScene)
const QPointF cursorPosition = currentScene->getScenePos();
view->ensureVisible(QRectF(cursorPosition.x()-5, cursorPosition.y()-5, 10, 10));
}
@ -284,9 +284,9 @@ void VToolBasePoint::DeleteTool(bool ask)
*/
void VToolBasePoint::SaveDialog(QDomElement &domElement)
{
SCASSERT(dialog != nullptr);
SCASSERT(dialog != nullptr)
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
SCASSERT(dialogTool != nullptr);
SCASSERT(dialogTool != nullptr)
QPointF p = dialogTool->GetPoint();
QString name = dialogTool->getPointName();
doc->SetAttribute(domElement, AttrName, name);
@ -361,7 +361,7 @@ void VToolBasePoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj
VToolSinglePoint::SaveOptions(tag, obj);
QSharedPointer<VPointF> point = qSharedPointerDynamicCast<VPointF>(obj);
SCASSERT(point.isNull() == false);
SCASSERT(point.isNull() == false)
doc->SetAttribute(tag, AttrType, ToolType);
doc->SetAttribute(tag, AttrX, qApp->fromPixel(point->x()));

Some files were not shown because too many files have changed in this diff Show More