- Timestamp:
- Aug 31, 2011, 3:52:05 PM (13 years ago)
- Location:
- trunk/packages/vizservers/vtkvis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/RpStreamlines.cpp
r2402 r2454 37 37 _colorMode(COLOR_BY_VECTOR_MAGNITUDE), 38 38 _colorMap(NULL), 39 _seedVisible(true) 39 _seedVisible(true), 40 _dataScale(1) 40 41 { 41 42 _faceCulling = true; … … 246 247 } 247 248 249 double cellSizeRange[2]; 250 double avgSize; 251 _dataSet->getCellSizeRange(cellSizeRange, &avgSize); 252 _dataScale = avgSize / 8.; 253 248 254 vtkSmartPointer<vtkCellDataToPointData> cellToPtData; 249 255 … … 746 752 numSides = 3; 747 753 tubeFilter->SetNumberOfSides(numSides); 748 tubeFilter->SetRadius( radius);754 tubeFilter->SetRadius(_dataScale * radius); 749 755 _pdMapper->SetInputConnection(_lineFilter->GetOutputPort()); 750 756 if (_faceCulling && _opacity == 1.0) … … 771 777 } 772 778 vtkRibbonFilter *ribbonFilter = vtkRibbonFilter::SafeDownCast(_lineFilter); 773 ribbonFilter->SetWidth( width);779 ribbonFilter->SetWidth(_dataScale * width); 774 780 ribbonFilter->SetAngle(angle); 775 781 ribbonFilter->UseDefaultNormalOn(); -
trunk/packages/vizservers/vtkvis/RpStreamlines.h
r2402 r2454 145 145 double _vectorMagnitudeRange[2]; 146 146 double _vectorComponentRange[3][2]; 147 double _dataScale; 147 148 148 149 vtkSmartPointer<vtkLookupTable> _lut; -
trunk/packages/vizservers/vtkvis/RpVtkDataSet.cpp
r2423 r2454 31 31 DataSet::DataSet(const std::string& name) : 32 32 _name(name), 33 _visible(true) 34 { 33 _visible(true), 34 _cellSizeAverage(0) 35 { 36 _cellSizeRange[0] = -1; 37 _cellSizeRange[1] = -1; 35 38 } 36 39 … … 80 83 //reader->ReadAllTensorsOn(); 81 84 reader->ReadAllFieldsOn(); 85 82 86 return setData(reader); 83 87 } … … 88 92 bool DataSet::setData(char *data, int nbytes) 89 93 { 90 TRACE("Entering");91 92 94 vtkSmartPointer<vtkDataSetReader> reader = vtkSmartPointer<vtkDataSetReader>::New(); 93 95 vtkSmartPointer<vtkCharArray> dataSetString = vtkSmartPointer<vtkCharArray>::New(); … … 109 111 reader->ReadAllFieldsOn(); 110 112 111 bool status = setData(reader); 112 113 TRACE("Leaving"); 114 return status; 113 return setData(reader); 115 114 } 116 115 … … 220 219 bool DataSet::setData(vtkDataSetReader *reader) 221 220 { 221 TRACE("Enter"); 222 222 // Force reading data set 223 223 reader->SetLookupTableName(""); … … 238 238 print(); 239 239 #endif 240 TRACE("Leave"); 240 241 return true; 241 242 } … … 515 516 * \brief Get the range of cell AABB diagonal lengths in the DataSet 516 517 */ 517 void DataSet::getCellSizeRange(double minmax[ 6], double *average) const518 void DataSet::getCellSizeRange(double minmax[2], double *average) 518 519 { 519 520 if (_dataSet == NULL || … … 522 523 minmax[1] = 1; 523 524 *average = 1; 525 return; 526 } 527 528 if (_cellSizeRange[0] >= 0.0) { 529 minmax[0] = _cellSizeRange[0]; 530 minmax[1] = _cellSizeRange[1]; 531 *average = _cellSizeAverage; 524 532 return; 525 533 } … … 545 553 minmax[1] = sqrt(minmax[1]); 546 554 *average = sqrt(*average/((double)_dataSet->GetNumberOfCells())); 555 _cellSizeRange[0] = minmax[0]; 556 _cellSizeRange[1] = minmax[1]; 557 _cellSizeAverage = *average; 547 558 } 548 559 -
trunk/packages/vizservers/vtkvis/RpVtkDataSet.h
r2423 r2454 68 68 void getBounds(double bounds[6]) const; 69 69 70 void getCellSizeRange(double minmax[ 6], double *average) const;70 void getCellSizeRange(double minmax[2], double *average); 71 71 72 72 bool getScalarValue(double x, double y, double z, double *value) const; … … 87 87 vtkSmartPointer<vtkDataSet> _dataSet; 88 88 bool _visible; 89 double _cellSizeRange[2]; 90 double _cellSizeAverage; 89 91 }; 90 92
Note: See TracChangeset
for help on using the changeset viewer.