Overlay Graphics
Overlays are used to draw temporary graphics to the Plant Modeller views.
Usage
Script programmer must first create an overlay context with PM_OVERLAY_CREATE().
Overlay entities, such as polylines and arrows, can be added to the overlay context by calling functions that have the prefix PM_OVERLAY_ADD.
Before the overlays are drawn, the overlay context must be closed with PM_OVERLAY_CLOSE().
Later, the overlay context can be reopened for editing by calling PM_OVERLAY_OPEN().
Single overlay entities can be removed from an open context by calling PM_OVERLAY_REMOVE_ENTITY().
All overlays registered to a context can be removed from the views by calling PM_OVERLAY_DELETE().
Properties can be passed to the overlay entities in a data record.
Property Tags
The available property tags are:
- PM_OVERLAY_COLOR_RED
- PM_OVERLAY_COLOR_GREEN
- PM_OVERLAY_COLOR_BLUE
- PM_OVERLAY_COLOR_ALPHA
- PM_OVERLAY_LINEWIDTH – Linewidth is measured as pixels on the screen.
- PM_OVERLAY_DEPTH_TEST – Determines whether overlays are drawn with depth testing on. This means that they can be occluded by objects in the view.
Note: Not all properties are applicable to every overlay entity. See the argument description of each function to check which properties they accept.
Typical Calling Sequence
Here is a typical calling sequence for overlay graphics:
overlay_hdl = PM_OVERLAY_CREATE (properties_drec_hdl);
if(PM_OVERLAY_OPEN(overlay_hdl) >= 0) {
polyl_hdl = PM_OVERLAY_ADD_3D_POLYLINE(overlay_hdl, properties_drec_hdl, pnts_hdl);
points_hdl = PM_OVERLAY_ADD_3D_SPHERE(overlay_hdl, properties_drec_hdl, x, y, z, radius);
...
PM_OVERLAY_CLOSE(overlay_hdl);
}
PM_OVERLAY_DELETE(overlay_hdl);
Example
%PMS_HOME%\pm\macro\Examples\PM_OVERLAY_DEMO.mac