refactoredCPPNeuronMesher
globals.h File Reference

Global state variables for the neuron visualization. More...

#include <vector>
#include <string>
#include <GLFW/glfw3.h>
Include dependency graph for globals.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Variables

Rendering State
int renderMode
 Current rendering mode (1-5) More...
 
double rotateX
 Camera rotation around X and Y axes (in degrees) More...
 
double rotateY
 
double zoom
 Camera zoom factor (higher values = more zoomed in) More...
 
double panX
 Camera pan offset in X and Y directions. More...
 
double panY
 
bool dragging
 Mouse drag state flags. More...
 
bool rightDragging
 
double lastX
 Last recorded mouse cursor position. More...
 
double lastY
 
double refineDelta
 Refinement parameter for mesh generation. More...
 
std::string help
 Help text displayed in the help window. More...
 
std::vector< SWCNodecurrentNodes
 Currently loaded neuron nodes for rendering. More...
 
GLFWwindow * helpWindow
 Pointer to the help window (nullptr if not open) More...
 
NeuronGraph graph
 The main neuron graph data structure. More...
 

Detailed Description

Global state variables for the neuron visualization.

This header declares all global variables used throughout the neuron viewer application. These variables manage the visualization state, camera controls, and current neuron data.

Warning
Global variables should be used sparingly and only for truly global state that needs to be accessed across multiple translation units.
Author
CPPNeuronMesher Team
Date
2025-07-27
Version
1.0

Variable Documentation

◆ currentNodes

std::vector<SWCNode> currentNodes
extern

Currently loaded neuron nodes for rendering.

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
extern

Mouse drag state flags.

These track the current drag operation:

  • dragging: True during left-button rotation
  • rightDragging: True during right-button panning

Mouse drag state flags.

◆ graph

NeuronGraph graph
extern

The main neuron graph data structure.

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
extern

Help text displayed in the 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
extern

Pointer to the help window (nullptr if not open)

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
extern

Last recorded mouse cursor position.

Used to calculate mouse movement deltas for smooth camera control.

Last recorded mouse cursor position.

◆ lastY

double lastY

◆ panX

double panX
extern

Camera pan offset in X and Y directions.

These values control the 2D panning of the view:

  • panX: Horizontal pan (positive = right)
  • panY: Vertical pan (positive = up)

Camera pan offset in X and Y directions.

◆ panY

double panY

◆ refineDelta

double refineDelta
extern

Refinement parameter for mesh generation.

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
extern

Current rendering mode (1-5)

Controls how the neuron is rendered:

  • 1: Basic line rendering
  • 2: Cylinder rendering
  • 3: Spheres at nodes
  • 4: Full 3D rendering
  • 5: Debug rendering mode

Current rendering mode (1-5)

◆ rightDragging

bool rightDragging

◆ rotateX

double rotateX
extern

Camera rotation around X and Y axes (in degrees)

These angles control the 3D view orientation:

  • rotateX: Rotation around the X-axis (vertical rotation)
  • rotateY: Rotation around the Y-axis (horizontal rotation)

Camera rotation around X and Y axes (in degrees)

◆ rotateY

double rotateY

◆ zoom

double zoom
extern

Camera zoom factor (higher values = more zoomed in)

Camera zoom factor (higher values = more zoomed in)