logical input devices (CG) part-2

Note: in this note I'm discussed one of important question of CG

LOGICAL INPUT DEVICES:

  •  These are characterized by its high-level interface with the application program rather than by its physical characteristics. 
  •  Consider the following fragment of C code:
int x;
scanf(“%d”,&x);
printf(“%d”,x);
  •  The above code reads and then writes an integer.
  • Although we run this program on workstation providing input from keyboard and seeing output on the display screen.
  • the use of scanf() and printf() requires no knowledge of the properties of physical devices such as keyboard codes or resolution of the display.
  • These are logical functions that are defined by how they handle input or 
    output character strings from the perspective of C program.
  •  From logical devices perspective inputs are from inside the application 
    program.
  • The two major characteristics describe the logical behavior of input devices are as follows:
  1.  The measurements that the device returns to the user program
  2.  The time when the device returns those measurements
API defines six classes of logical input devices which are given below:
  • String :

  • A string device is a logical device that provides the ASCII values of input characters to the user program. This logical device is usually implemented by means of physical keyboard. 

  • 2.LOCATOR:

  1. A locator device provides a position in world coordinates to the user program. It is usually implemented by means of pointing devices such as mouse or track ball.
  • 3. PICK:

  • A pick device returns the identifier of an object on the display to the user program. It is usually implemented with the same physical device as the locator but has a separate software interface to the user program.
  • In OpenGL, we can use a process of selection to accomplish picking.
  •  4. CHOICE:

  • A choice device allows the user to select one of a discretenumber of options. In OpenGL, we can use various widgets provided by the window system.
  • A widget is a graphical interactive component provided by the window system or a toolkit. The Widgets include menus, scrollbars andgraphical buttons.
For example, a menu with n selections acts as a choice device, allowing user to select one of ‘n’ alternatives.
  • 5. VALUATORS:

  • They provide analog input to the user program on somegraphical systems; there are boxes or dials to provide value.

  • 6. STROKE:

  • A stroke device returns array of locations. Example, pushingdown a mouse button starts the transfer of data into specified array and releasing of button ends this transfer.
Posted on by