| 5025 | } |
| 5026 | |
| 5027 | void vtkExodusIIReaderPrivate::SetObjectArrayStatus(int otyp, int i, int stat) |
| 5028 | { |
| 5029 | stat = (stat != 0); // Force stat to be either 0 or 1 |
| 5030 | std::map<int, std::vector<ArrayInfoType>>::iterator it = this->ArrayInfo.find(otyp); |
| 5031 | if (it != this->ArrayInfo.end()) |
| 5032 | { |
| 5033 | int N = (int)it->second.size(); |
| 5034 | if (i < 0 || i >= N) |
| 5035 | { |
| 5036 | vtkDebugMacro("You requested array " << i << " in a collection of only " << N << " arrays."); |
| 5037 | return; |
| 5038 | } |
| 5039 | if (it->second[i].Status == stat) |
| 5040 | { |
| 5041 | // no change => do nothing |
| 5042 | return; |
| 5043 | } |
| 5044 | it->second[i].Status = stat; |
| 5045 | this->Modified(); |
| 5046 | // FIXME: Mark something so we know what's changed since the last RequestData?! |
| 5047 | // For the "global" (assembled) array, this is tricky because we really only want |
| 5048 | // to invalidate a range of the total array... For now, we'll just force the "global" |
| 5049 | // array to be reassembled even if it does mean a lot more copying -- it's not like |
| 5050 | // it was any faster before. |
| 5051 | // vtkExodusIICacheKey key( 0, GLOBAL, 0, i ); |
| 5052 | // vtkExodusIICacheKey pattern( 0, 1, 0, 1 ); |
| 5053 | this->Cache->Invalidate( |
| 5054 | vtkExodusIICacheKey(0, vtkExodusIIReader::GLOBAL, otyp, i), vtkExodusIICacheKey(0, 1, 1, 1)); |
| 5055 | } |
| 5056 | else |
| 5057 | { |
| 5058 | vtkDebugMacro("Could not find collection of arrays for objects of type " |
| 5059 | << otyp << " (" << objtype_names[this->GetObjectTypeIndexFromObjectType(otyp)] << ")."); |
| 5060 | } |
| 5061 | } |
| 5062 | |
| 5063 | void vtkExodusIIReaderPrivate::SetInitialObjectArrayStatus( |
| 5064 | int objectType, const char* arrayName, int status) |