tweaking property names and visibilities

parent 26109aaf
......@@ -73,7 +73,7 @@ namespace campvis {
void PropertyCollectionWidget::setupWidget() {
_layout = new QVBoxLayout();
_layout->setSpacing(0);
_layout->setSpacing(8);
_layout->setMargin(0);
setLayout(_layout);
}
......
......@@ -72,11 +72,11 @@ namespace campvis {
_spinDomainRight->setSingleStep(0.01);
_gridLayout->addWidget(_spinDomainRight, 0, 2);
_btnFitDomainToImage = new QPushButton("Fit Intensity Domain to Image", _widget);
_gridLayout->addWidget(_btnFitDomainToImage, 1, 0, 1, 3);
_btnFitDomainToImage = new QPushButton("Fit", _widget);
_gridLayout->addWidget(_btnFitDomainToImage, 0, 3);
_btnEditTF = new QPushButton("Edit Transfer Function", _widget);
_gridLayout->addWidget(_btnEditTF, 2, 0, 1, 3);
_gridLayout->addWidget(_btnEditTF, 1, 1, 1, 3);
addWidget(_widget);
......
......@@ -42,9 +42,13 @@ namespace campvis {
, _texUnit(0)
, _maskImage(0)
{
_applyMask.s_changed.connect(this, &ProcessorDecoratorMasking::onPropertyChanged);
_maskID.setVisible(false);
_maskColor.setVisible(false);
}
ProcessorDecoratorMasking::~ProcessorDecoratorMasking() {
_applyMask.s_changed.disconnect(this);
delete _texUnit;
delete _maskImage;
}
......@@ -85,4 +89,11 @@ namespace campvis {
return "";
}
void ProcessorDecoratorMasking::onPropertyChanged(const AbstractProperty* p) {
if (p == &_applyMask) {
_maskID.setVisible(_applyMask.getValue());
_maskColor.setVisible(_applyMask.getValue());
}
}
}
......@@ -40,7 +40,7 @@
namespace campvis {
class ProcessorDecoratorMasking : public AbstractProcessorDecorator {
class ProcessorDecoratorMasking : public AbstractProcessorDecorator, public sigslot::has_slots<> {
public:
ProcessorDecoratorMasking();
virtual ~ProcessorDecoratorMasking();
......@@ -60,6 +60,10 @@ namespace campvis {
tgt::TextureUnit* _texUnit;
ScopedTypedData<RenderData>* _maskImage;
private:
void onPropertyChanged(const AbstractProperty* p);
};
}
......
......@@ -38,11 +38,11 @@ namespace campvis {
: AbstractProcessorDecorator()
, _enableShading("EnableShading", "Enable Shading", true, AbstractProcessor::INVALID_SHADER | AbstractProcessor::INVALID_RESULT)
, _centralDifferences("CentralDifferences", "Use Central instead of Forward Differences", false, AbstractProcessor::INVALID_SHADER | AbstractProcessor::INVALID_RESULT)
, _lightPosition("LightPosition", "Light Position", tgt::vec3(-8.f), tgt::vec3(-500.f), tgt::vec3(500.f), tgt::vec3(0.1f))
, _ambientColor("AmbientColor", "Ambient Light Color", tgt::vec3(0.5f), tgt::vec3(0.f), tgt::vec3(1.f))
, _lightPosition("LightPosition", "Light Position", tgt::vec3(-100.f), tgt::vec3(-500.f), tgt::vec3(500.f), tgt::vec3(1.f))
, _ambientColor("AmbientColor", "Ambient Light Color", tgt::vec3(0.4f), tgt::vec3(0.f), tgt::vec3(1.f))
, _diffuseColor("DiffuseColor", "Diffuse Light Color", tgt::vec3(0.75f), tgt::vec3(0.f), tgt::vec3(1.f))
, _specularColor("SpecularColor", "Specular Light Color", tgt::vec3(0.5f), tgt::vec3(0.f), tgt::vec3(1.f))
, _shininess("Shininess", "Specular Shininess", 4.f, 0.f, 64.f, 0.5f)
, _specularColor("SpecularColor", "Specular Light Color", tgt::vec3(0.6f), tgt::vec3(0.f), tgt::vec3(1.f))
, _shininess("Shininess", "Specular Shininess", 24.f, 0.f, 64.f, 0.5f)
, _attenuation("Attenuation", "Attenuation Factors", tgt::vec3(0.f), tgt::vec3(0.f), tgt::vec3(1.f))
, _lightUniformName(lightUniformName)
{
......
......@@ -48,9 +48,8 @@ namespace campvis {
, p_exitImageID("exitImageID", "Input Exit Points Image", "", DataNameProperty::READ)
, p_camera("camera", "Camera")
, p_transferFunction("TransferFunction", "Transfer Function", new SimpleTransferFunction(256))
, p_samplingRate("SamplingRate", "Sampling Rate", 2.f, 0.1f, 10.f, 0.1f)
, p_jitterEntryPoints("jitterEntryPoints", "Jitter Entry Points", true)
, p_jitterStepSizeMultiplier("jitterStepSizeMultiplier", "Jitter Step Size Multiplier", .5f, .1f, 1.f)
, p_samplingRate("SamplingRate", "Sampling Rate", 2.f, 0.1f, 10.f, 0.1f)
, _fragmentShaderFilename(fragmentShaderFileName)
, _shader(0)
, _bindEntryExitDepthTextures(bindEntryExitDepthTextures)
......@@ -61,9 +60,8 @@ namespace campvis {
addProperty(&p_exitImageID);
addProperty(&p_camera);
addProperty(&p_transferFunction);
addProperty(&p_samplingRate);
addProperty(&p_jitterEntryPoints);
addProperty(&p_jitterStepSizeMultiplier);
addProperty(&p_samplingRate);
}
RaycastingProcessor::~RaycastingProcessor() {
......@@ -107,7 +105,6 @@ namespace campvis {
_shader->setIgnoreUniformLocationError(true);
decorateRenderProlog(data, _shader);
_shader->setUniform("_viewportSizeRCP", 1.f / tgt::vec2(getEffectiveViewportSize()));
_shader->setUniform("_jitterEntryPoints", p_jitterEntryPoints.getValue());
_shader->setUniform("_jitterStepSizeMultiplier", p_jitterStepSizeMultiplier.getValue());
float samplingStepSize = 1.f / (p_samplingRate.getValue() * tgt::max(img->getSize()));
......
......@@ -106,9 +106,8 @@ namespace campvis {
CameraProperty p_camera; ///< Camera used for ray casting
TransferFunctionProperty p_transferFunction; ///< Transfer function
FloatProperty p_samplingRate; ///< Ray casting sampling rate
BoolProperty p_jitterEntryPoints; ///< Flag whether to jitter the entry points
FloatProperty p_jitterStepSizeMultiplier; ///< Step size multiplier for entry points jitter
FloatProperty p_samplingRate; ///< Ray casting sampling rate
protected:
/**
......
......@@ -35,7 +35,6 @@ out vec4 out_Color; ///< outgoing fragment color
#include "tools/transferfunction.frag"
uniform vec2 _viewportSizeRCP;
uniform bool _jitterEntryPoints;
uniform float _jitterStepSizeMultiplier;
// ray entry points
......@@ -73,8 +72,7 @@ vec4 raycastDRR(in vec3 entryPoint, in vec3 exitPoint) {
float tend = length(direction);
direction = normalize(direction);
if (_jitterEntryPoints)
jitterEntryPoint(entryPoint, direction, _samplingStepSize * _jitterStepSizeMultiplier);
jitterEntryPoint(entryPoint, direction, _samplingStepSize * _jitterStepSizeMultiplier);
while (t < tend) {
// compute sample position
......
......@@ -39,7 +39,6 @@ layout(location = 2) out vec4 out_FHN; ///< outgoing fragment first hit no
#include "tools/transferfunction.frag"
uniform vec2 _viewportSizeRCP;
uniform bool _jitterEntryPoints;
uniform float _jitterStepSizeMultiplier;
......@@ -92,8 +91,7 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords)
float tend = length(direction);
direction = normalize(direction);
if (_jitterEntryPoints)
jitterEntryPoint(entryPoint, direction, _samplingStepSize * _jitterStepSizeMultiplier);
jitterEntryPoint(entryPoint, direction, _samplingStepSize * _jitterStepSizeMultiplier);
while (t < tend) {
// compute sample position
......
......@@ -48,24 +48,26 @@ namespace campvis {
: VisualizationProcessor(viewportSizeProp)
, p_sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ)
, p_geometryID("geometryID", "Input Proxy Geometry ID", "proxygeometry", DataNameProperty::READ)
, p_mirrorID("mirrorID", "Input Mirror ID", "mirror", DataNameProperty::READ)
, p_geometryImageId("GeometryImageId", "Rendered Geometry to Integrate (optional)", "", DataNameProperty::READ)
, p_entryImageID("entryImageID", "Output Entry Points Image", "eep.entry", DataNameProperty::WRITE)
, p_exitImageID("exitImageID", "Output Exit Points Image", "eep.exit", DataNameProperty::WRITE)
, p_camera("camera", "Camera")
, p_enableMirror("enableMirror", "Enable Virtual Mirror Feature", false)
, p_enableMirror("enableMirror", "Enable Virtual Mirror Feature", false, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES)
, p_mirrorID("mirrorID", "Input Mirror ID", "", DataNameProperty::READ)
, _shader(0)
{
addDecorator(new ProcessorDecoratorMasking());
addProperty(&p_sourceImageID);
addProperty(&p_geometryID);
addProperty(&p_mirrorID);
addProperty(&p_geometryImageId);
addProperty(&p_entryImageID);
addProperty(&p_exitImageID);
addProperty(&p_camera);
addProperty(&p_enableMirror);
addProperty(&p_mirrorID);
p_mirrorID.setVisible(false);
decoratePropertyCollection(this);
}
......@@ -235,4 +237,9 @@ namespace campvis {
return getDecoratedHeader();
}
void EEPGenerator::updateProperties() {
p_mirrorID.setVisible(p_enableMirror.getValue());
HasPropertyCollection::updateProperties();
}
}
......@@ -80,7 +80,6 @@ namespace campvis {
DataNameProperty p_sourceImageID; ///< image ID for input image
DataNameProperty p_geometryID; ///< ID for input geometry
DataNameProperty p_mirrorID; ///< ID for input mirror geometry
DataNameProperty p_geometryImageId; ///< image ID for the optional rendered geometry to integrate into the EEP
DataNameProperty p_entryImageID; ///< image ID for output entry points image
DataNameProperty p_exitImageID; ///< image ID for output exit points image
......@@ -88,9 +87,12 @@ namespace campvis {
CameraProperty p_camera;
BoolProperty p_enableMirror; ///< Enable Virtual Mirror Feature
DataNameProperty p_mirrorID; ///< ID for input mirror geometry
protected:
/// \see HasProperyCollection::updateProperties()
virtual void updateProperties();
/**
* \see RaycastingProcessor::generateHeader()
......
......@@ -39,16 +39,19 @@ namespace campvis {
SimpleRaycaster::SimpleRaycaster(IVec2Property* viewportSizeProp)
: RaycastingProcessor(viewportSizeProp, "modules/vis/glsl/simpleraycaster.frag", true)
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_enableShadowing("EnableShadowing", "Enable Hard Shadows", false, AbstractProcessor::INVALID_SHADER)
, p_enableShadowing("EnableShadowing", "Enable Hard Shadows (Expensive!)", false, AbstractProcessor::INVALID_SHADER | AbstractProcessor::INVALID_PROPERTIES)
, p_shadowIntensity("ShadowIntensity", "Shadow Intensity", .5f, .0f, 1.f)
, p_enableAdaptiveStepsize("EnableAdaptiveStepSize", "Enable Adaptive Step Size", true, AbstractProcessor::INVALID_SHADER)
{
addDecorator(new ProcessorDecoratorShading());
addProperty(&p_targetImageID);
addProperty(&p_enableAdaptiveStepsize);
addProperty(&p_enableShadowing);
addProperty(&p_shadowIntensity);
addProperty(&p_enableAdaptiveStepsize);
p_shadowIntensity.setVisible(false);
decoratePropertyCollection(this);
}
......@@ -87,4 +90,9 @@ namespace campvis {
return toReturn;
}
void SimpleRaycaster::updateProperties() {
p_shadowIntensity.setVisible(p_enableShadowing.getValue());
HasPropertyCollection::updateProperties();
}
}
......@@ -75,6 +75,9 @@ namespace campvis {
protected:
/// \see HasProperyCollection::updateProperties()
virtual void updateProperties();
/// \see RaycastingProcessor::processImpl()
virtual void processImpl(DataContainer& data, ImageRepresentationGL::ScopedRepresentation& image);
......
......@@ -45,21 +45,39 @@ 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_pgProps("PGGProps", "Proxy Geometry Generator", AbstractProcessor::VALID)
, p_eepProps("EEPProps", "Entry/Exit Points Generator", AbstractProcessor::VALID)
, p_raycasterProps("RaycasterProps", "Raycaster", AbstractProcessor::VALID)
, _pgGenerator()
, _eepGenerator(viewportSizeProp)
, _raycaster(viewportSizeProp)
{
addProperty(&p_inputVolume);
addProperty(&p_camera);
// addProperty(&p_camera);
addProperty(&_raycaster.p_transferFunction);
addProperty(&_raycaster.p_samplingRate);
addProperty(&p_outputImage);
addProperty(_raycaster.getProperty("CentralDifferences"));
addProperty(_eepGenerator.getProperty("GeometryImageId"));
p_pgProps.addPropertyCollection(_pgGenerator);
_pgGenerator.p_sourceImageID.setVisible(false);
_pgGenerator.p_geometryID.setVisible(false);
addProperty(&p_pgProps);
p_eepProps.addPropertyCollection(_eepGenerator);
_eepGenerator.p_lqMode.setVisible(false);
_eepGenerator.p_camera.setVisible(false);
_eepGenerator.p_sourceImageID.setVisible(false);
_eepGenerator.p_geometryID.setVisible(false);
_eepGenerator.p_entryImageID.setVisible(false);
_eepGenerator.p_exitImageID.setVisible(false);
addProperty(&p_eepProps);
p_raycasterProps.addPropertyCollection(_raycaster);
_raycaster.p_lqMode.setVisible(false);
_raycaster.p_camera.setVisible(false);
_raycaster.p_sourceImageID.setVisible(false);
_raycaster.p_entryImageID.setVisible(false);
_raycaster.p_exitImageID.setVisible(false);
_raycaster.p_targetImageID.setVisible(false);
addProperty(&p_raycasterProps);
// setup shared properties
......
......@@ -84,6 +84,8 @@ namespace campvis {
CameraProperty p_camera;
DataNameProperty p_outputImage; ///< image ID for output image
MetaProperty p_pgProps; ///< MetaProperty for properties of the ProxyGeometryGenerator processor
MetaProperty p_eepProps; ///< MetaProperty for properties of the EEPGenerator processor
MetaProperty p_raycasterProps; ///< MetaProperty for properties of the raycasting processor
protected:
......
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