This section contains the description and examples on how to create various types of graphic objects in ADA language.

How to create the graphic object: 

  1. Graphic object creating
  2. Set the parameters
  3. Completion of the graphic object

1. Graphic object creating

You can create a graphic object by calling the call-back procedure CreateObj in which enter the number of created object.
In this table you can find a list of objects and pseudo objects that can be created with the help of this function.

Object objType Description
Line 0 Creates the object of Line type.
PLine 1 Creates the object of Multiline or Polygon.
DLine 2 Creates the object of Disjointed multiline.
Arc 3 Creates the object of Arc.
3Arc 4 Creates the object of 3-point arc.
Box 5 Creates the object of Rectangle.
PAngle 6 Creates the object of Polygon.
Circle 7 Creates the object of Circle.
PiArc 8 Creates the object of Circle sector.
Elipse 11 Creates the object of Ellipse.
Text 12 Creates the object of Text.
Group 32 Creates the object Group of objects that groups more objects in one group (till the group is closed).
LineCombined -1 Creates the object of Line type that (on condition that the line has the same attributes as the created lines) combines with the previous lines to the one object of Multiline or Disjointed multiline.
PLineAdd 
-2 Adds the parameters in the created object of Multiline type (if it does not exist, create the new one).

2. Set the parameters of new object

After creating the new object, set its parameters by calling call-back procedures of Set_xxx type. First parameter defines the type of parameter of graphic object which is being created, the second or third one represents new value of this parameter. In this table you can find the group of parameters:

Parameters Description
Position Position points, i.e. position or distance from the previous point.
Lines Line parameters.
Fill Parameters of fill.
Circle objects Parameters for circle objects.
Texts Parameters for texts.

3. Completion of the graphic object

Call-back procedure ObjAction closes the graphic object. This procedure executes the action with the object according to the defined parameter. 

Characteristics of actions:

Action objType Description
closeFigure 0 Closes the position points of Polyline - the object is changed to polygon.
closeObject 1 Closes the object (the object is closed automatically as soon as you start creating the new object).
closeGroup 2 Closes the group of objects - completes the current object and last group of objects.
closeAll 3 Closes all objects - completes the current object and all group of objects. The function with this parameter is called automatically when finishing the import.

The graphic objects Line up to Text are closes automatically as soon as the next object is created.

Napíšte komentár