Commit 8fcbfb5b authored by Artur Grunau's avatar Artur Grunau
Browse files

NumericProperty: provide a default step value

Even though all integer-based properties derived from NumericProperty
used the same step value, T(1), it had to be specified when
instantiating them. To reduce boilerplate code in property
constructors, NumericProperty now uses T(1) as the default step value.
parent b625ea64
......@@ -47,7 +47,7 @@ namespace campvis {
DataContainerInspectorCanvas::DataContainerInspectorCanvas(QWidget* parent /*= 0*/)
: tgt::QtThreadedCanvas("DataContainer Inspector", tgt::ivec2(640, 480), tgt::GLCanvas::RGBA_BUFFER, parent, true)
, p_currentSlice("CurrentSlice", "Slice", -1, -1, -1, 1)
, p_currentSlice("CurrentSlice", "Slice", -1, -1, -1)
, p_transferFunction("TransferFunction", "Transfer Function", new Geometry1DTransferFunction(256, tgt::vec2(0.f, 1.f)))
, _dataContainer(0)
, _paintShader(0)
......
......@@ -64,8 +64,8 @@ namespace campvis {
, tgt::EventListener()
, _lqMode(false)
, _ignoreCanvasSizeUpdate(false)
, _canvasSize("CanvasSize", "Canvas Size", tgt::ivec2(128, 128), tgt::ivec2(1, 1), tgt::ivec2(4096, 4096), tgt::ivec2(1, 1))
, _effectiveRenderTargetSize("EffectiveRenderTargetSize", "Render Target Size", tgt::ivec2(128, 128), tgt::ivec2(1, 1), tgt::ivec2(4096, 4096), tgt::ivec2(1, 1))
, _canvasSize("CanvasSize", "Canvas Size", tgt::ivec2(128, 128), tgt::ivec2(1, 1), tgt::ivec2(4096, 4096))
, _effectiveRenderTargetSize("EffectiveRenderTargetSize", "Render Target Size", tgt::ivec2(128, 128), tgt::ivec2(1, 1), tgt::ivec2(4096, 4096))
, _renderTargetID("renderTargetID", "Render Target ID", "VisualizationPipeline.renderTarget", DataNameProperty::READ)
, _canvas(0)
{
......
......@@ -116,7 +116,7 @@ namespace campvis {
const T& value,
const T& minValue,
const T& maxValue,
const T& stepValue,
const T& stepValue = T(1),
int invalidationLevel = AbstractProcessor::INVALID_RESULT);
/**
......@@ -216,7 +216,9 @@ namespace campvis {
// = Template Implementation ======================================================================
template<typename T>
campvis::NumericProperty<T>::NumericProperty(const std::string& name, const std::string& title, const T& value, const T& minValue, const T& maxValue, const T& stepValue, int invalidationLevel /*= AbstractProcessor::INVALID_RESULT*/)
campvis::NumericProperty<T>::NumericProperty(const std::string& name, const std::string& title, const T& value,
const T& minValue, const T& maxValue, const T& stepValue /*= T(1)*/,
int invalidationLevel /*= AbstractProcessor::INVALID_RESULT*/)
: GenericProperty<T>(name, title, value, invalidationLevel)
, _minValue(minValue)
, _maxValue(maxValue)
......
......@@ -60,7 +60,7 @@ namespace campvis {
, p_sourcePath("SourcePath", "Source Files Path", "")
, p_targetPathColor("TargetPathColor", "Target Path Color Files", "")
, p_targetPathFuzzy("TargetPathFuzzy", "Target Path Fuzzy Files", "")
, p_range("Range", "Files Range", tgt::ivec2(0, 1), tgt::ivec2(0, 0), tgt::ivec2(10000, 10000), tgt::ivec2(1, 1))
, p_range("Range", "Files Range", tgt::ivec2(0, 1), tgt::ivec2(0, 0), tgt::ivec2(10000, 10000))
, p_execute("Execute", "Execute Batch Pipeline")
{
addProcessor(&_usReader);
......@@ -219,4 +219,4 @@ namespace campvis {
}
}
}
\ No newline at end of file
}
......@@ -68,7 +68,7 @@ namespace campvis {
, p_gradientImageID("GradientImageId", "Gradient Input Image", "", DataNameProperty::READ)
, p_confidenceImageID("ConfidenceImageId", "Confidence Map Input", "", DataNameProperty::READ)
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_sliceNumber("sliceNumber", "Slice Number", 0, 0, 0, 1)
, p_sliceNumber("sliceNumber", "Slice Number", 0, 0, 0)
, p_transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256))
, p_confidenceTF("ConfidenceTF", "Confidence to Uncertainty TF", new Geometry1DTransferFunction(256))
, p_view("View", "Image to Render", viewOptions, 12)
......
......@@ -38,7 +38,7 @@ namespace campvis {
: AbstractProcessor()
, p_inputID("InputID", "Input Image Series ID", "input", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES)
, p_outputID("OutputID", "Output Image ID", "output", DataNameProperty::WRITE)
, p_imageIndex("ImageIndex", "Image to Select", 0, 0, 0, 1)
, p_imageIndex("ImageIndex", "Image to Select", 0, 0, 0)
{
addProperty(&p_inputID);
addProperty(&p_outputID);
......
......@@ -53,8 +53,8 @@ namespace campvis {
LtfImageReader::LtfImageReader()
: AbstractProcessor()
, p_url("url", "Image URL", "")
, p_size("Size", "Image Size", tgt::ivec3(1), tgt::ivec3(1), tgt::ivec3(2048), tgt::ivec3(1))
, p_numChannels("NumChannels", "Number of Channels per Element", 1, 1, 9, 1)
, p_size("Size", "Image Size", tgt::ivec3(1), tgt::ivec3(1), tgt::ivec3(2048))
, p_numChannels("NumChannels", "Number of Channels per Element", 1, 1, 9)
, p_baseType("BaseType", "Base Type", baseTypeOptions, 7)
, p_targetImageID("targetImageName", "Target Image ID", "LtfImageReader.output", DataNameProperty::WRITE)
, p_imageOffset("ImageOffset", "Image Offset in mm", tgt::vec3(0.f), tgt::vec3(-10000.f), tgt::vec3(10000.f), tgt::vec3(0.1f))
......@@ -104,4 +104,4 @@ namespace campvis {
validate(INVALID_RESULT);
}
}
\ No newline at end of file
}
......@@ -56,10 +56,10 @@ namespace campvis {
RawImageReader::RawImageReader()
: AbstractProcessor()
, p_url("url", "Image URL", "")
, p_size("Size", "Image Size", tgt::ivec3(1), tgt::ivec3(1), tgt::ivec3(2048), tgt::ivec3(1))
, p_numChannels("NumChannels", "Number of Channels per Element", 1, 1, 9, 1)
, p_size("Size", "Image Size", tgt::ivec3(1), tgt::ivec3(1), tgt::ivec3(2048))
, p_numChannels("NumChannels", "Number of Channels per Element", 1, 1, 9)
, p_baseType("BaseType", "Base Type", baseTypeOptions, 7)
, p_offset("Offset", "Byte Offset", 0, 0, std::numeric_limits<int>::max(), 1)
, p_offset("Offset", "Byte Offset", 0, 0, std::numeric_limits<int>::max())
, p_endianness("Endianess", "Endianess", endianOptions, 2)
, p_targetImageID("targetImageName", "Target Image ID", "RawImageReader.output", DataNameProperty::WRITE)
, p_imageOffset("ImageOffset", "Image Offset in mm", tgt::vec3(0.f), tgt::vec3(-10000.f), tgt::vec3(10000.f), tgt::vec3(0.1f))
......@@ -94,4 +94,4 @@ namespace campvis {
validate(INVALID_RESULT);
}
}
\ No newline at end of file
}
......@@ -196,9 +196,9 @@ namespace campvis {
, p_sourceImageID("InputVolume", "Input Volume ID", "volume", DataNameProperty::READ)
, p_targetImageID("OutputGradients", "Output Gradient Volume ID", "gradients", DataNameProperty::WRITE)
, p_filterMode("FilterMode", "Filter Mode", filterModes, 6, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES)
, p_kernelSize("KernelSize", "Kernel Size", 3, 3, 15, 1)
, p_kernelSize("KernelSize", "Kernel Size", 3, 3, 15)
, p_sigma("Sigma", "Sigma", 1.f, .1f, 10.f, 0.1f)
, p_numberOfSteps("NumberOfSteps", "Number of Steps", 5, 1, 15, 1)
, p_numberOfSteps("NumberOfSteps", "Number of Steps", 5, 1, 15)
, p_timeStep("TimeStep", "Time Step", .0625, .001f, .12499f, 0.001f)
, p_conductance("Conductance", "Conductance", 1.f, .1f, 5.f, 0.1f)
{
......
......@@ -193,7 +193,7 @@ namespace campvis {
, p_sourceImageID("InputVolume", "Input Volume ID", "volume", DataNameProperty::READ)
, p_targetImageID("OutputGradients", "Output Gradient Volume ID", "gradients", DataNameProperty::WRITE)
, p_filterMode("FilterMode", "Filter Mode", filterModes, 2, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES)
, p_kernelSize("KernelSize", "Kernel Size", 3, 3, 15, 1)
, p_kernelSize("KernelSize", "Kernel Size", 3, 3, 15)
{
addProperty(&p_sourceImageID);
addProperty(&p_targetImageID);
......
......@@ -51,7 +51,7 @@ namespace campvis {
, p_sourceImageID("InputVolume", "Input Volume ID", "volume", DataNameProperty::READ)
, p_targetImageID("OutputGradients", "Output Gradient Volume ID", "gradients", DataNameProperty::WRITE)
, p_filterMode("FilterMode", "Filter Mode", filterModes, 2)
, p_kernelSize("KernelSize", "Kernel Size", 3, 3, 15, 1)
, p_kernelSize("KernelSize", "Kernel Size", 3, 3, 15)
, p_sigma("Sigma", "Sigma", 1.f, .1f, 10.f, 0.1f)
{
addProperty(&p_sourceImageID);
......
......@@ -171,7 +171,7 @@ namespace campvis {
, p_gamma("Gamma", "Gamma Parameter", .06f, .01f, 1.f, 0.01f)
, p_normalizeValues("NormalizeValues", "Normalize Values", false)
, p_solver("FilterMode", "Filter Mode", solvers, 4)
, p_numSteps("NumSteps", "Number of Solver Steps", 1000, 100, 5000, 1)
, p_numSteps("NumSteps", "Number of Solver Steps", 1000, 100, 5000)
, p_curvilinear("Curvilinear", "Curvilinear Transducer?", false)
, p_origin("PolarOrigin", "Polar Origin", tgt::vec2(0.f), tgt::vec2(-1000.f), tgt::vec2(1000.f), tgt::vec2(0.1f))
, p_angles("PolarAngles", "Polar Angles", tgt::vec2(0.f, 1.f), tgt::vec2(0.f), tgt::vec2(1000.f), tgt::vec2(0.1f))
......
......@@ -100,7 +100,7 @@ namespace campvis {
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_camera("Camera", "Camera")
, p_sweepNumber("sweepNumber", "SweepNumber", 0, 0, 0, 1, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES)
, p_frameNumber("sliceNumber", "Slice Number", 0, 0, 0, 1)
, p_frameNumber("sliceNumber", "Slice Number", 0, 0, 0)
, p_showConfidenceMap("ShowConfidenceMap", "Show Confidence Map", false)
, p_smoothButton("SmoothButton", "Smooth Tracking")
, p_transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256))
......
......@@ -45,9 +45,9 @@ namespace campvis {
: AbstractProcessor()
, p_sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ)
, p_geometryID("geometryID", "Output Geometry ID", "proxygeometry", DataNameProperty::WRITE)
, p_clipX("clipX", "X Axis Clip Coordinates", tgt::ivec2(0), tgt::ivec2(0), tgt::ivec2(0), tgt::ivec2(1))
, p_clipY("clipY", "Y Axis Clip Coordinates", tgt::ivec2(0), tgt::ivec2(0), tgt::ivec2(0), tgt::ivec2(1))
, p_clipZ("clipZ", "Z Axis Clip Coordinates", tgt::ivec2(0), tgt::ivec2(0), tgt::ivec2(0), tgt::ivec2(1))
, p_clipX("clipX", "X Axis Clip Coordinates", tgt::ivec2(0), tgt::ivec2(0), tgt::ivec2(0))
, p_clipY("clipY", "Y Axis Clip Coordinates", tgt::ivec2(0), tgt::ivec2(0), tgt::ivec2(0))
, p_clipZ("clipZ", "Z Axis Clip Coordinates", tgt::ivec2(0), tgt::ivec2(0), tgt::ivec2(0))
, _sourceTimestamp(0)
{
addProperty(&p_sourceImageID);
......
......@@ -56,11 +56,11 @@ namespace campvis {
, p_sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES)
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_sliceOrientation("SliceOrientation", "Slice Orientation", compositingOptions, 3)
, p_xSliceNumber("XSliceNumber", "X Slice Number", 0, 0, 0, 1)
, p_xSliceNumber("XSliceNumber", "X Slice Number", 0, 0, 0)
, p_xSliceColor("XSliceColor", "X Slice Color", tgt::vec4(1.f, 0.f, 0.f, 1.f), tgt::vec4(0.f), tgt::vec4(1.f), tgt::vec4(0.01f))
, p_ySliceNumber("YSliceNumber", "Y Slice Number", 0, 0, 0, 1)
, p_ySliceNumber("YSliceNumber", "Y Slice Number", 0, 0, 0)
, p_ySliceColor("YSliceColor", "Y Slice Color", tgt::vec4(0.f, 1.f, 0.f, 1.f), tgt::vec4(0.f), tgt::vec4(1.f), tgt::vec4(0.01f))
, p_zSliceNumber("ZSliceNumber", "Z Slice Number", 0, 0, 0, 1)
, p_zSliceNumber("ZSliceNumber", "Z Slice Number", 0, 0, 0)
, p_zSliceColor("ZSliceColor", "Z Slice Color", tgt::vec4(0.f, 0.f, 1.f, 1.f), tgt::vec4(0.f), tgt::vec4(1.f), tgt::vec4(0.01f))
, p_transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256))
, _shader(0)
......
......@@ -52,7 +52,7 @@ namespace campvis {
, p_sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ)
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_camera("Camera", "Camera")
, p_sliceNumber("sliceNumber", "Slice Number", 0, 0, 0, 1)
, p_sliceNumber("sliceNumber", "Slice Number", 0, 0, 0)
, p_transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256))
, _shader(0)
{
......
......@@ -47,7 +47,7 @@ namespace campvis {
, p_mirrorNormal("mirrorNormal", "Mirror Normal", tgt::vec3(0.f, 1.f, 0.f), tgt::vec3(-1.f), tgt::vec3(1.f),
tgt::vec3(0.001f), tgt::ivec3(3), AbstractProcessor::VALID)
, p_size("mirrorSize", "Mirror Size", 4.0f, 0.1f, 1000.0f, 0.1f)
, p_numVertices("Roundness", "Roundness", 16, 4, 128, 1)
, p_numVertices("Roundness", "Roundness", 16, 4, 128)
, p_poi("poi", "Point of Interest", tgt::vec3::zero, tgt::vec3(-100.f), tgt::vec3(1000.f), tgt::vec3(0.1f))
, p_camera("camera", "Camera")
{
......
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