graphics - In terms of OO design, can two-d and the three-d point classes be derived from single base class? -


I am currently designing for a simple graphic editor, which is trivial for two-dimensional and three-dimensional size Support works.
The issue is, I want to render the prototype of these shapes, because MSPPent does. And right now it is rendering what I need to store pixels from canvas, which is covered by prototype, just because the prototype varies to restore its position on the canvas. Therefore, I want to support all such shapes to support this type of buffering (graphic operation is the basis square of all the rendering operations):

  Public abstract class shape: graphic operation {secure list & Lt; SomePoint & gt; Backup; Public shape (color C): base (C) {} public color picture {{color of return is obtained; } Protected Set {color = value; }} Public abstract zero Render Prototype (bitmap canvas tridone); }  


The main idea is that in the context of o o design it would be great to provide buffer support at the base class (shape) level, I mean two diappets and This list should be started separately for classes to 3DSpe - with two diapap examples, with two depot examples, and with three DPIT examples for thridship.
But to do this, there should be a two-dimensional point for two points for both points, and the three-dimensional point class Acceptable to get from?
There are so many words, but I just want to clarify the problem to everyone.
edit : BTW, is it a good idea to get points from the size of your king? I personally do not see any other option, but will it be better if I get it straight from the shape? Now it is:

  Public abstract class two-D size: Size {secure list & lt; Some point & gt; Backup; Public Dodship (Color C): Base (C) {}} Public Class Two Deport: Two Dashp {// ...}  

And it is for three DPE.

I do not see any reason, but if the difference between the shape is only in the type of those points, So why do not you create a template or "normal" in the Java language?


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -