Ignore:
Timestamp:
Dec 22, 2014 4:18:59 AM (9 years ago)
Author:
ldelgass
Message:

Merge serveral changes from trunk. Does not include threading, world space
changes, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.1/Flow.cpp

    r4893 r4904  
    99 *   Leif Delgass <ldelgass@purdue.edu>
    1010 */
     11
     12#include <float.h>
    1113
    1214#include <tcl.h>
     
    3133using namespace vrmath;
    3234
     35bool Flow::updatePending = false;
     36
    3337Flow::Flow(Tcl_Interp *interp, const char *name) :
    3438    _interp(interp),
     
    8185        return;
    8286
    83 #if 0  // Using volume bounds instead of these
    84     if (isDataLoaded()) {
    85         Vector3f umin, umax;
    86         Rappture::Unirect3d *unirect = data();
    87         unirect->getWorldSpaceBounds(umin, umax);
    88         if (min.x > umin.x) {
    89             min.x = umin.x;
    90         }
    91         if (max.x < umax.x) {
    92             max.x = umax.x;
    93         }
    94         if (min.y > umin.y) {
    95             min.y = umin.y;
    96         }
    97         if (max.y < umax.y) {
    98             max.y = umax.y;
    99         }
    100         if (min.z > umin.z) {
    101             min.z = umin.z;
    102         }
    103         if (max.z < umax.z) {
    104             max.z = umax.z;
    105         }
    106     }
    107 #endif
    10887    for (BoxHashmap::iterator itr = _boxTable.begin();
    10988         itr != _boxTable.end(); ++itr) {
     
    155134}
    156135
    157 float
    158 Flow::getRelativePosition()
    159 {
    160     return getRelativePosition(&_sv.slicePos);
    161 }
    162 
    163136void
    164137Flow::resetParticles()
     
    314287
    315288    Vector3f scale = volume->getPhysicalScaling();
    316     Vector3f location = _volume->location();
     289    Vector3f pos = _volume->getPosition();
    317290
    318291    if (NanoVis::licRenderer != NULL) {
    319292        NanoVis::licRenderer->
    320293            setVectorField(_volume->textureID(),
    321                            location,
     294                           pos,
    322295                           scale.x,
    323296                           scale.y,
    324297                           scale.z,
    325298                           _volume->wAxis.max());
    326         setCurrentPosition();
    327         setAxis();
    328         setActive();
     299        NanoVis::licRenderer->setSliceAxis(_sv.slicePos.axis);
     300        NanoVis::licRenderer->setSlicePosition(_sv.slicePos.value);
     301        NanoVis::licRenderer->visible(_sv.sliceVisible);
    329302    }
    330303
     
    332305        NanoVis::velocityArrowsSlice->
    333306            setVectorField(_volume->textureID(),
    334                            location,
     307                           pos,
    335308                           scale.x,
    336309                           scale.y,
    337310                           scale.z,
    338311                           _volume->wAxis.max());
    339         NanoVis::velocityArrowsSlice->axis(_sv.slicePos.axis);
    340         NanoVis::velocityArrowsSlice->slicePos(_sv.slicePos.value);
    341         NanoVis::velocityArrowsSlice->enabled(_sv.showArrows);
     312        NanoVis::velocityArrowsSlice->setSliceAxis(_sv.slicePos.axis);
     313        NanoVis::velocityArrowsSlice->setSlicePosition(_sv.slicePos.value);
     314        NanoVis::velocityArrowsSlice->visible(_sv.showArrows);
    342315    }
    343316
     
    345318         itr != _particlesTable.end(); ++itr) {
    346319        itr->second->setVectorField(_volume,
    347                                     location,
     320                                    pos,
    348321                                    scale.x,
    349322                                    scale.y,
     
    433406
    434407    Vector3f volScaling = volume->getPhysicalScaling();
    435     Vector3f loc(volScaling);
    436     loc *= -0.5;
    437     volume->location(loc);
     408    Vector3f pos(volScaling);
     409    pos *= -0.5;
     410    volume->setPosition(pos);
    438411
    439412    Volume::updatePending = true;
Note: See TracChangeset for help on using the changeset viewer.