OcclusionSlicer::OcclusionSlicer() : VolumeSlicer() , shaderProp_("slicing.shader", "Slicing shader", "sl_occlusion.frag", "sl_singlevolume.vert") , occlusionbuffer0_(Port::OUTPORT, "image.occlusionbuffer0", "OcclusionBuffer0 Output", false, Processor::INVALID_RESULT, //RenderPort::RENDERSIZE_DEFAULT, GL_RGBA16F_ARB) RenderPort::RENDERSIZE_DEFAULT) , occlusionbuffer1_(Port::OUTPORT, "image.occlusionbuffer1", "OcclusionBuffer1 Output", false, Processor::INVALID_RESULT, /*RenderPort::RENDERSIZE_DEFAULT, GL_RGBA16F_ARB)*/ RenderPort::RENDERSIZE_DEFAULT) , outport_(Port::OUTPORT, "image.eyebuffer", "EyeBuffer Output", true, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_RECEIVER) , cameraHandler_("cameraHandler", "Camera Handler", &camera_) , sigma_("sigma", "Sigma", 100.0f, 0.0f, 1000.0f) , radius_("radius", "Radius", 5, 0, 50) { addInteractionHandler(cameraHandler_); addPrivateRenderPort(occlusionbuffer0_); addPrivateRenderPort(occlusionbuffer1_); addPort(outport_); addProperty(shaderProp_); addProperty(sigma_); addProperty(radius_); addProperty(lightPosition_); }
UnsharpMasking::UnsharpMasking() : ImageProcessorBypassable("image/unsharpmaskingblur"), radius_("radius", "Radius", 5, 0, 25), sigma_("sigma", "Sigma", 2.0f, 0.1f, 10.0f), amount_("amount", "Amount", 1.0f, 0.f, 10.0f), threshold_("threshold", "Threshhold", 0.f, 0.f, 0.5f), alpha_("alpha", "Process Alpha-Channel", true), inport_(Port::INPORT, "image.inport"), outport_(Port::OUTPORT, "image.outport"), privatePort_(Port::OUTPORT, "image.privateport") { addProperty(enableSwitch_); addProperty(sigma_); addProperty(radius_); addProperty(amount_); addProperty(threshold_); addProperty(alpha_); sigma_.onChange(CallMemberAction<UnsharpMasking>(this, &UnsharpMasking::sigmaChanged)); radius_.onChange(CallMemberAction<UnsharpMasking>(this, &UnsharpMasking::radiusChanged)); addPort(inport_); addPort(outport_); addPrivateRenderPort(&privatePort_); sigmaFlag_ = false; radiusFlag_ = false; }
ExplosionCompositor::ExplosionCompositor() : ImageProcessor("image/compositor") , compositingMode_("blendMode", "Blend mode", Processor::INVALID_PROGRAM) , weightingFactor_("weightingFactor", "Weighting factor", 0.5f, 0.0f, 1.0f) , inport0_(Port::INPORT, "image.inport0") , interalPort_(Port::OUTPORT, "internalRenderPort", false) , outport_(Port::OUTPORT, "image.outport") , loopOutport_("loop.outport", Port::OUTPORT) { loopOutport_.setLoopPort(true); compositingMode_.addOption("depth-test", "Depth Test", "MODE_DEPTH_TEST"); compositingMode_.addOption("alpha-compositing", "Alpha Compositing", "MODE_ALPHA_COMPOSITING"); compositingMode_.addOption("alpha-blending", "Alpha Blending", "MODE_ALPHA_BLENDING"); compositingMode_.addOption("alpha-blending-b-over-a", "Alpha Blending (B over A)", "MODE_ALPHA_BLENDING_B_OVER_A"); compositingMode_.addOption("weighted-average", "Weighted Average", "MODE_WEIGHTED_AVERAGE"); compositingMode_.addOption("take-first", "Take First", "MODE_TAKE_FIRST"); compositingMode_.addOption("take-second", "Take Second", "MODE_TAKE_SECOND"); compositingMode_.addOption("first-has-priority", "First Has Priority", "MODE_FIRST_HAS_PRIORITY"); compositingMode_.addOption("second-has-priority", "Second Has Priority", "MODE_SECOND_HAS_PRIORITY"); compositingMode_.addOption("maximum-alpha", "Maximum Alpha", "MODE_MAXIMUM_ALPHA"); compositingMode_.addOption("difference", "Difference", "MODE_DIFFERENCE"); compositingMode_.onChange(CallMemberAction<ExplosionCompositor>(this, &ExplosionCompositor::compositingModeChanged)); compositingMode_.select("alpha-compositing"); addProperty(compositingMode_); addProperty(weightingFactor_); addPort(inport0_); addPrivateRenderPort(interalPort_); //interalPort_.initialize(); addPort(outport_); addPort(loopOutport_); }
TNMParallelCoordinates::TNMParallelCoordinates() : RenderProcessor() , _inport(Port::INPORT, "in.data") , _outport(Port::OUTPORT, "out.image") , _privatePort(Port::OUTPORT, "private.image", false, Processor::INVALID_RESULT, GL_RGBA32F) , _pickedHandle(-1) , _brushingIndices("brushingIndices", "Brushing Indices") , _linkingIndices("linkingIndices", "Linking Indices") { addPort(_inport); addPort(_outport); addPrivateRenderPort(_privatePort); addProperty(_brushingIndices); addProperty(_linkingIndices); _mouseClickEvent = new EventProperty<TNMParallelCoordinates>( "mouse.click", "Mouse Click", this, &TNMParallelCoordinates::handleMouseClick, tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::CLICK, tgt::Event::MODIFIER_NONE); addEventProperty(_mouseClickEvent); _mouseClickEvent = new EventProperty<TNMParallelCoordinates>( "mouse.rightclick", "Mouse Right Click", this, &TNMParallelCoordinates::handleMouseClick, tgt::MouseEvent::MOUSE_BUTTON_RIGHT, tgt::MouseEvent::CLICK, tgt::Event::MODIFIER_NONE); addEventProperty(_mouseClickEvent); _mouseMoveEvent = new EventProperty<TNMParallelCoordinates>( "mouse.move", "Mouse Move", this, &TNMParallelCoordinates::handleMouseMove, tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::MOTION, tgt::Event::MODIFIER_NONE); addEventProperty(_mouseMoveEvent); _mouseReleaseEvent = new EventProperty<TNMParallelCoordinates>( "mouse.release", "Mouse Release", this, &TNMParallelCoordinates::handleMouseRelease, tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::RELEASED, tgt::Event::MODIFIER_NONE); addEventProperty(_mouseReleaseEvent); // Create AxisHandles here with a unique id _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, 0, tgt::vec2(-1.f, -1.0f))); _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 1, tgt::vec2(-1.f, 1.0f))); _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, 2, tgt::vec2(-1.0/3, -1.0f))); _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 3, tgt::vec2(-1.0/3, 1.0f))); _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, 4, tgt::vec2(1.0/3, -1.0f))); _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 5, tgt::vec2(1.0/3, 1.0f))); _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, 6, tgt::vec2(1.f, -1.0f))); _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 7, tgt::vec2(1.f, 1.0f))); }
RenderStore::RenderStore() : RenderProcessor() , inport_(Port::INPORT, "image.input") , privatePort_(Port::OUTPORT, "image.stored", true) , outport_(Port::OUTPORT, "image.output") , shaderPrg_(0) { addPort(inport_); addPrivateRenderPort(&privatePort_); addPort(outport_); }
DepthDarkening::DepthDarkening() : ImageProcessorDepth("image/depthdarkening") , sigma_("sigma", "Sigma", 2.0f, 0.1f, 10.0f) , lambda_("lambda", "Lambda", 10.0f, 0.0f, 20.0f) , inport_(Port::INPORT, "image.inport") , outport_(Port::OUTPORT, "image.outport", true) , privatePort_(Port::OUTPORT, "image.privateport") { addProperty(sigma_); addProperty(lambda_); addPort(inport_); addPort(outport_); addPrivateRenderPort(privatePort_); }
StereoMeshEntryExitPoints::StereoMeshEntryExitPoints() : RenderProcessor() , entryPort_(Port::OUTPORT, "image.entrypoints", "Entry-points Output", true, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_RECEIVER) , exitPort_(Port::OUTPORT, "image.exitpoints", "Exit-points Output", true, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_RECEIVER) , inport_(Port::INPORT, "proxgeometry.geometry", "Proxy Geometry Input") , tmpPort_(Port::OUTPORT, "image.tmp", "image.tmp", false) , supportCameraInsideVolume_("supportCameraInsideVolume", "Support camera in volume", true) , jitterEntryPoints_("jitterEntryPoints", "Jitter entry params", false) , useFloatRenderTargets_("useFloatRenderTargets", "Use float render targets", false) , useCulling_("useCulling", "Use culling", true) , jitterStepLength_("jitterStepLength", "Jitter step length", 0.005f, 0.0005f, 0.025f) , 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))) , cameraLeft_("cameraLeft", "Camera Left", tgt::Camera(vec3(0.f, 0.f, 3.5f), vec3(0.f, 0.f, 0.f), vec3(0.f, 1.f, 0.f))) , cameraRight_("cameraRight", "Camera Right", tgt::Camera(vec3(0.f, 0.f, 3.5f), vec3(0.f, 0.f, 0.f), vec3(0.f, 1.f, 0.f))) , eyeSeparation_("eyeSeparation", "Eye separation", 0.f, 0.f, 1.f) , cameraDistance_("cameraDistance", "Camera distance", 0.f, 0.f, 5.f) , shaderProgram_(0) , shaderProgramJitter_(0) { addProperty(supportCameraInsideVolume_); // jittering addProperty(jitterEntryPoints_); jitterEntryPoints_.onChange(CallMemberAction<StereoMeshEntryExitPoints>(this, &StereoMeshEntryExitPoints::onJitterEntryPointsChanged)); onJitterEntryPointsChanged(); // set initial state jitterStepLength_.setStepping(0.001f); jitterStepLength_.setNumDecimals(3); addProperty(jitterStepLength_); addProperty(useFloatRenderTargets_); addProperty(useCulling_); addProperty(camera_); addProperty(cameraLeft_); addProperty(cameraRight_); addProperty(eyeSeparation_); addProperty(cameraDistance_); cameraHandler_ = new StereoCameraInteractionHandler("cameraHandler", "Camera", &camera_, &cameraLeft_, &cameraRight_, &eyeSeparation_, &cameraDistance_); addInteractionHandler(cameraHandler_); addPort(entryPort_); addPort(exitPort_); addPort(inport_); addPrivateRenderPort(&tmpPort_); }
Canny::Canny() : ImageProcessorDepth("image/canny") , startThreshold_("startThreshold", "Start threshold", 1.0f, 0.0f, 10.0f) , runThreshold_("runThreshold", "Run threshold", 0.5f, 0.0f, 10.0f) , edgeColor_("edgeColor", "Edge color", tgt::vec4(1.0f, 1.0f, 1.0f, 1.0f)) , inport_(Port::INPORT, "image.inport") , outport_(Port::OUTPORT, "image.outport", true) , privatePort_(Port::OUTPORT, "image.privateport", true) { addProperty(startThreshold_); addProperty(runThreshold_); addProperty(edgeColor_); edgeColor_.setViews(Property::COLOR); addPort(inport_); addPort(outport_); addPrivateRenderPort(&privatePort_); }
/* constructor */ EntryExitPoints::EntryExitPoints() : VolumeRenderer(), shaderProgram_(0), shaderProgramJitter_(0), shaderProgramClipping_(0), supportCameraInsideVolume_("supportCameraInsideVolume", "Support camera in volume", true), jitterEntryPoints_("jitterEntryPoints", "Jitter entry params", false), filterJitterTexture_("filterJitterTexture", "Filter jitter texture", true), jitterStepLength_("jitterStepLength", "Jitter step length", 0.005f, 0.0005f, 0.025f), jitterTexture_(0), 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))), entryPort_(Port::OUTPORT, "image.entrypoints"), exitPort_(Port::OUTPORT, "image.exitpoints"), inport_(Port::INPORT, "volumehandle.volumehandle"), cpPort_(Port::INPORT, "coprocessor.proxygeometry"), tmpPort_(Port::OUTPORT, "image.tmp", false) { addProperty(supportCameraInsideVolume_); // // jittering // addProperty(jitterEntryPoints_); jitterEntryPoints_.onChange(CallMemberAction<EntryExitPoints>(this, &EntryExitPoints::onJitterEntryPointsChanged)); onJitterEntryPointsChanged(); // set initial state jitterStepLength_.setStepping(0.001f); jitterStepLength_.setNumDecimals(3); addProperty(jitterStepLength_); addProperty(filterJitterTexture_); filterJitterTexture_.onChange(CallMemberAction<EntryExitPoints>(this, &EntryExitPoints::onFilterJitterTextureChanged)); addProperty(camera_); cameraHandler_ = new CameraInteractionHandler("cameraHandler", "Camera", &camera_); addInteractionHandler(cameraHandler_); addPort(entryPort_); addPort(exitPort_); addPort(inport_); addPort(cpPort_); addPrivateRenderPort(&tmpPort_); }
DepthPeelingProcessor::DepthPeelingProcessor() : RenderProcessor() , inport_(Port::INPORT, "image.input") , outport_(Port::OUTPORT, "image.output") , tempPort_(Port::OUTPORT, "image.temp") , cpPort_(Port::INPORT, "coprocessor.geometryrenderers", true) , shaderPrg_(0) , 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))) { addProperty(camera_); cameraHandler_ = new CameraInteractionHandler("cameraHandler", "Camera Handler", &camera_); addInteractionHandler(cameraHandler_); addPort(inport_); addPort(outport_); addPrivateRenderPort(tempPort_); addPort(cpPort_); }
HalfAngleSlicer::HalfAngleSlicer() : VolumeSlicer() , shaderProp_("slicing.prg", "Slicing shader", "sl_halfslicing.frag", "sl_singlevolume.vert") , outport_(Port::OUTPORT, "image.output", "Image Output", false, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_RECEIVER, GL_RGBA16F_ARB) , lightport_(Port::OUTPORT, "image.lightport", "Light Image Input", false, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_DEFAULT, GL_RGBA16F_ARB) , lightCamera_(tgt::Camera(tgt::vec3(0.f, -3.5f, -3.5f), tgt::vec3(0.f, 0.f, 0.f), tgt::vec3(0.f, 1.f, 0.f))) , eyeCamera_("eyeCamera", "Eye Camera", tgt::Camera(tgt::vec3(0.f, 0.f, 3.5f), tgt::vec3(0.f, 0.f, 0.f), tgt::vec3(0.f, 1.f, 0.f))) , cameraHandler_("cameraHandler", "Camera Handler", &eyeCamera_) , halfLight_("halfLight", "Light source position", tgt::vec4(0.f, -3.5f, -3.5f, 1.f), tgt::vec4(-15), tgt::vec4(15)) , invert_(false) { removeProperty(&camera_); addInteractionHandler(cameraHandler_); halfLight_.setViews(Property::View(Property::LIGHT_POSITION | Property::DEFAULT)); addProperty(shaderProp_); addProperty(eyeCamera_); addProperty(halfLight_); addPort(outport_); addPrivateRenderPort(lightport_); }
EEPGeometryIntegrator::EEPGeometryIntegrator() : ImageProcessor("eep_geometry") , inport0_(Port::INPORT, "image.entry") , inport1_(Port::INPORT, "image.exit") , geometryPort_(Port::INPORT, "image.geometry") , volumeInport_(Port::INPORT, "volumehandle.volumehandle", false, Processor::INVALID_RESULT) , entryPort_(Port::OUTPORT, "image.postentry", true, Processor::INVALID_PROGRAM) , exitPort_(Port::OUTPORT, "image.postexit", true, Processor::INVALID_PROGRAM) , tmpPort_(Port::OUTPORT, "image.tmp", false) , useFloatRenderTargets_("useFloatRenderTargets", "Use float rendertargets", false) , camera_("camera", "Camera", tgt::Camera(tgt::vec3(0.f, 0.f, 3.5f), tgt::vec3(0.f, 0.f, 0.f), tgt::vec3(0.f, 1.f, 0.f))) { addPort(inport0_); addPort(inport1_); addPort(geometryPort_); addPort(volumeInport_); addPort(entryPort_); addPort(exitPort_); addPrivateRenderPort(&tmpPort_); addProperty(useFloatRenderTargets_); addProperty(camera_); }
Gaussian::Gaussian() : ImageProcessorBypassable("image/gaussian"), sigma_("sigma", "Sigma", 2.0f, 0.1f, 10.0f), blurRed_("blurRed", "Red channel", true), blurGreen_("blurGreen", "Green channel", true), blurBlue_("blurBlue", "Blue channel", true), blurAlpha_("blurAlpha", "Alpha channel", true), blurDepth_("blurDepth", "Depth channel", false), inport_(Port::INPORT, "image.inport", "Image Input"), outport_(Port::OUTPORT, "image.outport", "Image Output"), privatePort_(Port::OUTPORT, "image.privateport", "image.privateport", true) { addProperty(sigma_); addProperty(blurRed_); addProperty(blurGreen_); addProperty(blurBlue_); addProperty(blurAlpha_); addProperty(blurDepth_); addPort(inport_); addPort(outport_); addPrivateRenderPort(&privatePort_); }
//---------------------------------------------------------------------------------------------------------------------------------------------------------------- TNMParallelCoordinates::TNMParallelCoordinates() : RenderProcessor() , _inport(Port::INPORT, "in.data") , _outport(Port::OUTPORT, "out.image") , _privatePort(Port::OUTPORT, "private.image", false, Processor::INVALID_RESULT, GL_RGBA32F) , _pickedHandle(-1) , _font("font", "Font") , _colorMethod("colorMethod", "Coloring Method") , _brushingIndices("brushingIndices", "Brushing Indices") , _linkingIndices("linkingIndices", "Linking Indices") { //---------------------------------------------------------------------------------------------------------------------------------------------------------------- addPort(_inport); addPort(_outport); addPrivateRenderPort(_privatePort); addProperty(_font); addProperty(_colorMethod); // // Create AxisHandles here with a unique id // _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 0, /* fix startposition */)); // ... // addProperty(_brushingIndices); addProperty(_linkingIndices); _mouseClickEvent = new EventProperty<TNMParallelCoordinates>( "mouse.click", "Mouse Click", this, &TNMParallelCoordinates::handleMouseClick, tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::CLICK, tgt::Event::MODIFIER_NONE); addEventProperty(_mouseClickEvent); _mouseClickEventRight = new EventProperty<TNMParallelCoordinates>( "mouseright.click", "Mouse Right Click", this, &TNMParallelCoordinates::handleMouseClickRight, tgt::MouseEvent::MOUSE_BUTTON_RIGHT, tgt::MouseEvent::CLICK, tgt::Event::MODIFIER_NONE); addEventProperty(_mouseClickEventRight); _mouseMoveEvent = new EventProperty<TNMParallelCoordinates>( "mouse.move", "Mouse Move", this, &TNMParallelCoordinates::handleMouseMove, tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::MOTION, tgt::Event::MODIFIER_NONE); addEventProperty(_mouseMoveEvent); _mouseReleaseEvent = new EventProperty<TNMParallelCoordinates>( "mouse.release", "Mouse Release", this, &TNMParallelCoordinates::handleMouseRelease, tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::RELEASED, tgt::Event::MODIFIER_NONE); addEventProperty(_mouseReleaseEvent); // Create AxisHandles here with a unique id float x_width = 1.8f / (NUM_DATA_VALUES - 1); float x_pos = -0.9f; for( int i = 0; i < 6; i++) { _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, i, tgt::vec2(x_pos, 0.9f))); x_pos += x_width; } x_pos = -0.9f; for( int i = 6; i < 12; i++) { _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, i, tgt::vec2(x_pos, -0.9f))); x_pos += x_width; } }
ButtonOverlayProcessor::ButtonOverlayProcessor() : ImageProcessor("image/compositor") , inport_(Port::INPORT, "image.input") , outport_(Port::OUTPORT, "image.output", "image.output", true, Processor::INVALID_PROGRAM, RenderPort::RENDERSIZE_DEFAULT, GL_RGBA) , overlayPort_(Port::OUTPORT, "image.overlay", "image.overlay", true, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_DEFAULT, GL_RGBA) , pickingPort_(Port::OUTPORT, "image.picking", "image.picking", true, Processor::INVALID_RESULT, RenderPort::RENDERSIZE_DEFAULT, GL_RGBA) , buttonRadiusX_("buttonRadiusX", "Button Size X", 20, 1, 100) , buttonRadiusY_("buttonRadiusY", "Button Size Y", 20, 1, 100) , groupBorder_("groupBorder", "Border between Buttons", 5, 0, 30) , horzBorder_("horzBorder", "Distance from left/right Border", 30, 0, 1000) , vertBorder_("vertBorder", "Distance from top/bottom Border", 100, 0, 1000) , fontSize_("fontSize", "Font size", 12, 1, 48) , opacity_("opacity", "Opacity", 1.0f) , pushButtonMode_("pushButtonMode", "Use pushbutton mode", false) #ifdef _MSC_VER #pragma warning(disable:4355) // passing 'this' is safe here #endif , buttonChecker_("mouseEvent.clickButton", "Clicking Button", this, &ButtonOverlayProcessor::onMouseClick, tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::PRESSED | tgt::MouseEvent::MOTION | tgt::MouseEvent::RELEASED, tgt::Event::MODIFIER_NONE) , buttonTexturePressed_(0) , buttonTextureReleased_(0) , buttonProps_() , pushButtonProps_() , isVisibleProps_() , nameProps_() , regenerateOverlay_(false) , oldSize_(tgt::ivec2(0)) { addEventProperty(buttonChecker_); addPort(inport_); addPort(outport_); addPrivateRenderPort(&overlayPort_); addPrivateRenderPort(&pickingPort_); addProperty(horzBorder_); addProperty(vertBorder_); addProperty(buttonRadiusX_); addProperty(buttonRadiusY_); addProperty(groupBorder_); addProperty(opacity_); addProperty(fontSize_); addProperty(pushButtonMode_); buttonRadiusX_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); buttonRadiusY_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); opacity_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); groupBorder_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); horzBorder_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); vertBorder_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); fontSize_.onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); for(size_t i = 0; i < 5; i++) { std::ostringstream os1, os2, os3, os4, os5, os6, os7, os8, os9; os1 << "showProp" << i; os2 << "Show Button No. " << i + 1; isVisibleProps_.push_back(new BoolProperty(os1.str(), os2.str(), false)); isVisibleProps_.back()->onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); addProperty(isVisibleProps_.back()); os3 << "buttonProp" << i; os4 << "Button Property " << i + 1; buttonProps_.push_back(new BoolProperty(os3.str(), os4.str(), false)); buttonProps_.back()->onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); addProperty(buttonProps_.back()); os5 << "nameProp" << i; os6 << "Button Name Property " << i + 1; os7 << "Button " << i + 1; nameProps_.push_back(new StringProperty(os5.str(), os6.str(), os7.str())); nameProps_.back()->onChange(CallMemberAction<ButtonOverlayProcessor>(this, &ButtonOverlayProcessor::onOverlayChange)); addProperty(nameProps_.back()); os8 << "pushButtonProp" << i; os9 << "Pushbutton Property " << i + 1; pushButtonProps_.push_back(new ButtonProperty(os8.str(), os9.str())); addProperty(pushButtonProps_.back()); } font_ = new tgt::Font(VoreenApplication::app()->getFontPath("Vera.ttf"), 12, tgt::Font::BitmapFont); //font_ = new tgt::Font(VoreenApplication::app()->getFontPath("VeraMono.ttf"), 12, tgt::BitmapFont); }
void RenderProcessor::addPrivateRenderPort(RenderPort& port) { addPrivateRenderPort(&port); }
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_); }
TextOverlay::TextOverlay() : ImageProcessor("textoverlay") , inport_(Port::INPORT, "image.input", "Image Input") , outport_(Port::OUTPORT, "image.output", "Image Output") , privatePort_(Port::OUTPORT, "image.tmp") , text0_(Port::INPORT, "text.text0", "Text0 Input", true) , text1_(Port::INPORT, "text.text1", "Text1 Input", true) , text2_(Port::INPORT, "text.text2", "Text2 Input", true) , text3_(Port::INPORT, "text.text3", "Text3 Input", true) , enabled_("enabled", "Enabled", true) , layout0_("layout0", "Text position 1:") , layout1_("layout1", "Text position 2:") , layout2_("layout2", "Text position 3:") , layout3_("layout3", "Text position 4:") #ifdef _MSC_VER #pragma warning(disable:4355) // passing 'this' is safe here #endif , mouseMoveEventProp_("mouseEvent.move", "Move Event", this, &TextOverlay::mouseMove, tgt::MouseEvent::MOUSE_BUTTON_NONE, tgt::MouseEvent::MOTION, tgt::MouseEvent::MODIFIER_NONE) #ifdef _MSC_VER #pragma warning(disable:4355) // passing 'this' is safe here #endif , mouseEnterExitEventProp_("mouseEvent.EnterExit", "Enter/Exit Event", this, &TextOverlay::mouseEnterExit, tgt::MouseEvent::MOUSE_BUTTON_NONE, tgt::MouseEvent::ENTER_EXIT, tgt::MouseEvent::MODIFIER_NONE) , viewportSize_(0,0) , mousePos_(0,0) , fontProp_("voreen.fontprop", "Font:") , blendMode_("blendMode","Color Mode:") , fontColor_("fontColor","Color of Font:",tgt::vec4(1.0f)) , renderFollowMouseText_(false) { addPort(inport_); addPort(outport_); addPrivateRenderPort(&privatePort_); addPort(text0_); addPort(text1_); addPort(text2_); addPort(text3_); std::vector<Option<std::string> > options; options.push_back(Option<std::string>("FOLLOW", "Follow mouse", "")); options.push_back(Option<std::string>("N", "North", "")); options.push_back(Option<std::string>("NE", "North-East", "")); options.push_back(Option<std::string>("E", "East", "")); options.push_back(Option<std::string>("SE", "South-East", "")); options.push_back(Option<std::string>("S", "South", "")); options.push_back(Option<std::string>("SW", "South-West", "")); options.push_back(Option<std::string>("W", "West", "")); options.push_back(Option<std::string>("NW", "North-West", "")); options.push_back(Option<std::string>("CENTER", "Center", "")); layout0_.setOptions(options); layout0_.select("NW"); layout1_.setOptions(options); layout1_.select("NW"); layout2_.setOptions(options); layout2_.select("NW"); layout3_.setOptions(options); layout3_.select("NW"); blendMode_.addOption("auto","Inverse Color of Background",0); blendMode_.addOption("fix","Chosen Color",1); blendMode_.select("auto"); blendMode_.onChange(CallMemberAction<TextOverlay>(this, &TextOverlay::blendModeOnChange)); fontColor_.setViews(Property::COLOR); addProperty(enabled_); addProperty(layout0_); addProperty(layout1_); addProperty(layout2_); addProperty(layout3_); addEventProperty(mouseMoveEventProp_); addEventProperty(mouseEnterExitEventProp_); addProperty(fontProp_); addProperty(blendMode_); addProperty(fontColor_); blendModeOnChange(); }
OrientationOverlay::OrientationOverlay() : ImageProcessor("image/orientationoverlay") , inport_(Port::INPORT, "image.input", "Image Input") , outport_(Port::OUTPORT, "image.output", "Image Output") , privatePort_(Port::OUTPORT, "image.tmp", "image.tmp", false) , drawCube_("drawCube", "Draw Cube", true) , drawAxes_("drawAxes", "Draw Axes", false) , drawTextures_("drawTextures", "Draw Cube Textures", true) , colorizeTextures_("colorizeTextures", "Colorize Textures", false) , filenameFront_("filenameFront", "Front Texture", "Select texture", VoreenApplication::app()->getUserDataPath("textures"), "*.jpg;*.png;*.bmp", FileDialogProperty::OPEN_FILE) , filenameBack_("filenameBack", "Back Texture", "Select texture", VoreenApplication::app()->getUserDataPath("textures"), "*.jpg;*.png;*.bmp", FileDialogProperty::OPEN_FILE) , filenameTop_("filenameTop", "Top Texture", "Select texture", VoreenApplication::app()->getUserDataPath("textures"), "*.jpg;*.png;*.bmp", FileDialogProperty::OPEN_FILE) , filenameBottom_("filenameBottom", "Bottom Texture", "Select texture", VoreenApplication::app()->getUserDataPath("textures"), "*.jpg;*.png;*.bmp", FileDialogProperty::OPEN_FILE) , filenameLeft_("filenameLeft", "Left Texture", "Select texture", VoreenApplication::app()->getUserDataPath("textures"), "*.jpg;*.png;*.bmp", FileDialogProperty::OPEN_FILE) , filenameRight_("filenameRight", "Right Texture", "Select texture", VoreenApplication::app()->getUserDataPath("textures"), "*.jpg;*.png;*.bmp", FileDialogProperty::OPEN_FILE) , shiftX_("shiftX", "Horizontal Position", 0.85f, 0.0f, 1.0f) , shiftY_("shiftY", "Vertical Position", 0.15f, 0.0f, 1.0f) , cubeSize_("cubeSize", "Cube Size", 0.15f, 0.05, 1) , axisLength_("axisLength", "Axes Length", 0.15f, 0.1, 4.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))) , frontTex_(0) , backTex_(0) , topTex_(0) , leftTex_(0) , bottomTex_(0) , rightTex_(0) , reloadTextures_(false) , loadingTextures_(false) { addPort(inport_); addPort(outport_); addPrivateRenderPort(&privatePort_); addProperty(drawCube_); addProperty(drawAxes_); addProperty(drawTextures_); filenameFront_.onChange(CallMemberAction<OrientationOverlay>(this, &OrientationOverlay::reloadTextures)); addProperty(colorizeTextures_); addProperty(filenameFront_); filenameBack_.onChange(CallMemberAction<OrientationOverlay>(this, &OrientationOverlay::reloadTextures)); addProperty(filenameBack_); filenameTop_.onChange(CallMemberAction<OrientationOverlay>(this, &OrientationOverlay::reloadTextures)); addProperty(filenameTop_); filenameBottom_.onChange(CallMemberAction<OrientationOverlay>(this, &OrientationOverlay::reloadTextures)); addProperty(filenameBottom_); filenameLeft_.onChange(CallMemberAction<OrientationOverlay>(this, &OrientationOverlay::reloadTextures)); addProperty(filenameLeft_); filenameRight_.onChange(CallMemberAction<OrientationOverlay>(this, &OrientationOverlay::reloadTextures)); addProperty(filenameRight_); addProperty(shiftX_); addProperty(shiftY_); addProperty(cubeSize_); addProperty(axisLength_); addProperty(camera_); // set initial texture names std::string texturePath = VoreenApplication::app()->getResourcePath("textures"); textureNames_[0] = texturePath + "/axial_t.png"; textureNames_[1] = texturePath + "/axial_b.png"; textureNames_[2] = texturePath + "/coronal_f.png"; textureNames_[3] = texturePath + "/coronal_b.png"; textureNames_[4] = texturePath + "/sagittal_l.png"; textureNames_[5] = texturePath + "/sagittal_r.png"; }