Discovering The Possibilities
Discovering The Possibilities
Contents
✦ Discovering the Possibilities ✦✦✦
Table of Contents
iii
Table of Contents
iv
Creating Contour Plots 36
Selecting Contour Levels 38
Modifying a Contour Plot 39
Changing the Appearance of a Contour Plot 39
Adding Color to a Contour Plot 41
Creating a Filled Contour Plot 42
Positioning Graphic Output in the Display Window 44
Setting the Graphic Margins 45
Setting the Graphic Position 46
Setting the Graphic Region 47
Creating Multiple Graphics Plots 47
Leaving Room for Titles with Multiple Graphics Plots 48
Non-Symmetrical Arrangements with !P.Multi 49
Adding Text to Graphical Displays 51
Finding the Names of Available Fonts 52
Adding Text with the XYOutS Command 52
Using XYOutS with Vector Fonts 53
Aligning Text 54
Erasing Text 54
Orienting Text 54
Adding Lines and Symbols to Graphical Displays 55
Adding Color to Your Graphical Displays 56
v
Table of Contents
vi
Using the Cursor with Images 112
Using the Cursor in Loops 113
Erasing Annotation From the Display 114
The “Exclusive OR” Method of Erasing Annotation 114
The Device Copy Method of Erasing Annotation 116
Drawing a Rubberband Box 118
Graphics Window Scrolling 119
Graphics Display Tricks in the Z-Graphics Buffer 120
The Z-Graphics Buffer Implementation 121
A Z-Graphics Buffer Example: Two Surfaces 121
Make the Z-Graphics Buffer the Current Device 121
Configure the Z-Graphics Buffer 122
Load the Objects into the Z-Graphics Buffer 122
Take a Picture of the Projection Plane 122
Display the Result on the Display Device 122
Some Z-Graphics Buffer Oddities 123
Warping Images with the Z-Graphics Buffer 123
Transparency Effects in the Z-Graphics Buffer 125
Combining Z-Graphics Buffer Effects with Volume Rendering 126
vii
Table of Contents
viii
Adding Color Palettes to HDF Files 173
Examples of Reading and Writing HDF Files 174
ix
Table of Contents
x
Writing an IDL Graphics Display Program ................................... 239
Chapter Overview 239
The HistoImage Program 240
Writing the Procedure Definition Statement 240
Writing the Error Handling Code 242
Checking for Positional and Keyword Parameters 242
Checking for the Image Positional Parameter 243
Checking for Keyword Parameters 243
Loading the Program Colors 246
Preparing to Draw the Graphics 246
Calculating Graphic Positions in the Window 246
Changing Character Size According To Window Size 247
Calculating the Image Histogram 248
Drawing the Graphics 248
Drawing the Histogram Plot 248
Drawing the Color Bar 251
Drawing the Image Plot 251
Working Around a Printer Device Bug 252
Compiling and Testing the Program 253
Reviewing the HistoImage Program’s Advantages 253
The HistoImage Program is Device Independent 255
Using HistoImage in a “Smart” Resizeable Graphics Window 256
xi
Table of Contents
xii
A Blocking Widget Program 326
A Modal Widget Program 327
Writing a Modal Dialog Form Widget Definition Module 327
Defining a Modal Top-Level Base 328
Defining Other Widgets 329
Storing Collected Information in Modal Dialogs 330
Creating the Info Structure 331
Creating a Blocked Widget 331
Returning from the Block 331
Writing the Modal Dialog Event Handler Modules 332
Error Handling 333
Testing the Modal Dialog Form Widget Program 335
Using FSC_InputField for Program Input 335
Adding an Open Image Capability to the Histo_GUI Program 337
Adding an Open Button 337
Writing the Open Image Event Handler 338
Creating a Non-Modal Widget Dialog 340
Writing a Non-Modal Dialog Widget Definition Module 341
Notifying Widgets of Program Events 342
Writing the Non-Modal Dialog Event Handler Modules 343
Sending Events to Other Widgets 344
Testing the Readlmage Program 345
Writing the Read Image Event Handler 345
xiii
Table of Contents
xiv
CW_Zoom Event Structure 394
FSC_InputField Event Structure 394
Widget Program Event Structures 394
XColors Event Structure 394
ReadImage Event Structure 395
Other Widget Event Structures 395
Keyboard Focus Events 395
Kill Widget Request Events 395
Widget Timer Events 395
Widget Tracking Events 395
xv