Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 06ba6dde authored by Hossain Mahmud's avatar Hossain Mahmud
Browse files

Everything looks good for loading in DataContainerInspectorWidget. Cleaned up the code.

parent 75ec440c
......@@ -72,6 +72,7 @@ namespace campvis {
, _mainLayout(0)
, _infoWidget(0)
, _infoWidgetLayout(0)
, _propEditorWid(0)
{
setupGUI();
}
......@@ -96,6 +97,10 @@ namespace campvis {
}
}
DataContainer* DataContainerInspectorWidget::getDataContainer() {
return _dataContainer;
}
void DataContainerInspectorWidget::onDataContainerDataAdded(const std::string& key, const DataHandle& dh) {
// copy QtDataHandle because signal will be handled by a different thread an indefinite amount of time later:
emit dataContainerChanged(QString::fromStdString(key), QtDataHandle(dh));
......@@ -165,8 +170,6 @@ namespace campvis {
_btnSaveToFile = new QPushButton(tr("Save to File"), _infoWidget);
_infoWidgetLayout->addWidget(_btnSaveToFile);
// Added by Hossain Mahmud <mahmud@in.tum.de>
// Date: January 02, 2014
_btnLoadFile = new QPushButton(tr("Load File"), _infoWidget);
_infoWidgetLayout->addWidget(_btnLoadFile);
......@@ -352,6 +355,9 @@ namespace campvis {
_dataContainer = 0;
_dctWidget->update(0);
if(_propEditorWid != nullptr)
_propEditorWid->deinit();
}
void DataContainerInspectorWidget::onDCTWidgetSelectionModelSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected) {
......@@ -453,43 +459,14 @@ namespace campvis {
}
void DataContainerInspectorWidget::onBtnLoadFileClicked() {
QString dialogCaption = QString::fromStdString("Select the file");
QString directory;
std::string fileTobeRead;
directory = tr("");
const QString fileFilter = tr("All files (*)");
QString filename;
filename = QFileDialog::getOpenFileName(QWidget::parentWidget(), dialogCaption, directory, fileFilter);
if (! filename.isEmpty()) {
fileTobeRead = filename.toStdString();
//emit modified();
}
GenericImageReader *imgReader = new GenericImageReader();
imgReader->setURL(fileTobeRead);
PropertyEditorWidget *propEditorWid = new PropertyEditorWidget(this, nullptr); //_dctWidget->getTreeModel()
propEditorWid->setDataContainer(_dataContainer);
propEditorWid->setImageReader(imgReader);
propEditorWid->updatePropCollection();
//propEditorWid->_propCollectionWidget->updatePropCollection(imgReader, _dataContainer);
propEditorWid->setParentx(this);
//imgReader->setVisibibility(".mhd", true);
propEditorWid->setVisible(true);
//imgReader->process(*_dataContainer);
_dctWidget->update(_dataContainer); //use this here. or next statement
//this->setDataContainer(_dataContainer);
// delete previous PropertyEditor, then create a new one
// the final one will be deleted with deinit()
if(nullptr != _propEditorWid)
delete _propEditorWid;
_propEditorWid = new PropertyEditorWidget(this, nullptr);
_propEditorWid->setVisible(true);
}
void DataContainerInspectorWidget::onDataContainerUpdated(const QString&, QtDataHandle) {
this->_dctWidget->update(_dataContainer);
}
}
\ No newline at end of file
......@@ -57,6 +57,7 @@ namespace campvis {
class DataContainer;
class DataContainerTreeWidget;
class FaceGeometry;
class PropertyEditorWidget;
class DataContainerInspectorWidget : public QWidget, public sigslot::has_slots<> {
Q_OBJECT;
......@@ -72,13 +73,18 @@ namespace campvis {
* Destructor.
*/
~DataContainerInspectorWidget();
/**
* Set the DataContainer this widget is inspecting.
* \param dataContainer The DataContainer this widget shall inspect, may be 0.
*/
void setDataContainer(DataContainer* dataContainer);
/**
* Get the DataContainer this widget is inspecting.
*/
DataContainer* getDataContainer();
/**
* Slot called when _dataContainer has changed and emitted the s_dataAdded signal.
*/
......@@ -139,8 +145,6 @@ namespace campvis {
*/
void onBtnLoadFileClicked();
void onDataContainerUpdated(const QString&, QtDataHandle);
protected:
/**
* Setup the GUI stuff
......@@ -194,9 +198,11 @@ namespace campvis {
QWidget* _colorValWidget; ///< Widget that shows the color value in color
QPalette* _ColorValWidgetPalette; ///< Palette which will be used to colorize the color widget
QPushButton* _btnSaveToFile;
// Added by Hossain Mahmud <mahmud@in.tum.de>
// Date: January 02, 2014
QPushButton* _btnLoadFile;
PropertyEditorWidget* _propEditorWid;
static const std::string loggerCat_;
};
......
......@@ -52,6 +52,9 @@ namespace campvis {
StringPropertyWidget::~StringPropertyWidget() {
}
void StringPropertyWidget::setButtonLabel(const std::string& btnLabel) {
this->_btnLoadFile->setText(QString(btnLabel.c_str()));
}
void StringPropertyWidget::updateWidgetFromProperty() {
StringProperty* prop = static_cast<StringProperty*>(_property);
......
......@@ -51,6 +51,8 @@ namespace campvis {
*/
virtual ~StringPropertyWidget();
void setButtonLabel(const std::string& btnLabel);
protected:
/**
* Gets called when the property has changed, so that widget can update its state.
......
......@@ -62,21 +62,20 @@ namespace campvis {
const std::string PropertyEditorWidget::loggerCat_ = "CAMPVis.application.PropertyEditorWidget";
PropertyEditorWidget::PropertyEditorWidget(DataContainerInspectorWidget* treeModel, QWidget* parent)
PropertyEditorWidget::PropertyEditorWidget(DataContainerInspectorWidget* parentDataInspector, QWidget* parent)
: QWidget(parent)
, _inited(false)
, _dataContainer(0)
//, _dctWidget(0)
, _canvas(0)
//, _pcWidget(0)
, _mainLayout(0)
//, _infoWidget(0)
, _pipelinePropertiesScrollArea(0)
, _propCollectionWidget(0)
//, _infoWidgetLayout(0)
, _fileName("fileName", "Image URL", "")
{
_parent = treeModel;
_parent = parentDataInspector;
_dataContainer = _parent->getDataContainer();
_imgReader = new GenericImageReader();
_imgReader->setVisibibility(".mhd", true);
setupGUI();
}
......@@ -88,35 +87,14 @@ namespace campvis {
void PropertyEditorWidget::setDataContainer(DataContainer* dataContainer) {
if (_dataContainer != 0) {
//_dataContainer->s_dataAdded.disconnect(this);
}
_dataContainer = dataContainer;
//_dctWidget->update(dataContainer);
//updateInfoWidget();
if (_dataContainer != 0) {
//_dataContainer->s_dataAdded.connect(this, &PropertyEditorWidget::onDataContainerDataAdded);
}
}
void PropertyEditorWidget::setParentx(DataContainerInspectorWidget* parent) {
this->_parent = parent;
}
void PropertyEditorWidget::setImageReader (GenericImageReader* imgReader) {
this->_imgReader = imgReader;
}
void PropertyEditorWidget::updatePropCollection () {
this->_propCollectionWidget->updatePropCollection(this->_imgReader, this->_dataContainer);
}
void PropertyEditorWidget::onDataContainerDataAdded(const std::string& key, const DataHandle& dh) {
// copy QtDataHandle because signal will be handled by a different thread an indefinite amount of time later:
emit dataContainerChanged();
}
QSize PropertyEditorWidget::sizeHint() const {
return QSize(200, 300);
}
......@@ -136,20 +114,15 @@ namespace campvis {
this->installEventFilter(this);
// _btnBrowse = new StringPropertyWidget(&_fileName, this);
// _mainLayout->addWidget(_btnBrowse);
_propCollectionWidget = new PropertyCollectionWidget(_pipelinePropertiesScrollArea);
_mainLayout->addWidget(_propCollectionWidget);
//_mainLayout->addStretch();
this->_propCollectionWidget->updatePropCollection(this->_imgReader, this->_dataContainer);
_btnLoadFile = new QPushButton(tr("Load File"), this);
_mainLayout->addWidget(_btnLoadFile);
_btnCancel = new QPushButton(tr("Cancel"), this);
_mainLayout->addWidget(_btnCancel);
qRegisterMetaType<QtDataHandle>("QtDataHandle");
connect(
_btnCancel, SIGNAL(clicked()),
......@@ -157,16 +130,6 @@ namespace campvis {
connect(
_btnLoadFile, SIGNAL(clicked()),
this, SLOT(onBtnLoadFileClicked()));
connect(
this, SIGNAL(dataContainerChanged()),
this->_parent, SLOT(onDataContainerChanged(const QString&, QtDataHandle)));
/*
if (_dataContainer != 0) {
_dataContainer->s_dataAdded.connect(this, &PropertyEditorWidget::updateDataInspector);
}*/
//_fileName.addSharedProperty(&_imgReader->p_url);
}
void PropertyEditorWidget::updateColor(){
......@@ -178,57 +141,24 @@ namespace campvis {
float depth = _canvas->getCapturedDepth();
}
//QString PropertyEditorWidget::humanizeBytes(size_t numBytes) const {
// QString units[5] = { tr(" Bytes"), tr(" KB"), tr(" MB"), tr(" GB"), tr(" TB") };
// size_t index = 0;
// size_t remainder = 0;
// while (numBytes > 1024 && index < 4) {
// remainder = numBytes % 1024;
// numBytes /= 1024;
// ++index;
// }
// if (remainder != 0)
// return QString::number(numBytes) + "." + QString::number(remainder) + units[index];
// else
// return QString::number(numBytes) + units[index];
//}
void PropertyEditorWidget::init() {
//if (_canvas != 0)
//_canvas->init(this);
_inited = true;
}
void PropertyEditorWidget::deinit() {
_inited = false;
//if (_canvas != 0)
//_canvas->deinit();
//_pcWidget->updatePropCollection(0, 0);
if (_dataContainer != 0) {
//_dataContainer->s_dataAdded.disconnect(this);
}
//_dataContainer = 0;
//_dctWidget->update(0);
if(nullptr != _imgReader)
delete _imgReader;
}
void PropertyEditorWidget::onBtnCancelClicked() {
if(nullptr != _imgReader)
delete _imgReader;
this->close();
}
void PropertyEditorWidget::updateDataInspector(const std::string& key, const DataHandle&dh) {
//emit dataContainerChanged(QString::fromStdString(key), QtDataHandle(dh));
}
void PropertyEditorWidget::onBtnLoadFileClicked() {
_imgReader->process(*_dataContainer);
//emit dataContainerChanged();
this->_parent->setDataContainer(_dataContainer);
this->close();
}
......
......@@ -37,7 +37,6 @@
#include "application/gui/properties/stringpropertywidget.h"
#include "core/tools/opengljobprocessor.h"
#include "modules/io/processors/genericimagereader.h"
//#include "application/gui/datacontainertreewidget.h"
#include "application/gui/datacontainerinspectorwidget.h"
#include <QLabel>
......@@ -59,11 +58,6 @@ namespace tgt {
}
namespace campvis {
class AbstractPipeline;
//class DataContainerInspectorWidget;
//class DataContainer;
//class DataContainerTreeWidget;
//class FaceGeometry;
class PropertyEditorWidget : public QWidget, public sigslot::has_slots<> {
Q_OBJECT;
......@@ -85,21 +79,6 @@ namespace campvis {
* \param dataContainer The DataContainer this widget shall inspect, may be 0.
*/
void setDataContainer(DataContainer* dataContainer);
void setParentx(DataContainerInspectorWidget* parent);
void setImageReader (GenericImageReader* imgReader);
void updatePropCollection ();
/**
* Slot called when _dataContainer has changed and emitted the s_dataAdded signal.
*/
void onDataContainerDataAdded(const std::string&, const DataHandle&);
void updateDataInspector(const std::string&, const DataHandle&);
//void mousePressEvent(QMouseEvent*) {
// updateInfoWidget();
//}
/**
* Size hint for the default window size
......@@ -130,7 +109,6 @@ namespace campvis {
void updateDepth();
signals:
void dataContainerChanged();
private slots:
/**
......@@ -150,42 +128,27 @@ namespace campvis {
void setupGUI();
protected:
/**
* Returns a string with \a numBytes humanized (i.e. "numBytes/1024^n [KMG]Byte")
* \param numBytes Number of bytes to be converted.
* \return "numBytes/1024^n [KMG]Bytes
*/
//QString humanizeBytes(size_t numBytes) const;
bool _inited;
DataContainer* _dataContainer; ///< The DataContainer this widget is inspecting
//DataContainerTreeWidget* _dctWidget; ///< The TreeWidget showing the DataHandles in _dataContainer
DataContainerInspectorCanvas* _canvas; ///< The OpenGL canvas for rendering the DataContainer's contents
//PropertyCollectionWidget* _pcWidget;
QVBoxLayout* _mainLayout; ///< Layout for this widget
//QWidget* _infoWidget; ///< Widget showing the information about the selected QtDataHandle
QVBoxLayout* rightLayout; ///< Layout for the _infoWidget
QVBoxLayout* rightLayout; ///< Layout for the _infoWidget
QScrollArea* _pipelinePropertiesScrollArea; ///< Scroll area for _pipelinePropertiesWidget
//QWidget* _pipelinePropertiesWidget; ///< Widget showing the selected pipeline's properties
QScrollArea* _pipelinePropertiesScrollArea; ///< Scroll area for _pipelinePropertiesWidget
public:
protected:
//QPushButton* _btnBrowse;
StringPropertyWidget* _btnBrowse;
protected:
QPushButton* _btnCancel;
QPushButton* _btnLoadFile;
StringProperty _fileName;
PropertyCollectionWidget* _propCollectionWidget; ///< Widget for browsing the PropertyCollection of the selected pipeline/processor
GenericImageReader *_imgReader;
PropertyCollectionWidget* _propCollectionWidget; ///< Widget for browsing the PropertyCollection of the selected pipeline/processor
DataContainerInspectorWidget* _parent;
static const std::string loggerCat_;
private:
};
}
......
......@@ -45,15 +45,15 @@ namespace campvis {
: AbstractProcessor()
, p_url("url", "Image URL", "")
{
addProperty(&p_url);
p_url.s_changed.connect(this, &GenericImageReader::onUrlPropertyChanged);
this->addReader(new CsvdImageReader());
this->addReader(new LtfImageReader());
this->addReader(new MhdImageReader());
this->addReader(new RawImageReader());
this->addReader(new VtkImageReader());
addProperty(&p_url);
p_url.s_changed.connect(this, &GenericImageReader::onUrlPropertyChanged);
this->_ext = "";
this->_currentlyVisible = nullptr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment