Changeset 3983 for trunk


Ignore:
Timestamp:
Oct 2, 2013, 6:51:58 AM (11 years ago)
Author:
ldelgass
Message:

Add 'colormap define' as synonym for 'colormap add', since add can be used to
modify an existing colormap. Also tweak volume quality setting.

Location:
trunk/packages/vizservers/vtkvis
Files:
2 edited

Legend:

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

    r3962 r3983  
    25092509static Rappture::CmdSpec colorMapOps[] = {
    25102510    {"add",    1, ColorMapAddOp,             5, 5, "colorMapName colormap alphamap"},
    2511     {"delete", 1, ColorMapDeleteOp,          2, 3, "?colorMapName?"},
     2511    {"define", 3, ColorMapAddOp,             5, 5, "colorMapName colormap alphamap"},
     2512    {"delete", 3, ColorMapDeleteOp,          2, 3, "?colorMapName?"},
    25122513    {"res",    1, ColorMapNumTableEntriesOp, 3, 4, "numTableEntries ?colorMapName?"}
    25132514};
     
    71657166    range[1] = -DBL_MAX;
    71667167
     7168    bool opaque = true;
     7169
    71677170    if (objc == 9) {
    71687171        const char *dataSetName = Tcl_GetString(objv[8]);
    71697172        if (!g_renderer->renderColorMap(colorMapName, dataSetName, legendType, fieldName, title,
    7170                                         range, width, height, true, numLabels, imgData)) {
     7173                                        range, width, height, opaque, numLabels, imgData)) {
    71717174            Tcl_AppendResult(interp, "Color map \"",
    71727175                             colorMapName, "\" or dataset \"",
     
    71767179    } else {
    71777180        if (!g_renderer->renderColorMap(colorMapName, "all", legendType, fieldName, title,
    7178                                         range, width, height, true, numLabels, imgData)) {
     7181                                        range, width, height, opaque, numLabels, imgData)) {
    71797182            Tcl_AppendResult(interp, "Color map \"",
    71807183                             colorMapName, "\" was not found", (char*)NULL);
     
    72377240        vtkSmartPointer<vtkUnsignedCharArray>::New();
    72387241
    7239     if (!g_renderer->renderColorMap(colorMapName, width, height, true, imgData)) {
     7242    bool opaque = true;
     7243
     7244    if (!g_renderer->renderColorMap(colorMapName, width, height, opaque, imgData)) {
    72407245        Tcl_AppendResult(interp, "Color map \"",
    72417246                         colorMapName, "\" was not found", (char*)NULL);
     
    72737278# endif // USE_THREADS
    72747279#endif // DEBUG
     7280
    72757281    return TCL_OK;
    72767282}
     
    1193611942    double distance;
    1193711943    double maxFactor = 4.0;
     11944#if 1
     11945    distance = 1.0 / (quality * (maxFactor - 1.0) + 1.0);
     11946#else
    1193811947    if (quality >= 0.5) {
    1193911948        distance = 1.0 / ((quality - 0.5) * (maxFactor - 1.0) * 2.0 + 1.0);
     
    1194111950        distance = ((0.5 - quality) * (maxFactor - 1.0) * 2.0 + 1.0);
    1194211951    }
     11952#endif
    1194311953    if (objc == 4) {
    1194411954        const char *name = Tcl_GetString(objv[3]);
  • trunk/packages/vizservers/vtkvis/protocol.txt

    r3962 r3983  
    189189
    190190colormap add <colorMapName> <colorMap> <opacityMap>
     191         (Re-)define a colormap.  If colorMapName doesn't exist, it is created,
     192         otherwise the colormap is redefined and all users will be updated.
    191193         colorMap = Tcl list of {value r g b} control points
    192194         opacityMap = Tcl list of {value alpha} control points
     195colormap define <colorMapName> <colorMap> <opacityMap>
     196         (Re-)define a colormap (same as 'add')
    193197colormap delete <?colorMapName?>
    194198colormap res <numberOfTableEntries>
Note: See TracChangeset for help on using the changeset viewer.