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_);
}
Esempio n. 2
0
/*
    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_);
}