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 37ceee46 authored by Hossain Mahmud's avatar Hossain Mahmud
Browse files

stuck!

parent 4ac8964c
......@@ -278,6 +278,9 @@ namespace campvis {
//if (! _luaVmState->injectObjectPointerToTableField(pipeline, "campvis::AutoEvaluationPipeline *", "pipelines", name))
LERROR("Could not inject the pipeline into the Lua VM.");
if (! _luaVmState->injectObjectPointerToTableField(pipeline, "campvis::AutoEvaluationPipeline *", "pipelines", pipeline->getName()))
LERROR("Could not inject the pipeline into the Lua VM.");
_luaVmState->execString("inspect(pipelines)");
#endif
......
......@@ -56,6 +56,8 @@
#include <QFileDialog>
#include <QScrollArea>
#include "scripting/luagen/properties/propertyluafactory.h"
namespace campvis {
const std::string DataContainerInspectorWidget::loggerCat_ = "CAMPVis.application.DataContainerInspectorWidget";
......@@ -214,6 +216,10 @@ namespace campvis {
_pcWidget->updatePropCollection(_canvas, _dataContainer);
_pipelinePropertiesScrollArea->setWidget(_pcWidget);
PropertyCollectionLua *_pcLua = new PropertyCollectionLua();
_pcLua->updatePropCollection(_canvas, _dataContainer);
std::cout << _pcLua->getLuaScript();
_infoWidgetLayout->addWidget(_pipelinePropertiesScrollArea, 6, 0, 1, 2);
_mainLayout->addWidget(_infoWidget, 0, 1, 3, 1);
......
......@@ -33,6 +33,8 @@
#include "application/gui/datacontainerinspectorcanvas.h"
#include "application/gui/properties/propertycollectionwidget.h"
#include "scripting/luagen/properties/propertycollectionlua.h"
#include <QLabel>
#include <QWidget>
#include <QVBoxLayout>
......
......@@ -39,6 +39,12 @@
#include "modules/pipelinefactory.h"
#include <QScrollBar>
#include <QFileDialog>
#include <fstream>
#include "scripting/luagen/properties/propertycollectionlua.h"
#include "scripting/luagen/properties/abstractpropertylua.h"
namespace campvis {
......@@ -141,6 +147,20 @@ namespace campvis {
ui.scriptingConsoleDock->setVisible(false);
#endif
#ifdef CAMPVIS_HAS_SCRIPTING
_btnLuaLoad = new QPushButton("Load Script", _pipelinePropertiesWidget);
rightLayout->addWidget(_btnLuaLoad);
_btnLuaSave = new QPushButton("Save Script", _pipelinePropertiesWidget);
rightLayout->addWidget(_btnLuaSave);
connect(
_btnLuaLoad, SIGNAL(clicked()),
this, SLOT(onBtnLuaLoadClicked()));
connect(
_btnLuaSave, SIGNAL(clicked()),
this, SLOT(onBtnLuaSaveClicked()));
#else
#endif
_dcInspectorWidget = new DataContainerInspectorWidget();
this->populateMainMenu();
......@@ -167,6 +187,7 @@ namespace campvis {
_application->s_PipelinesChanged.connect(this, &MainWindow::onPipelinesChanged);
_application->s_DataContainersChanged.connect(this, &MainWindow::onDataContainersChanged);
}
void MainWindow::populateMainMenu() {
......@@ -235,11 +256,13 @@ namespace campvis {
}
emit updatePropCollectionWidget(ptr, &_selectedPipeline->getDataContainer());
}
else {
emit updatePropCollectionWidget(0, 0);
_selectedDataContainer = 0;
}
}
else {
emit updatePropCollectionWidget(0, 0);
......@@ -264,6 +287,62 @@ namespace campvis {
}
}
void MainWindow::onBtnLuaLoadClicked() {
#ifdef CAMPVIS_HAS_SCRIPTING
const QString dialogCaption = QString::fromStdString("Select File");
const QString directory = QString::fromStdString(".");
const QString fileFilter = tr("All files (*)");
QString filename = QFileDialog::getOpenFileName(QWidget::parentWidget(), dialogCaption, directory, fileFilter);
if (filename != nullptr && _application->getLuaVmState() != nullptr) {
std::ifstream file;
file.open(filename.toStdString());
if (!file.fail()) {
_application->getLuaVmState()->execString("local proc = pipelines[\"" +_selectedPipeline->getName()+"\"]");
std::string script;
while (!file.eof()) {
script = "";
std::getline(file, script);
if (script == "")
continue;
printf("%s\n", script.c_str());
//if (_application->getLuaVmState() != nullptr) {
_application->getLuaVmState()->execString(script.c_str());
//}
}
printf("Load lua script");
}
}
#endif
}
void MainWindow::onBtnLuaSaveClicked() {
#ifdef CAMPVIS_HAS_SCRIPTING
const QString dialogCaption = QString::fromStdString("Save File as");
const QString directory = QString::fromStdString(".");
const QString fileFilter = tr("All files (*)");
QString filename = QFileDialog::getSaveFileName(QWidget::parentWidget(), dialogCaption, directory, fileFilter);
if (filename != nullptr) {
PropertyCollectionLua *_pcLua = new PropertyCollectionLua();
if (_selectedProcessor != 0 && _selectedPipeline != 0) {
_pcLua->updatePropCollection(_selectedProcessor, &_selectedPipeline->getDataContainer());
std::string script = _pcLua->getLuaScript();
if (script != "") {
std::ofstream file;
file.open(filename.toStdString());
file << script.c_str();
file.close();
printf("Saved Lua script");
}
}
}
#endif
}
void MainWindow::onBtnShowDataContainerInspectorClicked() {
if (_selectedPipeline != 0) {
if (_dcInspectorWindow == 0) {
......
......@@ -112,7 +112,7 @@ namespace campvis {
* \param index Index of the selected item
*/
void onPipelineWidgetItemClicked(const QModelIndex& index);
/**
* Slot to be called when _btnExecute was clicked.
*/
......@@ -123,6 +123,16 @@ namespace campvis {
*/
void onBtnShowDataContainerInspectorClicked();
/**
* Slot to be called when _btnExecute was clicked.
*/
void onBtnLuaLoadClicked();
/**
* Slot to be called when _btnShowDataContainerInspector was clicked.
*/
void onBtnLuaSaveClicked();
/// Slot to be called when _btnPipelineFactory was clicked;
void onBtnPipelineFactoryClicked();
......@@ -191,6 +201,9 @@ namespace campvis {
LogViewerWidget* _logViewer; ///< Widget displaying log messages
ScriptingWidget* _scriptingConsoleWidget; ///< Widget showing the scripting console (if available)
QPushButton* _btnLuaLoad;
QPushButton* _btnLuaSave;
std::vector<QDockWidget*> _primaryDocks; ///< Docks located in top docking area of the main window
};
}
......
......@@ -33,8 +33,6 @@
#include <QPushButton>
namespace campvis {
PropertyCollectionWidget::PropertyCollectionWidget(QWidget* parent /*= 0*/)
: QWidget(parent)
, _propCollection(0)
......
......@@ -42,4 +42,8 @@ namespace campvis {
return _accessInfo;
}
void DataNameProperty::setAccessInfo(DataAccessInfo access) {
_accessInfo = access;
}
}
......@@ -67,6 +67,7 @@ namespace campvis {
* \return _accessInfo
*/
DataAccessInfo getAccessInfo() const;
void setAccessInfo(DataAccessInfo access);
protected:
......
%module microscopysegmentation
%include std_string.i
%import "core/bindings/campvis.i"
%{
#include "core/pipeline/autoevaluationpipeline.h"
#include "modules/microscopysegmentation/processors/microscopyimagesegmentation.h"
%}
namespace campvis {
class ContourObject {
public:
ContourObject(std::string name);
virtual ~ContourObject();
ContourObject* operator=(const campvis::ContourObject& rhs);
};
class MicroscopyImageSegmentation : public VisualizationProcessor, public HasProcessorDecorators, public tgt::EventListener {
public:
MicroscopyImageSegmentation(campvis::IVec2Property* viewportSizeProp, campvis::RaycastingProcessor* raycaster);
virtual ~MicroscopyImageSegmentation();
const std::string getName() const;
%immutable;
campvis::DataNameProperty p_inputVolume;
campvis::DataNameProperty p_outputImage;
%mutable;
};
}
......@@ -14,6 +14,7 @@
#include "scripting/luagen/properties/metapropertylua.h"
#include "scripting/luagen/properties/propertycollectionlua.h"
#include "scripting/luagen/properties/transferfunctionpropertylua.h"
namespace campvis {
......
......@@ -54,7 +54,7 @@ namespace campvis {
};
// explicitly instantiate template, so that it gets registered also over DLL boundaries.
template class PropertyLuaRegistrar<ButtonPropertyLua, ButtonProperty>;
//template class PropertyLuaRegistrar<ButtonPropertyLua, ButtonProperty>;
}
#endif // BUTTONPROPERTYLUA_H__
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
//
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
//
// ================================================================================================
#include "transferfunctionpropertylua.h"
#include "core/tools/stringutils.h"
namespace campvis {
TransferFunctionPropertyLua::TransferFunctionPropertyLua(TransferFunctionProperty* property, DataContainer* dataContainer /*= nullptr*/)
: AbstractPropertyLua(property, true, dataContainer)
, _editor(0)
{
}
TransferFunctionPropertyLua::~TransferFunctionPropertyLua() {
}
std::string TransferFunctionPropertyLua::getLuaScript() {
TransferFunctionProperty* prop = static_cast<TransferFunctionProperty*>(_property);
AbstractTransferFunction* tf = prop->getTF();
const tgt::vec2& domain = tf->getIntensityDomain();
std::string ret = "";
ret += "getProperty(\"" + _property->getName() + "\"):setIntensityDomain(tgt.vec2("
+ StringUtils::toString(domain.x) +", " + StringUtils::toString(domain.y) + "))";
return ret;
}
}
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
//
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
//
// ================================================================================================
#ifndef TRANSFERFUNCTIONPROPERTYLUA_H__
#define TRANSFERFUNCTIONPROPERTYLUA_H__
#include "abstractpropertylua.h"
#include "propertyluafactory.h"
#include "core/properties/transferfunctionproperty.h"
namespace campvis {
class AbstractTransferFunctionEditor;
/**
* Widget for a TransferFunctionProperty
*/
class TransferFunctionPropertyLua : public AbstractPropertyLua {
public:
/**
* Creates a new PropertyWidget for the property \a property.
* \param property The property the widget shall handle
* \param dataContainer DataContainer to use (optional), defaults to nullptr.
* \param parent Parent Qt widget
*/
TransferFunctionPropertyLua(TransferFunctionProperty* property, DataContainer* dataContainer = nullptr);
/**
* Destructor
*/
virtual ~TransferFunctionPropertyLua();
std::string getLuaScript();
private:
AbstractTransferFunctionEditor* _editor; ///< Transfer function editor
};
// explicitly instantiate template, so that it gets registered also over DLL boundaries.
template class PropertyLuaRegistrar<TransferFunctionPropertyLua, TransferFunctionProperty>;
}
#endif // TRANSFERFUNCTIONPROPERTYLUA_H__
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