NCL Home > Documentation > HLUs > Classes

View class

The View class provides its subclasses with the ability to be drawn.

Synopsis

Header file:		ncarg/hlu/View.h
Class name:		viewClass
Class pointer:		<Not referenceable>
Fortran class function:	<Not referenceable>
Superclass:		Base
Composite classes:	<None>

Class-defined types

Type name:		NhlTOrientation
Definition:
typedef enum _NhlOrientation {
	NhlHORIZONTAL		= 0,	/* "Horizontal" */
	NhlVERTICAL		= 1	/* "Vertical"	*/
} NhlOrientation;


Type name:		NhlTPosition
Definition:
typedef enum _NhlPosition {
	NhlTOP			= 0,	/* "Top"	*/
	NhlBOTTOM		= 1,	/* "Bottom"	*/
	NhlRIGHT		= 2,	/* "Right"	*/
	NhlLEFT			= 3,	/* "Left"	*/
	NhlCENTER		= 4	/* "Center"	*/
} NhlPosition;

Type name:		NhlTJustification
Definition:
typedef enum _NhlJustification {
	NhlTOPLEFT		= 0,	/* "TopLeft"	  */
	NhlCENTERLEFT		= 1,	/* "CenterLeft"	  */
	NhlBOTTOMLEFT		= 2,	/* "BottomLeft"	  */
	NhlTOPCENTER		= 3,	/* "TopCenter"	  */
	NhlCENTERCENTER		= 4,	/* "CenterCenter" */
	NhlBOTTOMCENTER		= 5,	/* "BottomCenter" */
	NhlTOPRIGHT		= 6,	/* "TopRight"	  */
	NhlCENTERRIGHT		= 7,	/* "CenterRight"  */
	NhlBOTTOMRIGHT		= 8	/* "BottomRight"  */
} NhlJustification;

Type name:		NhlTDrawOrder
Definition:
typedef enum _NhlDrawOrder {
	NhlPREDRAW		= 0,	/* "PreDraw"	*/
	NhlDRAW			= 1,	/* "Draw"	*/
	NhlPOSTDRAW		= 2	/* "PostDraw"	*/
} NhlDrawOrder;

Resources

Local resources

+---------------------------------------------------------------+
|			View Resource Set			|
|---------------------------------------------------------------|
| NAME				TYPE			ACCESS	|
|	CLASS				DEFAULT			|
|===============================================================|
| vpXF                          NhlTFloat               RCSG    |
|       VpXF                            0.2                     |
|---------------------------------------------------------------|
| vpYF                          NhlTFloat               RCSG    |
|       VpYF                            0.8                     |
|---------------------------------------------------------------|
| vpWidthF                      NhlTFloat               RCSG    |
|       VpWidthF                        0.6                     |
|---------------------------------------------------------------|
| vpHeightF                     NhlTFloat               RCSG    |
|       VpHeightF                       0.6                     |
|---------------------------------------------------------------|
| vpOn                          NhlTBoolean             RCSG    |
|       VpOn                            True                    |
|---------------------------------------------------------------|
| vpKeepAspect                  NhlTBoolean             RCSG    |
|       VpKeepAspect                    False                   |
|---------------------------------------------------------------|
| vpUseSegments                 NhlTBoolean             RCSG    |
|       VpUseSegments                   False                   |
|---------------------------------------------------------------|
| vpClipOn                      NhlTBoolean             RCSG    |
|       VpClipOn                        True                    |
|---------------------------------------------------------------|
| vpAnnoManagerId                NhlTObjId              G       |
|       VpAnnoManagerId                 NullObjId               |
+---------------------------------------------------------------+

Composite resources

The View object class has no composite class resources.

Superclass resources

The superclass of the View object class does not define any resources.


Description

The View class is the superclass of all viewable objects: that is, all objects that can be drawn within the NDC viewspace. A viewable object is also called simply a view. It contains resources to specify the location and size of each viewable object in NDC units. It allows you to control whether the aspect ratio of the object may change after the object is created. It also allows you to ask any view with segment support to store its image into a segment, in order that it may subsequently redraw itself faster and more efficiently.

A number of View subclasses support the use of segments in order to speed the task of redrawing themselves when their contents have not changed. A segment is a stored record of all the primitives drawn as a result of drawing a particular instance of the class. Segments may be transformed to a different size or shape in NDC space. Therefore when segment drawing is in effect, changes to the View resources vpXF, vpYF, vpWidthF, or vpHeightF can be handled by redrawing the segment rather than completely redrawing the object. You set the resource vpUseSegments True in order to activate the use of segments.

You may make any view into an external annotation of a plot object. In this case, the plot object creates an AnnoManager object that you can use to set the position of the view relative to the base plot's viewport. Once a view becomes an annotation, the base plot takes control of positioning, drawing, and usually sizing it. If a view is currently functioning as an annotation, you may retrieve the id of its AnnoManager using the resource vpAnnoManagerId. If the view is not currently an annotation, the value of vpAnnoManagerId will be NullObjId (0).


Support functions

The View class defines the following support functions:
NhlGetBB
Given the id of a View class object, this function returns the coordinates of the left, right, top, and bottom edges of the object's bounding box in NDC units.
NhlIsView
This function just determines if a given object id identifies a View class object.

Status


See also