Changeset 4385 for trunk/packages
- Timestamp:
- Jun 12, 2014, 9:27:21 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/VtkDataSetReader.cpp
r4164 r4385 109 109 int iy = 0; 110 110 int iz = 0; 111 vtkDataArray *mask = resampledDataSet->GetPointData()->GetArray("vtkValidPointMask"); 111 112 for (int p = 0; p < npts; p++) { 112 113 int nindex = p * 4; 113 114 double val; 115 int loc[3]; 116 loc[0] = ix; loc[1] = iy; loc[2] = iz; 117 vtkIdType idx = resampledDataSet->ComputePointId(loc); 118 bool valid = (mask->GetComponent(idx, 0) != 0.0); 114 119 if (isVectorData) { 115 120 double vec[3]; 116 int loc[3];117 loc[0] = ix; loc[1] = iy; loc[2] = iz;118 vtkIdType idx = resampledDataSet->ComputePointId(loc);119 121 resampledDataSet->GetPointData()->GetVectors()->GetTuple(idx, vec); 120 122 val = sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]); … … 124 126 data[nindex+3] = (float)vec[2]; 125 127 } else { 126 val = resampledDataSet->GetScalarComponentAsDouble(ix, iy, iz, 0); 127 data[nindex] = (float)val; 128 //val = resampledDataSet->GetScalarComponentAsDouble(ix, iy, iz, 0); 129 val = resampledDataSet->GetPointData()->GetScalars()->GetComponent(idx, 0); 130 data[nindex] = valid ? (float)val : -FLT_MAX; 128 131 } 129 if (val < vmin) { 130 vmin = val; 131 } else if (val > vmax) { 132 vmax = val; 133 } 134 if (val != 0.0 && val < nzero_min) { 135 nzero_min = val; 132 if (valid) { 133 if (val < vmin) { 134 vmin = val; 135 } else if (val > vmax) { 136 vmax = val; 137 } 138 if (val != 0.0 && val < nzero_min) { 139 nzero_min = val; 140 } 136 141 } 137 142
Note: See TracChangeset
for help on using the changeset viewer.