OrsDatasetCropper

Creates subsets of datasets by cropping

author:ORS Team
contact:http://theobjects.com
email:info@theobjects.com
organization:Object Research Systems (ORS), Inc.
address:460 Ste-Catherine Ouest, suite 600, Montréal, Québec, Canada, H3B 1A7
copyright:Object Research Systems (ORS), Inc. All rights reserved 2021.
date:Aug 04 2015 17:43
dragonflyVersion:
 3.0
UUID:6c71e7e8761111e7be64448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsDatasetCropper.OrsDatasetCropper.OrsDatasetCropper(varname=None)
OrsStateClipBoxManipulate = 'OrsStateClipBoxManipulate'
UIDescriptors = [<ORSServiceClass.OrsPlugin.uidescriptor.UIDescriptor object>]
cleanup()

Deletes the variables managed by the plugin. It is the place to remove callbacks and other references to Python objects that would prevent them to be garbage collected. This method is called during the process of deletion of the plugin. It calls for the cleanup and deletion of the forms.

classmethod contextualMenu(context)
interfacemethod crop(structuredGrid, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, createNewStructuredGrid)

Crop a structured grid by index range.

Parameters:
  • structuredGrid (ORSModel.ors.StructuredGrid) – the structured grid to crop
  • xMin (int) – minimal cropping index in X
  • yMin (int) – minimal cropping index in Y
  • zMin (int) – minimal cropping index in Z
  • tMin (int) – minimal cropping index in T
  • xMax (int) – maximal cropping index in X
  • yMax (int) – maximal cropping index in Y
  • zMax (int) – maximal cropping index in Z
  • tMax (int) – maximal cropping index in T
  • createNewStructuredGrid (bool) – if True, a new dataset will be generated. If False, the input structuredGrid will be modified.
Returns:

newStructuredGrid (ORSModel.ors.StructuredGrid) – cropped dataset. If createNewStructuredGrid is False, None is returned.

interfacemethod cropFromBox(structuredGrid, createNewStructuredGrid, aBox=None, tMin=0, tMax=0)

Crop a structured grid using a box.

Parameters:
  • structuredGrid (ORSModel.ors.StructuredGrid) – the structured grid to crop
  • createNewStructuredGrid (bool) – if True, a new dataset will be generated. If False, the input structuredGrid will be modified.
  • aBox (ORSModel.ors.Box) – the box used to set the cropping range. If None, the box of the structured grid to crop is used.
  • tMin (int) – minimal cropping index in T
  • tMax (int) – maximal cropping index in T
Returns:

newStructuredGrid (ORSModel.ors.StructuredGrid) – cropped dataset. If createNewStructuredGrid is False, None is returned.

classmethod findAllDisplaysWhereStructuredGridIsVisible(structuredGrid)
classmethod getMainFormClass()

Gets the class of the main form

Returns:output
classmethod getSelectedItems()

Opens a GUI to let the user select objects, and then crop the selected objects

Returns:output (list of GUIDs) –

getSourceStructuredGrid()
getStructuredGridGUID()
handleChanged(oldHandleName, newHandleName)

This method is called when the state of the application is changed.

Parameters:
  • oldState (str) – name of the old (previous) state
  • newState (str) – name of the new (current) state
handleTriggered(eventdata)

This method is called on every user input (mouse move, mouse click, key press, …) when the current state of the application is one of those declared by the plugin. This method can be used to perform specific tasks even if no action is currently in progress.

Parameters:eventData (OrsEvent.eventdata.InputEventData) – the event data
keepAlive = False
classmethod menuItemCrop()
multiple = False
classmethod openDatasetCropperAction(structuredGridGUID)
orsCurrentDisplayChange()
savable = False
selectedObjectsChanged()
setSourceStructuredGrid(structuredGrid)
stateDescriptors = [<ORSServiceClass.OrsPlugin.statedescriptor.StateDescriptor object>]