Make sure that the shape's matrix is 1) not null, and 2) has a matrix that can handle at least the specified number of dimensions.
(int dimensions)
| 3324 | * that can handle <em>at least</em> the specified number of dimensions. |
| 3325 | */ |
| 3326 | protected void checkMatrix(int dimensions) { |
| 3327 | if (matrix == null) { |
| 3328 | if (dimensions == 2) { |
| 3329 | matrix = new PMatrix2D(); |
| 3330 | } else { |
| 3331 | matrix = new PMatrix3D(); |
| 3332 | } |
| 3333 | } else if (dimensions == 3 && (matrix instanceof PMatrix2D)) { |
| 3334 | // time for an upgrayedd for a double dose of my pimpin' |
| 3335 | matrix = new PMatrix3D(matrix); |
| 3336 | } |
| 3337 | } |
| 3338 | |
| 3339 | |
| 3340 | // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
no outgoing calls
no test coverage detected