NhlAddAnnotation

The Fortran name of this function is NhlFAddAnnotation.

This function adds an arbitrary View object to a plot object as an external annotation, and returns an AnnoManager object to manage it.


C Synopsis

#include <ncarg/hlu/hlu.h>
#include <hfile for Plot Object>

int NhlAddAnnotation(
	        int	plot_id,
		int	view_id
		)

Fortran Synopsis

      subroutine NhlFAddAnnotation(plot_id, view_id, anno_manager_id)
      integer plot_id, view_id, anno_manager_id

Arguments

plot_id (input)
Identifier of the plot object to which the View object is to be added as an annotation.
view_id (input)
Identifier of the View object to be added as an annotation of the plot object.
anno_manager_id (output, Fortran only)
If successful, identifier of new AnnoManager object; else error code.

Types

Type name:		NhlTErrorTypes
Definition:
typedef enum _NhlErrType{
	NhlFATAL	= -4,	/* "FATAL"	*/
	NhlWARNING	= -3,	/* "WARNING"	*/
	NhlINFO		= -2,	/* "INFO"	*/
	NhlNOERROR	= -1	/* "NOERROR"	*/
} NhlErrorTypes;

Description

Use this function to add an arbitrary view as an external annotation of a plot object. The view must have the same Workstation parent as the plot object to which it is added, and it cannot already be a plot member. Assuming the object identifiers are valid, the the function will return the identifier of an AnnoManager object whose resources you can manipulate in order to set the position and usually the size of the view relative to the viewport or the data coordinate space of the base plot.

The view id is appended to an array of user-created annotations accessible through the PlotManager resource pmAnnoViews. The id of its controlling AnnoManager object is in like manner appended to the resource pmAnnoManagers.

You can remove the annotation from the plot object using the NhlRemoveAnnotation function. You can retrieve the id of the view's controlling AnnoManager at any time by getting the value of the View resource vpAnnoManagerId. Note that you are responsible for destroying the view when you are through using it.


Return Values

If successful the NhlAddAnnotation C function returns the identifier of the AnnoManager object created to manage the view as an external annotation, and the NhlFAddAnnotation Fortran subroutine returns this value in anno_manager_id. A return value less than 0 indicates failure; you may cast such a value to type NhlErrorTypes in order to determine the error level. The following table indicates what the various return Error Values mean:
Value	|			Meaning
--------+-------------------------------------------------
NOERROR	|	not possible
--------+-------------------------------------------------
INFO	|	not possible
--------+-------------------------------------------------
WARNING	|	not possible
--------+-------------------------------------------------
FATAL	|	An invalid object id passed in, or internal error.


See Also


Copyright

Copyright 1987-1999 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.

NCAR Graphics is a registered trademark of the University Corporation for Atmospheric Research.

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$Revision: 1.15 $ $Date: 1998/06/15 21:26:01 $