Skip to main content

Dynamic Context Menus

VRGS adds many context menu items dynamically at runtime based on available data and current context. These menus are constructed using AppendMenu() calls in the C++ code rather than static definitions in dsl.rc.

info

Dynamic menus provide context-sensitive commands that adapt to the current project state, available objects, and user selections. The available options change based on what data is loaded.


Mesh Context Menus

Context: Point Cloud, Polyline, or other objects Source: CProjectTreeRButton.cpp, ProjectInterpTree.cpp

Dynamically populated list of all meshes in the project. Allows linking the selected object to a specific mesh surface.

Menu items: List of all mesh names in the project

What it does Displays all available meshes and allows you to attach/link the current object to the selected mesh. Used for:

  • Attaching polylines to mesh surfaces
  • Linking point clouds to reference meshes
  • Associating interpretations with specific surfaces

When to use it

  • Project geometry to mesh surface
  • Snap polylines to mesh
  • Create surface-constrained features

Context: Point Cloud Source: CProjectTreeRButton.cpp (line 750)

Dynamically populated list of all TIN geosurfaces in the project.

Menu items: List of all geosurface names

What it does Links the selected point cloud to a specific TIN geosurface for projection, clipping, or spatial queries.

When to use it

  • Project point cloud attributes onto geosurface
  • Clip point cloud to stratigraphic surface
  • Calculate point cloud distances to interpreted horizon

Context: Point Cloud, Mesh Source: CProjectTreeRButton.cpp (lines 49, 766)

Dynamically populated list of all orthographic panels in the project.

Menu items: List of all ortho panel names

What it does Links selected 3D data to an orthographic panel for 2D interpretation or texture extraction.

When to use it

  • Extract 2D section from 3D point cloud
  • Project mesh data onto ortho panel
  • Create section views for interpretation

Mesh Debug Commands (DebugPopup)

Context: Mesh (development/debug builds) Source: CProjectTreeRButton.cpp (lines 705-712)

Advanced debugging and diagnostic commands for mesh analysis.

Menu items:

  • Fractal Dimension - Calculate fractal dimension of mesh surface
  • Cartesian to Spherical - Convert coordinates to spherical system
  • Spherical To Cartesian - Convert coordinates to Cartesian system
  • Node Position Attribute - Store node XYZ as mesh attributes
  • Randomise Position - Add random noise to vertex positions (testing)
  • Un-Index - Convert indexed mesh to non-indexed representation
  • Texture Index 2 Attribute - Convert texture coordinates to attributes
  • Add Debug Shader - Apply debug visualization shader
Development Builds Only

These commands are primarily for developers and advanced users. They may not appear in release builds or may be hidden under advanced options.


Mesh Generator Commands (GeneratorPopup)

Context: Procedurally generated meshes Source: CProjectTreeRButton.cpp (lines 651-653)

Commands for meshes created by procedural generators (e.g., channel models, fractures).

Menu items:

  • Regenerate - Re-run the mesh generation algorithm
  • Paste Orientation - Apply copied orientation to generator parameters

What it does Allows regeneration of procedural meshes with modified parameters or orientations.

When to use it

  • Update channel mesh after parameter changes
  • Regenerate fracture network with new orientation
  • Apply orientation from another object

Mesh Intersection with Polyline (IntersectPopup)

Context: Mesh Source: CProjectTreeRButton.cpp (lines 692-697)

Dynamically populated list of all polylines for mesh intersection operations.

Menu items: List of all polyline names

What it does Computes the intersection between the selected mesh and a chosen polyline, creating a new line or profile.

When to use it

  • Extract elevation profile along polyline
  • Create cross-section through mesh
  • Generate intersection line for interpretation

Photograph Context Menus

Image Regions and Annotations (SubMenu)

Context: Photograph View Source: PhotographView.cpp (lines 3404-3414)

Tools for annotating and analyzing photographs.

Menu items:

  • Add Region - Draw region of interest on photograph
  • Add Label - Place text label on photograph
  • Goto in 3D view - Navigate 3D view to feature location
  • Auto Pan in 3D View - Automatically pan 3D view with photograph pan
  • Detect Fractures (Phase Congruence) - Run automated fracture detection
  • Convert to 3D (Polyline) - Convert 2D annotation to 3D polyline

What it does Provides tools for marking up photographs, detecting features, and linking 2D annotations to 3D scene.

