------------------------------------------------------------------ -- -- NAME: CONVERT_NDC_DC -- DISCREPANCY REPORTS: -- ------------------------------------------------------------------ -- File: CONVERT_NDC_DC_1A.ADA -- Level: 1A, 2A with GKS_TYPES; use GKS_TYPES; package CONVERT_NDC_DC is -- This package performs 2-D coordinate transformations between the NDC -- and DC coordinate systems. -- -- In support of levels m and 0, workstation transformations and their -- inverse transforms are supported for POINT, VECTOR, POINT_ARRAY, -- RECTANGLE_LIMITS and SIZE types. -- -- At level 1a, segment transformations are included in the NDC to DC -- transformations. Inverse transformations are not supported and only -- POINT, VECTOR and POINT_ARRAY are supported. type NDC_DC_SCALE_TYPE is private; -- NDC_DC_SCALE_TYPE is an abstraction of the workstation -- transformation and its inverse transformation. subtype WINDOW_TYPE is NDC.RECTANGLE_LIMITS; -- WINDOW_TYPE is used to specify the window of the workstation -- transformation subtype VIEWPORT_TYPE is DC.RECTANGLE_LIMITS; -- VIEWPORT_TYPE is used to specify the viewport of the workstation -- transformation procedure SET_UNIFORM_SCALES (WINDOW : WINDOW_TYPE; VIEWPORT : VIEWPORT_TYPE; SCALE : out NDC_DC_SCALE_TYPE); function DC_POINT (POINT : NDC.POINT; SCALE : NDC_DC_SCALE_TYPE) return DC.POINT; function DC_POINT_ARRAY (POINT_ARRAY : NDC.POINT_ARRAY; SCALE : NDC_DC_SCALE_TYPE) return DC.POINT_ARRAY; function DC_RECTANGLE_LIMITS (RECTANGLE_LIMITS : NDC.RECTANGLE_LIMITS; SCALE : NDC_DC_SCALE_TYPE) return DC.RECTANGLE_LIMITS; -- The following functions are for relative scaling only, -- not absolute positions function DC_VECTOR (VECTOR : NDC.VECTOR; SCALE : NDC_DC_SCALE_TYPE) return DC.VECTOR; function DC_SIZE (SIZE : NDC.SIZE; SCALE : NDC_DC_SCALE_TYPE) return DC.SIZE; -- Conversions from DC to NDC function NDC_POINT (POINT : DC.POINT; SCALE : NDC_DC_SCALE_TYPE) return NDC.POINT; function NDC_POINT_ARRAY (POINT_ARRAY : DC.POINT_ARRAY; SCALE : NDC_DC_SCALE_TYPE) return NDC.POINT_ARRAY; function NDC_RECTANGLE_LIMITS (RECTANGLE_LIMITS : DC.RECTANGLE_LIMITS; SCALE : NDC_DC_SCALE_TYPE) return NDC.RECTANGLE_LIMITS; -- The following functions are for relative scaling only, -- not absolute positions function NDC_VECTOR (VECTOR : DC.VECTOR; SCALE : NDC_DC_SCALE_TYPE) return NDC.VECTOR; function NDC_SIZE (SIZE : DC.SIZE; SCALE : NDC_DC_SCALE_TYPE) return NDC.SIZE; -- Segment transformation functions type NDC_DC_XFORM_TYPE is private; -- NDC_DC_XFORM_TYPE represents a segment transformation combined -- with a workstation transformation. procedure SET_COMBINED_XFORM (SEGMENT_XFORM : in TRANSFORMATION_MATRIX; SCALE : in NDC_DC_SCALE_TYPE; COMBINED_XFORM : out NDC_DC_XFORM_TYPE); function DC_POINT (POINT : NDC.POINT; XFORM : NDC_DC_XFORM_TYPE) return DC.POINT; function DC_POINT_ARRAY (POINT_ARRAY : NDC.POINT_ARRAY; XFORM : NDC_DC_XFORM_TYPE) return DC.POINT_ARRAY; -- The following functions are for relative scaling only, -- not absolute positions function DC_VECTOR (VECTOR : NDC.VECTOR; XFORM : NDC_DC_XFORM_TYPE) return DC.VECTOR; private type NDC_DC_SCALE_TYPE is record V_SCALE : DC.POINT; V_SHIFT : DC.POINT; W_SCALE : NDC.POINT; W_SHIFT : NDC.POINT; end record; -- V_SCALE and V_SHIFT are used to transform to DC types. -- W_SCALE and W_SHIFT are used to transform to NDC types. type NDC_DC_XFORM_TYPE is array (1..2, 1..3) of DC_TYPE; -- A transformation matrix end CONVERT_NDC_DC;