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 f50e26e2 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Introducing MetaProperty and its widget, still buggy.

parent 25b57767
......@@ -51,6 +51,7 @@ SET(CampvisApplicationToBeMocced
gui/properties/floatpropertywidget.h
gui/properties/geometry1dtransferfunctioneditor.h
gui/properties/geometry2dtransferfunctioneditor.h
gui/properties/metapropertywidget.h
gui/properties/optionpropertywidget.h
gui/properties/propertycollectionwidget.h
gui/properties/simpletransferfunctioneditor.h
......
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universität München
// Boltzmannstr. 3, 85748 Garching b. München, Germany
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// The licensing of this softare is not yet resolved. Until then, redistribution in source or
// binary forms outside the CAMP chair is not permitted, unless explicitly stated in legal form.
// However, the names of the original authors and the above copyright notice must retain in its
// original state in any case.
//
// Legal disclaimer provided by the BSD license:
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ================================================================================================
#include "tgt/assert.h"
#include "metapropertywidget.h"
namespace campvis {
MetaPropertyWidget::MetaPropertyWidget(MetaProperty* property, DataContainer* dc, QWidget* parent /*= 0*/)
: AbstractPropertyWidget(property, true, parent)
, _pcw(0)
, _dc(dc)
{
tgtAssert(_dc != 0, "Pointer to DataContainer must not be 0.");
_pcw = new PropertyCollectionWidget(this);
_pcw->updatePropCollection(property, _dc);
addWidget(_pcw);
}
MetaPropertyWidget::~MetaPropertyWidget() {
}
void MetaPropertyWidget::updateWidgetFromProperty() {
}
}
\ No newline at end of file
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universität München
// Boltzmannstr. 3, 85748 Garching b. München, Germany
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// The licensing of this softare is not yet resolved. Until then, redistribution in source or
// binary forms outside the CAMP chair is not permitted, unless explicitly stated in legal form.
// However, the names of the original authors and the above copyright notice must retain in its
// original state in any case.
//
// Legal disclaimer provided by the BSD license:
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ================================================================================================
#ifndef METAPROPERTYWIDGET_H__
#define METAPROPERTYWIDGET_H__
#include "application/gui/properties/propertycollectionwidget.h"
#include "application/gui/properties/abstractpropertywidget.h"
#include "core/properties/metaproperty.h"
namespace campvis {
class DataContainer;
/**
* Widget for a Camera.
* For now just offering read-access.
*/
class MetaPropertyWidget : public AbstractPropertyWidget {
Q_OBJECT;
public:
/**
* Creates a new MetaPropertyWidget for the property \a property.
* \param property The property the widget shall handle
* \param parent Parent Qt widget
*/
MetaPropertyWidget(MetaProperty* property, DataContainer* dc, QWidget* parent = 0);
/**
* Destructor
*/
virtual ~MetaPropertyWidget();
protected:
/**
* Gets called when the property has changed, so that widget can update its state.
*/
virtual void updateWidgetFromProperty();
private:
PropertyCollectionWidget* _pcw;
DataContainer* _dc;
};
}
#endif // METAPROPERTYWIDGET_H__
......@@ -36,6 +36,7 @@
#include "application/gui/properties/datanamepropertywidget.h"
#include "application/gui/properties/intpropertywidget.h"
#include "application/gui/properties/floatpropertywidget.h"
#include "application/gui/properties/metapropertywidget.h"
#include "application/gui/properties/optionpropertywidget.h"
#include "application/gui/properties/stringpropertywidget.h"
#include "application/gui/properties/transferfunctionpropertywidget.h"
......@@ -108,6 +109,10 @@ namespace campvis {
return new TransferFunctionPropertyWidget(tester);
}
if (MetaProperty* tester = dynamic_cast<MetaProperty*>(property)) {
return new MetaPropertyWidget(tester, dc);
}
return 0;
}
......
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universität München
// Boltzmannstr. 3, 85748 Garching b. München, Germany
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// The licensing of this softare is not yet resolved. Until then, redistribution in source or
// binary forms outside the CAMP chair is not permitted, unless explicitly stated in legal form.
// However, the names of the original authors and the above copyright notice must retain in its
// original state in any case.
//
// Legal disclaimer provided by the BSD license:
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ================================================================================================
#include "metaproperty.h"
namespace campvis {
const std::string MetaProperty::loggerCat_ = "CAMPVis.core.datastructures.MetaProperty";
MetaProperty::MetaProperty(const std::string& name, const std::string& title, int invalidationLevel /*= AbstractProcessor::INVALID_RESULT*/)
: AbstractProperty(name, title, invalidationLevel)
{
}
MetaProperty::~MetaProperty() {
}
void MetaProperty::init() {
AbstractProperty::init();
initAllProperties();
}
void MetaProperty::deinit() {
deinitAllProperties();
AbstractProperty::deinit();
}
void MetaProperty::lock() {
AbstractProperty::lock();
lockAllProperties();
}
void MetaProperty::unlock() {
unlockAllProperties();
AbstractProperty::unlock();
}
void MetaProperty::onPropertyChanged(const AbstractProperty* prop) {
s_changed(prop);
}
void MetaProperty::addPropertyCollection(HasPropertyCollection& pc) {
PropertyCollection& c = pc.getProperties();
for (std::vector<AbstractProperty*>::const_iterator it = c.begin(); it != c.end(); ++it) {
addProperty(*it);
}
}
}
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universität München
// Boltzmannstr. 3, 85748 Garching b. München, Germany
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// The licensing of this softare is not yet resolved. Until then, redistribution in source or
// binary forms outside the CAMP chair is not permitted, unless explicitly stated in legal form.
// However, the names of the original authors and the above copyright notice must retain in its
// original state in any case.
//
// Legal disclaimer provided by the BSD license:
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ================================================================================================
#ifndef METAPROPERTY_H__
#define METAPROPERTY_H__
#include "core/properties/abstractproperty.h"
#include "core/properties/propertycollection.h"
namespace campvis {
/**
* Property wrapping around a bunch of other properties.
* Useful either for grouping properties or for wrapping around entire property collections.
*/
class MetaProperty : public AbstractProperty, public HasPropertyCollection {
public:
/**
* Creates a new MetaProperty
* \param name Property name (unchangable!)
* \param title Property title (e.g. used for GUI)
* \param invalidationLevel Invalidation level that this property triggers
*/
MetaProperty(const std::string& name, const std::string& title, int invalidationLevel = AbstractProcessor::INVALID_RESULT);
/**
* Virtual Destructor
**/
virtual ~MetaProperty();
/// \see AbstractProperty::init()
virtual void init();
/// \see AbstractProperty::deinit()
virtual void deinit();
/// \see AbstractProperty::lock()
virtual void lock();
/// \see AbstractProperty::unlock()
virtual void unlock();
/// \see HasPropertyCollection::onPropertyChanged
virtual void onPropertyChanged(const AbstractProperty* prop);
/**
* Adds all properties in \a pc to this meta property.
* \param pc PropertyCollection to add
*/
void addPropertyCollection(HasPropertyCollection& pc);
protected:
static const std::string loggerCat_;
};
}
#endif // METAPROPERTY_H__
......@@ -45,6 +45,7 @@ namespace campvis {
, p_inputVolume("InputVolume", "Input Volume", "", DataNameProperty::READ, AbstractProcessor::VALID)
, p_camera("Camera", "Camera", tgt::Camera(), AbstractProcessor::VALID)
, p_outputImage("OutputImage", "Output Image", "vr.output", DataNameProperty::WRITE, AbstractProcessor::VALID)
, p_raycasterProps("RaycasterProps", "Raycaster", AbstractProcessor::VALID)
, _pgGenerator()
, _eepGenerator(viewportSizeProp)
, _raycaster(viewportSizeProp)
......@@ -58,6 +59,9 @@ namespace campvis {
addProperty(_raycaster.getProperty("CentralDifferences"));
addProperty(_eepGenerator.getProperty("GeometryImageId"));
p_raycasterProps.addPropertyCollection(_raycaster);
addProperty(&p_raycasterProps);
// setup shared properties
p_inputVolume.addSharedProperty(&_pgGenerator.p_sourceImageID);
p_inputVolume.addSharedProperty(&_eepGenerator.p_sourceImageID);
......
......@@ -32,6 +32,7 @@
#include "core/pipeline/visualizationprocessor.h"
#include "core/properties/datanameproperty.h"
#include "core/properties/metaproperty.h"
#include "core/properties/numericproperty.h"
#include "modules/vis/processors/eepgenerator.h"
......@@ -83,6 +84,8 @@ namespace campvis {
CameraProperty p_camera;
DataNameProperty p_outputImage; ///< image ID for output image
MetaProperty p_raycasterProps; ///< MetaProperty for properties of the raycasting processor
protected:
/// Additional invalidation levels for this processor.
/// Not the most beautiful design though.
......
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