When to use it

  • Annotate field photographs
  • Detect fractures from outcrop photos
  • Link photograph features to 3D model
  • Create 3D interpretations from 2D photos

Sedimentary Log Context Menus

Facies Selection (FaciesList)

Context: Log elements, samples, interpretation Source: dslView.cpp (line 1823), CProjectTreeRButton.cpp (line 276)

Dynamically populated list of all facies definitions in the project.

Menu items: List of all facies names from project collections

What it does Assigns a facies classification to the selected log unit or sample point. Facies are defined in the Project Collections Tree under "Facies".

When to use it

  • Classify stratigraphic log units
  • Assign facies to sample points
  • Tag geobody polygons with facies

Grainsize Selection (GSList)

Context: Log elements Source: dslView.cpp (line 1808)

Dynamically populated list of all grain size classifications.

Menu items: List of grain size classes (clay, silt, sand, gravel, etc.)

What it does Assigns grain size classification to log units. Grain sizes are defined in Project Collections under "Grainsize".

When to use it

  • Classify sediment grain size in logs
  • Set grain size for facies
  • Populate grain size attributes

Carbonate Classification (CarbList)

Context: Log elements Source: dslView.cpp (line 1840)

Dynamically populated list of carbonate rock classifications (Dunham, Folk, etc.).

Menu items: List of generic classification schemes from collections

What it does Applies carbonate classification schemes (Dunham, Folk) to log units. Classifications are defined in Project Collections under "Generic Classes".

When to use it

  • Classify carbonate facies
  • Apply Dunham classification
  • Use Folk carbonate taxonomy

Base Contact Type (BaseContacts)

Context: Log unit boundaries Source: dslView.cpp (line 1856)

Dynamically populated list of base contact types.

Menu items: Sharp, Gradational, Erosional, Scoured, etc.

What it does Classifies the nature of the basal contact between stratigraphic units.

When to use it

  • Describe bed boundaries
  • Record contact relationships
  • Document erosional surfaces

Lithology Selection (Lithologies)

Context: Log elements Source: dslView.cpp (line 1873)

Dynamically populated list of lithology types.

Menu items: Sandstone, Mudstone, Limestone, etc.

What it does Assigns lithology classification to log units. Lithologies are defined in Project Collections under "Lithologies".

When to use it

  • Describe rock type in logs
  • Classify lithology of samples
  • Set primary lithology

Sedimentary Structures (SST)

Context: Log elements Source: dslView.cpp (lines 1940-1942)

Dynamically populated list of sedimentary structure types.

Menu items: Cross-bedding, Ripples, Lamination, Bioturbation, etc.

What it does Documents sedimentary structures observed in log units. Structures are defined in Project Collections under "Sed Structures".

When to use it

  • Record sedimentary structures
  • Document primary sedimentary features
  • Tag diagnostic textures

Palaeontology (Paleo)

Context: Log elements Source: dslView.cpp (lines 1912-1914)

Dynamically populated list of fossil types and trace fossils.

Menu items: Fossil names from palaeontology collection

What it does Records fossil occurrences and trace fossils in stratigraphic logs. Defined in Project Collections under "Palaeo".

When to use it

  • Document fossil content
  • Record trace fossils
  • Mark biostratigraphic indicators

Log Track Selection (LogTracks, GenericTracks)

Context: Log view editing Source: dslView.cpp (lines 1671, 1679)

Dynamically populated list of available log tracks (columns).

Menu items: List of all log track/column types

What it does Selects which log track to display or edit. Tracks include lithology, grain size, structures, facies, etc.

When to use it

  • Add new log column
  • Switch between log tracks
  • Configure log panel layout

Context: Point Cloud, Photographs Source: dslView.cpp (line 1693), CProjectTreeRButton.cpp (line 520)

Dynamically populated list of all stratigraphic logs in the project.

Menu items: List of all log names

What it does Links 3D data (point clouds, photographs) to specific stratigraphic logs for attribute projection or visualization.

When to use it

  • Project point cloud attributes onto log
  • Link photograph to log position
  • Associate 3D data with stratigraphic section

Sample Points Context Menus

Sample List (SampleList)

Context: Interpretation, Kriging, Geostatistics Source: dslView.cpp (lines 1772, 1791)

Dynamically populated list of sample point collections.

Menu items: List of all sample point object names

What it does Selects sample points for geostatistical analysis, kriging, or attribute mapping.

