refactoredCPPNeuronMesher
globals.cpp File Reference

Global variables and state for the neuron viewer application. More...

#include <string>
#include "neurongraph.h"
#include "globals.h"
Include dependency graph for globals.cpp:

Variables

int renderMode = 1
 Current rendering mode (1-6) that determines how the neuron is displayed. More...
 
double rotateX = 0.0f
 Rotation around the X-axis in degrees. More...
 
double rotateY = 0.0f
 Rotation around the Y-axis in degrees. More...
 
double zoom = 1.0f
 Zoom factor (1.0 = normal, >1.0 = zoom in, <1.0 = zoom out) More...
 
double panX = 0.0f
 Horizontal pan offset in screen coordinates. More...
 
double panY = 0.0f
 Vertical pan offset in screen coordinates. More...
 
bool dragging = false
 Flag indicating if left mouse button is being dragged. More...
 
bool rightDragging = false
 Flag indicating if right mouse button is being dragged. More...
 
double lastX
 X coordinate of the last mouse position. More...
 
double lastY
 Y coordinate of the last mouse position. More...
 
double refineDelta = 8.0
 Refinement parameter for geometry processing. More...
 
std::string help
 Help text displayed in the console and help window. More...
 
std::vector< SWCNodecurrentNodes
 Global container for the currently loaded neuron nodes. More...
 
GLFWwindow * helpWindow = nullptr
 Pointer to the GLFW help window. More...
 
NeuronGraph graph
 Global instance of the neuron graph. More...
 

Detailed Description

Global variables and state for the neuron viewer application.

This file contains the implementation of global variables used throughout the neuron visualization application. These variables maintain the application state, including view parameters, user interface state, and the current neuron data being visualized.

Key components:

  • View parameters (rotation, zoom, pan)
  • Rendering mode and quality settings
  • User interaction state (mouse dragging, etc.)
  • Help text and UI state
  • Current neuron data and graph representation
Note
These variables are declared as extern in globals.h
See also
globals.h for declarations and documentation of each variable
Author
CPPNeuronMesher Team
Date
2025-07-27
Version
1.0

Variable Documentation

◆ currentNodes

std::vector<SWCNode> currentNodes

Global container for the currently loaded neuron nodes.

Currently loaded neuron nodes for rendering.

This vector holds the SWC nodes of the currently loaded neuron. It's used throughout the application for rendering and processing.

Note
Updated when a new file is loaded via openNeuronFile()
See also
SWCNode

◆ dragging

bool dragging = false

Flag indicating if left mouse button is being dragged.

Mouse drag state flags.

◆ graph

NeuronGraph graph

Global instance of the neuron graph.

The main neuron graph data structure.

This object holds the complete neuron graph structure and provides methods for loading, processing, and querying the neuron morphology.

See also
NeuronGraph class for available operations

◆ help

std::string help
Initial value:
= "=== SWC Viewer Controls ===\n"
"1 - 6 | Change render mode\n"
"F | Refine geometry (cubic spline)\n"
"Ctrl + F | Coarsen geometry (cubic spline)\n"
"O | Open SWC/UGX file\n"
"S | Save to SWC/UGX file\n"
"R | Reset camera view\n"
"H | Help screen\n"
"Mouse Drag | Rotate scene (Left Button)\n"
"Mouse Drag | Pan scene (Right Button)\n"
"Scroll Wheel | Zoom in/out\n"
"ESC | Exit viewer"

Help text displayed in the console and help window.

Help text displayed in the help window.

Contains formatted text describing the application's keyboard and mouse controls. The text is displayed when the user presses the 'H' key or when explicitly requested.

See also
printHelpText()

◆ helpWindow

GLFWwindow* helpWindow = nullptr

Pointer to the GLFW help window.

Pointer to the help window (nullptr if not open)

This is the main window used for displaying the help text. Initialized to nullptr and created when the help window is shown.

Note
Managed by the main application loop
See also
showHelpWindow() in the main application file

◆ lastX

double lastX

X coordinate of the last mouse position.

Last recorded mouse cursor position.

◆ lastY

double lastY

Y coordinate of the last mouse position.

◆ panX

double panX = 0.0f

Horizontal pan offset in screen coordinates.

Camera pan offset in X and Y directions.

◆ panY

double panY = 0.0f

Vertical pan offset in screen coordinates.

◆ refineDelta

double refineDelta = 8.0

Refinement parameter for geometry processing.

Refinement parameter for mesh generation.

Controls the level of detail in the generated geometry. Higher values result in coarser meshes, while lower values produce more detailed meshes. Used in cubic spline interpolation.

Note
Initialized to 8.0 for a coarse starting point
See also
allCubicSplineResampledTrunks()

◆ renderMode

int renderMode = 1

Current rendering mode (1-6) that determines how the neuron is displayed.

Current rendering mode (1-5)

◆ rightDragging

bool rightDragging = false

Flag indicating if right mouse button is being dragged.

◆ rotateX

double rotateX = 0.0f

Rotation around the X-axis in degrees.

Camera rotation around X and Y axes (in degrees)

◆ rotateY

double rotateY = 0.0f

Rotation around the Y-axis in degrees.

◆ zoom

double zoom = 1.0f

Zoom factor (1.0 = normal, >1.0 = zoom in, <1.0 = zoom out)

Camera zoom factor (higher values = more zoomed in)