ITT Rule IDL Version 7.0 Manual de usuario Pagina 265

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 430
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 264
Chapter 10: Creating a File Writer 265
iTool Developer’s Guide Creating a New File Writer
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.
Note
A file writer need not register any properties at all, if the write operation is simple.
Many of the standard iTool image file writers work without registering any
properties.
See “IDLitWriter::GetProperty” (IDL Reference Guide) for additional details.
Example GetProperty Method
PRO ExampleWriter::GetProperty, _REF_EXTRA = _extra
IF (N_ELEMENTS(_extra) GT 0) THEN $
self->IDLitWriter::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 file writer. Since the file writer we are creating has
no properties of its own, there are no keywords explicitly defined. Note the use of the
keyword inheritance mechanism to allow us to get properties from the
ExampleWriter class’ superclasses without knowing the names of the properties.
Since our
ExampleWriter class has no properties of its own, we simply call the
superclass’ GetProperty method, passing in all of the keywords stored in the
_extra
structure.
Creating a SetProperty Method
The file writer SetProperty method stores property values in the file writer object’s
instance data. It should set the specified property value, either by storing the value
directly in the visualization object’s instance data or by calling another class’
SetProperty method.
Vista de pagina 264
1 2 ... 260 261 262 263 264 265 266 267 268 269 270 ... 429 430

Comentarios a estos manuales

Sin comentarios