Robot: Apply clang format
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <QString>
|
||||
#include <QString>
|
||||
#endif
|
||||
|
||||
#include <Gui/Application.h>
|
||||
@@ -30,20 +30,20 @@
|
||||
#include <Gui/Document.h>
|
||||
#include <Gui/ViewProvider.h>
|
||||
|
||||
#include "ui_TaskEdge2TracParameter.h"
|
||||
#include "TaskEdge2TracParameter.h"
|
||||
#include "ui_TaskEdge2TracParameter.h"
|
||||
|
||||
|
||||
using namespace RobotGui;
|
||||
using namespace Gui;
|
||||
|
||||
TaskEdge2TracParameter::TaskEdge2TracParameter(Robot::Edge2TracObject *pcObject,QWidget *parent)
|
||||
TaskEdge2TracParameter::TaskEdge2TracParameter(Robot::Edge2TracObject* pcObject, QWidget* parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("Robot_Edge2Trac"),
|
||||
tr("TaskEdge2TracParameter"),
|
||||
true,
|
||||
parent),
|
||||
pcObject(pcObject),
|
||||
HideShowObj(nullptr)
|
||||
tr("TaskEdge2TracParameter"),
|
||||
true,
|
||||
parent)
|
||||
, pcObject(pcObject)
|
||||
, HideShowObj(nullptr)
|
||||
{
|
||||
// we need a separate container widget to add all controls to
|
||||
proxy = new QWidget(this);
|
||||
@@ -53,23 +53,26 @@ TaskEdge2TracParameter::TaskEdge2TracParameter(Robot::Edge2TracObject *pcObject,
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
QObject::connect(ui->pushButton_HideShow, &QPushButton::clicked, this, &TaskEdge2TracParameter::hideShow);
|
||||
QObject::connect(ui->doubleSpinBoxSizing, qOverload<double>(&QDoubleSpinBox::valueChanged),
|
||||
this, &TaskEdge2TracParameter::sizingValueChanged);
|
||||
QObject::connect(ui->checkBoxOrientation, &QCheckBox::toggled,
|
||||
this, &TaskEdge2TracParameter::orientationToggled);
|
||||
// clang-format off
|
||||
connect(ui->pushButton_HideShow, &QPushButton::clicked,
|
||||
this, &TaskEdge2TracParameter::hideShow);
|
||||
connect(ui->doubleSpinBoxSizing, qOverload<double>(&QDoubleSpinBox::valueChanged),
|
||||
this, &TaskEdge2TracParameter::sizingValueChanged);
|
||||
connect(ui->checkBoxOrientation, &QCheckBox::toggled,
|
||||
this, &TaskEdge2TracParameter::orientationToggled);
|
||||
// clang-format on
|
||||
|
||||
setHideShowObject();
|
||||
|
||||
}
|
||||
void TaskEdge2TracParameter::setHideShowObject()
|
||||
{
|
||||
HideShowObj = pcObject->Source.getValue();
|
||||
|
||||
if(HideShowObj){
|
||||
if (HideShowObj) {
|
||||
QString ObjectName = QString::fromUtf8(HideShowObj->Label.getValue());
|
||||
ui->lineEdit_ObjectName->setText(ObjectName);
|
||||
}else{
|
||||
}
|
||||
else {
|
||||
ui->lineEdit_ObjectName->setText(QString());
|
||||
}
|
||||
}
|
||||
@@ -78,12 +81,14 @@ void TaskEdge2TracParameter::hideShow()
|
||||
{
|
||||
setHideShowObject();
|
||||
|
||||
if(HideShowObj){
|
||||
if (HideShowObj) {
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
if(doc->getViewProvider(HideShowObj)->isVisible())
|
||||
if (doc->getViewProvider(HideShowObj)->isVisible()) {
|
||||
doc->getViewProvider(HideShowObj)->setVisible(false);
|
||||
else
|
||||
}
|
||||
else {
|
||||
doc->getViewProvider(HideShowObj)->setVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,18 +102,19 @@ void TaskEdge2TracParameter::orientationToggled(bool Value)
|
||||
pcObject->UseRotation.setValue(Value);
|
||||
}
|
||||
|
||||
void TaskEdge2TracParameter::setEdgeAndClusterNbr(int NbrEdges,int NbrClusters)
|
||||
void TaskEdge2TracParameter::setEdgeAndClusterNbr(int NbrEdges, int NbrClusters)
|
||||
{
|
||||
QPalette palette(QApplication::palette());
|
||||
QString text;
|
||||
QString text;
|
||||
|
||||
const int a=200,p=0;
|
||||
const int a = 200, p = 0;
|
||||
|
||||
// set the text and the background color for the Edges label
|
||||
if(NbrEdges > 0){
|
||||
palette.setBrush(QPalette::WindowText,QColor(p,a,p));
|
||||
}else{
|
||||
palette.setBrush(QPalette::WindowText,QColor(a,p,p));
|
||||
if (NbrEdges > 0) {
|
||||
palette.setBrush(QPalette::WindowText, QColor(p, a, p));
|
||||
}
|
||||
else {
|
||||
palette.setBrush(QPalette::WindowText, QColor(a, p, p));
|
||||
}
|
||||
|
||||
text = QString::fromLatin1("Edges: %1").arg(NbrEdges);
|
||||
@@ -116,18 +122,16 @@ void TaskEdge2TracParameter::setEdgeAndClusterNbr(int NbrEdges,int NbrClusters)
|
||||
ui->label_Edges->setText(text);
|
||||
|
||||
// set the text and the background color for the Clusters label
|
||||
if(NbrClusters == 1){
|
||||
palette.setBrush(QPalette::WindowText,QColor(p,a,p));
|
||||
}else{
|
||||
palette.setBrush(QPalette::WindowText,QColor(a,p,p));
|
||||
if (NbrClusters == 1) {
|
||||
palette.setBrush(QPalette::WindowText, QColor(p, a, p));
|
||||
}
|
||||
else {
|
||||
palette.setBrush(QPalette::WindowText, QColor(a, p, p));
|
||||
}
|
||||
|
||||
text = QString::fromLatin1("Cluster: %1").arg(NbrClusters);
|
||||
ui->label_Cluster->setPalette(palette);
|
||||
ui->label_Cluster->setText(text);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user