Geant4-11
Public Member Functions | Data Fields
G4OpenInventorXtExaminerViewer::elementForSorting Struct Reference

Public Member Functions

G4bool operator< (elementForSorting const &other) const
 

Data Fields

SbVec3f closestPoint
 
float closestPointZCoord
 
float distanceToBeamlineStart
 
std::string name
 
float smallestDistance
 

Detailed Description

Definition at line 274 of file G4OpenInventorXtExaminerViewer.hh.

Member Function Documentation

◆ operator<()

G4bool G4OpenInventorXtExaminerViewer::elementForSorting::operator< ( elementForSorting const &  other) const
inline

Definition at line 281 of file G4OpenInventorXtExaminerViewer.hh.

282 {
283 if (closestPointZCoord < other.closestPointZCoord)
284 return true;
285 if (closestPointZCoord > other.closestPointZCoord)
286 return false;
287
288 // otherwise closestPointZCoord == other.closestPointZCoord.
289 // Compare the distances from the center of the element to
290 // the start of the beamline.
291 if (distanceToBeamlineStart < other.distanceToBeamlineStart)
292 return true;
293 if (distanceToBeamlineStart > other.distanceToBeamlineStart)
294 return false;
295
296 // In case both closestPointZCoord and smallestDistance are
297 // equal, we have two exactly overlapping elements, if so
298 // the order doesn't matter
299 return true;
300 }

References closestPointZCoord, and distanceToBeamlineStart.

Field Documentation

◆ closestPoint

SbVec3f G4OpenInventorXtExaminerViewer::elementForSorting::closestPoint

◆ closestPointZCoord

float G4OpenInventorXtExaminerViewer::elementForSorting::closestPointZCoord

◆ distanceToBeamlineStart

float G4OpenInventorXtExaminerViewer::elementForSorting::distanceToBeamlineStart

◆ name

std::string G4OpenInventorXtExaminerViewer::elementForSorting::name

◆ smallestDistance

float G4OpenInventorXtExaminerViewer::elementForSorting::smallestDistance

The documentation for this struct was generated from the following file: