------------------------------------------------------------------------------ Description: Number of boundaries of dimension `dim' (or all dimensions less than GetDimension() if -1) of the cell. \pre valid_dim_range: (dim==-1) || ((dim>=0)&&(dim =0
| 222 | // \pre valid_dim_range: (dim==-1) || ((dim>=0)&&(dim<GetDimension())) |
| 223 | // \post positive_result: result>=0 |
| 224 | int vtkBridgeCell::GetNumberOfBoundaries(int dim) |
| 225 | { |
| 226 | assert("pre: valid_dim_range" && ((dim == -1) || ((dim >= 0) && (dim < GetDimension())))); |
| 227 | |
| 228 | int result = 0; |
| 229 | if ((dim == 0) && (this->GetDimension() > 1)) |
| 230 | { |
| 231 | result += this->Cell->GetNumberOfPoints(); |
| 232 | if (!this->Cell->IsLinear()) |
| 233 | { // Old cell API treats mid-edge nodes as vertices; subtract those out: |
| 234 | result -= this->Cell->GetNumberOfEdges(); |
| 235 | } |
| 236 | } |
| 237 | if (((dim == -1) && (this->GetDimension() > 1)) || (dim == 1)) |
| 238 | { |
| 239 | result = result + this->Cell->GetNumberOfEdges(); |
| 240 | } |
| 241 | if (((dim == -1) && (this->GetDimension() > 2)) || (dim == 2)) |
| 242 | { |
| 243 | result = result + this->Cell->GetNumberOfFaces(); |
| 244 | } |
| 245 | |
| 246 | assert("post: positive_result" && result >= 0); |
| 247 | return result; |
| 248 | } |
| 249 | |
| 250 | //------------------------------------------------------------------------------ |
| 251 | // Description: |
no test coverage detected