------------------------------------------------------------------ -- -- NAME: SET_PRIMITIVE_ATTRIBUTES_0A - BODY -- DISCREPANCY REPORTS: ------------------------------------------------------------------ -- file: set_prim_attr_0a_b.ada -- level: 0a, 1a, 2a, 0b, 1b, 2b, 0c, 1c, 2c with WSM; with CGI_SUBTYPES_A; with ERROR_HANDLING; with GKS_OPERATING_STATE_LIST; with GKS_ERRORS; with GKS_STATE_LIST; with TRANSFORMATION_MATH; with GKS_ERROR_STATE_LIST; use WSM; use CGI_SUBTYPES_A; use GKS_ERROR_STATE_LIST; use GKS_OPERATING_STATE_LIST; use GKS_ERRORS; package body SET_PRIMITIVE_ATTRIBUTES_0A is -- This is the package body for the procedures which set the values -- of the workstation independent primitive attributes. -- -- Each of the procedures in this package inquires the -- GKS_OPERATING_STATE_LIST to check if GKS is in one of the -- states GKOP, WSOP, WSAC, or SGOP. If it is not, error 8 -- occurs and the procedure calls the procedure ERROR_HANDLING. -- -- If an error indicator above 0 occurs, these procedures call -- the ERROR_HANDLING. procedure SET_TEXT_PATH (PATH : in TEXT_PATH) is -- This procedure sets the value of the current text path entry -- in the GKS_STATE_LIST to the value specified. Then it calls -- the WS_MANAGER to pass it the value. This value is used when -- creating subsequent text output primitives. -- -- PATH - Specifies the text path to be set. GKS_INSTR : CGI_SET_TEXT_PATH; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if structure inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_TEXT_PATH"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_TEXT_PATH := PATH; -- Call to WS_MANAGER with the new text path. GKS_INSTR.TEXT_PATH_SET := PATH; WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_TEXT_PATH"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_TEXT_PATH; procedure SET_PATTERN_SIZE (SIZE : in WC.SIZE) is -- This procedure sets the value of the current pattern size entry -- in the GKS_STATE_LIST to the value specified. Then it calls -- the WS_MANAGER to pass it the value. -- -- SIZE - Specifies the pattern size in WC to be set. GKS_INSTR : CGI_SET_PATTERN_VECTORS; -- DR019 begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if structure inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_PATTERN_SIZE"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_PATTERN_WIDTH_VECTOR := (WC_TYPE(SIZE.XAXIS),0.0); GKS_STATE_LIST.CURRENT_PATTERN_HEIGHT_VECTOR := (0.0,WC_TYPE(SIZE.YAXIS)); -- Call to WS_MANAGER with the new pattern size. -- Transformation logic for WC to NDC -- DR019 next 4 lines GKS_INSTR.PATTERN_HEIGHT_VECTOR_SET := (0.0, NDC_TYPE ((GKS_STATE_LIST.LIST_OF_NORMALIZATION_TRANSFORMATIONS (GKS_STATE_LIST.CURRENT_NORMALIZATION_TRANSFORMATION). NDC_FACTORS(1,1)) * NDC_TYPE(SIZE.XAXIS))); -- DR019 next 4 lines GKS_INSTR.PATTERN_WIDTH_VECTOR_SET := (NDC_TYPE ((GKS_STATE_LIST.LIST_OF_NORMALIZATION_TRANSFORMATIONS (GKS_STATE_LIST.CURRENT_NORMALIZATION_TRANSFORMATION). NDC_FACTORS(2,2)) * NDC_TYPE(SIZE.YAXIS)), 0.0); WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when NUMERIC_ERROR | CONSTRAINT_ERROR => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (ARITHMETIC, "SET_PATTERN_SIZE"); -- Error 308 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_PATTERN_SIZE"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_PATTERN_SIZE; procedure SET_PATTERN_REFERENCE_POINT (POINT : in WC.POINT) is -- This procedure sets the value of the current pattern reference -- point in the GKS_STATE_LIST to the value specified. Then it calls -- the WS_MANAGER to pass it the value. -- -- POINT - Specifies the pattern reference point to be set. GKS_INSTR : CGI_SET_PATTERN_REFERENCE_POINT; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if structure inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_PATTERN_REFERENCE_POINT"); --Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_PATTERN_REFERENCE_POINT := POINT; -- Call to WS_MANAGER with the new pattern size. -- Transformation logic for WC to NDC GKS_INSTR.PATTERN_REFERENCE_POINT_SET:= TRANSFORMATION_MATH .WC_TO_NDC(GKS_STATE_LIST.LIST_OF_NORMALIZATION_TRANSFORMATIONS (GKS_STATE_LIST.CURRENT_NORMALIZATION_TRANSFORMATION) .NDC_FACTORS, POINT); WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when NUMERIC_ERROR | CONSTRAINT_ERROR => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (ARITHMETIC, "SET_PATTERN_REFERENCE_POINT"); GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; -- Error 308 exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_PATTERN_REFERENCE_POINT"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_PATTERN_REFERENCE_POINT; end SET_PRIMITIVE_ATTRIBUTES_0A;