Changeset 2513
- Timestamp:
- Sep 15, 2011, 10:45:04 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/RpStreamlines.cpp
r2510 r2513 422 422 double bounds[6]; 423 423 _dataSet->getBounds(bounds); 424 double xLen = bounds[1] - bounds[0]; 425 double yLen = bounds[3] - bounds[2]; 426 double zLen = bounds[5] - bounds[4]; 424 427 double maxBound = 0.0; 425 if ( bounds[1] - bounds[0]> maxBound) {426 maxBound = bounds[1] - bounds[0];427 } 428 if ( bounds[3] - bounds[2]> maxBound) {429 maxBound = bounds[3] - bounds[2];430 } 431 if ( bounds[5] - bounds[4]> maxBound) {432 maxBound = bounds[5] - bounds[4];428 if (xLen > maxBound) { 429 maxBound = xLen; 430 } 431 if (yLen > maxBound) { 432 maxBound = yLen; 433 } 434 if (zLen > maxBound) { 435 maxBound = zLen; 433 436 } 434 437 … … 461 464 462 465 _streamTracer->SetInput(ds); 463 _streamTracer->SetMaximumPropagation( 2.0 * maxBound / avgSize);466 _streamTracer->SetMaximumPropagation(xLen + yLen + zLen); 464 467 _streamTracer->SetIntegratorTypeToRungeKutta45(); 468 469 TRACE("Setting streamlines max length to %g", 470 _streamTracer->GetMaximumPropagation()); 465 471 466 472 if (_pdMapper == NULL) { … … 1000 1006 * \brief Set the step size units. Length units are world 1001 1007 * coordinates, and cell units means steps are from cell to 1002 * cell. Default is cell units 1008 * cell. Default is cell units. 1009 * 1010 * Note: calling this function will not convert existing 1011 * initial, minimum or maximum step value settings to the 1012 * new units, so this function should be called before 1013 * setting step values. 1003 1014 */ 1004 1015 void Streamlines::setIntegrationStepUnit(StepUnit unit) … … 1063 1074 1064 1075 /** 1065 * \brief Set maximum length of stream lines in integration1066 * step units (see setIntegrationStepUnit)1076 * \brief Set maximum length of stream lines in world 1077 * coordinates 1067 1078 */ 1068 1079 void Streamlines::setMaxPropagation(double length) … … 1196 1207 return; 1197 1208 1198 vtkDataSet *ds = _dataSet->getVtkDataSet();1199 1200 1209 switch (mode) { 1201 1210 case COLOR_BY_SCALAR: { … … 1210 1219 _pdMapper->ScalarVisibilityOn(); 1211 1220 _pdMapper->SetScalarModeToUsePointFieldData(); 1212 if (ds->GetPointData() != NULL && 1213 ds->GetPointData()->GetVectors() != NULL) { 1214 _pdMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName()); 1215 } 1221 _pdMapper->SelectColorArray(_dataSet->getActiveVectorsName()); 1216 1222 if (_lut != NULL) { 1217 1223 _lut->SetRange(_vectorMagnitudeRange); … … 1223 1229 _pdMapper->ScalarVisibilityOn(); 1224 1230 _pdMapper->SetScalarModeToUsePointFieldData(); 1225 if (ds->GetPointData() != NULL && 1226 ds->GetPointData()->GetVectors() != NULL) { 1227 _pdMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName()); 1228 } 1231 _pdMapper->SelectColorArray(_dataSet->getActiveVectorsName()); 1229 1232 if (_lut != NULL) { 1230 1233 _lut->SetRange(_vectorComponentRange[0]); … … 1236 1239 _pdMapper->ScalarVisibilityOn(); 1237 1240 _pdMapper->SetScalarModeToUsePointFieldData(); 1238 if (ds->GetPointData() != NULL && 1239 ds->GetPointData()->GetVectors() != NULL) { 1240 _pdMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName()); 1241 } 1241 _pdMapper->SelectColorArray(_dataSet->getActiveVectorsName()); 1242 1242 if (_lut != NULL) { 1243 1243 _lut->SetRange(_vectorComponentRange[1]); … … 1249 1249 _pdMapper->ScalarVisibilityOn(); 1250 1250 _pdMapper->SetScalarModeToUsePointFieldData(); 1251 if (ds->GetPointData() != NULL && 1252 ds->GetPointData()->GetVectors() != NULL) { 1253 _pdMapper->SelectColorArray(ds->GetPointData()->GetVectors()->GetName()); 1254 } 1251 _pdMapper->SelectColorArray(_dataSet->getActiveVectorsName()); 1255 1252 if (_lut != NULL) { 1256 1253 _lut->SetRange(_vectorComponentRange[2]);
Note: See TracChangeset
for help on using the changeset viewer.