Description
Hi everybody!
I noticed the following naming inconsistency:
- RectangleShape has a span in every direction and is therefore a hypercube and centered
- CenteredRectangleShape has no non-centered counterpart.
In general, there are no non-centered RectangleShapes and RectangleShape could be easily implemented over a fitting span parameter for CenteredRectangleShape.
This will probably be hard to do because of API breaks, but I would suggest the following:
Rename CenteredRectangleShape
to (Hyper)RectangleShape
and make it uncentered, then do the centering and the Cube
shapes over constructor parameters or subclasses (Hyper)CubeShape
and Centered*Shape
.
As far as I can tell, the current implementation of RectangleNeighborhood (aka. CenteredRectangleNeighborhood) is flexible enough to be easily adapted to an uncentered implementation.
Benefits: Straight-forward naming and code reuse for all Rectangle-based shapes.
Please tell me what you think and if I missed something.
Greetings, Squareys.