473,587 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2781
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*******@graf fiti.netwrote in message
news:48******** *************** ***********@z66 g2000hsc.google groups.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*******@graf fiti.netwrote in message
news:48******** *************** ***********@z66 g2000hsc.google groups.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
GeometryCollect ion.

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
1375
by: Dennis Benzinger | last post by:
Hi! Does anyone know of Python bindings for the Computational Geometry Algorithms Library (http://www.cgal.org/)?
3
3014
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 vector / matrix / quaternion classes I can make use of? Thanks..
0
925
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 and the Command attribute, but i'm having to add some tk options to the geometry method, in the case, pack. Is there a way to overcome this? For...
1
1836
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 with the header "class classtitle(Frame):" in a script called classtitle.py. Having imported classtitle, I create a Frame widget within my gui using...
5
4537
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 to some relevant postings or websites. In any case, I want to create a geometry class that has some base functionalities. The problem I am...
0
1563
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 can see is that I have to load using a set of INSERT (or UPDATE) commands, which are rather verbose, and which produce a lot of messages each time a...
7
9536
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 C++. The terms and conditions of use are very simple and described on the License page. AGG doesn't depend on any graphic API or technology....
3
2143
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 coordinate. How can I do this using the update statement?
7
6576
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 I found what I'm looking for in tk itself: """ 13.3. How can I clear the geometry settings for a toplevel? If you want to have Tk resize your...
12
3884
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 physical part/component, I would like to write a program where they can at least see the resulting geometry and navigate it, i.e., zoon-in/out,...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.