What design to use?
-
Hello, I am developing an application which can be used for digitize a geographical map through GUI and mouse interaction. I am using C++ with wxWidgets and OpenGL Well, here are the list of objects that need to be created using mouse clicks. 1) Points 2) Polyline 3) Polygon 4) Rectangle/Square 5) Ellipse/Circle 6) Text Can any one guide me what will be the best design which can be used to store the data(objects) more efficiently? So that both accessing objects and rendering them will be easier and faster? I have started with Composite Design pattern to store the objects and Visitor Design pattern to render these objects. http://en.wikipedia.org/wiki/Composite_pattern http://en.wikipedia.org/wiki/Visitor_pattern But everytime rendering is done sequentially. Will not this take more time if the number of objects increases? Can anyone suggest me any other technique better and more efficient technique? Thanks in advance Regards
-
Hello, I am developing an application which can be used for digitize a geographical map through GUI and mouse interaction. I am using C++ with wxWidgets and OpenGL Well, here are the list of objects that need to be created using mouse clicks. 1) Points 2) Polyline 3) Polygon 4) Rectangle/Square 5) Ellipse/Circle 6) Text Can any one guide me what will be the best design which can be used to store the data(objects) more efficiently? So that both accessing objects and rendering them will be easier and faster? I have started with Composite Design pattern to store the objects and Visitor Design pattern to render these objects. http://en.wikipedia.org/wiki/Composite_pattern http://en.wikipedia.org/wiki/Visitor_pattern But everytime rendering is done sequentially. Will not this take more time if the number of objects increases? Can anyone suggest me any other technique better and more efficient technique? Thanks in advance Regards
I think it would be useful to adopt a behavior pattern
-
Hello, I am developing an application which can be used for digitize a geographical map through GUI and mouse interaction. I am using C++ with wxWidgets and OpenGL Well, here are the list of objects that need to be created using mouse clicks. 1) Points 2) Polyline 3) Polygon 4) Rectangle/Square 5) Ellipse/Circle 6) Text Can any one guide me what will be the best design which can be used to store the data(objects) more efficiently? So that both accessing objects and rendering them will be easier and faster? I have started with Composite Design pattern to store the objects and Visitor Design pattern to render these objects. http://en.wikipedia.org/wiki/Composite_pattern http://en.wikipedia.org/wiki/Visitor_pattern But everytime rendering is done sequentially. Will not this take more time if the number of objects increases? Can anyone suggest me any other technique better and more efficient technique? Thanks in advance Regards
-
I think it would be useful to adopt a behavior pattern
You mean behavioral design patterns? If yes, then Visitor is a behavioral design pattern only. :)
-
Thanks for that link. Definitely it will be of some use for me. :)
-
That example uses GUI's own graphics context. And I am using OpenGL. So, it won't work with OpenGL. Thanks anyways :)