CONTENTS Title Page Copyright Page Preface 1 Introducing DEC GKS 1.1 DEC GKS 1.1.1 The GKS-3D Standard 1.1.2 DEC GKS Software Components 1.1.3 Data Structures 1.1.4 GKS Operating States 1.1.5 DEC GKS Workstation Categories 1.1.6 GKS Levels 1.2 DEC GKS Function Categories 2 Getting Started with DEC GKS 2.1 Using DEC GKS Control Functions 2.1.1 Establishing a DEC GKS Session 2.2 Controlling the Workstation Surface 2.3 Generating Output 2.4 Working with Segments 2.5 Program Example Used in This Chapter 3 Composing and Transforming Pictures 3.1 DEC GKS Coordinate Systems and Transformations 3.1.1 Normalization Transformation: WC Plane to NDC Plane 3.1.1.1 Setting up the Normalization Transformation 3.1.1.2 Normalization Clipping 3.1.2 View Transformation: NDC Space to NPC Space 3.1.2.1 View Orientation Transformation 3.1.2.2 View Mapping Transformation 3.1.2.3 View Clip 3.1.3 Hidden Line Hidden Surface Removal 3.1.4 Workstation Clipping 3.1.5 Workstation Transformation 3.2 Transformations to Produce Particular Effects 3.2.1 Unused Display Space 3.2.2 Aspect Ratio and Transformations 3.2.3 Mapping a Picture to the Entire Workstation Surface 3.2.4 Zooming In and Out of a Picture 3.2.5 Panning Across a Picture 3.2.6 Using a Smaller Portion of the Workstation Surface 3.3 Two-Dimensional Pipeline Optimization 3.4 Program Example Used in This Chapter 4 Customizing Output 4.1 Output Attributes 4.2 Individual and Bundled Attributes 4.2.1 Binding Attributes to Primitives 4.2.2 Aspect Source Flags 4.2.3 Bundle Index Representations 4.2.4 Text Attributes 4.3 Using Segments 4.3.1 Segment Attributes 4.3.2 Workstation Independent Segment Storage 4.4 Program Example Used in this Chapter 5 Data Input 5.1 Logical Input Devices 5.1.1 Characteristics of Logical Input Devices 5.1.2 Classes of Logical Input Device 5.1.3 Initializing a Logical Input Device 5.1.4 Activating a Logical Input Device 5.1.5 Obtaining Measures from a Logical Input Device 5.2 Operating Modes of Logical Input Devices 5.2.1 Deciding Which Mode to Use 5.2.2 How to Select an Input Mode 5.2.3 Input Operating Mode Differences 5.2.3.1 Setting the Mode 5.2.3.2 Request Mode 5.2.3.3 Sample Mode 5.2.3.4 Event Mode 5.2.3.5 The Event Input Report Queue 5.2.3.6 Removing Reports from the Queue 5.2.3.7 Generating Simultaneous Events 5.2.3.8 Overflow of the Input Queue 5.3 Input Viewport Priority 5.3.1 Restricting Movement of Locator, Stroke, and Pick Prompts 5.4 Prompt and Echo Types 5.4.1 Data Records 5.4.2 Inquiry Functions 5.4.3 Controlling the Prompt Interface: Input Data Record 5.5 Using Several Logical Input Devices Concurrently 5.6 Documenting How to Use Logical Input Devices 5.7 Program Examples Used in This Chapter 6 Writing Device-Independent and System-Independent Programs 6.1 Writing Device-Independent Code 6.1.1 Specifying the Connection Identifier and Device Type 6.1.2 Checking and Specifying the Workstation Category 6.1.3 Checking the GKS Level 6.1.4 Checking and Setting the Deferral State 6.1.5 Setting Workstation-Dependent Output Attributes 6.1.6 Checking the Color Capabilities of the Device 6.1.7 Determining the Size of the Display 6.1.8 Determining the Number of Logical Input Devices 6.1.9 Checking the Available Prompt and Echo Types 6.2 Writing System-Independent Programs 6.3 Presentation of Program Examples in This Manual 7 Storing the Picture in a Metafile 7.1 Using Metafile Functions 7.2 Creating and Reading Metafiles 7.2.1 Metafile Output 7.2.2 Metafile Input 7.3 Understanding Metafile Structure 7.3.1 Data Format Information 7.3.2 GKS Metafile Structure 7.3.2.1 Metafile Header Structure 7.3.2.2 Metafile Item Structure 7.3.2.3 Item Header Structure 7.3.2.4 Layout of Item Data Records 7.4 GKS Metafile Physical File Organization A Color Models A.1 RGB Color Model A.2 CIE Color Model A.3 HSV Color Model A.4 HLS Color Model Glossary EXAMPLES 2-1 Beginning to Program with DEC GKS 3-1 Using the DEC GKS Transformations 4-1 Using DEC GKS Output Functions 5-1 Synchronous Input Example 5-2 Asynchronous Input Example 6-1 Device-Independent Program Example FIGURES 1-1 DEC GKS Software Components 1-2 The GKS Operating States 1-3 Functionality by GKS Levels 1-4 Possible DEC GKS Primitives 3-1 DEC GKS Two-Dimensional Transformation Pipeline 3-2 The DEC GKS Three-Dimensional Viewing Pipeline 3-3 Plotting Portions of a Picture in World Coordinates 3-4 Composing a Picture in NDC Space 3-5 Establishing a View Reference Point 3-6 Parallel Projection 3-7 Perspective Projection 3-8 Unit Cube 4-1 Binding of Attributes 4-2 Default Polyline Aspect Source Flag Settings 4-3 Specifying Bundled Aspect Source Flag Settings 4-4 Specifying Bundled and Individual Aspect Source Flags 4-5 The Segment Pipeline 5-1 Possible Prompts for DEC GKS Logical Input Classes 5-2 Relationship Between Measure and Trigger for Different Input Modes 5-3 Generating Event Input Reports with CHOICE 5-4 Generating Simultaneous Event Reports with Choice and Valuator 5-5 Restricting the Echo Area 5-6 Possible Locator Prompts 7-1 Metafile Structure 7-2 GKS Metafile Header Structures 7-3 GKS Metafile Item Structure 7-4 GKS Metafile Item Header Structure A-1 The RGB Color Model A-2 The HSV Color Model A-3 The HLS Color Model TABLES 1-1 DEC GKS Data Structures 1-2 The GKS Operating States 4-1 Primitives and Relevant Attributes 6-1 DEC GKS Data Structures 6-2 Portability of Language Bindings 7-1 Environment Options for Metafile Output 7-2 GKS Metafile Header Fields 7-3 GKS Metafile Item Header Fields 7-4 GKS Three-Dimensional Metafile Data Record Fields 7-5 GKS Two-Dimensional Metafile Data Record Fields