When to use it

  • Select samples for variogram analysis
  • Choose control points for kriging
  • Link samples for correlation

Structural Analysis Context Menus

Structural Set Selection (SetPopup)

Context: Stereonet view, Orientation data Source: StereonetView.cpp (line 761)

Dynamically populated list of structural measurement sets.

Menu items: List of all structural set names from collections

What it does Filters or colours orientation measurements by structural set (bedding, joint sets, cleavage, etc.). Sets are defined in Project Collections under "Sets".

When to use it

  • Plot specific joint set on stereonet
  • Colour code by structural set
  • Analyze bedding vs fracture orientations

Camera and Calibration Context Menus

Attach Camera Calibration (calib_menu)

Context: Photographs, Photogrammetry Source: CProjectTreeRButton.cpp (lines 607-609)

Dynamically populated list of camera calibration profiles.

Menu items: List of all camera calibration names from collections

What it does Attaches a camera calibration profile to photographs for photogrammetric processing. Calibrations are defined in Project Collections under "Camera Calibrations".

When to use it

  • Assign camera parameters to photos
  • Link calibration for photogrammetry
  • Set lens distortion parameters

Neural Networks & AI Context Menus

ANN Classifier Selection (ANNPopup)

Context: Point Cloud, Mesh, Voxel attributes Source: CProjectTreeRButton.cpp (line 779), ProjectInterpTree.cpp (lines 489, 513)

Dynamically populated list of trained neural network classifiers.

Menu items: List of all ANN (Artificial Neural Network) classifier names

What it does Applies a trained neural network to classify data (point clouds, meshes, images). Networks are stored in the project and can be retrained or applied to new data.

When to use it

  • Classify point cloud by trained network
  • Apply facies classifier to attributes
  • Run automated feature detection

Context: Flight path animation Source: ProjectInterpTree.cpp (line 513)

Dynamically populated list of viewpoint/camera positions.

Menu items: List of viewpoint names

What it does Links flight path keyframes to saved viewpoint positions for animated camera paths.

When to use it

  • Create camera animation
  • Build geotour sequence
  • Link flight path to viewpoints

Coordinate Transformation Context Menus

Apply Transform (TransformsPopup)

Context: All 3D objects Source: CProjectTree.cpp (line 630)

Dynamically populated list of saved coordinate transformations.

Menu items: List of all transformation matrix names from collections

What it does Applies a pre-defined coordinate transformation to the selected object. Transformations are defined in Project Collections under "Transforms".

When to use it

  • Apply saved rotation/translation
  • Align data to project coordinate system
  • Batch transform multiple objects

Notes on Dynamic Menus

How Dynamic Menus Work

Dynamic menus are constructed at runtime by:

  1. Querying project collections for available items (facies, sets, transforms, etc.)
  2. Iterating through lists and calling AppendMenu() for each item
  3. Assigning command IDs based on base ID + index
  4. Handling selections via command ID ranges

Finding Dynamic Menu Commands

Dynamic menu items are not visible in dsl.rc. To find them:

# Search for AppendMenu calls
grep -n "AppendMenu" /mnt/d/repos/VRGS/VRGS2020/*.cpp

# Find specific menu by popup name
grep -B 10 -A 5 "FaciesList.AppendMenu" /mnt/d/repos/VRGS/VRGS2020/*.cpp

Command ID Ranges

Dynamic menus use ID ranges defined in resource.h:

  • ID_FACIESLIST_START + i - Facies items
  • ID_GRAINSIZE_START + i - Grain size items
  • ID_PCLPOPUP_MESHLIST_START + i - Mesh items
  • ID_PCLPOPUP_ANNLIST_START + i - Neural network items
  • ID_CAMCALIBS_START + i - Camera calibrations
  • ID_POPUPMENU_SETS_START + i - Structural sets

Adding New Dynamic Menus

To add new dynamic menu items:

  1. Define ID range in resource.h
  2. Create menu popup in context menu handler
  3. Iterate collection and call AppendMenu() with ID offset
  4. Implement ON_COMMAND_RANGE handler for ID range
  5. Process selection based on (ID - BASE_ID) index


Source Analysis:

  • 48 dynamic menu items identified
  • 6 source files analyzed
  • Most common: Facies, Mesh lists, Log tracks, Sample points
  • See /tmp/dynamic_menus_report.txt for detailed source locations