Show
Ignore:
Timestamp:
06/09/11 12:48:19 (4 years ago)
Author:
robert
Message:

Changed the defaults volume setting to not enable the SampleDensityWhenMoving? property.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgvolume/osgvolume.cpp

    r12507 r12508  
    548548    arguments.getApplicationUsage()->addCommandLineOption("--sequence-length <num>","Set the length of time that a sequence of images with run for."); 
    549549    arguments.getApplicationUsage()->addCommandLineOption("--sd <num>","Short hand for --sequence-length"); 
     550    arguments.getApplicationUsage()->addCommandLineOption("--sdwm <num>","Set the SampleDensityWhenMovingProperty to specified value"); 
     551    arguments.getApplicationUsage()->addCommandLineOption("--lod","Enable techniques to reduce the level of detail when moving."); 
    550552//    arguments.getApplicationUsage()->addCommandLineOption("--raw <sizeX> <sizeY> <sizeZ> <numberBytesPerComponent> <numberOfComponents> <endian> <filename>","read a raw image data"); 
    551553 
     
    721723    while(arguments.read("--cpu-tf")) { gpuTransferFunction = false; } 
    722724 
     725    double sampleDensityWhenMoving = 0.0; 
     726    while(arguments.read("--sdwm", sampleDensityWhenMoving)) {} 
     727 
     728    while(arguments.read("--lod")) { sampleDensityWhenMoving = 0.02; } 
     729 
    723730    double sequenceLength = 10.0; 
    724731    while(arguments.read("--sequence-duration", sequenceLength) || 
    725         arguments.read("--sd", sequenceLength)) {} 
     732          arguments.read("--sd", sequenceLength)) {} 
    726733 
    727734    typedef std::list< osg::ref_ptr<osg::Image> > Images; 
     
    11191126        osgVolume::AlphaFuncProperty* ap = new osgVolume::AlphaFuncProperty(alphaFunc); 
    11201127        osgVolume::SampleDensityProperty* sd = new osgVolume::SampleDensityProperty(0.005); 
    1121         osgVolume::SampleDensityWhenMovingProperty* sdwm = new osgVolume::SampleDensityWhenMovingProperty(0.02); 
     1128        osgVolume::SampleDensityWhenMovingProperty* sdwm = sampleDensityWhenMoving!=0.0 ? new osgVolume::SampleDensityWhenMovingProperty(sampleDensityWhenMoving) : 0; 
    11221129        osgVolume::TransparencyProperty* tp = new osgVolume::TransparencyProperty(1.0); 
    11231130        osgVolume::TransferFunctionProperty* tfp = transferFunction.valid() ? new osgVolume::TransferFunctionProperty(transferFunction.get()) : 0; 
     
    11281135            cp->addProperty(ap); 
    11291136            cp->addProperty(sd); 
    1130             cp->addProperty(sdwm); 
    11311137            cp->addProperty(tp); 
     1138            if (sdwm) cp->addProperty(sdwm); 
    11321139            if (tfp) cp->addProperty(tfp); 
    11331140 
     
    11421149            cp->addProperty(tp); 
    11431150            cp->addProperty(new osgVolume::LightingProperty); 
     1151            if (sdwm) cp->addProperty(sdwm); 
    11441152            if (tfp) cp->addProperty(tfp); 
    11451153 
     
    11531161            cp->addProperty(tp); 
    11541162            cp->addProperty(new osgVolume::IsoSurfaceProperty(alphaFunc)); 
     1163            if (sdwm) cp->addProperty(sdwm); 
    11551164            if (tfp) cp->addProperty(tfp); 
    11561165 
     
    11651174            cp->addProperty(tp); 
    11661175            cp->addProperty(new osgVolume::MaximumIntensityProjectionProperty); 
     1176            if (sdwm) cp->addProperty(sdwm); 
    11671177            if (tfp) cp->addProperty(tfp); 
    11681178