Drawing3d documented Class Library

Drawing3d Namespace

Namespace Hierarchy

Classes

Class 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;
     }
    }
...
Camera Enthält sämtliche Eigenschaften, die benötigt werden, um eine Szene mit einer Kamera zu betrachten. Base,Angles,Yaw,Pitch,Roll, FieldOfView, NearClipping,FarClipping,Panning, Position,DirectionFocus,Center die wichtigsten Eigenschaften sind:
Position : Position der Kamera
Direction: Richtung, in die die Kamera gerichtet ist
Focus: Abstand von der Kamera. Er bestimmt das Center Center: Center kann nur gelesen werden. Beim automatischen Navigieren, bleibt das Center in Ruhe
CameraEditor Eine Klasse, die von UITypeEditor abstammt. Sie zeigt zu einer Eigenschaft einen modalen Dialog an, der ein PropertyGrid besitzt.
D3DCursors Summary for cursors.
D3DReader Together with D3DWriter is it the base of the Drawing3d-streamingconcept. Its a simple thing: If O is a arbitrary object, you can save it with WriteObject and load with ReadObject. This is necessary: 1. Every object must have a constructor without a parameter. 2. Fields, you want to write in the file have to be public3. An object that is used as a link must be marked by [Link], otherwise it will also be written into the file. In this case the linked object must implement the ISerializePath-interface The structure is xml-like.
D3DWriter Together with D3DReader it is the base of the Drawing3d-streaming concept. Its quite simple: If O is a arbitrary object, you can save it with WriteObject and load with ReadObject.
double_2Editor Eine Klasse, die von UITypeEditor abstammt. Sie zeigt zu einer Eigenschaft einen modalen Dialog an, der ein PropertyGrid besitzt.
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
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).
EventServer An EventServer distributes events to a list of IEvents. By login a IEvents will be inserted in this list. By logout a IEvents will be removed from this list. The EventsServer by himself will be served by an other object (in our case by MNDevice) which gets the events by the windows main loop. This object calls the public methods MouseMove, MouseDown a.s.o.
FrmArrays  
HitInfo HitInfo is the basic info object. Derived from that are the clsses HitItemList.drawLineInfo, HitItemList.drawPolyInfo, HitItemList.drawPolyPolyInfo, HitItemList.drawCurveInfo, HitItemList.drawPolyCurveInfo, HitItemList.drawPolyPolyCurveInfo, HitItemList.drawSurfaceInfo, HitItemList.drawPointInfo, HitItemList.drawTextInfo, HitItemList.drawImageInfo If you are eager to get more information about a catched drawing, you can obtain this in the field Info In this field an info object is stored. It depends on KindOfPrimitiv. You can for example cast the field HitItem.Info to drawLineInfo, if KindOfPrimitiv equals HitItemList.Primitives.Line is.
HitItem A Hititem is an Entry of a HitItemList and is generated, when a drawing object is snapped. Every MNDevice contains a Hititemlist.
HitItemList The HitItemList is the container for HitItem. It is needed to point a graphical object with a cursor for example. It may be that objects are located at the place, where the cursor is. Every drawing that is close to the point produces a Hititem-entry in the HitItemList.

The HitItemList will be renewed, if you call the Select-method with a Point as parameter. It indicates, where the cursor is located. To every Hititem belongs a primitive drawmethod, who is "near" to that point. This means, the distance of the drawing to the point is smaller than CatchDistance. A Hititem holds a lot of information about the primitive drawing, see Info and HitItem
The entries in the HitItmList are sorted by the following priorities:
1. Distance to the Eye, also called z-Order
2. Keep-old-current : the "oldcurrent" has priority. This avoid a flickering of the catch results.
3. Point before Lines before Planes.

