Changeset 12508 for OpenSceneGraph/trunk/examples/osgvolume/osgvolume.cpp
- Timestamp:
- 06/09/11 12:48:19 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgvolume/osgvolume.cpp
r12507 r12508 548 548 arguments.getApplicationUsage()->addCommandLineOption("--sequence-length <num>","Set the length of time that a sequence of images with run for."); 549 549 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."); 550 552 // arguments.getApplicationUsage()->addCommandLineOption("--raw <sizeX> <sizeY> <sizeZ> <numberBytesPerComponent> <numberOfComponents> <endian> <filename>","read a raw image data"); 551 553 … … 721 723 while(arguments.read("--cpu-tf")) { gpuTransferFunction = false; } 722 724 725 double sampleDensityWhenMoving = 0.0; 726 while(arguments.read("--sdwm", sampleDensityWhenMoving)) {} 727 728 while(arguments.read("--lod")) { sampleDensityWhenMoving = 0.02; } 729 723 730 double sequenceLength = 10.0; 724 731 while(arguments.read("--sequence-duration", sequenceLength) || 725 arguments.read("--sd", sequenceLength)) {}732 arguments.read("--sd", sequenceLength)) {} 726 733 727 734 typedef std::list< osg::ref_ptr<osg::Image> > Images; … … 1119 1126 osgVolume::AlphaFuncProperty* ap = new osgVolume::AlphaFuncProperty(alphaFunc); 1120 1127 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; 1122 1129 osgVolume::TransparencyProperty* tp = new osgVolume::TransparencyProperty(1.0); 1123 1130 osgVolume::TransferFunctionProperty* tfp = transferFunction.valid() ? new osgVolume::TransferFunctionProperty(transferFunction.get()) : 0; … … 1128 1135 cp->addProperty(ap); 1129 1136 cp->addProperty(sd); 1130 cp->addProperty(sdwm);1131 1137 cp->addProperty(tp); 1138 if (sdwm) cp->addProperty(sdwm); 1132 1139 if (tfp) cp->addProperty(tfp); 1133 1140 … … 1142 1149 cp->addProperty(tp); 1143 1150 cp->addProperty(new osgVolume::LightingProperty); 1151 if (sdwm) cp->addProperty(sdwm); 1144 1152 if (tfp) cp->addProperty(tfp); 1145 1153 … … 1153 1161 cp->addProperty(tp); 1154 1162 cp->addProperty(new osgVolume::IsoSurfaceProperty(alphaFunc)); 1163 if (sdwm) cp->addProperty(sdwm); 1155 1164 if (tfp) cp->addProperty(tfp); 1156 1165 … … 1165 1174 cp->addProperty(tp); 1166 1175 cp->addProperty(new osgVolume::MaximumIntensityProjectionProperty); 1176 if (sdwm) cp->addProperty(sdwm); 1167 1177 if (tfp) cp->addProperty(tfp); 1168 1178
