The video below is best viewed in Full Screen mode, with maximum resolution (720 HD)
INTViewer allows you to write Python scripts that will add contextual menu items to layers, windows and data nodes.
In order to do this, you will need to put your desired contextual script into a specially named folder in your INTViewer Python directory. The naming pattern for this folder is dependent upon what kind of contextual action you are adding:
If you want to apply a contextual script to a layer node in the Desktop Explorer, include the script in a directory with the name from the above list that applies, followed by "_Node". For example, adding a contextual
menu to the node of a seismic layer requires putting your script under a folder called Contextual_XSection_Seismic_Layer_Node.
For multiple window and layer nodes, use the "_Nodes" notation. For example, adding a contextual
menu for one or several seismic layer nodes requires putting your script under a folder called Contextual_XSection_Seismic_Layer_Nodes (example).
INTViewer will define several variables for use in your script, depending on the type of contextual action you are defining:
The following variables are mainly useful for debugging of Java plugins. They indicate various coordinates when the contextual menu was opened.
For a detailed explanation of device vs model coordinates, refer to this article: https://sites.google.com/a/geotoolkit.net/intviewer/intviewer-apis-for-windows/coordinate-system in the web site dedicated to Java plugin development.
Contextual Functions
INTViewer defines several functions which your contextual script can override. Create a separate Python script in the same directory with #Functions appended to the end of the script name. For instance, if the script is named showGisAttributes.py the functions file would be named showGisAttributes#Functions.py. There are four common functions which can be defined:
Before implementing the functions file, the contextual menu would look something like this:
The following example shows a script file with the common functions implemented. All contextual variables will be passed to the function. In this example, we are using a GIS layer, and thus the layer variable is available for use.
This functions file would produce the following result:
Scripts that react to point data events have an additional option: