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)
| 3414 | * that can handle <em>at least</em> the specified number of dimensions. |
| 3415 | */ |
| 3416 | protected void checkMatrix(int dimensions) { |
| 3417 | if (matrix == null) { |
| 3418 | if (dimensions == 2) { |
| 3419 | matrix = new PMatrix2D(); |
| 3420 | } else { |
| 3421 | matrix = new PMatrix3D(); |
| 3422 | } |
| 3423 | } else if (dimensions == 3 && (matrix instanceof PMatrix2D)) { |
| 3424 | // time for an upgrayedd for a double dose of my pimpin' |
| 3425 | matrix = new PMatrix3D(matrix); |
| 3426 | } |
| 3427 | } |
| 3428 | |
| 3429 | |
| 3430 | // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
no outgoing calls
no test coverage detected