HitItemList.drawCurveInfo drawCurveInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives.Curve In this case you can cast Hititem.Info by (drawCurveInfo)Hititem.Info;
HitItemList.drawImageInfo drawImageInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives.Bitmap In this case you can cast Hititem.Info by (drawImageInfo)Hititem.Info;
HitItemList.drawLineInfo drawLineInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives.Line In this case you can cast Hititem.Info by (drawLineInfo)Hititem.Info;
HitItemList.drawMeshInfo drawMeshInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives. Mesh In this case you can cast Hititem.Info by (drawMeshInfo)Hititem.Info;
HitItemList.drawPointInfo drawPointInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives.Point In this case you can cast Hititem.Info by (drawPointInfo)Hititem.Info;
HitItemList.drawPolyCurveInfo drawPolyCurveInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives.PolyCurve In this case you can cast Hititem.Info by (drawPolyCurveInfo)Hititem.Info;
HitItemList.drawPolyInfo drawPolyInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives. PolyLine In this case you can cast Hititem.Info by (drawPolyInfo)Hititem.Info;
HitItemList.drawPolyPolyCurveInfo drawPolyPolyCurveInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives.PolyPolyCurve In this case you can cast Hititem.Info by (drawPolyPolyCurveInfo)Hititem.Info;
HitItemList.drawPolyPolyInfo drawPolyPolyInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives. PolyPolyLine In this case you can cast Hititem.Info by (drawPolyPolyInfo)Hititem.Info;
HitItemList.drawSurfaceInfo drawSurfaceInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives.Surface In this case you can cast Hititem.Info by (drawSurfaceInfo)Hititem.Info;
HitItemList.drawTextInfo drawTextInfo is an instance of HitInfo. You can get it from Hititem.Info if the Hititem.KindOfPrimitiv equals HitItemList.Primitives.Text In this case you can cast Hititem.Info by (drawTextInfo)Hititem.Info;
IOAttribute Is the attribute class which implements Ignore and Link It is used by ReadObject and WriteObject.
Light The abstract class Light encapsulates the essential properties of a light like Ambient, Specular, Diffuse A intstance of Light must override, the abstract method UpDate. A call to this method moves all values of the light to the graphicenvironment.
MaterialEditor Eine Klasse, die von UITypeEditor abstammt. Sie zeigt zu einer Eigenschaft einen modalen Dialog an, der ein PropertyGrid besitzt.
Mesh  
Mesh.FaceGroup This class encapsulate a Facegroup, which defines a subgroup of Vertices by the Array Indices. Additionally a facegroup has a Material-property and a MaxBox-property.
Mesh.Faces This class is a List of Mesh.FaceGroup
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.
MNComponent MNComponent is the rootclass from which some important classes are derived. The class is typical for a tree-structure. So it contains children and has a parent by himself. With the property Name a node inner a parent is unique. With the function fullPath you get an unique node description with names separated by "/". If you set the parent, the MNComponent is added to the children of this parent. In case of generatenames = true a valid name is generated and set to the MNComponent. The default indexer is set to a MNComponentclass
MNDevice MNDevice is the basic abstract class for all other devices. She implements all concepts of a modern graphic engine, like Lights,Material, Texture, ProjectionMatrix... Beside the representation of graphic objects she offers the possibility to select graphical objects in a very confortable way. See HitItemList The MNdevice is linked to a WinControl and manages also their mouseevents ( MouseMove ,MouseDown , MouseUp, windowsevents (Resize, OnPaint ..).
The fastest way to see some result is to use the OnPaint-Method. There you can set up some primitive drawmethods like (drawPolyLine, drawSurface, drawPolyCurve,...). With the property Navigate a automatical navigation of the device can be forced.

From this device derived are the
- OpenGlDevice :
She uses the opengllibrary opengl32.dll.
- GdiDevice:
She uses Microsofts Directdraw.
MNDevice.D3DLights This class is a container for the D3DLights and retrieves as default indexer a Light.
NicerXMLFormatter With the class NicerXMLFormatter you can serialize and deserialize an object to an XML. It uses "reflection" for this.
NicerXMLFormatter.Alias The class binds an aliasname to a full typename. for example:
 NicerXMLFormatter.Aliases.Add(new NicerXMLFormatter.Alias("int", "System.Int32")); NicerXMLFormatter.Aliases.Add(new NicerXMLFormatter.Alias("double", "System.Double")); NicerXMLFormatter.Aliases.Add(new NicerXMLFormatter.Alias("object", "System.Object")); NicerXMLFormatter.Aliases.Add(new NicerXMLFormatter.Alias("string", "System.String")); 
On this way the XML-code will be better to read.
NicerXMLFormatter.CustomBinder The NicerXMLFormatter.CustomBinder class performs the mapping to types declared in this assembly. It accumulates all types defined in the assembly this class is defined in. Optionally, an assembly can be passed as an argument.
NicerXMLFormatter.CustomSerializationEntry The NicerXMLFormatter.CustomSerializationEntry mimics the SerializationEntry class to make it possible to create are own entries. The class acts as a placeholder for a type, it's name and it's value. This class is used in the NicerXMLFormatter class to serialize objects.
NicerXMLFormatter.CustomStringConverter StringConverter.
PropEditor Eine Klasse, die von UITypeEditor abstammt. Sie zeigt zu einer Eigenschaft einen modalen Dialog an, der ein PropertyGrid besitzt.
ShadowSettingEditor Eine Klasse, die von UITypeEditor abstammt. Sie zeigt zu einer Eigenschaft einen modalen Dialog an, der ein PropertyGrid besitzt.
ShadowSettings Behinhaltet die Settings, die bei der Berschnung des Schattens verwendet werden. .
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.
TaskCtrl.CommitItem Member of the CommitList.
TaskCtrl.D3DCommitList Type of the CommitList and RedoList The important method is Text
Texture Texture encapsulates the properties, which are needed for drawing. The most important property is Bitmap, which holds the bitmadata.
Tools Utils contains a lot of excellent methods to draw in a device. Most of them are static methods.
TransformationEditor Eine Klasse, die von UITypeEditor abstammt. Sie zeigt zu einer Eigenschaft einen modalen Dialog an, der ein PropertyGrid besitzt.
UIFrmMaterial  
UIFrmMatrix  
xyzArray_2Editor Eine Klasse, die von UITypeEditor abstammt. Sie zeigt zu einer Eigenschaft einen modalen Dialog an, der ein PropertyGrid besitzt.

Interfaces

Interface Description
IEvents The interface IEvents encapsulates mouse- and keyevents. Additionally it has an EventServer
ILoad This interface is used by the D3DReader. He calls AfterLoad, if the object was loaded.
ISave This interface is used by the D3DWriter. He calls BeforeSave before the object will be saved.
ISerializePath This interface is implemented in all MNComponents. It gives a unique relation between Path and object.

Structures

Structure Description
MNDevice.PointData Define the Data of drawing of a point in the drawPoint-Method
PointData pd = new PointData( PointKind.Cube, new xyz(device.CatchDistanceF, device.CatchDistanceF, 0),new xyz(0, 0, 0));
device.drawPoint(new xyz(4 , 2, 1), pd); // Draws a Point as cube at position 4, 2, 1

Delegates

Delegate Description
DrawNotify Delegate, which is used from some classes like getDisplayList, draw
NicerXMLFormatter.Comparer  
TaskCtrl.UndoHandler The delegate UndoHandler is used from OnUndo, OnCommit.

Enumerations

Enumeration Description
Camera.LookKind Wird für verschiedene Bewegungen der Kamera verwendet
Camera.NavigateRotationKind  
DrawCtrl.CtrlPointKind This enum holds the Tags, which will be set by the CtrlRect-method.
HitItemList.Primitives Enumerates the primitives, which are supported by a device. It is the type of KindOfPrimitiv in HitItem
IOAttributes Summary description for Class1
MNDevice.MatrixKind Id used by PushMatrix and PopMatrix to indicate the related Matrix.
MNDevice.PointKind This type is used from the MNDevice.PointData-structure, which is used in drawPoint
NavigateKind Is used by Navigate and sets the kind for navigating the view of a device. Used are Mousedownmove, Alt + Mousedownmove, Ctrl + Mousedownmove.
NicerXMLFormatter.ReferenceHandling Used by ReferenceSupport
PenStyles The enum is used by PenStyle
PolygonMode PolygonMode is the Type of the PolygonMode - property of a Device. In case of Fill solid surfaces will be drawn, otherwise only a wireframe.
PrimType Three primitive type, which indicates where the snap is done: inside a plane, on a point or on a line.
RenderMode If a device plays the paint-mechanism, a so called rendermode is setted. The following types describe the RenderMode of a device.
ShadowKind Diese zwei Schattenalgorithmen werden von Drawing3d unterstützt.
Tools.ShadowDirection Defines the directions of the shadow for drawShadow
Tools.TextureKind Defines the kinds, which are used for texturing profiles from drawProfile and extursions from drawExtruded
Tools.TextureVisibility Is used from drawExtruded and from drawProfile to specify the visibility of the texture.