Drawing3d documented Class Library

ITransform Interface

If an object implements the interface ITransform it will be transformated by calling this interface

For a list of all members of this type, see ITransform Members .

[Visual Basic]
Public Interface ITransform
[C#]
public interface ITransform

Types that implement ITransform

Type Description
ActiveCtrl The ActiveCtrl inherits from DrawCtrl. It holds properties and methods to implement interactive manipulations of graphical datas.
With the Mouse- and Keyevents you have an instrument to handle actions of an user. By a click you get information about the tag, which is set as parameter to these methods.
...
protected override void draw(MNDevice device)
    { 
    ...
        ctrlMarker(new xyz(4, 4, 0), 2006);
        // draws a marker at position (4 / 4/ 0)
        // if the mouse moves over this marker, it will be highlighted with 
        //hovercolor
        ctrlMarker(new xyz(0, 4, 0), 2007);
        ctrlMarker(new xyz(0, 0, 0), 2008);
        
    ...
        
    }

protected override void MouseMove( System.Windows.Forms.MouseEventArgs e)
    {
    if (CurrentHit!=null)
     switch ((int)CurrentHit.Tag)
     {
        case 2006 :// Mouse is at Marker  4/ 4/ 0 
                    break;
        case 2007 :// Mouse is at Marker  0/ 4/ 0 
                    break;
        case 2008 :// Mouse is at Marker  0/ 0/ 0 
                    break;
     }
    }
...
Arc The class a encapsulate properties and method about an arc, i.e a part of a ellipse. It has main properties Center, aRadius, bRadiusAlfa, Beta and Orientation. By these properties an arc is unique defined. Aditionally the is a fine method ReShape, who allows you to define an arc by a point and a tangent.
Bezier The class Bezier implements a Bezier curve. This curve is initialized by four control points, which make the curve to a cubic Bezier. By setting the Points you can make a bezier of any degree.
Bezier3D The class Bezier implements a Bezier curve. This curve is initialized by four control points, which make the curve to a cubic Bezier. By setting the Points you can make a bezier of any degree.
BSpline The class BSpline implements a BSpline curve. This Class contains ControlPoints and the property Degree. The curve is trimmed to his endpoints. The controlPointsarray is initialized with four zero values. The Degree is initialized with 3.
BSpline3d The class BSpline implements a BSpline curve. This Class contains ControlPoints and the property Degree. The curve is trimmed to his endpoints. The controlPointsarray is initialized with four zero values. The Degree is initialized with 3.
Circle3D Implements a Circle, which is given in the x-y Plane of the Base.The Center is the Base.BaseO. The range for the parameter goes from 0 to 1 and calculate the values in a the sense, which is given by the property Clockwise, whixh is fals by default. If you will produce a an arc from 0° to 90° you have set fromParam to 0 and toParam to 0.25.
Curve The class Curve represents a two-dimensional parameterized mathematical curve. The parameter is restricted to the interval [0, 1]. To define a curve you have to override the abstract Methods Value and Derivation If this is done, a curve can be drawn in a device by the method drawCurve. Additionally a curve has a resolution. This is used by the method ToArray, which retrieves an array with Resolution+1 points.
Curve3D The class Curve3D represents a thre-dimensional parameterized mathematical curve. The parameter is restricted to the interval [fromParam, toParam]. fromParam and toParam are initialized by 0 and 1.
To define your own curve you have to override the Methods Value and Derivation
value : R -> R³. If this is done, a curve can be drawn in a device by the method drawCurve. Additionally a curve has a resolution. This is used by the method ToArray, which retrieves an array with Resolution+1 points.
CurveArray This class is a container for curves.
In general the curves don`t havo to be coherently.
The Count-property is read- and writeable. A CurveArrray can be drawn directly by calling drawPolyCurve It is a ArrayList which contains an ITransform-Interface.
Line Line, which contains the two points A and B and describes a line between A and B.
Line3D Line, which contains the two points A and B and describes a line between A and B.
Loca Loca represents a List of curveArrays. The class is mostly needed for describing areas which are bounded by curves and have additional holes, which are bounded by curves as well.
With drawPolyPolyCurve you can draw a Loca. In this case the CurveArrays are assumed to be coherently. If you want to make visible holes, every curve array, which lays inside of an other, must have an orientation, which is different to that. For example: If Loca[0] has a clockwise orientation and Loca[1] lays completely inside of Loca[0] then Loca[1] must have a counterclocwise orientation. In this case you have a hole, described by Loca[1]- inside Loca[0].
MappedCurve Defines a Curve lying on a Surface by mapping a 2d-Curve to a surface. It contains a surface Mapper and a 2D-Curve Curve2d. The 3D-Curve.value is given by a call to Curve2d.value(t), which gives the parameter u,v. The Value of u and v retrieves the points of a Curve on the surface.
 xy v = Curve2d.Value(t);
 Mapper.Value(v.x, v.y);
MNCurve MNCurve is defined on reason of compatibility
Nurbs2d The class Nurbs2d implements a non uniform rational bspline. This Class contains ControlPoints and the property Degree, Knots and Weights. The curve is trimmed to his endpoints. The Degree is initialized with 3.
Nurbs3d The class Nurbs implements a non uniform rational bspline. This Class contains ControlPoints and the property Degree, Knots and Weights. The curve is trimmed to his endpoints. The Degree is initialized with 3.
QSpline QSpline represents a quadratic spline which has the three control points A, B and ControlPoint. Additionally it holds a weight, which represents the attractivity of the ControlPoint. By default, the weight is set to 1.
SurfaceCurve A Surface curve inherits from Curve3D and adds the property MappedCurves and Curve. She is considered as Container for th Curve. The interpolationpoints of the SurfaceCurve are the same as the Interpolationpoints from the Curve.
If the SurfaceCurve is an Edge of a Surface the the MappedCurves property has in general two elements, so a link to the neighborsurface is given.
DrawCtrl The class DrawCtrl contains a lot of controlled drawing methods:setparen The methods ctrlMarker, ctrlLine, ctrlCurve, ctrlCircle and ctrlPoly are nice drawing methods. They change the Color ( HoverColor if the mouse is positioned over it. In addition they have a "Tag". With this Tag you can identify the DrawCtrl and so this class is very useful to make interactive components. It is related to a Device and is located as child of Work
Cursor3d The class can be used to get interactively some 3D-cordinates. The Cursor3d catches the mouse position and calculates the nearest point to the cordinate axes, which is associated to the Base. This point you get from the Posxyz-property.
With the Position-property you set the Base.BaseO.
Entity Entity is the foundation class for all graphical classes. She contains a Transformation and can ordered in a treestructured system because she is an instance of MNComponent. Additionally, she has a public virtual Paintmethod, which will be called by the parent. To start this painting one of the parents must be setted as Root of a device or as child of Work of a device. In order to that the device starts the painting by its own Paint-Method.
The method Paint is called by the protected method draw. Its better to override draw than Paint, because in the Paintmethod some calls enclose the drawmethod (for example the transformation will be setted).
Loxy Loxy is a List of xyzArrays. This is sometimes needed in geometry, when a polygon contains holes.
Loxyz Loxyz is a List of xyzArrays. This is sometimes needed in geometry, when a polygon contains holes.
Plane An essential geometrical object is a Plane. We represent a plane allways by a point and a normal vector, which is normalized.
xyArray The class xyArray is our base container for points of type xy. It has some pretty properties and Methods. So the Count is setable. With the Value method you get for any positive param < Count a point, which lies on the polygon. Also a triangulation is implemented, which returns a

The Method returns if the xyArray is clockwise orientated, a positive value otherwise the value is negative. The length of cross is twice the area of the xyArray.
xyzArray The class xyzArray is our base container for points of type xyz. It has some pretty properties and Methods. So the count is setable. With the Value method you get for any positive param < Count a point, which lies on the polygon. Also a triangulation is implemented, which returns a

The Method returns if the xyzArray is plane, a normal vector. His length is 2*area of the closed polygon.
MeshContainer A Meshcontainer is an Entity, whose overrides the draw-method. It contains Meshes, which is a List of Mesh and it draws this list. Additionally it contains MaxBox and Center. Whith this two properties you can calculate a position for drawing.
With the method LoadFromFile you can load a 3ds-File.
DiscreteCone Ein DicreteCone ist fast dasselbe wie ein Cone mit dem Unterschied, dass die Mantelfäche des DiscreteCone aus lauter Ebenen Flächen besteht (entsprechend UResolution und VResolution) und ein Cone ein Cone als Tägergeometrie für den Matel besitzt. Der Grund liegt darin, dass zum jetzigen Zeitpunkt der Entwicklung, auf Solids, von denen alle Faces eine ebene Geometrie haben (Surface = PlaneSurface mengentheoretische Operationen wie Vereinigung, Durchschnitt und Komplementaäsolid angewandt werden können.
DiscreteSolid Ein DiscreteSolid enthält nur eben Faces, deren Surface eine PlaneSurface ist.
Solid Die Klasse Solid im SolidSurface-Modell realisiert einen massiven 3D-Körper und nicht nur ein Oberflächenmodell.

Folgende Listen sind habe zentrale Bedeutung:

1. Die Punkteliste (VertexList)

2. Die Kantenliste (EdgeList)

3. Die Oberflächenliste (FaceList)

4. Die 3D-Kurvenliste (EdgeCurveList)


Durch diese Listen sind die Geometrie und die Topologie des Körpers vollständig definiert.

Die Punkteliste

Sie enthält alle Eckpunkte eines Körpers. Die Koordinaten zweier verschiedener Punkte sind im Allgemeinen gleich, aber es kann durchaus vorkommen, dass sie übereinstimmen.
Die Punkte sind Klassen vom Typ Vertex3d.

Die Kantenliste:
Die Kanten sind vom Typ Edge.
Eigenschaften von Edge:
- EdgeStart und EdgeEnd: Zu jedem Paar von von Punkten A, B des Solid gibt es ein Paar(!) von "Softwarekanten" Edge. Die eine Kante hat A als Anfgangspunkt EdgeStart und B als Endpunkt EdgeEnd, die andere Kante hat A als Endpunkt und B als Anfangspunkt. Die beiden Kanten nennen wir zu einander duale Kanten. Es ist oft wichtig, zu einer Kante ihre duale Kante zu bestimmen.
Ein Quader besitzt somit 24 Edge.
Zu jeder Edge ist eindeutig ein Face zugeordnet. Rechterhand derKante liegt die Oberfläche von Face. Alle Kanten, die zu einem Face gehören, umschließen eine Fläche. die im Uhrzeigersinn umlaufen wird.
- ParamCurve: Eine zweidimensionale Kurve, die sich auf den Parameterraum von Face bezieht. Sie stellt die Grenzen der Oberfläche dar, deren Geometrie durch Face bestimmt wird. .
Ist z.B. das Face der Mantel eines Zylinders ( Cone) und ParamCurve eine Gerade von (0,0) nach (PI,0), so ergibt dies einen Halbkreis in R³.

- EdgeCurve: Eine dreidimensionale Kurve, die identisch ist mit der durch ParamCurve und definierten Kurve. Eine Kante und ihre duale Kante besitzen nur eine gemeinsame EdgeCurve. Z.B.: besitzt ein Quader 12 EdgeCurves. Siehe EdgeCurveList.
Eine 3D-Curve besitzt die Eigenschaft Neighbors, ein array bestehend aus den zwei benachbarten Faces. Diese Eigenschaft ist wichtig, um von einem Face via Edge zum Nachbarface zu gelangen.
-SameSense: Durch die ParamCurve und ddie zugehörige Geometrie wird eine 3D-Curve definiert. Ist SameSense = true, so ist diese Kurve identisch mit EdgeCurve andernfalls ist diese Kurve invertiert.

Die Oberflächenliste:
Sie besteht aus Oberflächen, die das Solid begrenzen: Faces.
Eigenschaften von Face:
- Surface: Enthält die Geometrie der Obfläche. Von ParamCurves wird sie verwendet, um 3D- Kurven zu evaluieren.
-ParamCurves: Sie bestimmen die Berandung der Oberflächen. Tatsächlich werden sie immer wieder neu berechnet, wenn sich ein Änderung der Topologie oder der Geometrie des Solids ereignet hat. Sie werden lediglich zu raschen Renderung des Solids benötigt. Neu berechnet können sie werden aus den Inhalten von Bounds mit der Methode RefreshParamCurves.
-Bounds:
Sie bestehen aus Listen von EdgeList. Die 0-te EdgeList gibt die äußere Kontur des Face an und sollten die Overfläche im Uhrzeigersinn um laufen. Liegt eine Edgelist geometrisch innerhalb einer anderen, so muss deren Umlaufssinn umgekehrt sein.
Besitzt z.B.: eine Flaäche eine Umrandung und ein Loch, so ist Bounds.Count = 2. Bounds[0] ist im Uhrzeigersinn und Bounds[1] im Gegenuhrzeigersinn. Natürlich muss Bounds[1] vollständig innerhalb von Bounds[0] liegen.
/
Die 3D-Kurvenliste:/
Zu jeder "physikalischen" Kante eines Solids gibt es genau eine Curve3D. Zwei zueinander duale Kanten besitzen die gleiche Kurve. Für die Topologie des Solids ist das Feld Neighbors wichtig, das beide Nachbarfaces enthält die an einander entlang der 3D-Kurve grenzen.
SolidBox Ein massiven Quader der Größe Size.
SolidCone Ein massiver Kegelstumpf.
SolidExtrude Definiert ein Solid, das entsteht, wenn man eine Loxy extrudiert mit einer bestimmten Höhe. Alle Surfaces sind PlaneSurface
TaskCtrl The class TaskCtrl is specially made for bigger interactive actions. He inherits from ActiveCtrl and has additionally two important parts: The taskhandling with StateBusy and Terminate
. The Undo-Redo-handling: Most of them is static. So CommitList, RedoListMaxCommitUnDoReDoLastCommit Only Commit are not static and the virtual Undo- and Redo-methods, which are called from the static ones.
The handling is easier as it seems to be.
1. You have to override GetUndoData and GetRedoData
2. Override UnDo and ReDo
3. You have to call "Commit" at several points in your code.
In GetUndoData you return the data that you need in Undo.
The correspondence is given by an id.

Requirements

Namespace: Drawing3d.Math

Assembly: Drawing3d (in Drawing3d.dll)

See Also

ITransform Members | Drawing3d.Math Namespace