Changeset 3883


Ignore:
Timestamp:
Aug 22, 2013, 7:30:02 PM (11 years ago)
Author:
ldelgass
Message:

Add cutplane visibility flag to nanovis. Will be used to add cutplanes button
in client

Location:
trunk/packages/vizservers/nanovis
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Command.cpp

    r3870 r3883  
    766766}
    767767
     768static int
     769CutplaneVisibleOp(ClientData clientData, Tcl_Interp *interp, int objc,
     770                  Tcl_Obj *const *objv)
     771{
     772    bool state;
     773    if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) {
     774        return TCL_ERROR;
     775    }
     776
     777    std::vector<Volume *> ivol;
     778    if (GetVolumes(interp, objc - 4, objv + 4, &ivol) != TCL_OK) {
     779        return TCL_ERROR;
     780    }
     781    std::vector<Volume *>::iterator iter;
     782    for (iter = ivol.begin(); iter != ivol.end(); iter++) {
     783        (*iter)->cutplanesVisible(state);
     784    }
     785    return TCL_OK;
     786}
     787
    768788static Rappture::CmdSpec cutplaneOps[] = {
    769789    {"position", 1, CutplanePositionOp, 4, 0, "relval axis ?indices?",},
    770790    {"state",    1, CutplaneStateOp,    4, 0, "bool axis ?indices?",},
     791    {"visible",  1, CutplaneVisibleOp,  3, 0, "bool ?indices?",},
    771792};
    772793static int nCutplaneOps = NumCmdSpecs(cutplaneOps);
  • trunk/packages/vizservers/nanovis/Volume.cpp

    r3630 r3883  
    4848    _numComponents(n),
    4949    _nonZeroMin(nonZeroMin),
     50    _cutplanesVisible(true),
    5051    _tex(NULL),
    5152    _position(0,0,0),
  • trunk/packages/vizservers/nanovis/Volume.h

    r3630 r3883  
    155155    void disableCutplane(int index);
    156156
     157    void cutplanesVisible(bool state)
     158    {
     159        _cutplanesVisible = state;
     160    }
     161
     162    bool cutplanesVisible() const
     163    {
     164        return _cutplanesVisible;
     165    }
     166
    157167    void setCutplanePosition(int index, float location);
    158168
     
    387397    double _nonZeroMin;
    388398
     399    bool _cutplanesVisible;
    389400    std::vector<CutPlane> _plane; ///< cut planes
    390401
  • trunk/packages/vizservers/nanovis/VolumeRenderer.cpp

    r3630 r3883  
    281281
    282282        for (int j = 0; j < volume->getCutplaneCount(); j++) {
    283             if (!volume->isCutplaneEnabled(j)) {
     283            if (!volume->cutplanesVisible() || !volume->isCutplaneEnabled(j)) {
    284284                continue;
    285285            }
Note: See TracChangeset for help on using the changeset viewer.