Ignore:
Timestamp:
Nov 9, 2013 8:50:03 PM (11 years ago)
Author:
ldelgass
Message:

Add protocol for setting depth peeling params and bump version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vtkvis/RendererCmd.cpp

    r3983 r4040  
    1019410194    }
    1019510195    g_renderer->setUseDepthPeeling(state);
     10196    if (objc > 3) {
     10197        if (objc < 5) {
     10198             Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]),
     10199                              " ", Tcl_GetString(objv[1]), " bool ?occlusionRatio maxPeels?\"", (char*)NULL);
     10200            return TCL_ERROR;
     10201        }
     10202        double occlusionRatio;
     10203        int maxPeels;
     10204        if (Tcl_GetDoubleFromObj(interp, objv[3], &occlusionRatio) != TCL_OK) {
     10205            return TCL_ERROR;
     10206        }
     10207        if (occlusionRatio < 0.0 || occlusionRatio > 0.5) {
     10208            Tcl_AppendResult(interp, "bad occlusionRatio value \"", Tcl_GetString(objv[3]),
     10209                             "\": should be [0,0.5]", (char*)NULL);
     10210            return TCL_ERROR;
     10211        }
     10212        if (Tcl_GetIntFromObj(interp, objv[4], &maxPeels) != TCL_OK) {
     10213            return TCL_ERROR;
     10214        }
     10215        if (maxPeels < 0) {
     10216            Tcl_AppendResult(interp, "bad maxPeels value \"", Tcl_GetString(objv[3]),
     10217                             "\": must be zero or greater", (char*)NULL);
     10218            return TCL_ERROR;
     10219        }
     10220        g_renderer->setDepthPeelingParams(occlusionRatio, maxPeels);
     10221    }
    1019610222    return TCL_OK;
    1019710223}
     
    1023510261static Rappture::CmdSpec rendererOps[] = {
    1023610262    {"clipplane",  1, RendererClipPlaneOp, 5, 5, "axis ratio direction"},
    10237     {"depthpeel",  1, RendererDepthPeelingOp, 3, 3, "bool"},
     10263    {"depthpeel",  1, RendererDepthPeelingOp, 3, 5, "bool ?occlusionRatio maxPeels?"},
    1023810264    {"light2side", 6, RendererTwoSidedLightingOp, 3, 3, "bool"},
    1023910265    {"lights",     6, RendererLightsOp, 4, 4, "idx bool"},
Note: See TracChangeset for help on using the changeset viewer.