12. Plugins¶
This section explains how to create and edit plugins.
12.1. Files location¶
To be recognized by the application, plugins should be located in one of these folders:
- %LocalAppData%/ORS/Dragonfly(version)/pythonUserExtensions/Plugins (available for the current user)
- %ProgramData%/ORS/Dragonfly(version)/pythonAllUsersExtensions/Plugins (available for all users)
- %ProgramData%/ORS/Dragonfly(version)/python/OrsPythonPlugins (distributed with the application)
Note
All the mandatory files defining a plugin should be contained in a folder having the same name as the
plugin implementation file and the implementation class.
For example, a simple plugin named ASimplePlugin would be constituted of these files:
- %LocalAppData%/ORS/Dragonfly(version)/pythonUserExtensions/Plugins/ASimplePlugin/__init__.py
- %LocalAppData%/ORS/Dragonfly(version)/pythonUserExtensions/Plugins/ASimplePlugin/ASimplePlugin.py
See Extension files for more information on the purpose of each file.
12.2. File creation¶
To create a plugin, start the application,
start the OrsPythonPlugins.OrsPluginGenerator.OrsPluginGenerator
(found in Developer/Python Plugin Generator),
fill in the required fields in the different tabs and press the button Create plugin.
See Plugin elements for more information on the elements of a plugin.
12.3. File edition¶
Design the UI
If a UI is used, design it in the generated .ui file(s).
See How to develop a User Interface for more information.
Develop the code
Open the implementation file (the Python file having the name of the plugin) in a text editor. Fill in the required methods.
12.4. Demos¶
- Interface methods basic structure
- Interface methods input as list
- Interface methods multiple outputs
- Top level menu item
- Static contextual menu item
- Static contextual menu item
- Dynamic contextual menu item
- Association of menu items to actions
- Class action
- Instance action
- State-dependent action
- Cursors
- Method handleChanged
- Method handleTriggered
- Temporary actions
- Temporary actions external state
- Interest on entities defined by the application
- Interest on user defined entities
- Mouse handlers state activation
- Mouse handlers annotations
- Instance callbacks
- Class callbacks
- Global callbacks
- Dirty signature flags
- Progress bars
- Promoting widgets
- How to develop a User Interface (video tutorial)