A Workstation object manages an instance of an output device.
Header file: ncarg/hlu/Workstation.h Class name: workstationClass Class pointer: <Not referenceable> Fortran class function: <Not referenceable> Superclass: Base Composite classes: <None>
Type name: NhlTColorIndex Definition: typedef int NhlColorIndex; Valid Range is -1 to 255 -1: NhlTRANSPARENT 0: NhlBACKGROUND 1: NhlFOREGROUND Type name: NhlTColorMap Definition: A name of a pre-defined colormap, or an array of a combination of RGB values, named colors, and other color specification formats. Type name: NhlTColorIndexGenArray Definition: An array of NhlTColorIndex elements. Type name: NhlTColorDefinitionGenArray Definition: A one-dimensional array defining an RGB triplet, or a string containing a color name from $NCARG_ROOT/lib/ncarg/database/rgb.txt. Type name: NhlTDashIndex Definition: typedef int NhlDashIndex; Valid Range is 0 to NhlNwkDashTableLength 0: NhlSOLIDLINE Type name: NhlTDashIndexGenArray Definition: An array of NhlTDashIndex elements. Type name: NhlTFillIndex Definition: typedef int NhlFillIndex; Valid Range is -1 to NhlNwkFillTableLength -1: NhlHOLLOWFILL 0: NhlSOLIDFILL Type name: NhlTFillIndexGenArray Definition: An array of NhlTFillIndex elements. Type name: NhlTMarkerIndex Definition: typedef int NhlMarkerIndex; Valid Range is 0 to NhlNwkMarkerTableLength 0: "default" 1: "dot" 2: "+" 2: "plus" 3: "*" 3: "asterisk" 4: "hollow_circle" 5: "cross" 5: "x" 6: "hollow_square" 7: "up_triangle" 8: "down_triangle" 9: "diamond" 10: "left_triangle_filled" 11: "right_triangle_filled" 12: "star_5point" 13: "star_6point" 14: "circle_w_dot" 15: "circle_w_cross" 16: "circle_filled" Type name: NhlTMarkerIndexGenArray Definition: An array of NhlTMarkerIndex elements. Type name: NhlTMarkLineMode Definition: typedef enum _NhlMarkLineMode { NhlLINES = 0, /* "Lines" */ NhlMARKERS = 1, /* "Markers" */ NhlMARKLINES = 2 /* "MarkLines" */ } NhlMarkLineMode; Type name: NhlTMarkLineModeGenArray Definition: An array of NhlTMarkLineMode elements.
+---------------------------------------------------------------+ | Workstation Resource Set | |---------------------------------------------------------------| | NAME TYPE ACCESS | | CLASS DEFAULT | |===============================================================| | wkColorMap NhlTColorMap RCSG | | WkColorMap <Dynamic> | |---------------------------------------------------------------| | wkColorMapLen NhlTInteger G | | WkColorMapLen <Dynamic> | |---------------------------------------------------------------| | wkBackgroundColor NhlTColorDefinitionGenArray RCSG | | WkBackgroundColor (/0.0,0.0,0.0/) | |---------------------------------------------------------------| | wkForegroundColor NhlTColorDefinitionGenArray RCSG | | WkForegroundColor <Dynamic> | |---------------------------------------------------------------| | wkDashTableLength NhlTInteger G | | WkDashTableLength <Dynamic> | |---------------------------------------------------------------| | wkFillTableLength NhlTInteger G | | WkFillTableLength <Dynamic> | |---------------------------------------------------------------| | wkMarkerTableLength NhlTInteger G | | WkMarkerTableLength <Dynamic> | |---------------------------------------------------------------| | wkGksWorkId NhlTInteger G | | WkGksWorkId <Dynamic> | |---------------------------------------------------------------| | wkDefGraphicStyleId NhlTInteger G | | WkDefGraphicStyleId <Dynamic> | +---------------------------------------------------------------+
The Workstation object provides access to a color map and tables of line dash patterns, area fill patterns, and markers. There is a default colormap that is shared by all subclasses of Workstation objects, but it is also possible to create an individual colormap for any instance of a Workstation object. The dash pattern, fill pattern, and marker tables are shared by all Workstation objects and are currently read-only. Eventually, however, there will be methods for creating individual user-defined versions of each of these tables.
The Workstation colormap may contain up to 256 different colors, including the background color. You specify the color of features to be drawn using an HLU color index in the range 0 through 255. An allocated color index is one for which an RGB triple defining a color has been specified. Color index 0 specifies the background color and color index 1 specifies the foreground color. The Workstation colormap is defined to repeat itself. So, if you specify a color index that is greater than any of the currently defined indexes, the index will be mapped into the correct range. If you specify a currently unallocated color index for a feature, the Workstation object will use the foreground color. (This refers to color indexes that are unallocated, but are less than another currently defined index. In other words, the holes in the colormap are filled with the foreground color.) You may allocate a complete colormap using the wkColorMap resource; there are also support functions for allocating and freeing individual colors.
All Workstation class objects share the ability to update and clear the Workstation drawing area. The UpdateWorkstation and ClearWorkstation functions perform different tasks depending on the class of Workstation object for which they are invoked. For the NcgmWorkstation, the clear and update functions write special CGM commands into the CGM file that end the current frame and start a new one. For the XWorkstation, the update function causes all pending draw commands to be drawn, and the clear function clears the entire window. There is also a convenience function, Frame, that calls both the update and clear functions. This function operates much like the Frame call in the low level NCAR graphics libraries.
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?