You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppFlowPost/GUIDialog/ColorMapperEditDialog.cpp

78 lines
2.5 KiB
C++

#include "ColorMapperEditDialog.h"
#include "ui_ColorMapperEditDialog.h"
#include "OperatorsInterface/ParaWidgetInterfaceOperator.h"
#include "PostGraphAdaptor/PostGraphObjectBase.h"
#include "PostGraphAdaptor/PostGraphObjectManager.h"
#include "PostGraphAdaptor/PostGraphProperty.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
#include "FITK_Interface/FITKInterfaceCFDPost/FITKAbstractCFDPostData.h"
namespace GUI
{
ColorMapperEditDialog::ColorMapperEditDialog(Interface::FITKAbstractCFDPostData* postData, EventOper::ParaWidgetInterfaceOperator* oper) :
GUIDialogBase(oper,"ColorMapperEditDialog", FITKAPP->getGlobalData()->getMainWindow()), _postData(postData)
{
_ui = new Ui::ColorMapperEditDialog();
_ui->setupUi(this);
setWindowTitle(tr("Color mapper edit"));
init();
}
ColorMapperEditDialog::~ColorMapperEditDialog()
{
if (_ui)delete _ui;
}
void ColorMapperEditDialog::init()
{
_ui->lineEdit_Name->setEnabled(false);
setDataToWidget();
}
void ColorMapperEditDialog::setDataToWidget()
{
if (_postData == nullptr)return;
QString name = _postData->getDataObjectName();
_ui->lineEdit_Name->setText(name);
int colorNum = _postData->getScalaraBarColorNum();
_ui->spinBox_Number->setValue(colorNum);
Interface::PostGraphObjectBase* postGraph = _postGraphManager->getGraphObjectBase(_postData);
if (postGraph == nullptr)return;
Interface::PostGraphProperty* postProperty = postGraph->getProperty();
if (postProperty == nullptr)return;
postProperty->getCurrentField(_type, _filedName, _componentIndex);
double range[2] = { 0,0 };
_postData->getRange(range, _type, _filedName, _componentIndex);
_ui->lineEdit_Min->setText(QString::number(range[0]));
_ui->lineEdit_Max->setText(QString::number(range[1]));
}
void ColorMapperEditDialog::on_pushButton_OK_clicked()
{
//int colorNum = _ui->spinBox_Number->value();
//double colorMin = _ui->lineEdit_Min->text().toDouble();
//double colorMax = _ui->lineEdit_Max->text().toDouble();
//_postData->setScalarBarColorNum(colorNum);
//_postData->setRange(colorMin, colorMax);
//_postData->update();
//if (_oper) {
// _oper->execProfession();
//}
//this->accept();
}
void ColorMapperEditDialog::on_pushButton_Cencel_clicked()
{
this->reject();
}
}