ITT Rule IDL Version 7.0 User Manual Page 131

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 130
Chapter 6: Creating a Visualization 131
iTool Developer’s Guide Creating a New Visualization Type
Creating a GetProperty Method
The visualization class GetProperty method retrieves property values from the
visualization object instance or from instance data of other associated objects. The
method can retrieve the requested property value from the visualization object’s
instance data or by calling another class’ GetProperty method.
Note
Any property registered with a call to the RegisterProperty method must be listed as
a keyword to the GetProperty method either of the visualization class or one of its
superclasses.
See “IDLitVisualization::GetProperty” (IDL Reference Guide) for additional details.
Example GetProperty Method
The following example code shows a very simple GetProperty method for the
ExampleVis visualization type:
PRO ExampleVis::GetProperty, $
EXAMPLEPROPERTY = exampleProperty, $
_REF_EXTRA = _extra
IF ARG_PRESENT(exampleProperty) THEN BEGIN
exampleProperty = self._exampleproperty
ENDIF
; get superclass properties
IF (N_ELEMENTS(_extra) GT 0) THEN $
self->IDLitVisualization::GetProperty, _EXTRA = _extra
END
Discussion
The GetProperty method first defines the keywords it will accept. There must be a
keyword for each property of the visualization type. The keyword inheritance
mechanism allows properties to be retrieved from the ExampleVis class’ superclasses
without knowing the names of the properties.
Using the ARG_PRESENT function, the method checks for the presence of
keywords in the call to the GetProperty method. If a keyword is detected, it retrieves
the value of the associated property from the object’s instance data. In this example,
only one property (ExampleProperty) is specific to the
ExampleVis object.
Page view 130
1 2 ... 126 127 128 129 130 131 132 133 134 135 136 ... 429 430

Comments to this Manuals

No comments