------------------------------------------------------------------------------
| 167 | |
| 168 | //------------------------------------------------------------------------------ |
| 169 | int vtkXMLStructuredDataReader::ReadPiece(vtkXMLDataElement* ePiece) |
| 170 | { |
| 171 | if (!this->Superclass::ReadPiece(ePiece)) |
| 172 | { |
| 173 | return 0; |
| 174 | } |
| 175 | int* pieceExtent = this->PieceExtents + this->Piece * 6; |
| 176 | |
| 177 | // Read the extent of the piece. |
| 178 | if (strcmp(ePiece->GetName(), "Piece") == 0) |
| 179 | { |
| 180 | if (!ePiece->GetAttribute("Extent")) |
| 181 | { |
| 182 | vtkErrorMacro("Piece has no extent."); |
| 183 | } |
| 184 | if (ePiece->GetVectorAttribute("Extent", 6, pieceExtent) < 6) |
| 185 | { |
| 186 | vtkErrorMacro("Extent attribute is not 6 integers."); |
| 187 | return 0; |
| 188 | } |
| 189 | } |
| 190 | else if (ePiece->GetVectorAttribute("WholeExtent", 6, pieceExtent) < 6) |
| 191 | { |
| 192 | vtkErrorMacro("WholeExtent attribute is not 6 integers."); |
| 193 | return 0; |
| 194 | } |
| 195 | |
| 196 | // Compute the dimensions and increments for this piece's extent. |
| 197 | int* piecePointDimensions = this->PiecePointDimensions + this->Piece * 3; |
| 198 | vtkIdType* piecePointIncrements = this->PiecePointIncrements + this->Piece * 3; |
| 199 | int* pieceCellDimensions = this->PieceCellDimensions + this->Piece * 3; |
| 200 | vtkIdType* pieceCellIncrements = this->PieceCellIncrements + this->Piece * 3; |
| 201 | |
| 202 | this->ComputePointDimensions(pieceExtent, piecePointDimensions); |
| 203 | this->ComputePointIncrements(pieceExtent, piecePointIncrements); |
| 204 | this->ComputeCellDimensions(pieceExtent, pieceCellDimensions); |
| 205 | this->ComputeCellIncrements(pieceExtent, pieceCellIncrements); |
| 206 | |
| 207 | return 1; |
| 208 | } |
| 209 | |
| 210 | //------------------------------------------------------------------------------ |
| 211 | void vtkXMLStructuredDataReader::ReadXMLData() |
nothing calls this directly
no test coverage detected