------------------------------------------------------------------------------
| 148 | |
| 149 | //------------------------------------------------------------------------------ |
| 150 | void vtkXMLWriterBase::SetBlockSize(size_t blockSize) |
| 151 | { |
| 152 | // Enforce constraints on block size. |
| 153 | size_t nbs = blockSize; |
| 154 | #if VTK_SIZEOF_DOUBLE > VTK_SIZEOF_ID_TYPE |
| 155 | typedef double LargestScalarType; |
| 156 | #else |
| 157 | typedef vtkIdType LargestScalarType; |
| 158 | #endif |
| 159 | size_t remainder = nbs % sizeof(LargestScalarType); |
| 160 | if (remainder) |
| 161 | { |
| 162 | nbs -= remainder; |
| 163 | nbs = std::max(nbs, sizeof(LargestScalarType)); |
| 164 | vtkWarningMacro("BlockSize must be a multiple of " |
| 165 | << int(sizeof(LargestScalarType)) << ". Using " << nbs << " instead of " << blockSize |
| 166 | << "."); |
| 167 | } |
| 168 | vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting BlockSize to " << nbs); |
| 169 | if (this->BlockSize != nbs) |
| 170 | { |
| 171 | this->BlockSize = nbs; |
| 172 | this->Modified(); |
| 173 | } |
| 174 | } |
| 175 | //------------------------------------------------------------------------------ |
| 176 | int vtkXMLWriterBase::Write() |
| 177 | { |
no test coverage detected