473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Geometry-Sample to explain OOP in C#

Hello,

do you know an URL for me where to find a sample for an abstract
Geometry class, where classes like Point, Line, Area are inherited.
This sample should explain OOP (what is inheritance, polymorphism,
encapsulation, ...)

Thank you,
Norbert
Sep 6 '08 #1
3 2771
It may not be exactly what you want but the animation example on my site has
some simple graphical objects that derive from a base.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Norbert Pürringer" <th*******@graffiti.netwrote in message
news:48**********************************@z66g2000 hsc.googlegroups.com...
Hello,

do you know an URL for me where to find a sample for an abstract
Geometry class, where classes like Point, Line, Area are inherited.
This sample should explain OOP (what is inheritance, polymorphism,
encapsulation, ...)

Thank you,
Norbert
Sep 6 '08 #2
Inherited from what? A Shape class?

I can help you out if you're willing to spend a lousy five or six bucks on a
used book. Go to Amazon and buy a copy of the C# Class Design Handbook
published by Wrox. Just plug in your words and you're all set with an entire
treatise that covers the spectrum of OOP as it pertains to its fundamental
unit; the class.

Then you can write the next AutoCAD :-)

Answer for extra credit: minimum number of vectors required to initialize a
3D primitive object which is derived from the least number of instances of
the Line class as possible. Its a two part question: What is the least
primitive object and what are its properties?

You can plug thoughts like that into the C# Class Design Handbook and get
insight out the other end. For less than ten bucks.

"Norbert Pürringer" <th*******@graffiti.netwrote in message
news:48**********************************@z66g2000 hsc.googlegroups.com...
Hello,

do you know an URL for me where to find a sample for an abstract
Geometry class, where classes like Point, Line, Area are inherited.
This sample should explain OOP (what is inheritance, polymorphism,
encapsulation, ...)

Thank you,
Norbert
Sep 6 '08 #3
Hello,

thank you for your advises.

I have written a geometry sample by my own. As guide I used the Simple
Feature Access specification by OGC. There is an abstract Geometry
object and descendants like Point, Polyline, Polygon and
GeometryCollection.

The Geometry class contains the abstract properties or methods like
GeometryType, Is3D, Empty and GetWKT. GetWKT is a quite good sample to
explain polymorphism. You can call this function for each geometry
object. The sub class implements the Well Known Text algorithm.

Thank you again,

Norbert
Sep 7 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dennis Benzinger | last post by:
Hi! Does anyone know of Python bindings for the Computational Geometry Algorithms Library (http://www.cgal.org/)?
3
by: Will McGugan | last post by:
Hi, Is there a general purpose 3D geometry module for Python? I would like to be able to read / write 3D models and perform per vertex / per face operations on them. Failing that, are there...
0
by: Gabriel B. | last post by:
i'm using almost every widget property from my pyTk programs in the form of resources, like: self.tk.option_add ( "*InputClass*background", "White" ) In the widget creation i have only the Class...
1
by: Shankar Iyer (siyer | last post by:
Hi, I am still new to Python and Tkinter, so I apologize in advance if I do not word my question optimally. I am trying to use a frame widget as the parent for other widgets. There is a class...
5
by: Jon | last post by:
Hello all, I'm certain this question has been asked before; I was unsure what terms to search for within the newsgroup archive to find the proper answer I wanted. Hopefully someone can point me...
0
by: Clive Page | last post by:
I am trying to use the geometry data types introduced in version 4.1-alpha and the spatial indexing seems to work well. But I have a large volume of data to load, and from the documentation all I...
7
by: Maxim Shemanarev | last post by:
I'd like to announce my project called Anti-Grain Geometry. http://www.antigrain.com Anti-Grain Geometry (AGG) is an Open Source, free of charge graphic library, written in industrially standard...
3
by: Otavio Macedo | last post by:
Hi, I am working with MySQL 4.1 and I got a table with a point field. I need to do an "offset" in all the points, that is, adding some deltaX to the X coordinate and a deltaY to the Y...
7
by: Chris | last post by:
Hi, If a user resizes a Toplevel window, or I set a Toplevel's geometry using the geometry() method*, is there any way to have the geometry reset to that required for all the widgets? I think...
12
by: gsal | last post by:
What would be the easiest way to go about offering 3D graphics for the purpose of rendering geometry? Suppose engineers (my co-workes) have to design some enclosure, nozzle, bracket, or whatever...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.