------------------------------------------------------------------ -- -- NAME: GKS_GDP -- DISCREPANCY REPORTS: ------------------------------------------------------------------ -- file: GKS_GDP.ADA -- level: 0A and above with GKS_TYPES; use GKS_TYPES; package GKS_GDP is -- This package provides the registered GDP procedures available -- in this implementation. In addition to the procedures for the -- implemented GDP functions, the GENERALIZED_GDP procedure is -- provided to support the ability to write a registered GDP, that -- is not implemented, to a metafile. Each supported GDP may be -- invoked by calling the specific procedure or by calling the -- GENERALIZED_GDP procedure with the appropriate GDP_ID and -- GDP_DATA_RECORD. -- The following constants are used to define the GDP IDs. The -- GDP IDs are negative since none have completed the registration -- process. CIRCLE_ID : constant GDP_ID := -1; ELLIPSE_ID : constant GDP_ID := -2; BEZIER_CURVE_ID : constant GDP_ID := -3; type GDP_FLOAT is digits PRECISION; -- Defines the real values used in GDPs. type GDP_INTEGER_ARRAY is array (SMALL_NATURAL range <>) of INTEGER; -- Used to pass a variable number of integers to a GDP function. type GDP_FLOAT_ARRAY is array (SMALL_NATURAL range <>) of GDP_FLOAT; -- Used to pass a variable number of reals to a GDP function. type GDP_STRING_ARRAY is array (SMALL_NATURAL range <>) of STRING (1..80); -- Used to pass a variable number of strings to a GDP function. type GDP_DATA_RECORD ( NUM_OF_INTEGERS : SMALL_NATURAL := 0; NUM_OF_REALS : SMALL_NATURAL := 0; NUM_OF_STRINGS : SMALL_NATURAL := 0) is record INTEGER_ARRAY : GDP_INTEGER_ARRAY (1 .. NUM_OF_INTEGERS); REAL_ARRAY : GDP_FLOAT_ARRAY (1 .. NUM_OF_REALS); GDP_STRINGS : GDP_STRING_ARRAY (1 .. NUM_OF_STRINGS); end record; -- This type defines a record used to pass data in and out of the -- GENERALIZED_GDP procedure. type BEZIER_POINTS is new WC.POINT_ARRAY (1 .. 4); -- Used to define the four control points for the BEZIER_CURVE -- procedure. procedure GENERALIZED_GDP ( GDP_NAME : in GDP_ID; POINTS : in WC.POINT_LIST; GDP_DATA : in GDP_DATA_RECORD); -- -- This procedure provides access to all registered GDP -- functions that are supported. It can be called to write an -- unsupported registered GDP function to a GKS metafile. -- -- GDP IDs, Points and Input Data Records: -- -- Circle (see GDP_CIRCLE) - -- GDP ID : CIRCLE_ID (defined above) -- Points -- Number of points : 1 -- Meaning of points : the center in WC -- Input Data Record -- Number of integers : 0 -- Number of reals : 1 -- Meaning of reals : the radius in WC - greater than 0.0 -- Number of strings : 0 -- -- Ellipse (see ELLIPSE) - -- GDP ID : ELLIPSE_ID (defined above) -- Points -- Number of points : 3 -- Meaning of points : the center in WC, -- the first CDP endpoint, -- the second CDP endpoint -- Input Data Record -- Number of integers : 0 -- Number of reals : 0 -- Number of strings : 0 -- -- Bezier curve (see GDP_BEZIER_CURVE) - -- GDP ID : BEZIER_CURVE_ID (defined above) -- Points -- Number of points : 4 -- Meaning of points : the four control points in WC -- Input Data Record -- Number of integers : 0 -- Number of reals : 0 -- Number of strings : 0 -- -- Possible errors: -- 5 GKS not in proper state: GKS shall be either in state WSAC -- or in the state SGOP -- 100 Number of points is invalid -- 103 Contents of generalized drawing primitive data record is invalid -- 104 At least one active workstation is not able to generate the -- specified generalized drawing primitive -- 105 At least one active workstation is not able to generate the -- specified generalized drawing primitive under the current -- transformation and clipping rectangle procedure GDP_CIRCLE ( CIRCLE_POINTS : in WC.POINT; RADIUS : in WC.MAGNITUDE); -- -- This procedure outputs a circle with the specified center and -- radius. The CIRCLE_POINTS parameter is a single WC point that -- specifies the center of the circle. The circle may be transformed -- to an ellipse due to a normalization or segment transformation. -- The attributes used to define the aspects of the circle GDP -- are the same as the fill area attributes. -- -- Possible errors: -- 5 GKS not in proper state: GKS shall be either in state WSAC -- or in the state SGOP -- 104 At least one active workstation is not able to generate the -- specified generalized drawing primitive -- 105 At least one active workstation is not able to generate the -- specified generalized drawing primitive under the current -- transformation and clipping rectangle procedure ELLIPSE ( CENTER : in WC.POINT; FIRST_CDP_ENDPOINT : in WC.POINT; SECOND_CDP_ENDPOINT : in WC.POINT); -- -- This procedure outputs an ellipse with the specified center and -- conjugate diameter pair endpoints. The attributes used to define -- the aspects of the ellipse are the same as the fill area attributes. -- -- Possible errors: -- 5 GKS not in proper state: GKS shall be either in state WSAC -- or in the state SGOP -- 104 At least one active workstation is not able to generate the -- specified generalized drawing primitive -- 105 At least one active workstation is not able to generate the -- specified generalized drawing primitive under the current -- transformation and clipping rectangle procedure BEZIER_CURVE ( BEZIER_CONTROL_POINTS : in BEZIER_POINTS); -- -- This procedure outputs a Bezier cubic section using the four -- points specified in BEZIER_CONTROL_POINTS. The curve starts -- at the first point and ends at the fourth point; the second -- and third points are used as control points. The attributes -- used to define the aspects of the Bezier curve GDP are the same -- as the polyline attributes. -- -- Possible errors: -- 5 GKS not in proper state: GKS shall be either in state WSAC -- or in the state SGOP -- 104 At least one active workstation is not able to generate the -- specified generalized drawing primitive -- 105 At least one active workstation is not able to generate the -- specified generalized drawing primitive under the current -- transformation and clipping rectangle end GKS_GDP;