ITT Rule IDL Version 7.0 User Manual Page 173

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 172
Chapter 7: Creating an Operation 173
iTool Developer’s Guide Creating a New Generalized Operation
; Make sure we have a valid iTool object.
IF ~ OBJ_VALID(oTool) THEN RETURN, OBJ_NEW()
; Get the selected objects
oTargets = oTool->GetSelectedItems()
; Select only IDLitVisSurface objects. If there are
; no surface objects selected, return a null object.
surfaces = OBJ_NEW()
FOR i = 0, N_ELEMENTS(oTargets)-1 DO BEGIN
IF (OBJ_ISA(oTargets[i], 'IDLitVisSurface')) THEN BEGIN
surfaces = OBJ_VALID(surfaces[0]) ? $
[surfaces, oTargets[i]] : oTargets[i]
ENDIF
ENDFOR
IF (~OBJ_VALID(surfaces[0])) THEN RETURN, OBJ_NEW()
; Create a command set:
oCmdSet = self->IDLitOperation::DoAction(oTool)
; Record the initial values
IF (~ self->RecordInitialValues(oCmdSet, surfaces, '')) THEN $
BEGIN
OBJ_DESTROY, oCmdSet
RETURN, OBJ_NEW()
ENDIF
; Increment the style index for each surface.
FOR i = 0, N_ELEMENTS(surfaces)-1 DO BEGIN
; Retrieve the current surface style and increment it
surfaces[i]->GetProperty, STYLE = styleIndex
IF styleIndex eq 6 THEN BEGIN
styleIndex = 0
ENDIF ELSE BEGIN
styleIndex += 1
ENDELSE
; Set the new surface style
surfaces[i]->SetProperty, STYLE = styleIndex
ENDFOR
oTool->RefreshCurrentWindow
; Record the final values
result = self->RecordFinalValues(oCmdSet, surfaces, '')
RETURN, oCmdSet
Page view 172
1 2 ... 168 169 170 171 172 173 174 175 176 177 178 ... 429 430

Comments to this Manuals

No comments