[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Proposal for the geometric engine, RFC
The geomtric engine will go into deep change in the next month, I
enclose there what i'm going to change, If you have suggestion you
want to appear, this is the good time to tell me.
Hilaire
----------------
The problems:
1. When a curve class is added, new point classes need to be added:
a. a class representing a point on this curve.
b. classes representing intersection point with this kind of
curve and the already existing ones.
c. classes representing the transformation of this curve
(rotation, translation, symetry, reflexion & scale)
2. The locus classes use two kind of point: point on a curve & point
with constraint. However, in the actual object representation there is
no mother class of point on curve, this is troublesome.
3. Locus need a different object for each kind of cruve a point is
mobile on.
Proposals:
1. There is 3 base objects: point, curve and vector all derived from
an abstract object geometricObject
a. derivated form basic point object we have: free point on a
plane, free point on a curve, intersection points and transformed
point. (the parent& are stored in one GList and data in another or
parent& + data are strored in an union structure, not yed decided but
not only pointer data need to be stored)
b. derivated from curve object we have: line, half-line,
segment, circle, arc circle and locus. The transformed representation
of this object and variant representation (ex: a line can be defined
by two points, a point and a line (parallel or perpendicular) can be
represented by this classes, the parent& are stored in GList or union
structure.
The constructor of this objects will look like :
objectName(parentList&, dataList&, type);
Object pointed in dataList should be re-instanced in the class
and referenced in a data list.
The curve object are in charge of computing the coordinate of
a free point on it, given an abscissa. They also compute the coordinate
of an intersection point with another kind of curve.
c. vector can be moved independently of their origin and end,
so that the representation is coherent with the math. representation.
All this mean we will need less classes to describe all the geometric
object:
geometricObject
+-point+
| |
| +-freePoint
| +-freePontOnCurve
| +-intersectionPoint
| +-transformedPoint
+-line
+-halfLine
+-segment
+-circle
+-arcCircle
+-locus
+-vector
Compared to the actual situation where we have 10th of object this
will make the structure more easy to manage and extend.
2. A new objet: coordinate referential is added; it is composed of one
point and two vector (probably three points can be an additional
possibility to build it)
3. Each geometric object depends on a coordinate referential, so the
object coordinate are relative to one referential. This allows
teaching this topic. Technically this mean the geomtricObject
contained a reference to a coordinate referential. There is a
mechanism to change the referential attached to one obcjet