예제 #1
0
VolumePort::VolumePort(PortDirection direction, const std::string& id, const std::string& guiName,
      bool allowMultipleConnections, Processor::InvalidationLevel invalidationLevel)
    : GenericPort<VolumeBase>(direction, id, guiName, allowMultipleConnections, invalidationLevel),
      VolumeObserver(),
      texFilterMode_("textureFilterMode_", "Texture Filtering"),
      texClampMode_("textureClampMode_", "Texture Clamp"),
      texBorderIntensity_("textureBorderIntensity", "Texture Border Intensity", 0.f)
{
    // add texture access properties for inports
    if (!isOutport()) {
        // volume texture filtering
        texFilterMode_.addOption("nearest", "Nearest",  GL_NEAREST);
        texFilterMode_.addOption("linear",  "Linear",   GL_LINEAR);
        texFilterMode_.selectByKey("linear");
        addProperty(texFilterMode_);

        // volume texture clamping
        texClampMode_.addOption("clamp",           "Clamp",             GL_CLAMP);
        texClampMode_.addOption("clamp-to-edge",   "Clamp to Edge",     GL_CLAMP_TO_EDGE);
        texClampMode_.addOption("clamp-to-border", "Clamp to Border",   GL_CLAMP_TO_BORDER);
        texClampMode_.selectByKey("clamp-to-edge");
        addProperty(texClampMode_);
        addProperty(texBorderIntensity_);

        // assign texture access properties to property group
        texFilterMode_.setGroupID(id);
        texClampMode_.setGroupID(id);
        texBorderIntensity_.setGroupID(id);
        setPropertyGroupGuiName(id, (isInport() ? "Inport: " : "Outport: ") + guiName);

        showTextureAccessProperties(false);
    }
}
예제 #2
0
CanvasRenderer::CanvasRenderer()
    : RenderProcessor()
    , canvasSize_("canvasSize", "Canvas Size", tgt::ivec2(256), tgt::ivec2(32), tgt::ivec2(2 << 12), Processor::VALID)
    , showCursor_("showCursor", "Show Cursor", true)
    , showFullScreen_("showFullScreen", "Show Fullscreen (F11)", false)
    , screenshotFilename_("screenshotFilename", "File", "Select file...","", "*.*", FileDialogProperty::SAVE_FILE, Processor::INVALID_PATH)
    , saveScreenshotButton_("saveScreenshot", "Save Screenshot")
    , canvas_(0)
    , shader_(0)
    , inport_(Port::INPORT, "image.input", "Image Input", false, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_ORIGIN)
    , errorTex_(0)
    , renderToImage_(false)
    , renderToImageFilename_("")
{
    addPort(inport_);
    addProperty(canvasSize_);

    addProperty(showCursor_);
    addProperty(showFullScreen_);

    addProperty(screenshotFilename_);
    addProperty(saveScreenshotButton_);
    screenshotFilename_.setGroupID("screenshot");
    saveScreenshotButton_.setGroupID("screenshot");
    setPropertyGroupGuiName("screenshot", "Screenshot");

    canvasSize_.onChange(CallMemberAction<CanvasRenderer>(this, &CanvasRenderer::sizePropChanged));
    showCursor_.onChange(CallMemberAction<CanvasRenderer>(this, &CanvasRenderer::boolPropertyChanged));
    showFullScreen_.onChange(CallMemberAction<CanvasRenderer>(this, &CanvasRenderer::boolPropertyChanged));
    saveScreenshotButton_.onChange(CallMemberAction<CanvasRenderer>(this, &CanvasRenderer::saveScreenshotClicked));
}
예제 #3
0
PlotFunctionSource::PlotFunctionSource():
    Processor()
    , outPort_(Port::OUTPORT,"PlotFunctionOutPort")
    , functionInput_("functionInput_","Function Input","x",Processor::VALID)
    , expressionNameInput_("expressionNameInput_","Expression-Name","f",Processor::VALID)
    , expressionText_("Expression Format","Expression Format",Processor::VALID)
    , selfDescription_("selfDescription","Custom Text","",Processor::VALID)
    , maxLength_("maxLength","Max Expression Length",200,1,1000,Processor::VALID)
    , pData_(0)
    , recalculate_("Calculate","Calculate")
{
    recalculate_.onChange(CallMemberAction<PlotFunctionSource>(this, &PlotFunctionSource::recalculate));
    addProperty(&functionInput_);
    addProperty(&expressionNameInput_);
    addProperty(&expressionText_);
    addProperty(&selfDescription_);
    addProperty(&maxLength_);
    addProperty(&recalculate_);
    addPort(&outPort_);

    expressionText_.addOption("full","Full Expression Text",static_cast<int>(PlotFunction::FULL));
    expressionText_.addOption("length","Defined Length",static_cast<int>(PlotFunction::MAXLENGTH));
    expressionText_.addOption("self","Self Defined Expression Name",static_cast<int>(PlotFunction::CUSTOM));
    expressionText_.addOption("name","Expression Name + (..)",static_cast<int>(PlotFunction::ONLYNAME));
    expressionText_.selectByValue(0);
    expressionText_.onChange(CallMemberAction<PlotFunctionSource>(this, &PlotFunctionSource::changeText));
    selfDescription_.setVisible(false);
    maxLength_.setVisible(false);

    expressionNameInput_.setGroupID("Expression Representation");
    expressionText_.setGroupID("Expression Representation");
    selfDescription_.setGroupID("Expression Representation");
    maxLength_.setGroupID("Expression Representation");
    setPropertyGroupGuiName("Expression Representation","Expression Representation");
}
예제 #4
0
PlotDataMerge::PlotDataMerge()
    :Processor()
    , outPort_(Port::OUTPORT,"PlotData.OutPort")
    , inPortFirst_(Port::INPORT,"PlotData.InPortFirst")
    , inPortSecond_(Port::INPORT,"PlotData.InPortSecond")
    , pFirstData_(0)
    , pSecondData_(0)
    , pDataOut_(0)
    , swapData_("swap", "Swap Data",Processor::VALID)
    , ignoreColumnLabel_("Ignore Columnlabels","Ignore Columnlabels",Processor::VALID)
    , maxTableColumnWidth_("Max Column Width","Max Column Width",0,0,500,Processor::VALID)
    , keyColumnColor_("Key-Column Color","Key-Column Color",tgt::vec4(200.0/255.0,200.0/255.0,200.0/255.0,1.0),
        tgt::vec4(0.0),tgt::vec4(1.0),Processor::VALID)
    , dataColumnColor_("Data-Column Color","Data-Column Color",tgt::vec4(240.0/255.0,240.0/255.0,240.0/255.0,1.0),
        tgt::vec4(0.0),tgt::vec4(1.0),Processor::VALID)
{
    swapData_.onChange(CallMemberAction<PlotDataMerge>(this, &PlotDataMerge::activateComputeButton));
    ignoreColumnLabel_.onChange(CallMemberAction<PlotDataMerge>(this, &PlotDataMerge::activateComputeButton));
    keyColumnColor_.onChange(CallMemberAction<PlotDataMerge>(this, &PlotDataMerge::updateView));
    dataColumnColor_.onChange(CallMemberAction<PlotDataMerge>(this, &PlotDataMerge::updateView));
    maxTableColumnWidth_.onChange(CallMemberAction<PlotDataMerge>(this, &PlotDataMerge::updateView));

    keyColumnColor_.setViews(Property::COLOR);
    dataColumnColor_.setViews(Property::COLOR);

    addPort(inPortFirst_);
    addPort(inPortSecond_);
    addPort(outPort_);

    addProperty(&swapData_);
    addProperty(&ignoreColumnLabel_);
    addProperty(maxTableColumnWidth_);

    addProperty(keyColumnColor_);
    addProperty(dataColumnColor_);

    setPropertyGroupGuiName("Input Configuration","Input Configuration");
    setPropertyGroupGuiName("Merge Parameter","Merge Parameter");
    swapData_.setGroupID("Input Configuration");
    ignoreColumnLabel_.setGroupID("Merge Parameter");

    setPropertyGroupGuiName("Widget-Configuration","Widget-Configuration");
    keyColumnColor_.setGroupID("Widget-Configuration");
    dataColumnColor_.setGroupID("Widget-Configuration");
    maxTableColumnWidth_.setGroupID("Widget-Configuration");
}
예제 #5
0
LinePlot::LinePlot()
    : PlotProcessor(PlotEntitySettings::LINE, false)
    , lineWidth_("lineWidth", "Line Width", 2.f, 1.f, 5.f)
    , pointSize_("pointSize", "Point Size", 2.f, 1.f, 9.f)
    , logXAxis_("logXAxes", "Logarithmic x Axis", false)
    , logYAxis_("logYAxes", "Logarithmic y Axis", false)
    , renderLineLabel_("renderLineLabel", "Line Labels", false)
    , dataList_(0)
    , pickingList_(0)
{
    plotEntitiesProp_.setGuiName("Line Data");
    addProperty(selectionPlaneColor_);
    addProperty(renderMousePosition_);
    addProperty(discreteStep_);
    addProperty(renderXHelperLines_);
    addProperty(renderYHelperLines_);
    addProperty(logXAxis_);
    addProperty(logYAxis_);
    addProperty(renderLineLabel_);
    addProperty(lineWidth_);
    addProperty(pointSize_);
    addProperty(xScaleStep_);
    addProperty(yScaleStep_);
    addProperty(marginLeft_);
    addProperty(marginRight_);
    addProperty(marginBottom_);
    addProperty(marginTop_);

    // group properties
    renderLineLabel_.setGroupID("line");
    lineWidth_.setGroupID("line");
    pointSize_.setGroupID("line");
    setPropertyGroupGuiName("line", "Line Settings");

    logXAxis_.setGroupID("axis");
    logYAxis_.setGroupID("axis");

    addEventProperty(eventHighlight_);
    addEventProperty(eventLabel_);
    addEventProperty(eventZoom_);
    addEventProperty(eventHighlightAdditive_);
    addEventProperty(eventLabelAdditive_);
    addEventProperty(eventZoomAdditive_);
    addEventProperty(mousePositionUpdateEvent_);
    addEventProperty(mouseEventEnterExit_);

    //if one of the following properties is changed we handle it like plot entities property is changed
    logXAxis_.onChange       (CallMemberAction<LinePlot>(this, &LinePlot::regenDisplayLists));
    logYAxis_.onChange       (CallMemberAction<LinePlot>(this, &LinePlot::regenDisplayLists));
    renderLineLabel_.onChange(CallMemberAction<LinePlot>(this, &LinePlot::regenDisplayLists));
    lineWidth_.onChange      (CallMemberAction<LinePlot>(this, &LinePlot::regenDisplayLists));
    pointSize_.onChange      (CallMemberAction<LinePlot>(this, &LinePlot::regenDisplayLists));
}
예제 #6
0
PlotFunctionDiscret::PlotFunctionDiscret()
    :Processor()
    , outPort_(Port::OUTPORT,"PlotData.OutPort")
    , inPort_(Port::INPORT,"PlotPort.PlotFunction.InPort")
    , dimensionsList_("DimensionsList_","Dimension List",Processor::VALID)
    , leftInterval_("leftInterval_","Left Interval",-5,-std::numeric_limits<float>::max(),std::numeric_limits<float>::max(),Processor::VALID)
    , rightInterval_("rightInterval_","Right Interval",5,-std::numeric_limits<float>::max(),std::numeric_limits<float>::max(),Processor::VALID)
    , steps_("Steps_","Stepwidth", 0.1f,0.0001f,10,Processor::VALID)
    , startDiscretization_("startDiscretization_","Discretize again")
    , numberofCalculations_("NumberofCalculations","Number of Calculations",0,0,std::numeric_limits<float>::max(),Processor::VALID)
    , pData_(0)
    , pDataOut_(0)
{
    dimensionsList_.onChange(CallMemberAction<PlotFunctionDiscret>(this, &PlotFunctionDiscret::choiceChange));
    leftInterval_.onChange(CallMemberAction<PlotFunctionDiscret>(this, &PlotFunctionDiscret::leftIntervalChange));
    rightInterval_.onChange(CallMemberAction<PlotFunctionDiscret>(this, &PlotFunctionDiscret::rightIntervalChange));
    steps_.onChange(CallMemberAction<PlotFunctionDiscret>(this, &PlotFunctionDiscret::intervalStepChange));
    startDiscretization_.onClick(CallMemberAction<PlotFunctionDiscret>(this,&PlotFunctionDiscret::calculate));
    addPort(inPort_);
    addPort(outPort_);

    addProperty(dimensionsList_);
    addProperty(leftInterval_);
    addProperty(rightInterval_);
    addProperty(steps_);
    addProperty(startDiscretization_);
    addProperty(numberofCalculations_);
    setPropertyGroupGuiName("Discretization","Discretization");
    dimensionsList_.setGroupID("Discretization");
    leftInterval_.setGroupID("Discretization");
    rightInterval_.setGroupID("Discretization");
    steps_.setGroupID("Discretization");
    startDiscretization_.setGroupID("Discretization");
    steps_.setNumDecimals(4);
    std::stringstream  optionText;
    std::stringstream  keyText;
    for (int i = 0; i < 26; ++i) {
        optionText.str("");
        optionText.clear();
        keyText.str("");
        keyText.clear();
        optionText << i+1 << " te Dimension";
        keyText << i+1 << " Column";
        dimensionsList_.addOption(keyText.str(),optionText.str(),i+1);
    }
    numberofCalculations_.setWidgetsEnabled(false);
    numberofCalculations_.setNumDecimals(0);
}
예제 #7
0
CubeMeshProxyGeometry::CubeMeshProxyGeometry()
    : Processor()
    , inport_(Port::INPORT, "volumehandle.volumehandle")
    , outport_(Port::OUTPORT, "proxygeometry.geometry")
    , enableClipping_("useClipping", "Enable Clipping", true)
    , clipRight_("rightClippingPlane", "Right clipping plane (x)", 0.f, 0.f, 1e5f)
    , clipLeft_("leftClippingPlane", "Left clipping plane (x)", 1e5f, 0.f, 1e5f)
    , clipFront_("frontClippingPlane", "Front clipping plane (y)", 0.f, 0.f, 1e5f)
    , clipBack_("backClippingPlane", "Back clipping plane (y)", 1e5f, 0.f, 1e5f)
    , clipBottom_("bottomClippingPlane", "Bottom clipping plane (z)", 0.f, 0.f, 1e5f)
    , clipTop_("topClippingPlane", "Top clipping plane (z)", 1e5f, 0.f, 1e5f)
    , resetClipPlanes_("resetClipPlanes", "Reset Planes")
    , geometry_(new MeshListGeometry())
{

    addPort(inport_);
    addPort(outport_);

    clipRight_.onChange(CallMemberAction<CubeMeshProxyGeometry>(this, &CubeMeshProxyGeometry::onClipRightChange));
    clipLeft_.onChange(CallMemberAction<CubeMeshProxyGeometry>(this, &CubeMeshProxyGeometry::onClipLeftChange));
    clipFront_.onChange(CallMemberAction<CubeMeshProxyGeometry>(this, &CubeMeshProxyGeometry::onClipFrontChange));
    clipBack_.onChange(CallMemberAction<CubeMeshProxyGeometry>(this, &CubeMeshProxyGeometry::onClipBackChange));
    clipBottom_.onChange(CallMemberAction<CubeMeshProxyGeometry>(this, &CubeMeshProxyGeometry::onClipBottomChange));
    clipTop_.onChange(CallMemberAction<CubeMeshProxyGeometry>(this, &CubeMeshProxyGeometry::onClipTopChange));
    enableClipping_.onChange(CallMemberAction<CubeMeshProxyGeometry>(this, &CubeMeshProxyGeometry::adjustClipPropertiesVisibility));
    resetClipPlanes_.onChange(CallMemberAction<CubeMeshProxyGeometry>(this, &CubeMeshProxyGeometry::resetClipPlanes));

    addProperty(enableClipping_);
    addProperty(clipRight_);
    addProperty(clipLeft_);
    addProperty(clipFront_);
    addProperty(clipBack_);
    addProperty(clipBottom_);
    addProperty(clipTop_);
    addProperty(resetClipPlanes_);

    clipRight_.setGroupID("clipping");
    clipLeft_.setGroupID("clipping");
    clipFront_.setGroupID("clipping");
    clipBack_.setGroupID("clipping");
    clipBottom_.setGroupID("clipping");
    clipTop_.setGroupID("clipping");
    resetClipPlanes_.setGroupID("clipping");
    setPropertyGroupGuiName("clipping", "Clipping Planes");
    adjustClipPropertiesVisibility();

    oldVolumeDimensions_ = tgt::ivec3(0,0,0);
}
예제 #8
0
BarPlot::BarPlot()
    : PlotProcessor(PlotEntitySettings::BAR, false)
    , barWidth_("barWidth", "Bar Width", 70, 1, 100)
    , shear_("shear", "Shear", tgt::vec2(35,70), tgt::vec2(0,0), tgt::vec2(100,100))
    , squeezeFactor_("squeezeFactor", "Squeeze Factor", 0.9,0.1,0.95)
    , barMode_("barMode", "Bar Mode")
{
    plotEntitiesProp_.setGuiName("Bar Data");
    barMode_.addOption("groupedBar", "Grouped Bar", PlotLibrary::GROUPED);
    barMode_.addOption("stackedBar", "Stacked Bar", PlotLibrary::STACKED);
    barMode_.addOption("mergedBar", "Merged Bar", PlotLibrary::MERGED);
    addProperty(barMode_);
    selectionProp_.setEnableZoomToFlags(false);
    addProperty(barWidth_);
    addProperty(shear_);
    addProperty(squeezeFactor_);
    squeezeFactor_.setVisible(false);
    addProperty(renderYHelperLines_);
    addProperty(yScaleStep_);
    addProperty(marginLeft_);
    addProperty(marginRight_);
    addProperty(marginBottom_);
    addProperty(marginTop_);

    // group properties
    barMode_.setGroupID("bar");
    barWidth_.setGroupID("bar");
    shear_.setGroupID("bar");
    squeezeFactor_.setGroupID("bar");
    setPropertyGroupGuiName("bar", "Bar Settings");

    addEventProperty(eventHighlight_);
    addEventProperty(eventLabel_);
    addEventProperty(eventHighlightAdditive_);
    addEventProperty(eventLabelAdditive_);

    barMode_.onChange(CallMemberAction<BarPlot>(this, &BarPlot::toggleProperties));
    barMode_.onChange(CallMemberAction<BarPlot>(this, &BarPlot::calcDomains));
}
예제 #9
0
GeometryRenderer::GeometryRenderer()
    : GeometryRendererBase()
    , inport_(Port::INPORT, "inport.geometry", "Geometry Input")
    , texPort_(Port::INPORT, "inport.texture", "Texture Input")
    , polygonMode_("polygonMode", "Polygon Mode")
    , lineWidth_("lineWidth", "Line Width", 1.f, 1.f, 20.f)
    , pointSize_("pointSize", "Point Size", 1.f, 1.f, 20.f)
    , mapTexture_("mapTexture", "Map Texture", false)
    , textureMode_("textureMode", "Texture Mode")
    , enableLighting_("enableLighting", "Enable Lighting", false)
    , lightPosition_("lightPosition", "Light Source Position", tgt::vec4(2.3f, 1.5f, 1.5f, 1.f), tgt::vec4(-10), tgt::vec4(10))
    , lightAmbient_("lightAmbient", "Ambient Light", tgt::Color(0.4f, 0.4f, 0.4f, 1.f))
    , lightDiffuse_("lightDiffuse", "Diffuse Light", tgt::Color(0.8f, 0.8f, 0.8f, 1.f))
    , lightSpecular_("lightSpecular", "Specular Light", tgt::Color(0.6f, 0.6f, 0.6f, 1.f))
    , materialShininess_("materialShininess", "Shininess", 60.f, 0.1f, 128.f)
    , useShader_("use.shader", "Use shader", false)
    , shaderProp_("geometry.prg", "Shader", "trianglemesh.frag", "trianglemesh.vert", "trianglemesh.geom")
    , enableClipping_("enable.clipping", "Enable on-the-fly clipping", false)
    , planeNormal_("plane.normal", "Clipping plane normal", tgt::vec3(0.f, 0.f, 1.f), tgt::vec3(-1.f), tgt::vec3(1.f))
    , planeDistance_("plane.distance", "Clipping plane distance", 0.f, -10000.f, 10000.f)
{
    addPort(inport_);
    addPort(texPort_);

    polygonMode_.addOption("point", "Point", GL_POINT);
    polygonMode_.addOption("line",  "Line",  GL_LINE);
    polygonMode_.addOption("fill",  "Fill",  GL_FILL);
    polygonMode_.select("fill");
    polygonMode_.onChange(CallMemberAction<GeometryRenderer>(this, &GeometryRenderer::updatePropertyVisibilities));
    addProperty(polygonMode_);

    addProperty(pointSize_);
    addProperty(lineWidth_);

    mapTexture_.onChange(CallMemberAction<GeometryRenderer>(this, &GeometryRenderer::updatePropertyVisibilities));
    textureMode_.addOption("modulate", "GL_MODULATE",  GL_MODULATE);
    textureMode_.addOption("replace",  "GL_REPLACE",   GL_REPLACE);
    textureMode_.addOption("decal",    "GL_DECAL",     GL_DECAL);
    textureMode_.addOption("blend",    "GL_BLEND",     GL_BLEND);
    textureMode_.selectByKey("replace");
    addProperty(mapTexture_);
    addProperty(textureMode_);

    enableLighting_.onChange(CallMemberAction<GeometryRenderer>(this, &GeometryRenderer::updatePropertyVisibilities));

    //lightPosition_.setViews(Property::View(Property::LIGHT_POSITION | Property::DEFAULT));
    lightAmbient_.setViews(Property::COLOR);
    lightDiffuse_.setViews(Property::COLOR);
    lightSpecular_.setViews(Property::COLOR);
    addProperty(enableLighting_);
    addProperty(lightPosition_);
    addProperty(lightAmbient_);
    addProperty(lightDiffuse_);
    addProperty(lightSpecular_);
    addProperty(materialShininess_);

    addProperty(useShader_);
    addProperty(shaderProp_);
    addProperty(enableClipping_);
    addProperty(planeNormal_);
    addProperty(planeDistance_);

    useShader_.onChange(CallMemberAction<GeometryRenderer>(this, &GeometryRenderer::updatePropertyVisibilities));
    enableClipping_.onChange(CallMemberAction<GeometryRenderer>(this, &GeometryRenderer::updatePropertyVisibilities));

    // assign lighting properties to property group
    lightPosition_.setGroupID("lighting");
    lightAmbient_.setGroupID("lighting");
    lightDiffuse_.setGroupID("lighting");
    lightSpecular_.setGroupID("lighting");
    materialShininess_.setGroupID("lighting");
    setPropertyGroupGuiName("lighting", "Lighting Parameters");

    updatePropertyVisibilities();
}
예제 #10
0
TransFuncOverlay::TransFuncOverlay()
    : ImageProcessor("image/compositor")
    , imageInport_(Port::INPORT, "image.in", "Image Inpput")
    , privatePort_(Port::OUTPORT, "private","Privateport")
    , outport_(Port::OUTPORT, "image.out", "Image Output")
    , fontProp_("voreen.fontprop", "Font:")
    , transferFunc_("transferFunction", "Transfer Function:")
    , renderPreIntegrationTable_("renderPreIntegrationTable", "Render Pre-Integration Table", false)
    , renderOverlay_("renderOverlay", "Render Overlay", true)
    , usePixelCoordinates_("usePixelCoordinates", "Move/Resize Overlay by ")
    , overlayBottomLeft_("overlayBottomLeft", "Overlay Bottom Left", tgt::ivec2(10), tgt::ivec2(-4096), tgt::ivec2(4096))
    , overlayDimensions_("overlayDimensions", "Overlay Dimensions", tgt::ivec2(100), tgt::ivec2(0), tgt::ivec2(4096))
    , overlayBottomLeftRelative_("overlayBottomLeftRelative", "Overlay Bottom Left (Relative)", tgt::vec2(0.05f), tgt::vec2(-1.f), tgt::vec2(1.f))
    , overlayDimensionsRelative_("overlayDimensionsRelative", "Overlay Dimensions (Relative)", tgt::vec2(0.25f), tgt::vec2(0.f), tgt::vec2(1.f))
    , overlayOpacity_("overlayOpacity", "Overlay Opacity", 1.f)
    , fontColor_("fontColor","Font Color", tgt::Color(0.f, 0.f, 0.f, 1.f))
    , scalingProp_("scalingProp","Scaling",1.f,0.01,10000.f)
    , tfUnit_("tfUnit","Unit (max 7 Chars)","")
    , renderBorder_("renderBorder", "Render Border", true)
    , borderWidth_("borderWidth", "Border Width", 2.f, 0.1f, 10.f)
    , borderColor_("borderColor", "Border Color", tgt::Color(0.f, 0.f, 0.f, 1.f))
    , copyShader_(0)
{
    borderColor_.setViews(Property::COLOR);
    fontColor_.setViews(Property::COLOR);
    addPort(imageInport_);
    addPrivateRenderPort(&privatePort_);
    addPort(outport_);

    addProperty(fontProp_);
       fontProp_.setVisible(false);
    addProperty(transferFunc_);
    addProperty(renderPreIntegrationTable_);

    addProperty(renderOverlay_);
    renderOverlay_.setGroupID("general");
    addProperty(overlayOpacity_);
    overlayOpacity_.setGroupID("general");
    addProperty(usePixelCoordinates_);
    usePixelCoordinates_.setGroupID("general");
    usePixelCoordinates_.addOption("true","Pixel Coordinates",true);
    usePixelCoordinates_.addOption("false","Resative Position",false);
    usePixelCoordinates_.select("true");
    usePixelCoordinates_.onChange(CallMemberAction<TransFuncOverlay>(this, &TransFuncOverlay::onChangeUsePixelCoordinates));
    setPropertyGroupGuiName("general","General");

    addProperty(overlayBottomLeft_);
    overlayBottomLeft_.setGroupID("overlayAbs");
    addProperty(overlayDimensions_);
    overlayDimensions_.setGroupID("overlayAbs");

    addProperty(overlayBottomLeftRelative_);
    overlayBottomLeftRelative_.setGroupID("overlayPer");
    addProperty(overlayDimensionsRelative_);
    overlayDimensionsRelative_.setGroupID("overlayPer");

    setPropertyGroupGuiName("overlayAbs","Overlay Options (absolute)");
    setPropertyGroupGuiName("overlayPer","Overlay Options (relative)");

    addProperty(fontColor_);
    fontColor_.setGroupID("overlay settings");
    addProperty(tfUnit_);
    tfUnit_.setGroupID("overlay settings");
    addProperty(scalingProp_);
    scalingProp_.setGroupID("overlay settings");
    addProperty(renderBorder_);
    renderBorder_.setGroupID("overlay settings");
    addProperty(borderWidth_);
    borderWidth_.setGroupID("overlay settings");
    addProperty(borderColor_);
    borderColor_.setGroupID("overlay settings");
    setPropertyGroupGuiName("overlay settings","Overlay Settings");

    onChangeUsePixelCoordinates();
    //privatePort_.resize(ppSizeX_,ppSizeY_);
}
예제 #11
0
PlotDataFitFunction::PlotDataFitFunction()
    :Processor()
    , outPort_(Port::OUTPORT,"PlotData.OutPort")
    , inPort_(Port::INPORT,"PlotData.InPort")
    , pData_(0)
    , pDataOut_(0)
    , ignoreFalseValues_("Ignore False Values","Ignore False Values",true)
    , expressionNameInput_("expressionNameInput_","Expression-Name","f",Processor::VALID)
    , expressionText_("Expression Format","Expression Format",Processor::VALID)
    , selfDescription_("selfDescription","Custom Text","",Processor::VALID)
    , maxLength_("maxLength","Max Expression Length",200,1,1000,Processor::VALID)
    , recalculate_("recalculate","recalculate",Processor::VALID)
    , maxTableColumnWidth_("Max Column Width","Max Column Width",0,0,500,Processor::VALID)
    , keyColumnColor_("Key-Column Color","Key-Column Color",tgt::vec4(200.0/255.0,200.0/255.0,200.0/255.0,1.0),
        tgt::vec4(0.0),tgt::vec4(1.0),Processor::VALID)
    , dataColumnColor_("Data-Column Color","Data-Column Color",tgt::vec4(240.0/255.0,240.0/255.0,240.0/255.0,1.0),
        tgt::vec4(0.0),tgt::vec4(1.0),Processor::VALID)
    , fittingColumnColor_("Fitting-Column Color","Fitting-Column Color",tgt::vec4(1.0,180.0/255.0,142.0/255.0,1.0),
        tgt::vec4(0.0),tgt::vec4(1.0),Processor::VALID)
{
    keyColumnColor_.onChange(CallMemberAction<PlotDataFitFunction>(this, &PlotDataFitFunction::updateView));
    dataColumnColor_.onChange(CallMemberAction<PlotDataFitFunction>(this, &PlotDataFitFunction::updateView));
    fittingColumnColor_.onChange(CallMemberAction<PlotDataFitFunction>(this, &PlotDataFitFunction::updateView));
    maxTableColumnWidth_.onChange(CallMemberAction<PlotDataFitFunction>(this, &PlotDataFitFunction::updateView));
    maxTableColumnWidth_.onChange(CallMemberAction<PlotDataFitFunction>(this, &PlotDataFitFunction::updateView));
    recalculate_.onChange(CallMemberAction<PlotDataFitFunction>(this, &PlotDataFitFunction::recalculate));

    fittingValues_.column = -1;
    fittingValues_.regressionType = FunctionLibrary::NOREGRESSION;
    fittingValues_.dimension = 2;
    fittingValues_.mse = -2;

    keyColumnColor_.setViews(Property::COLOR);
    dataColumnColor_.setViews(Property::COLOR);
    fittingColumnColor_.setViews(Property::COLOR);

    addPort(inPort_);
    addPort(outPort_);

    addProperty(ignoreFalseValues_);

    addProperty(expressionNameInput_);
    addProperty(expressionText_);
    addProperty(selfDescription_);
    addProperty(maxLength_);
    addProperty(recalculate_);

    addProperty(maxTableColumnWidth_);

    addProperty(keyColumnColor_);
    addProperty(dataColumnColor_);
    addProperty(fittingColumnColor_);

    setPropertyGroupGuiName("Fitting-Options","Fitting-Options");
    setPropertyGroupGuiName("Widget-Configuration","Widget-Configuration");
    setPropertyGroupGuiName("Expression Representation","Expression Representation");
    ignoreFalseValues_.setGroupID("Fitting-Options");
    keyColumnColor_.setGroupID("Widget-Configuration");
    dataColumnColor_.setGroupID("Widget-Configuration");
    fittingColumnColor_.setGroupID("Widget-Configuration");
    maxTableColumnWidth_.setGroupID("Widget-Configuration");
    expressionNameInput_.setGroupID("Expression Representation");
    expressionText_.setGroupID("Expression Representation");
    selfDescription_.setGroupID("Expression Representation");
    maxLength_.setGroupID("Expression Representation");

    expressionText_.addOption("full","Full Expression Text",static_cast<int>(PlotFunction::FULL));
    expressionText_.addOption("length","Defined Length",static_cast<int>(PlotFunction::MAXLENGTH));
    expressionText_.addOption("self","Self Defined Expression Name",static_cast<int>(PlotFunction::CUSTOM));
    expressionText_.addOption("name","Expression Name + (..)",static_cast<int>(PlotFunction::ONLYNAME));
    expressionText_.selectByValue(0);
    expressionText_.onChange(CallMemberAction<PlotDataFitFunction>(this, &PlotDataFitFunction::changeText));
    selfDescription_.setVisible(false);
    maxLength_.setVisible(false);

}
예제 #12
0
SingleVolumeRaycaster::SingleVolumeRaycaster()
    : VolumeRaycaster()
    , volumeInport_(Port::INPORT, "volumehandle.volumehandle", "Volume Input", false, Processor::INVALID_PROGRAM)
    , entryPort_(Port::INPORT, "image.entrypoints", "Entry-points Input", false, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_ORIGIN)
    , exitPort_(Port::INPORT, "image.exitpoints", "Exit-points Input", false, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_ORIGIN)
    , outport_(Port::OUTPORT, "image.output", "Image Output", true, Processor::INVALID_PROGRAM, RenderPort::RENDERSIZE_RECEIVER)
    , outport1_(Port::OUTPORT, "image.output1", "Image1 Output", true, Processor::INVALID_PROGRAM, RenderPort::RENDERSIZE_RECEIVER)
    , outport2_(Port::OUTPORT, "image.output2", "Image2 Output", true, Processor::INVALID_PROGRAM, RenderPort::RENDERSIZE_RECEIVER)
    , shaderProp_("raycast.prg", "Raycasting Shader", "rc_singlevolume.frag", "passthrough.vert")
    , transferFunc_("transferFunction", "Transfer Function")
    , camera_("camera", "Camera", tgt::Camera(vec3(0.f, 0.f, 3.5f), vec3(0.f, 0.f, 0.f), vec3(0.f, 1.f, 0.f)))
    , compositingMode1_("compositing1", "Compositing (OP2)", Processor::INVALID_PROGRAM)
    , compositingMode2_("compositing2", "Compositing (OP3)", Processor::INVALID_PROGRAM)
    , gammaValue_("gammaValue", "Gamma Value (OP1)", 0, -1, 1)
    , gammaValue1_("gammaValue1", "Gamma Value (OP2)", 0, -1, 1)
    , gammaValue2_("gammaValue2", "Gamma Value (OP3)", 0, -1, 1)
{
    // ports
    volumeInport_.addCondition(new PortConditionVolumeTypeGL());
    volumeInport_.showTextureAccessProperties(true);
    addPort(volumeInport_);
    addPort(entryPort_);
    addPort(exitPort_);
    addPort(outport_);
    addPort(outport1_);
    addPort(outport2_);

    addProperty(shaderProp_);

    // shading / classification props
    addProperty(transferFunc_);
    addProperty(camera_);
    addProperty(gradientMode_);
    addProperty(classificationMode_);
    addProperty(shadeMode_);

    gammaValue_.setTracking(true);
    addProperty(gammaValue_);
    gammaValue1_.setTracking(true);
    addProperty(gammaValue1_);
    gammaValue2_.setTracking(true);
    addProperty(gammaValue2_);

    // compositing modes
    addProperty(compositingMode_);
    compositingMode1_.addOption("dvr", "DVR");
    compositingMode1_.addOption("mip", "MIP");
    compositingMode1_.addOption("mida", "MIDA");
    compositingMode1_.addOption("iso", "ISO");
    compositingMode1_.addOption("fhp", "FHP");
    compositingMode1_.addOption("fhn", "FHN");
    addProperty(compositingMode1_);

    compositingMode2_.addOption("dvr", "DVR");
    compositingMode2_.addOption("mip", "MIP");
    compositingMode2_.addOption("mida", "MIDA");
    compositingMode2_.addOption("iso", "ISO");
    compositingMode2_.addOption("fhp", "FHP");
    compositingMode2_.addOption("fhn", "FHN");
    addProperty(compositingMode2_);

    addProperty(isoValue_);

    // lighting
    addProperty(lightPosition_);
    addProperty(lightAmbient_);
    addProperty(lightDiffuse_);
    addProperty(lightSpecular_);
    addProperty(materialShininess_);
    addProperty(applyLightAttenuation_);
    addProperty(lightAttenuation_);

    // assign lighting properties to property group
    lightPosition_.setGroupID("lighting");
    lightAmbient_.setGroupID("lighting");
    lightDiffuse_.setGroupID("lighting");
    lightSpecular_.setGroupID("lighting");
    materialShininess_.setGroupID("lighting");
    applyLightAttenuation_.setGroupID("lighting");
    lightAttenuation_.setGroupID("lighting");
    setPropertyGroupGuiName("lighting", "Lighting Parameters");

    // listen to changes of properties that influence the GUI state (i.e. visibility of other props)
    classificationMode_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    shadeMode_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    compositingMode_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    compositingMode1_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    compositingMode2_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    applyLightAttenuation_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
}
GeodesicActiveContourShapePriorLevelSetImageFilterWorkflowITK::GeodesicActiveContourShapePriorLevelSetImageFilterWorkflowITK()
    : ITKProcessor(),
    inport1_(Port::INPORT, "InputImage"),
    outport1_(Port::OUTPORT, "OutputImage"),
    seedPointPort_(Port::INPORT, "seedPointInput"),
    enableProcessing_("enabled", "Enable", false),
    initLevelSet_("initialLevelSetMethod", "Initial LevelSet Method"),
    numSeedPoint_("numSeedPoint", "Take Seed-Point", 0, 0, 0, Processor::VALID),
    seedPoint_("SeedPoint", "Seed-Point", tgt::vec3(1),tgt::vec3(1),tgt::vec3(5000)),
    inputIsBinary_("inputIsBinary", "InputIsBinary", false),
    squaredDistance_("squaredDistance", "SquaredDistance", false),
    useImageSpacing_("useImageSpacing", "UseImageSpacing", false),
    timestep_("timestep", "Timestep", 0.0625f, 0.0f, 0.0625f),
    numberofiterations_ ("numberofiterations", "Number of Iterations", 5, 1, 65535),
    conductanceparameter_ ("conductanceparameter", "Conductance Parameter", 2.0f, 0.0f, 1000.0f),
    alpha_ ("alpha", "Alpha", -0.5f, -150.00f, 150.0f),
    beta_ ("beta", "Beta", 3.0f, -150.0f, 150.0f),
    sigma_("sigma", "Sigma", 0.5f, 0.0f, 50.0f),
    stoptime_("stoptime", "Stopping Value", 60.0f, 1.0f, 100000.0f),
    initialDistance_("initialDistance", "InitialDistance", 5.0f, 0.0f, 1000.0f),
    propagationScaling_("propagationScaling", "PropagationScaling", 2.0f, 0.0f, 100.0f)
{
    addPort(inport1_);
    PortConditionLogicalOr* orCondition1 = new PortConditionLogicalOr();
    orCondition1->addLinkedCondition(new PortConditionVolumeTypeFloat());
    orCondition1->addLinkedCondition(new PortConditionVolumeTypeDouble());
    inport1_.addCondition(orCondition1);
    addPort(outport1_);
    addPort(seedPointPort_);

    addProperty(enableProcessing_);
    initLevelSet_.addOption("danielsson", "SignedDanielssonDistanceMap");
    initLevelSet_.addOption("fastmarching", "FastMarching");
    addProperty(initLevelSet_);

    //seed point
    addProperty(numSeedPoint_);
    addProperty(seedPoint_);
    numSeedPoint_.onChange(CallMemberAction<GeodesicActiveContourShapePriorLevelSetImageFilterWorkflowITK>(this, &GeodesicActiveContourShapePriorLevelSetImageFilterWorkflowITK::process));
    seedPoint_.setWidgetsEnabled(false);

    //properties for DanielsonSignedDistance
    addProperty(inputIsBinary_);
    addProperty(squaredDistance_);
    addProperty(useImageSpacing_);

    inputIsBinary_.setGroupID("Danielsson");
    squaredDistance_.setGroupID("Danielsson");
    useImageSpacing_.setGroupID("Danielsson");
    setPropertyGroupGuiName("Danielsson", "Danielsson");

    //properties for smoothing, sigmoid, gradientMagnitude

    addProperty(timestep_);
    addProperty(numberofiterations_);
    addProperty(conductanceparameter_);
    timestep_.setGroupID("smooth");
    numberofiterations_.setGroupID("smooth");
    conductanceparameter_.setGroupID("smooth");
    setPropertyGroupGuiName("smooth", "Smoothing");

    addProperty(alpha_);
    addProperty(beta_);
    alpha_.setGroupID("sigmoid");
    beta_.setGroupID("sigmoid");
    setPropertyGroupGuiName("sigmoid", "Sigmoid");

    addProperty(sigma_);
    sigma_.setGroupID("magnitude");
    setPropertyGroupGuiName("magnitude", "Gradient Magnitude");

    //properties for fast marching
    addProperty(stoptime_);
    addProperty (initialDistance_);
    stoptime_.setGroupID("fastmarching");
    initialDistance_.setGroupID("fastmarching");
    setPropertyGroupGuiName("fastmarching", "Fast Marching");


    //properties for segmentation
    addProperty(propagationScaling_);
    propagationScaling_.setGroupID("segmentation");
    setPropertyGroupGuiName("segmentation", "GeodesicActiveContourShapePriorLevelSet");
}
예제 #14
0
MultiVolumeRaycaster::MultiVolumeRaycaster()
    : VolumeRaycaster()
    , volumeInport1_(Port::INPORT, "volume1", false, Processor::INVALID_PROGRAM)
    , volumeInport2_(Port::INPORT, "volume2", false, Processor::INVALID_PROGRAM)
    , volumeInport3_(Port::INPORT, "volume3", false, Processor::INVALID_PROGRAM)
    , volumeInport4_(Port::INPORT, "volume4", false, Processor::INVALID_PROGRAM)
    , entryPort_(Port::INPORT, "image.entrypoints")
    , exitPort_(Port::INPORT, "image.exitpoints")
    , outport_(Port::OUTPORT, "image.output", true, Processor::INVALID_PROGRAM, GL_RGBA16F_ARB)
    , outport1_(Port::OUTPORT, "image.output1", true, Processor::INVALID_PROGRAM, GL_RGBA16F_ARB)
    , outport2_(Port::OUTPORT, "image.output2", true, Processor::INVALID_PROGRAM, GL_RGBA16F_ARB)
    , raycastPrg_(0)
    , shadeMode1_("shading1", "Shading 1", Processor::INVALID_PROGRAM)
    , shadeMode2_("shading2", "Shading 2", Processor::INVALID_PROGRAM)
    , shadeMode3_("shading3", "Shading 3", Processor::INVALID_PROGRAM)
    , shadeMode4_("shading4", "Shading 4", Processor::INVALID_PROGRAM)
    , transferFunc1_("transferFunction1", "Transfer Function 1")
    , transferFunc2_("transferFunction2", "Transfer Function 2")
    , transferFunc3_("transferFunction3", "Transfer Function 3")
    , transferFunc4_("transferFunction4", "Transfer Function 4")
    , texFilterMode1_("textureFilterMode1_", "Texture Filtering 1")
    , texFilterMode2_("textureFilterMode2_", "Texture Filtering 2")
    , texFilterMode3_("textureFilterMode3_", "Texture Filtering 3")
    , texFilterMode4_("textureFilterMode4_", "Texture Filtering 4")
    , texClampMode1_("textureClampMode1_", "Texture Clamp 1")
    , texClampMode2_("textureClampMode2_", "Texture Clamp 2")
    , texClampMode3_("textureClampMode3_", "Texture Clamp 3")
    , texClampMode4_("textureClampMode4_", "Texture Clamp 4")
    , texBorderIntensity_("textureBorderIntensity", "Texture Border Intensity", 0.f)
    , camera_("camera", "Camera", tgt::Camera(vec3(0.f, 0.f, 3.5f), vec3(0.f, 0.f, 0.f), vec3(0.f, 1.f, 0.f)))
    , compositingMode1_("compositing1", "Compositing (OP2)", Processor::INVALID_PROGRAM)
    , compositingMode2_("compositing2", "Compositing (OP3)", Processor::INVALID_PROGRAM)
{
    // ports
    volumeInport1_.addCondition(new PortConditionVolumeTypeGL());
    volumeInport2_.addCondition(new PortConditionVolumeTypeGL());
    volumeInport3_.addCondition(new PortConditionVolumeTypeGL());
    volumeInport4_.addCondition(new PortConditionVolumeTypeGL());
    addPort(volumeInport1_);
    addPort(volumeInport2_);
    addPort(volumeInport3_);
    addPort(volumeInport4_);
    addPort(entryPort_);
    addPort(exitPort_);
    addPort(outport_);
    addPort(outport1_);
    addPort(outport2_);

    // tf properties
    addProperty(transferFunc1_);
    addProperty(transferFunc2_);
    addProperty(transferFunc3_);
    addProperty(transferFunc4_);
    addProperty(camera_);

    // shading properties
    addProperty(gradientMode_);
    shadeMode1_.addOption("none", "none");
    shadeMode1_.addOption("phong-diffuse", "Phong (Diffuse)");
    shadeMode1_.addOption("phong-specular", "Phong (Specular)");
    shadeMode1_.addOption("phong-diffuse-ambient", "Phong (Diffuse+Amb.)");
    shadeMode1_.addOption("phong-diffuse-specular", "Phong (Diffuse+Spec.)");
    shadeMode1_.addOption("phong", "Phong (Full)");
    shadeMode1_.addOption("toon", "Toon");
    shadeMode1_.select("phong");
    addProperty(shadeMode1_);
    shadeMode2_.addOption("none", "none");
    shadeMode2_.addOption("phong-diffuse", "Phong (Diffuse)");
    shadeMode2_.addOption("phong-specular", "Phong (Specular)");
    shadeMode2_.addOption("phong-diffuse-ambient", "Phong (Diffuse+Amb.)");
    shadeMode2_.addOption("phong-diffuse-specular", "Phong (Diffuse+Spec.)");
    shadeMode2_.addOption("phong", "Phong (Full)");
    shadeMode2_.addOption("toon", "Toon");
    shadeMode2_.select("phong");
    addProperty(shadeMode2_);
    shadeMode3_.addOption("none", "none");
    shadeMode3_.addOption("phong-diffuse", "Phong (Diffuse)");
    shadeMode3_.addOption("phong-specular", "Phong (Specular)");
    shadeMode3_.addOption("phong-diffuse-ambient", "Phong (Diffuse+Amb.)");
    shadeMode3_.addOption("phong-diffuse-specular", "Phong (Diffuse+Spec.)");
    shadeMode3_.addOption("phong", "Phong (Full)");
    shadeMode3_.addOption("toon", "Toon");
    shadeMode3_.select("phong");
    addProperty(shadeMode3_);
    shadeMode4_.addOption("none", "none");
    shadeMode4_.addOption("phong-diffuse", "Phong (Diffuse)");
    shadeMode4_.addOption("phong-specular", "Phong (Specular)");
    shadeMode4_.addOption("phong-diffuse-ambient", "Phong (Diffuse+Amb.)");
    shadeMode4_.addOption("phong-diffuse-specular", "Phong (Diffuse+Spec.)");
    shadeMode4_.addOption("phong", "Phong (Full)");
    shadeMode4_.addOption("toon", "Toon");
    shadeMode4_.select("phong");
    addProperty(shadeMode4_);

    // compositing modes
    addProperty(compositingMode_);
    compositingMode1_.addOption("dvr", "DVR");
    compositingMode1_.addOption("mip", "MIP");
    compositingMode1_.addOption("iso", "ISO");
    compositingMode1_.addOption("fhp", "W-FHP");
    //compositingMode1_.addOption("fhn", "FHN");
    addProperty(compositingMode1_);
    compositingMode2_.addOption("dvr", "DVR");
    compositingMode2_.addOption("mip", "MIP");
    compositingMode2_.addOption("iso", "ISO");
    compositingMode2_.addOption("fhp", "W-FHP");
    //compositingMode2_.addOption("fhn", "FHN");
    addProperty(compositingMode2_);
    addProperty(isoValue_);

    // lighting properties
    addProperty(lightPosition_);
    addProperty(lightAmbient_);
    addProperty(lightDiffuse_);
    addProperty(lightSpecular_);
    addProperty(materialShininess_);
    addProperty(applyLightAttenuation_);
    addProperty(lightAttenuation_);

    // assign lighting properties to property group
    lightPosition_.setGroupID("lighting");
    lightAmbient_.setGroupID("lighting");
    lightDiffuse_.setGroupID("lighting");
    lightSpecular_.setGroupID("lighting");
    materialShininess_.setGroupID("lighting");
    applyLightAttenuation_.setGroupID("lighting");
    lightAttenuation_.setGroupID("lighting");
    setPropertyGroupGuiName("lighting", "Lighting Parameters");

    // volume texture filtering
    texFilterMode1_.addOption("nearest", "Nearest",  GL_NEAREST);
    texFilterMode1_.addOption("linear",  "Linear",   GL_LINEAR);
    texFilterMode1_.selectByKey("linear");
    addProperty(texFilterMode1_);
    texFilterMode2_.addOption("nearest", "Nearest",  GL_NEAREST);
    texFilterMode2_.addOption("linear",  "Linear",   GL_LINEAR);
    texFilterMode2_.selectByKey("linear");
    addProperty(texFilterMode2_);
    texFilterMode3_.addOption("nearest", "Nearest",  GL_NEAREST);
    texFilterMode3_.addOption("linear",  "Linear",   GL_LINEAR);
    texFilterMode3_.selectByKey("linear");
    addProperty(texFilterMode3_);
    texFilterMode4_.addOption("nearest", "Nearest",  GL_NEAREST);
    texFilterMode4_.addOption("linear",  "Linear",   GL_LINEAR);
    texFilterMode4_.selectByKey("linear");
    addProperty(texFilterMode4_);

    // volume texture clamping
    texClampMode1_.addOption("clamp",           "Clamp",             GL_CLAMP);
    texClampMode1_.addOption("clamp-to-edge",   "Clamp to Edge",     GL_CLAMP_TO_EDGE);
    texClampMode1_.addOption("clamp-to-border", "Clamp to Border",   GL_CLAMP_TO_BORDER);
    texClampMode1_.selectByKey("clamp-to-edge");
    addProperty(texClampMode1_);
    texClampMode2_.addOption("clamp",           "Clamp",             GL_CLAMP);
    texClampMode2_.addOption("clamp-to-edge",   "Clamp to Edge",     GL_CLAMP_TO_EDGE);
    texClampMode2_.addOption("clamp-to-border", "Clamp to Border",   GL_CLAMP_TO_BORDER);
    texClampMode2_.selectByKey("clamp-to-edge");
    addProperty(texClampMode2_);
    texClampMode3_.addOption("clamp",           "Clamp",             GL_CLAMP);
    texClampMode3_.addOption("clamp-to-edge",   "Clamp to Edge",     GL_CLAMP_TO_EDGE);
    texClampMode3_.addOption("clamp-to-border", "Clamp to Border",   GL_CLAMP_TO_BORDER);
    texClampMode3_.selectByKey("clamp-to-edge");
    addProperty(texClampMode3_);
    texClampMode4_.addOption("clamp",           "Clamp",             GL_CLAMP);
    texClampMode4_.addOption("clamp-to-edge",   "Clamp to Edge",     GL_CLAMP_TO_EDGE);
    texClampMode4_.addOption("clamp-to-border", "Clamp to Border",   GL_CLAMP_TO_BORDER);
    texClampMode4_.selectByKey("clamp-to-edge");
    addProperty(texClampMode4_);
    addProperty(texBorderIntensity_);

    // assign texture access properties to property group
    texFilterMode1_.setGroupID("textureAccess");
    texFilterMode2_.setGroupID("textureAccess");
    texFilterMode3_.setGroupID("textureAccess");
    texFilterMode4_.setGroupID("textureAccess");
    texClampMode1_.setGroupID("textureAccess");
    texClampMode2_.setGroupID("textureAccess");
    texClampMode3_.setGroupID("textureAccess");
    texClampMode4_.setGroupID("textureAccess");
    texBorderIntensity_.setGroupID("textureAccess");
    setPropertyGroupGuiName("textureAccess", "Volume Texture Access");

    // listen to changes of properties that influence the GUI state (i.e. visibility of other props)
    classificationMode_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
    shadeMode_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
    compositingMode_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
    compositingMode1_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
    compositingMode2_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
    applyLightAttenuation_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
    texClampMode1_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
    texClampMode2_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
    texClampMode3_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
    texClampMode4_.onChange(CallMemberAction<MultiVolumeRaycaster>(this, &MultiVolumeRaycaster::adjustPropertyVisibilities));
}
예제 #15
0
SingleVolumeRaycaster::SingleVolumeRaycaster()
    : VolumeRaycaster()
    , volumeInport_(Port::INPORT, "volumehandle.volumehandle", false, Processor::INVALID_PROGRAM)
    , entryPort_(Port::INPORT, "image.entrypoints")
    , exitPort_(Port::INPORT, "image.exitpoints")
    , outport_(Port::OUTPORT, "image.output", true, Processor::INVALID_PROGRAM)
    , outport1_(Port::OUTPORT, "image.output1", true, Processor::INVALID_PROGRAM)
    , outport2_(Port::OUTPORT, "image.output2", true, Processor::INVALID_PROGRAM)
    , raycastPrg_(0)
    , transferFunc_("transferFunction", "Transfer Function")
    , camera_("camera", "Camera", tgt::Camera(vec3(0.f, 0.f, 3.5f), vec3(0.f, 0.f, 0.f), vec3(0.f, 1.f, 0.f)))
    , compositingMode1_("compositing1", "Compositing (OP2)", Processor::INVALID_PROGRAM)
    , compositingMode2_("compositing2", "Compositing (OP3)", Processor::INVALID_PROGRAM)
    , texFilterMode_("textureFilterMode_", "Texture Filtering")
    , texClampMode_("textureClampMode_", "Texture Clamp")
    , texBorderIntensity_("textureBorderIntensity", "Texture Border Intensity", 0.f)
{
    // ports
    addPort(volumeInport_);
    addPort(entryPort_);
    addPort(exitPort_);
    addPort(outport_);
    addPort(outport1_);
    addPort(outport2_);

    // shading / classification props
    addProperty(transferFunc_);
    addProperty(camera_);
    addProperty(gradientMode_);
    addProperty(classificationMode_);
    addProperty(shadeMode_);

    // compositing modes
    addProperty(compositingMode_);
    compositingMode1_.addOption("dvr", "DVR");
    compositingMode1_.addOption("mip", "MIP");
    compositingMode1_.addOption("iso", "ISO");
    compositingMode1_.addOption("fhp", "FHP");
    compositingMode1_.addOption("fhn", "FHN");
    addProperty(compositingMode1_);

    compositingMode2_.addOption("dvr", "DVR");
    compositingMode2_.addOption("mip", "MIP");
    compositingMode2_.addOption("iso", "ISO");
    compositingMode2_.addOption("fhp", "FHP");
    compositingMode2_.addOption("fhn", "FHN");
    addProperty(compositingMode2_);

    addProperty(isoValue_);

    // lighting
    addProperty(lightPosition_);
    addProperty(lightAmbient_);
    addProperty(lightDiffuse_);
    addProperty(lightSpecular_);
    addProperty(materialShininess_);
    addProperty(applyLightAttenuation_);
    addProperty(lightAttenuation_);

    // assign lighting properties to property group
    lightPosition_.setGroupID("lighting");
    lightAmbient_.setGroupID("lighting");
    lightDiffuse_.setGroupID("lighting");
    lightSpecular_.setGroupID("lighting");
    materialShininess_.setGroupID("lighting");
    applyLightAttenuation_.setGroupID("lighting");
    lightAttenuation_.setGroupID("lighting");
    setPropertyGroupGuiName("lighting", "Lighting Parameters");

    // volume texture filtering
    texFilterMode_.addOption("nearest", "Nearest",  GL_NEAREST);
    texFilterMode_.addOption("linear",  "Linear",   GL_LINEAR);
    texFilterMode_.selectByKey("linear");
    addProperty(texFilterMode_);

    // volume texture clamping
    texClampMode_.addOption("clamp",           "Clamp",             GL_CLAMP);
    texClampMode_.addOption("clamp-to-edge",   "Clamp to Edge",     GL_CLAMP_TO_EDGE);
    texClampMode_.addOption("clamp-to-border", "Clamp to Border",   GL_CLAMP_TO_BORDER);
    texClampMode_.selectByKey("clamp-to-edge");
    addProperty(texClampMode_);
    addProperty(texBorderIntensity_);

    // assign texture access properties to property group
    texFilterMode_.setGroupID("textureAccess");
    texClampMode_.setGroupID("textureAccess");
    texBorderIntensity_.setGroupID("textureAccess");
    setPropertyGroupGuiName("textureAccess", "Volume Texture Access");

    // listen to changes of properties that influence the GUI state (i.e. visibility of other props)
    classificationMode_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    shadeMode_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    compositingMode_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    compositingMode1_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    compositingMode2_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    applyLightAttenuation_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
    texClampMode_.onChange(CallMemberAction<SingleVolumeRaycaster>(this, &SingleVolumeRaycaster::adjustPropertyVisibilities));
}