Geant4  10.02.p03
G4ViewParameters Class Reference

#include <G4ViewParameters.hh>

Collaboration diagram for G4ViewParameters:

Public Types

enum  DrawingStyle { wireframe, hlr, hsr, hlhsr }
 
enum  CutawayMode { cutawayUnion, cutawayIntersection }
 
enum  RotationStyle { constrainUpDirection, freeRotation }
 

Public Member Functions

 G4ViewParameters ()
 
 ~G4ViewParameters ()
 
G4bool operator!= (const G4ViewParameters &) const
 
DrawingStyle GetDrawingStyle () const
 
G4bool IsAuxEdgeVisible () const
 
G4bool IsCulling () const
 
G4bool IsCullingInvisible () const
 
G4bool IsDensityCulling () const
 
G4double GetVisibleDensity () const
 
G4bool IsCullingCovered () const
 
G4bool IsSection () const
 
const G4Plane3DGetSectionPlane () const
 
G4bool IsCutaway () const
 
CutawayMode GetCutawayMode () const
 
const G4PlanesGetCutawayPlanes () const
 
G4bool IsExplode () const
 
G4double GetExplodeFactor () const
 
const G4Point3DGetExplodeCentre () const
 
G4int GetNoOfSides () const
 
const G4Vector3DGetViewpointDirection () const
 
const G4Vector3DGetUpVector () const
 
G4double GetFieldHalfAngle () const
 
G4double GetZoomFactor () const
 
const G4Vector3DGetScaleFactor () const
 
const G4Point3DGetCurrentTargetPoint () const
 
G4double GetDolly () const
 
G4bool GetLightsMoveWithCamera () const
 
const G4Vector3DGetLightpointDirection () const
 
G4Vector3DGetActualLightpointDirection ()
 
const G4VisAttributesGetDefaultVisAttributes () const
 
const G4VisAttributesGetDefaultTextVisAttributes () const
 
const G4VMarkerGetDefaultMarker () const
 
G4double GetGlobalMarkerScale () const
 
G4double GetGlobalLineWidthScale () const
 
G4bool IsMarkerNotHidden () const
 
unsigned int GetWindowSizeHintX () const
 
unsigned int GetWindowSizeHintY () const
 
G4int GetWindowAbsoluteLocationHintX (G4int) const
 
G4int GetWindowAbsoluteLocationHintY (G4int) const
 
G4int GetWindowLocationHintX () const
 
G4int GetWindowLocationHintY () const
 
const G4StringGetXGeometryString () const
 
bool IsWindowSizeHintX () const
 
bool IsWindowSizeHintY () const
 
bool IsWindowLocationHintX () const
 
bool IsWindowLocationHintY () const
 
G4bool IsAutoRefresh () const
 
const G4ColourGetBackgroundColour () const
 
G4bool IsPicking () const
 
RotationStyle GetRotationStyle () const
 
const std::vector< G4ModelingParameters::VisAttributesModifier > & GetVisAttributesModifiers () const
 
G4double GetCameraDistance (G4double radius) const
 
G4double GetNearDistance (G4double cameraDistance, G4double radius) const
 
G4double GetFarDistance (G4double cameraDistance, G4double nearDistance, G4double radius) const
 
G4double GetFrontHalfHeight (G4double nearDistance, G4double radius) const
 
void SetDrawingStyle (G4ViewParameters::DrawingStyle style)
 
void SetAuxEdgeVisible (G4bool)
 
void SetCulling (G4bool)
 
void SetCullingInvisible (G4bool)
 
void SetDensityCulling (G4bool)
 
void SetVisibleDensity (G4double visibleDensity)
 
void SetCullingCovered (G4bool)
 
void SetSectionPlane (const G4Plane3D &sectionPlane)
 
void UnsetSectionPlane ()
 
void SetCutawayMode (CutawayMode)
 
void AddCutawayPlane (const G4Plane3D &cutawayPlane)
 
void ChangeCutawayPlane (size_t index, const G4Plane3D &cutawayPlane)
 
void ClearCutawayPlanes ()
 
void SetExplodeFactor (G4double explodeFactor)
 
void UnsetExplodeFactor ()
 
void SetExplodeCentre (const G4Point3D &explodeCentre)
 
G4int SetNoOfSides (G4int nSides)
 
void SetViewpointDirection (const G4Vector3D &viewpointDirection)
 
void SetViewAndLights (const G4Vector3D &viewpointDirection)
 
void SetUpVector (const G4Vector3D &upVector)
 
void SetFieldHalfAngle (G4double fieldHalfAngle)
 
void SetOrthogonalProjection ()
 
void SetPerspectiveProjection (G4double fieldHalfAngle=30. *CLHEP::deg)
 
void SetZoomFactor (G4double zoomFactor)
 
void MultiplyZoomFactor (G4double zoomFactorMultiplier)
 
void SetScaleFactor (const G4Vector3D &scaleFactor)
 
void MultiplyScaleFactor (const G4Vector3D &scaleFactorMultiplier)
 
void SetCurrentTargetPoint (const G4Point3D &currentTargetPoint)
 
void SetDolly (G4double dolly)
 
void IncrementDolly (G4double dollyIncrement)
 
void SetLightpointDirection (const G4Vector3D &lightpointDirection)
 
void SetLightsMoveWithCamera (G4bool moves)
 
void SetPan (G4double right, G4double up)
 
void IncrementPan (G4double right, G4double up)
 
void IncrementPan (G4double right, G4double up, G4double forward)
 
void SetDefaultVisAttributes (const G4VisAttributes &)
 
void SetDefaultColour (const G4Colour &)
 
void SetDefaultTextVisAttributes (const G4VisAttributes &)
 
void SetDefaultTextColour (const G4Colour &)
 
void SetDefaultMarker (const G4VMarker &defaultMarker)
 
void SetGlobalMarkerScale (G4double globalMarkerScale)
 
void SetGlobalLineWidthScale (G4double globalLineWidthScale)
 
void SetMarkerHidden ()
 
void SetMarkerNotHidden ()
 
void SetWindowSizeHint (G4int xHint, G4int yHint)
 
void SetWindowLocationHint (G4int xHint, G4int yHint)
 
void SetXGeometryString (const G4String &)
 
void SetAutoRefresh (G4bool)
 
void SetBackgroundColour (const G4Colour &)
 
void SetPicking (G4bool)
 
void SetRotationStyle (RotationStyle)
 
void AddVisAttributesModifier (const G4ModelingParameters::VisAttributesModifier &)
 
G4String CameraAndLightingCommands (const G4Point3D standardTargetPoint) const
 
G4String DrawingStyleCommands () const
 
G4String SceneModifyingCommands () const
 
G4String TouchableCommands () const
 
void PrintDifferences (const G4ViewParameters &v) const
 

Private Types

enum  {
  fNoValue = 0, fXValue = 0x0001, fYValue = 0x0002, fWidthValue = 0x0004,
  fHeightValue = 0x0008, fAllValues = 0x000F, fXNegative = 0x0010, fYNegative = 0x0020
}
 

Private Member Functions

G4int ParseGeometry (const char *string, G4int *x, G4int *y, unsigned int *width, unsigned int *height)
 
G4int ReadInteger (char *string, char **NextString)
 

Private Attributes

DrawingStyle fDrawingStyle
 
G4bool fAuxEdgeVisible
 
G4bool fCulling
 
G4bool fCullInvisible
 
G4bool fDensityCulling
 
G4double fVisibleDensity
 
G4bool fCullCovered
 
G4bool fSection
 
G4Plane3D fSectionPlane
 
CutawayMode fCutawayMode
 
G4Planes fCutawayPlanes
 
G4double fExplodeFactor
 
G4Point3D fExplodeCentre
 
G4int fNoOfSides
 
G4Vector3D fViewpointDirection
 
G4Vector3D fUpVector
 
G4double fFieldHalfAngle
 
G4double fZoomFactor
 
G4Vector3D fScaleFactor
 
G4Point3D fCurrentTargetPoint
 
G4double fDolly
 
G4bool fLightsMoveWithCamera
 
G4Vector3D fRelativeLightpointDirection
 
G4Vector3D fActualLightpointDirection
 
G4VisAttributes fDefaultVisAttributes
 
G4VisAttributes fDefaultTextVisAttributes
 
G4VMarker fDefaultMarker
 
G4double fGlobalMarkerScale
 
G4double fGlobalLineWidthScale
 
G4bool fMarkerNotHidden
 
G4int fWindowSizeHintX
 
G4int fWindowSizeHintY
 
G4int fWindowLocationHintX
 
G4int fWindowLocationHintY
 
G4bool fWindowLocationHintXNegative
 
G4bool fWindowLocationHintYNegative
 
G4String fXGeometryString
 
G4int fGeometryMask
 
G4bool fAutoRefresh
 
G4Colour fBackgroundColour
 
G4bool fPicking
 
RotationStyle fRotationStyle
 
std::vector< G4ModelingParameters::VisAttributesModifierfVisAttributesModifiers
 

Friends

std::ostream & operator<< (std::ostream &, const DrawingStyle &)
 
std::ostream & operator<< (std::ostream &, const G4ViewParameters &)
 

Detailed Description

Definition at line 90 of file G4ViewParameters.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
fNoValue 
fXValue 
fYValue 
fWidthValue 
fHeightValue 
fAllValues 
fXNegative 
fYNegative 

Definition at line 321 of file G4ViewParameters.hh.

321  { // Constants for geometry mask in ParseGeometry and related functions.
322  fNoValue = 0,
323  fXValue = 0x0001,
324  fYValue = 0x0002,
325  fWidthValue = 0x0004,
326  fHeightValue = 0x0008,
327  fAllValues = 0x000F,
328  fXNegative = 0x0010,
329  fYNegative = 0x0020
330  };

◆ CutawayMode

Enumerator
cutawayUnion 
cutawayIntersection 

Definition at line 101 of file G4ViewParameters.hh.

101  {
102  cutawayUnion, // Union (addition) of result of each cutaway plane.
103  cutawayIntersection // Intersection (multiplication) " .
104  };

◆ DrawingStyle

Enumerator
wireframe 
hlr 
hsr 
hlhsr 

Definition at line 94 of file G4ViewParameters.hh.

94  {
95  wireframe, // Draw edges - no hidden line removal.
96  hlr, // Draw edges - hidden lines removed.
97  hsr, // Draw surfaces - hidden surfaces removed.
98  hlhsr // Draw surfaces and edges - hidden removed.
99  };

◆ RotationStyle

Enumerator
constrainUpDirection 
freeRotation 

Definition at line 106 of file G4ViewParameters.hh.

106  {
107  constrainUpDirection, // Standard, HEP convention.
108  freeRotation // Free, Google-like rotation, using mouse-grab.
109  };

Constructor & Destructor Documentation

◆ G4ViewParameters()

G4ViewParameters::G4ViewParameters ( )

Definition at line 42 of file G4ViewParameters.cc.

42  :
44  fAuxEdgeVisible (false),
45  fCulling (true),
46  fCullInvisible (true),
47  fDensityCulling (false),
48  fVisibleDensity (0.01 * g / cm3),
49  fCullCovered (false),
50  fSection (false),
51  fSectionPlane (),
53  fCutawayPlanes (),
54  fExplodeFactor (1.),
55  fNoOfSides (24),
56  fViewpointDirection (G4Vector3D (0., 0., 1.)), // On z-axis.
57  fUpVector (G4Vector3D (0., 1., 0.)), // y-axis up.
58  fFieldHalfAngle (0.), // Orthogonal projection.
59  fZoomFactor (1.),
60  fScaleFactor (G4Vector3D (1., 1., 1.)),
62  fDolly (0.),
63  fLightsMoveWithCamera (false),
67  fDefaultTextVisAttributes (G4Colour (0., 0., 1.)),
68  fDefaultMarker (),
69  fGlobalMarkerScale (1.),
71  fMarkerNotHidden (true),
72  fWindowSizeHintX (600),
73  fWindowSizeHintY (600),
78  fGeometryMask(0),
79  fAutoRefresh (false),
80  fBackgroundColour (G4Colour(0.,0.,0.)), // Black
81  fPicking (false),
83 {
85  // Markers are 5 pixels "overall" size, i.e., diameter.
86 }
CutawayMode fCutawayMode
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
G4Point3D fCurrentTargetPoint
static const double cm3
Definition: G4SIunits.hh:120
G4VisAttributes fDefaultVisAttributes
G4double fGlobalLineWidthScale
G4Vector3D fRelativeLightpointDirection
G4bool fWindowLocationHintYNegative
RotationStyle fRotationStyle
G4Vector3D fViewpointDirection
G4bool fWindowLocationHintXNegative
G4VisAttributes fDefaultTextVisAttributes
G4Vector3D fActualLightpointDirection
DrawingStyle fDrawingStyle
void SetScreenSize(G4double)
Here is the call graph for this function:

◆ ~G4ViewParameters()

G4ViewParameters::~G4ViewParameters ( )

Definition at line 88 of file G4ViewParameters.cc.

88 {}
Here is the call graph for this function:

Member Function Documentation

◆ AddCutawayPlane()

void G4ViewParameters::AddCutawayPlane ( const G4Plane3D cutawayPlane)

Definition at line 150 of file G4ViewParameters.cc.

150  {
151  if (fCutawayPlanes.size () < 3 ) {
152  fCutawayPlanes.push_back (cutawayPlane);
153  }
154  else {
155  G4cerr <<
156  "ERROR: G4ViewParameters::AddCutawayPlane:"
157  "\n A maximum of 3 cutaway planes supported." << G4endl;
158  }
159 }
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddVisAttributesModifier()

void G4ViewParameters::AddVisAttributesModifier ( const G4ModelingParameters::VisAttributesModifier )
Here is the caller graph for this function:

◆ CameraAndLightingCommands()

G4String G4ViewParameters::CameraAndLightingCommands ( const G4Point3D  standardTargetPoint) const

Definition at line 252 of file G4ViewParameters.cc.

253 {
254  std::ostringstream oss;
255 
256  oss << "#\n# Camera and lights commands";
257 
258  oss << "\n/vis/viewer/set/viewpointVector "
260  << ' ' << fViewpointDirection.y()
261  << ' ' << fViewpointDirection.z();
262 
263  oss << "\n/vis/viewer/set/upVector "
264  << fUpVector.x()
265  << ' ' << fUpVector.y()
266  << ' ' << fUpVector.z();
267 
268  oss << "\n/vis/viewer/set/projection ";
269  if (fFieldHalfAngle == 0.) {
270  oss
271  << "orthogonal";
272  } else {
273  oss
274  << "perspective "
276  << " deg";
277  }
278 
279  oss << "\n/vis/viewer/zoomTo "
280  << fZoomFactor;
281 
282  oss << "\n/vis/viewer/scaleTo "
283  << fScaleFactor.x()
284  << ' ' << fScaleFactor.y()
285  << ' ' << fScaleFactor.z();
286 
287  oss << "\n/vis/viewer/set/targetPoint "
288  << G4BestUnit(standardTargetPoint+fCurrentTargetPoint,"Length")
289  << "\n# Note that if you have not set a target point, the vis system sets"
290  << "\n# a target point based on the scene - plus any panning and dollying -"
291  << "\n# so don't be alarmed by strange coordinates here.";
292 
293  oss << "\n/vis/viewer/dollyTo "
294  << G4BestUnit(fDolly,"Length");
295 
296  oss << "\n/vis/viewer/set/lightsMove ";
297  if (fLightsMoveWithCamera) {
298  oss << "camera";
299  } else {
300  oss << "object";
301  }
302 
303  oss << "\n/vis/viewer/set/lightsVector "
305  << ' ' << fRelativeLightpointDirection.y()
306  << ' ' << fRelativeLightpointDirection.z();
307 
308  oss << "\n/vis/viewer/set/rotationStyle ";
310  oss << "constrainUpDirection";
311  } else {
312  oss << "freeRotation";
313  }
314 
316  oss << "\n/vis/viewer/set/background "
317  << c.GetRed()
318  << ' ' << c.GetGreen()
319  << ' ' << c.GetBlue()
320  << ' ' << c.GetAlpha();
321 
323  oss << "\n/vis/viewer/set/defaultColour "
324  << c.GetRed()
325  << ' ' << c.GetGreen()
326  << ' ' << c.GetBlue()
327  << ' ' << c.GetAlpha();
328 
330  oss << "\n/vis/viewer/set/defaultTextColour "
331  << c.GetRed()
332  << ' ' << c.GetGreen()
333  << ' ' << c.GetBlue()
334  << ' ' << c.GetAlpha();
335 
336  oss << std::endl;
337 
338  return oss.str();
339 }
G4double GetAlpha() const
Definition: G4Colour.hh:142
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double GetGreen() const
Definition: G4Colour.hh:140
G4double GetRed() const
Definition: G4Colour.hh:139
G4double GetBlue() const
Definition: G4Colour.hh:141
G4Point3D fCurrentTargetPoint
static const double deg
Definition: G4SIunits.hh:151
G4VisAttributes fDefaultVisAttributes
G4Vector3D fRelativeLightpointDirection
RotationStyle fRotationStyle
G4Vector3D fViewpointDirection
G4VisAttributes fDefaultTextVisAttributes
const G4Colour & GetColour() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChangeCutawayPlane()

void G4ViewParameters::ChangeCutawayPlane ( size_t  index,
const G4Plane3D cutawayPlane 
)

Definition at line 162 of file G4ViewParameters.cc.

162  {
163  if (index >= fCutawayPlanes.size()) {
164  G4cerr <<
165  "ERROR: G4ViewParameters::ChangeCutawayPlane:"
166  "\n Plane " << index << " does not exist." << G4endl;
167  } else {
168  fCutawayPlanes[index] = cutawayPlane;
169  }
170 }
Int_t index
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
Here is the caller graph for this function:

◆ ClearCutawayPlanes()

void G4ViewParameters::ClearCutawayPlanes ( )
Here is the caller graph for this function:

◆ DrawingStyleCommands()

G4String G4ViewParameters::DrawingStyleCommands ( ) const

Definition at line 341 of file G4ViewParameters.cc.

342 {
343  std::ostringstream oss;
344 
345  oss << "#\n# Drawing style commands";
346 
347  oss << "\n/vis/viewer/set/style ";
348  if (fDrawingStyle == wireframe || fDrawingStyle == hlr) {
349  oss << "wireframe";
350  } else {
351  oss << "surface";
352  }
353 
354  oss << "\n/vis/viewer/set/hiddenEdge ";
355  if (fDrawingStyle == hlr || fDrawingStyle == hlhsr) {
356  oss << "true";
357  } else {
358  oss << "false";
359  }
360 
361  oss << "\n/vis/viewer/set/auxiliaryEdge ";
362  if (fAuxEdgeVisible) {
363  oss << "true";
364  } else {
365  oss << "false";
366  }
367 
368  oss << "\n/vis/viewer/set/hiddenMarker ";
369  if (fMarkerNotHidden) {
370  oss << "false";
371  } else {
372  oss << "true";
373  }
374 
375  oss << "\n/vis/viewer/set/globalLineWidthScale "
377 
378  oss << "\n/vis/viewer/set/globalMarkerScale "
380 
381  oss << std::endl;
382 
383  return oss.str();
384 }
G4double fGlobalLineWidthScale
DrawingStyle fDrawingStyle
Here is the caller graph for this function:

◆ GetActualLightpointDirection()

G4Vector3D & G4ViewParameters::GetActualLightpointDirection ( )

Definition at line 97 of file G4ViewParameters.cc.

97  {
100 }
void SetViewAndLights(const G4Vector3D &viewpointDirection)
G4Vector3D fViewpointDirection
G4Vector3D fActualLightpointDirection
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBackgroundColour()

const G4Colour& G4ViewParameters::GetBackgroundColour ( ) const
Here is the caller graph for this function:

◆ GetCameraDistance()

G4double G4ViewParameters::GetCameraDistance ( G4double  radius) const

Definition at line 110 of file G4ViewParameters.cc.

110  {
111  G4double cameraDistance;
112  if (fFieldHalfAngle == 0.) {
113  cameraDistance = radius;
114  }
115  else {
116  cameraDistance = radius / std::sin (fFieldHalfAngle) - fDolly;
117  }
118  return cameraDistance;
119 }
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ GetCurrentTargetPoint()

const G4Point3D& G4ViewParameters::GetCurrentTargetPoint ( ) const
Here is the caller graph for this function:

◆ GetCutawayMode()

CutawayMode G4ViewParameters::GetCutawayMode ( ) const
Here is the caller graph for this function:

◆ GetCutawayPlanes()

const G4Planes& G4ViewParameters::GetCutawayPlanes ( ) const
Here is the caller graph for this function:

◆ GetDefaultMarker()

const G4VMarker& G4ViewParameters::GetDefaultMarker ( ) const

◆ GetDefaultTextVisAttributes()

const G4VisAttributes* G4ViewParameters::GetDefaultTextVisAttributes ( ) const
Here is the caller graph for this function:

◆ GetDefaultVisAttributes()

const G4VisAttributes* G4ViewParameters::GetDefaultVisAttributes ( ) const
Here is the caller graph for this function:

◆ GetDolly()

G4double G4ViewParameters::GetDolly ( ) const
Here is the caller graph for this function:

◆ GetDrawingStyle()

DrawingStyle G4ViewParameters::GetDrawingStyle ( ) const
Here is the caller graph for this function:

◆ GetExplodeCentre()

const G4Point3D& G4ViewParameters::GetExplodeCentre ( ) const
Here is the caller graph for this function:

◆ GetExplodeFactor()

G4double G4ViewParameters::GetExplodeFactor ( ) const
Here is the caller graph for this function:

◆ GetFarDistance()

G4double G4ViewParameters::GetFarDistance ( G4double  cameraDistance,
G4double  nearDistance,
G4double  radius 
) const

Definition at line 129 of file G4ViewParameters.cc.

131  {
132  G4double farDistance = cameraDistance + radius;
133  if (farDistance < nearDistance) farDistance = nearDistance;
134  return farDistance;
135 }
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ GetFieldHalfAngle()

G4double G4ViewParameters::GetFieldHalfAngle ( ) const
Here is the caller graph for this function:

◆ GetFrontHalfHeight()

G4double G4ViewParameters::GetFrontHalfHeight ( G4double  nearDistance,
G4double  radius 
) const

Definition at line 137 of file G4ViewParameters.cc.

138  {
139  G4double frontHalfHeight;
140  if (fFieldHalfAngle == 0.) {
141  frontHalfHeight = radius / fZoomFactor;
142  }
143  else {
144  frontHalfHeight = nearDistance * std::tan (fFieldHalfAngle) / fZoomFactor;
145  }
146  return frontHalfHeight;
147 }
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ GetGlobalLineWidthScale()

G4double G4ViewParameters::GetGlobalLineWidthScale ( ) const
Here is the caller graph for this function:

◆ GetGlobalMarkerScale()

G4double G4ViewParameters::GetGlobalMarkerScale ( ) const
Here is the caller graph for this function:

◆ GetLightpointDirection()

const G4Vector3D& G4ViewParameters::GetLightpointDirection ( ) const
Here is the caller graph for this function:

◆ GetLightsMoveWithCamera()

G4bool G4ViewParameters::GetLightsMoveWithCamera ( ) const
Here is the caller graph for this function:

◆ GetNearDistance()

G4double G4ViewParameters::GetNearDistance ( G4double  cameraDistance,
G4double  radius 
) const

Definition at line 121 of file G4ViewParameters.cc.

122  {
123  const G4double small = 1.e-6 * radius;
124  G4double nearDistance = cameraDistance - radius;
125  if (nearDistance < small) nearDistance = small;
126  return nearDistance;
127 }
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ GetNoOfSides()

G4int G4ViewParameters::GetNoOfSides ( ) const
Here is the caller graph for this function:

◆ GetRotationStyle()

RotationStyle G4ViewParameters::GetRotationStyle ( ) const
Here is the caller graph for this function:

◆ GetScaleFactor()

const G4Vector3D& G4ViewParameters::GetScaleFactor ( ) const
Here is the caller graph for this function:

◆ GetSectionPlane()

const G4Plane3D& G4ViewParameters::GetSectionPlane ( ) const
Here is the caller graph for this function:

◆ GetUpVector()

const G4Vector3D& G4ViewParameters::GetUpVector ( ) const
Here is the caller graph for this function:

◆ GetViewpointDirection()

const G4Vector3D& G4ViewParameters::GetViewpointDirection ( ) const
Here is the caller graph for this function:

◆ GetVisAttributesModifiers()

const std::vector<G4ModelingParameters::VisAttributesModifier>& G4ViewParameters::GetVisAttributesModifiers ( ) const
Here is the caller graph for this function:

◆ GetVisibleDensity()

G4double G4ViewParameters::GetVisibleDensity ( ) const
Here is the caller graph for this function:

◆ GetWindowAbsoluteLocationHintX()

G4int G4ViewParameters::GetWindowAbsoluteLocationHintX ( G4int  sizeX) const

Definition at line 967 of file G4ViewParameters.cc.

967  {
969  return sizeX + fWindowLocationHintX - fWindowSizeHintX;
970  }
971  return fWindowLocationHintX;
972 }
G4bool fWindowLocationHintXNegative

◆ GetWindowAbsoluteLocationHintY()

G4int G4ViewParameters::GetWindowAbsoluteLocationHintY ( G4int  sizeY) const

Definition at line 974 of file G4ViewParameters.cc.

974  {
976  return sizeY + fWindowLocationHintY - fWindowSizeHintY;
977  }
978  return fWindowLocationHintY;
979 }
G4bool fWindowLocationHintYNegative

◆ GetWindowLocationHintX()

G4int G4ViewParameters::GetWindowLocationHintX ( ) const

◆ GetWindowLocationHintY()

G4int G4ViewParameters::GetWindowLocationHintY ( ) const

◆ GetWindowSizeHintX()

unsigned int G4ViewParameters::GetWindowSizeHintX ( ) const

◆ GetWindowSizeHintY()

unsigned int G4ViewParameters::GetWindowSizeHintY ( ) const

◆ GetXGeometryString()

const G4String& G4ViewParameters::GetXGeometryString ( ) const
Here is the caller graph for this function:

◆ GetZoomFactor()

G4double G4ViewParameters::GetZoomFactor ( ) const
Here is the caller graph for this function:

◆ IncrementDolly()

void G4ViewParameters::IncrementDolly ( G4double  dollyIncrement)
Here is the caller graph for this function:

◆ IncrementPan() [1/2]

void G4ViewParameters::IncrementPan ( G4double  right,
G4double  up 
)

Definition at line 241 of file G4ViewParameters.cc.

241  {
242  IncrementPan (right,up, 0);
243 }
void IncrementPan(G4double right, G4double up)
Here is the caller graph for this function:

◆ IncrementPan() [2/2]

void G4ViewParameters::IncrementPan ( G4double  right,
G4double  up,
G4double  forward 
)

Definition at line 245 of file G4ViewParameters.cc.

245  {
246  G4Vector3D unitRight = (fUpVector.cross (fViewpointDirection)).unit();
247  G4Vector3D unitUp = (fViewpointDirection.cross (unitRight)).unit();
248  fCurrentTargetPoint += right * unitRight + up * unitUp + distance * fViewpointDirection;
249 }
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
G4Point3D fCurrentTargetPoint
G4Vector3D fViewpointDirection
Here is the call graph for this function:

◆ IsAutoRefresh()

G4bool G4ViewParameters::IsAutoRefresh ( ) const
Here is the caller graph for this function:

◆ IsAuxEdgeVisible()

G4bool G4ViewParameters::IsAuxEdgeVisible ( ) const
Here is the caller graph for this function:

◆ IsCulling()

G4bool G4ViewParameters::IsCulling ( ) const
Here is the caller graph for this function:

◆ IsCullingCovered()

G4bool G4ViewParameters::IsCullingCovered ( ) const
Here is the caller graph for this function:

◆ IsCullingInvisible()

G4bool G4ViewParameters::IsCullingInvisible ( ) const
Here is the caller graph for this function:

◆ IsCutaway()

G4bool G4ViewParameters::IsCutaway ( ) const
Here is the caller graph for this function:

◆ IsDensityCulling()

G4bool G4ViewParameters::IsDensityCulling ( ) const
Here is the caller graph for this function:

◆ IsExplode()

G4bool G4ViewParameters::IsExplode ( ) const
Here is the caller graph for this function:

◆ IsMarkerNotHidden()

G4bool G4ViewParameters::IsMarkerNotHidden ( ) const
Here is the caller graph for this function:

◆ IsPicking()

G4bool G4ViewParameters::IsPicking ( ) const
Here is the caller graph for this function:

◆ IsSection()

G4bool G4ViewParameters::IsSection ( ) const
Here is the caller graph for this function:

◆ IsWindowLocationHintX()

bool G4ViewParameters::IsWindowLocationHintX ( ) const

◆ IsWindowLocationHintY()

bool G4ViewParameters::IsWindowLocationHintY ( ) const

◆ IsWindowSizeHintX()

bool G4ViewParameters::IsWindowSizeHintX ( ) const

◆ IsWindowSizeHintY()

bool G4ViewParameters::IsWindowSizeHintY ( ) const

◆ MultiplyScaleFactor()

void G4ViewParameters::MultiplyScaleFactor ( const G4Vector3D scaleFactorMultiplier)

Definition at line 91 of file G4ViewParameters.cc.

91  {
92  fScaleFactor.setX(fScaleFactor.x() * scaleFactorMultiplier.x());
93  fScaleFactor.setY(fScaleFactor.y() * scaleFactorMultiplier.y());
94  fScaleFactor.setZ(fScaleFactor.z() * scaleFactorMultiplier.z());
95 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MultiplyZoomFactor()

void G4ViewParameters::MultiplyZoomFactor ( G4double  zoomFactorMultiplier)
Here is the caller graph for this function:

◆ operator!=()

G4bool G4ViewParameters::operator!= ( const G4ViewParameters v) const

Definition at line 815 of file G4ViewParameters.cc.

815  {
816 
817  // Put performance-sensitive parameters first.
818  if (
819  // This first to optimise spin, etc.
821 
822  // No particular order from here on.
823  (fDrawingStyle != v.fDrawingStyle) ||
825  (fCulling != v.fCulling) ||
828  (fCullCovered != v.fCullCovered) ||
829  (fSection != v.fSection) ||
830  (IsCutaway() != v.IsCutaway()) ||
831  (IsExplode() != v.IsExplode()) ||
832  (fNoOfSides != v.fNoOfSides) ||
833  (fUpVector != v.fUpVector) ||
835  (fZoomFactor != v.fZoomFactor) ||
836  (fScaleFactor != v.fScaleFactor) ||
838  (fDolly != v.fDolly) ||
850  (fGeometryMask != v.fGeometryMask) ||
851  (fAutoRefresh != v.fAutoRefresh) ||
853  (fPicking != v.fPicking) ||
855  )
856  return true;
857 
858  if (fDensityCulling &&
859  (fVisibleDensity != v.fVisibleDensity)) return true;
860 
861  if (fSection &&
862  (!(fSectionPlane == v.fSectionPlane))) return true;
863 
864  if (IsCutaway()) {
865  if (fCutawayPlanes.size () != v.fCutawayPlanes.size ())
866  return true;
867  else {
868  for (size_t i = 0; i < fCutawayPlanes.size (); i++) {
869  if (!(fCutawayPlanes[i] == v.fCutawayPlanes[i])) return true;
870  }
871  }
872  }
873 
874  if (IsExplode() &&
875  ((fExplodeFactor != v.fExplodeFactor) ||
876  (fExplodeCentre != v.fExplodeCentre))) return true;
877 
878  if (fVisAttributesModifiers != v.fVisAttributesModifiers) return true;
879 
880  return false;
881 }
G4bool IsExplode() const
G4bool IsCutaway() const
G4Point3D fCurrentTargetPoint
G4VisAttributes fDefaultVisAttributes
G4double fGlobalLineWidthScale
G4Vector3D fRelativeLightpointDirection
RotationStyle fRotationStyle
G4Vector3D fViewpointDirection
G4VisAttributes fDefaultTextVisAttributes
std::vector< G4ModelingParameters::VisAttributesModifier > fVisAttributesModifiers
DrawingStyle fDrawingStyle
Here is the call graph for this function:

◆ ParseGeometry()

int G4ViewParameters::ParseGeometry ( const char *  string,
G4int x,
G4int y,
unsigned int *  width,
unsigned int *  height 
)
private

Definition at line 995 of file G4ViewParameters.cc.

1001 {
1002 
1003  G4int mask = fNoValue;
1004  char *strind;
1005  unsigned int tempWidth = 0;
1006  unsigned int tempHeight = 0;
1007  G4int tempX = 0;
1008  G4int tempY = 0;
1009  char *nextCharacter;
1010  if ( (string == NULL) || (*string == '\0')) {
1011  return(mask);
1012  }
1013  if (*string == '=')
1014  string++; /* ignore possible '=' at beg of geometry spec */
1015  strind = (char *)string;
1016  if (*strind != '+' && *strind != '-' && *strind != 'x') {
1017  tempWidth = ReadInteger(strind, &nextCharacter);
1018  if (strind == nextCharacter)
1019  return (0);
1020  strind = nextCharacter;
1021  mask |= fWidthValue;
1022  }
1023  if (*strind == 'x' || *strind == 'X') {
1024  strind++;
1025  tempHeight = ReadInteger(strind, &nextCharacter);
1026  if (strind == nextCharacter)
1027  return (0);
1028  strind = nextCharacter;
1029  mask |= fHeightValue;
1030  }
1031 
1032  if ((*strind == '+') || (*strind == '-')) {
1033  if (*strind == '-') {
1034  strind++;
1035  tempX = -ReadInteger(strind, &nextCharacter);
1036  if (strind == nextCharacter)
1037  return (0);
1038  strind = nextCharacter;
1039  mask |= fXNegative;
1040 
1041  }
1042  else
1043  { strind++;
1044  tempX = ReadInteger(strind, &nextCharacter);
1045  if (strind == nextCharacter)
1046  return(0);
1047  strind = nextCharacter;
1048  }
1049  mask |= fXValue;
1050  if ((*strind == '+') || (*strind == '-')) {
1051  if (*strind == '-') {
1052  strind++;
1053  tempY = -ReadInteger(strind, &nextCharacter);
1054  if (strind == nextCharacter)
1055  return(0);
1056  strind = nextCharacter;
1057  mask |= fYNegative;
1058  }
1059  else
1060  {
1061  strind++;
1062  tempY = ReadInteger(strind, &nextCharacter);
1063  if (strind == nextCharacter)
1064  return(0);
1065  strind = nextCharacter;
1066  }
1067  mask |= fYValue;
1068  }
1069  }
1070  /* If strind isn't at the end of the string the it's an invalid
1071  geometry specification. */
1072  if (*strind != '\0') return (0);
1073  if (mask & fXValue)
1074  *x = tempX;
1075  if (mask & fYValue)
1076  *y = tempY;
1077  if (mask & fWidthValue)
1078  *width = tempWidth;
1079  if (mask & fHeightValue)
1080  *height = tempHeight;
1081  return (mask);
1082 }
static ush mask[]
Definition: csz_inflate.cc:317
#define width
G4int ReadInteger(char *string, char **NextString)
int G4int
Definition: G4Types.hh:78
Double_t y
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintDifferences()

void G4ViewParameters::PrintDifferences ( const G4ViewParameters v) const

Definition at line 579 of file G4ViewParameters.cc.

579  {
580 
581  // Put performance-sensitive parameters first.
582  if (
583  // This first to optimise spin, etc.
585 
586  // No particular order from here on.
587  (fDrawingStyle != v.fDrawingStyle) ||
589  (fCulling != v.fCulling) ||
593  (fCullCovered != v.fCullCovered) ||
594  (fSection != v.fSection) ||
595  (fNoOfSides != v.fNoOfSides) ||
596  (fUpVector != v.fUpVector) ||
598  (fZoomFactor != v.fZoomFactor) ||
599  (fScaleFactor != v.fScaleFactor) ||
601  (fDolly != v.fDolly) ||
613  (fGeometryMask != v.fGeometryMask) ||
614  (fAutoRefresh != v.fAutoRefresh) ||
616  (fPicking != v.fPicking) ||
618  )
619  G4cout << "Difference in 1st batch." << G4endl;
620 
621  if (fSection) {
622  if (!(fSectionPlane == v.fSectionPlane))
623  G4cout << "Difference in section planes batch." << G4endl;
624  }
625 
626  if (IsCutaway()) {
627  if (fCutawayPlanes.size () != v.fCutawayPlanes.size ()) {
628  G4cout << "Difference in no of cutaway planes." << G4endl;
629  }
630  else {
631  for (size_t i = 0; i < fCutawayPlanes.size (); i++) {
632  if (!(fCutawayPlanes[i] == v.fCutawayPlanes[i]))
633  G4cout << "Difference in cutaway plane no. " << i << G4endl;
634  }
635  }
636  }
637 
638  if (IsExplode()) {
640  G4cout << "Difference in explode factor." << G4endl;
642  G4cout << "Difference in explode centre." << G4endl;
643  }
644 }
G4bool IsExplode() const
G4bool IsCutaway() const
G4GLOB_DLL std::ostream G4cout
G4Point3D fCurrentTargetPoint
G4VisAttributes fDefaultVisAttributes
G4double fGlobalLineWidthScale
G4Vector3D fRelativeLightpointDirection
RotationStyle fRotationStyle
#define G4endl
Definition: G4ios.hh:61
G4Vector3D fViewpointDirection
G4VisAttributes fDefaultTextVisAttributes
DrawingStyle fDrawingStyle
Here is the call graph for this function:

◆ ReadInteger()

G4int G4ViewParameters::ReadInteger ( char *  string,
char **  NextString 
)
private

Definition at line 1088 of file G4ViewParameters.cc.

1089 {
1090  G4int Result = 0;
1091  G4int Sign = 1;
1092 
1093  if (*string == '+')
1094  string++;
1095  else if (*string == '-')
1096  {
1097  string++;
1098  Sign = -1;
1099  }
1100  for (; (*string >= '0') && (*string <= '9'); string++)
1101  {
1102  Result = (Result * 10) + (*string - '0');
1103  }
1104  *NextString = string;
1105  if (Sign >= 0)
1106  return (Result);
1107  else
1108  return (-Result);
1109 }
int G4int
Definition: G4Types.hh:78
Here is the caller graph for this function:

◆ SceneModifyingCommands()

G4String G4ViewParameters::SceneModifyingCommands ( ) const

Definition at line 386 of file G4ViewParameters.cc.

387 {
388  std::ostringstream oss;
389 
390  oss << "#\n# Scene-modifying commands";
391 
392  oss << "\n/vis/viewer/set/culling global ";
393  if (fCulling) {
394  oss << "true";
395  } else {
396  oss << "false";
397  }
398 
399  oss << "\n/vis/viewer/set/culling invisible ";
400  if (fCullInvisible) {
401  oss << "true";
402  } else {
403  oss << "false";
404  }
405 
406  oss << "\n/vis/viewer/set/culling density ";
407  if (fDensityCulling) {
408  oss << "true " << fVisibleDensity/(g/cm3) << " g/cm3";
409  } else {
410  oss << "false";
411  }
412 
413  oss << "\n/vis/viewer/set/culling coveredDaughters ";
414  if (fCullCovered) {
415  oss << "true";
416  } else {
417  oss << "false";
418  }
419 
420  oss << "\n/vis/viewer/set/sectionPlane ";
421  if (fSection) {
422  oss << "on "
423  << G4BestUnit(fSectionPlane.point(),"Length")
424  << fSectionPlane.normal().x()
425  << ' ' << fSectionPlane.normal().y()
426  << ' ' << fSectionPlane.normal().z();
427  } else {
428  oss << "off";
429  }
430 
431  oss << "\n/vis/viewer/set/cutawayMode ";
432  if (fCutawayMode == cutawayUnion) {
433  oss << "union";
434  } else {
435  oss << "intersection";
436  }
437 
438  oss << "\n/vis/viewer/clearCutawayPlanes";
439  if (fCutawayPlanes.size()) {
440  for (size_t i = 0; i < fCutawayPlanes.size(); i++) {
441  oss << "\n/vis/viewer/addCutawayPlane "
442  << G4BestUnit(fCutawayPlanes[i].point(),"Length")
443  << fCutawayPlanes[i].normal().x()
444  << ' ' << fCutawayPlanes[i].normal().y()
445  << ' ' << fCutawayPlanes[i].normal().z();
446  }
447  } else {
448  oss << "\n# No cutaway planes defined.";
449  }
450 
451  oss << "\n/vis/viewer/set/explodeFactor "
452  << fExplodeFactor
453  << ' ' << G4BestUnit(fExplodeCentre,"Length");
454 
455  oss << "\n/vis/viewer/set/lineSegmentsPerCircle "
456  << fNoOfSides;
457 
458  oss << std::endl;
459 
460  return oss.str();
461 }
Normal3D< T > normal() const
Definition: Plane3D.h:90
CutawayMode fCutawayMode
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
Point3D< T > point(const Point3D< T > &p) const
Definition: Plane3D.h:108
static const double cm3
Definition: G4SIunits.hh:120
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAutoRefresh()

void G4ViewParameters::SetAutoRefresh ( G4bool  )
Here is the caller graph for this function:

◆ SetAuxEdgeVisible()

void G4ViewParameters::SetAuxEdgeVisible ( G4bool  )
Here is the caller graph for this function:

◆ SetBackgroundColour()

void G4ViewParameters::SetBackgroundColour ( const G4Colour )
Here is the caller graph for this function:

◆ SetCulling()

void G4ViewParameters::SetCulling ( G4bool  )
Here is the caller graph for this function:

◆ SetCullingCovered()

void G4ViewParameters::SetCullingCovered ( G4bool  )
Here is the caller graph for this function:

◆ SetCullingInvisible()

void G4ViewParameters::SetCullingInvisible ( G4bool  )
Here is the caller graph for this function:

◆ SetCurrentTargetPoint()

void G4ViewParameters::SetCurrentTargetPoint ( const G4Point3D currentTargetPoint)
Here is the caller graph for this function:

◆ SetCutawayMode()

void G4ViewParameters::SetCutawayMode ( CutawayMode  )
Here is the caller graph for this function:

◆ SetDefaultColour()

void G4ViewParameters::SetDefaultColour ( const G4Colour )

◆ SetDefaultMarker()

void G4ViewParameters::SetDefaultMarker ( const G4VMarker defaultMarker)

◆ SetDefaultTextColour()

void G4ViewParameters::SetDefaultTextColour ( const G4Colour )

◆ SetDefaultTextVisAttributes()

void G4ViewParameters::SetDefaultTextVisAttributes ( const G4VisAttributes )
Here is the caller graph for this function:

◆ SetDefaultVisAttributes()

void G4ViewParameters::SetDefaultVisAttributes ( const G4VisAttributes )
Here is the caller graph for this function:

◆ SetDensityCulling()

void G4ViewParameters::SetDensityCulling ( G4bool  )
Here is the caller graph for this function:

◆ SetDolly()

void G4ViewParameters::SetDolly ( G4double  dolly)
Here is the caller graph for this function:

◆ SetDrawingStyle()

void G4ViewParameters::SetDrawingStyle ( G4ViewParameters::DrawingStyle  style)
Here is the caller graph for this function:

◆ SetExplodeCentre()

void G4ViewParameters::SetExplodeCentre ( const G4Point3D explodeCentre)
Here is the caller graph for this function:

◆ SetExplodeFactor()

void G4ViewParameters::SetExplodeFactor ( G4double  explodeFactor)
Here is the caller graph for this function:

◆ SetFieldHalfAngle()

void G4ViewParameters::SetFieldHalfAngle ( G4double  fieldHalfAngle)
Here is the caller graph for this function:

◆ SetGlobalLineWidthScale()

void G4ViewParameters::SetGlobalLineWidthScale ( G4double  globalLineWidthScale)
Here is the caller graph for this function:

◆ SetGlobalMarkerScale()

void G4ViewParameters::SetGlobalMarkerScale ( G4double  globalMarkerScale)
Here is the caller graph for this function:

◆ SetLightpointDirection()

void G4ViewParameters::SetLightpointDirection ( const G4Vector3D lightpointDirection)

Definition at line 230 of file G4ViewParameters.cc.

230  {
231  fRelativeLightpointDirection = lightpointDirection;
233 }
void SetViewAndLights(const G4Vector3D &viewpointDirection)
G4Vector3D fRelativeLightpointDirection
G4Vector3D fViewpointDirection
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetLightsMoveWithCamera()

void G4ViewParameters::SetLightsMoveWithCamera ( G4bool  moves)
Here is the caller graph for this function:

◆ SetMarkerHidden()

void G4ViewParameters::SetMarkerHidden ( )
Here is the caller graph for this function:

◆ SetMarkerNotHidden()

void G4ViewParameters::SetMarkerNotHidden ( )
Here is the caller graph for this function:

◆ SetNoOfSides()

G4int G4ViewParameters::SetNoOfSides ( G4int  nSides)

Definition at line 189 of file G4ViewParameters.cc.

189  {
191  if (nSides < nSidesMin) {
192  nSides = nSidesMin;
193  G4cout << "G4ViewParameters::SetNoOfSides: attempt to set the"
194  "\nnumber of sides per circle < " << nSidesMin
195  << "; forced to " << nSides << G4endl;
196  }
197  fNoOfSides = nSides;
198  return fNoOfSides;
199 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
static G4int GetMinLineSegmentsPerCircle()
G4VisAttributes fDefaultVisAttributes
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetOrthogonalProjection()

void G4ViewParameters::SetOrthogonalProjection ( )

◆ SetPan()

void G4ViewParameters::SetPan ( G4double  right,
G4double  up 
)

Definition at line 235 of file G4ViewParameters.cc.

235  {
236  G4Vector3D unitRight = (fUpVector.cross (fViewpointDirection)).unit();
237  G4Vector3D unitUp = (fViewpointDirection.cross (unitRight)).unit();
238  fCurrentTargetPoint = right * unitRight + up * unitUp;
239 }
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
G4Point3D fCurrentTargetPoint
G4Vector3D fViewpointDirection
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPerspectiveProjection()

void G4ViewParameters::SetPerspectiveProjection ( G4double  fieldHalfAngle = 30. *CLHEP::deg)

◆ SetPicking()

void G4ViewParameters::SetPicking ( G4bool  )
Here is the caller graph for this function:

◆ SetRotationStyle()

void G4ViewParameters::SetRotationStyle ( RotationStyle  )
Here is the caller graph for this function:

◆ SetScaleFactor()

void G4ViewParameters::SetScaleFactor ( const G4Vector3D scaleFactor)
Here is the caller graph for this function:

◆ SetSectionPlane()

void G4ViewParameters::SetSectionPlane ( const G4Plane3D sectionPlane)
Here is the caller graph for this function:

◆ SetUpVector()

void G4ViewParameters::SetUpVector ( const G4Vector3D upVector)
Here is the caller graph for this function:

◆ SetViewAndLights()

void G4ViewParameters::SetViewAndLights ( const G4Vector3D viewpointDirection)

Definition at line 202 of file G4ViewParameters.cc.

202  {
203 
204  fViewpointDirection = viewpointDirection;
205 
206  // If the requested viewpoint direction is parallel to the up
207  // vector, the orientation of the view is undefined...
208  if (fViewpointDirection.unit() * fUpVector.unit() > .9999) {
209  G4cout <<
210  "WARNING: Viewpoint direction is very close to the up vector direction."
211  "\n Consider setting the up vector to obtain definable behaviour."
212  << G4endl;
213  }
214 
215  // Move the lights too if requested...
216  if (fLightsMoveWithCamera) {
217  G4Vector3D zprime = fViewpointDirection.unit ();
218  G4Vector3D xprime = (fUpVector.cross (zprime)).unit ();
219  G4Vector3D yprime = zprime.cross (xprime);
221  fRelativeLightpointDirection.x () * xprime +
222  fRelativeLightpointDirection.y () * yprime +
223  fRelativeLightpointDirection.x () * zprime;
224  } else {
226  }
227 }
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
G4GLOB_DLL std::ostream G4cout
G4Vector3D fRelativeLightpointDirection
#define G4endl
Definition: G4ios.hh:61
G4Vector3D fViewpointDirection
BasicVector3D< T > unit() const
G4Vector3D fActualLightpointDirection
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetViewpointDirection()

void G4ViewParameters::SetViewpointDirection ( const G4Vector3D viewpointDirection)
Here is the caller graph for this function:

◆ SetVisibleDensity()

void G4ViewParameters::SetVisibleDensity ( G4double  visibleDensity)

Definition at line 172 of file G4ViewParameters.cc.

172  {
173  const G4double reasonableMaximum = 10.0 * g / cm3;
174  if (visibleDensity < 0) {
175  G4cout << "G4ViewParameters::SetVisibleDensity: attempt to set negative "
176  "density - ignored." << G4endl;
177  }
178  else {
179  if (visibleDensity > reasonableMaximum) {
180  G4cout << "G4ViewParameters::SetVisibleDensity: density > "
181  << G4BestUnit (reasonableMaximum, "Volumic Mass")
182  << " - did you mean this?"
183  << G4endl;
184  }
185  fVisibleDensity = visibleDensity;
186  }
187 }
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
G4GLOB_DLL std::ostream G4cout
static const double cm3
Definition: G4SIunits.hh:120
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetWindowLocationHint()

void G4ViewParameters::SetWindowLocationHint ( G4int  xHint,
G4int  yHint 
)

◆ SetWindowSizeHint()

void G4ViewParameters::SetWindowSizeHint ( G4int  xHint,
G4int  yHint 
)

◆ SetXGeometryString()

void G4ViewParameters::SetXGeometryString ( const G4String geomStringArg)

Definition at line 884 of file G4ViewParameters.cc.

885 {
886  G4int x,y = 0;
887  unsigned int w,h = 0;
888  G4String geomString = geomStringArg;
889  // Parse windowSizeHintString for backwards compatibility...
890  const G4String delimiters("xX+-");
891  G4String::size_type i = geomString.find_first_of(delimiters);
892  if (i == G4String::npos) { // Does not contain "xX+-". Assume single number
893  std::istringstream iss(geomString);
894  G4int size;
895  iss >> size;
896  if (!iss) {
897  size = 600;
898  G4cout << "Unrecognised windowSizeHint string: \""
899  << geomString
900  << "\". Asuuming " << size << G4endl;
901  }
902  std::ostringstream oss;
903  oss << size << 'x' << size;
904  geomString = oss.str();
905  }
906 
907  fGeometryMask = ParseGeometry( geomString, &x, &y, &w, &h );
908 
909  // Handle special case :
910  if ((fGeometryMask & fYValue) == 0)
911  { // Using default
913  }
914  if ((fGeometryMask & fXValue) == 0)
915  { // Using default
917  }
918 
919  // Check errors
920  // if there is no Width and Height
921  if ( ((fGeometryMask & fHeightValue) == 0 ) &&
922  ((fGeometryMask & fWidthValue) == 0 )) {
923  h = fWindowSizeHintY;
924  w = fWindowSizeHintX;
925  } else if ((fGeometryMask & fHeightValue) == 0 ) {
926 
927  // if there is only Width. Special case to be backward compatible
928  // We set Width and Height the same to obtain a square windows.
929 
930  G4cout << "Unrecognised geometry string \""
931  << geomString
932  << "\". No Height found. Using Width value instead"
933  << G4endl;
934  h = w;
935  }
936  if ( ((fGeometryMask & fXValue) == 0 ) ||
937  ((fGeometryMask & fYValue) == 0 )) {
938  //Using defaults
941  }
942  // Set the string
943  fXGeometryString = geomString;
944 
945  // Set values
947  fWindowSizeHintY = h;
950 
951  if ( ((fGeometryMask & fXValue)) &&
952  ((fGeometryMask & fYValue))) {
953 
954  if ( (fGeometryMask & fXNegative) ) {
956  } else {
958  }
959  if ( (fGeometryMask & fYNegative) ) {
961  } else {
963  }
964  }
965 }
int G4int
Definition: G4Types.hh:78
Double_t y
G4GLOB_DLL std::ostream G4cout
G4bool fWindowLocationHintYNegative
#define G4endl
Definition: G4ios.hh:61
G4bool fWindowLocationHintXNegative
G4int ParseGeometry(const char *string, G4int *x, G4int *y, unsigned int *width, unsigned int *height)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetZoomFactor()

void G4ViewParameters::SetZoomFactor ( G4double  zoomFactor)
Here is the caller graph for this function:

◆ TouchableCommands()

G4String G4ViewParameters::TouchableCommands ( ) const

Definition at line 463 of file G4ViewParameters.cc.

464 {
465  std::ostringstream oss;
466 
467  oss << "#\n# Touchable commands";
468 
469  const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
471 
472  if (vams.empty()) {
473  oss << "\n# None";
474  oss << std::endl;
475  return oss.str();
476  }
477 
479  std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
480  iModifier;
481  for (iModifier = vams.begin();
482  iModifier != vams.end();
483  ++iModifier) {
485  iModifier->GetPVNameCopyNoPath();
486  if (vamPath != lastPath) {
487  lastPath = vamPath;
488  oss << "\n/vis/set/touchable";
490  for (iVAM = vamPath.begin();
491  iVAM != vamPath.end();
492  ++iVAM) {
493  oss << ' ' << iVAM->GetName() << ' ' << iVAM->GetCopyNo();
494  }
495  }
496  const G4VisAttributes& vamVisAtts = iModifier->GetVisAttributes();
497  const G4Colour& c = vamVisAtts.GetColour();
498  switch (iModifier->GetVisAttributesSignifier()) {
500  oss << "\n/vis/touchable/set/visibility ";
501  if (vamVisAtts.IsVisible()) {
502  oss << "true";
503  } else {
504  oss << "false";
505  }
506  break;
508  oss << "\n/vis/touchable/set/daughtersInvisible ";
509  if (vamVisAtts.IsDaughtersInvisible()) {
510  oss << "true";
511  } else {
512  oss << "false";
513  }
514  break;
516  oss << "\n/vis/touchable/set/colour "
517  << c.GetRed()
518  << ' ' << c.GetGreen()
519  << ' ' << c.GetBlue()
520  << ' ' << c.GetAlpha();
521  break;
523  oss << "\n/vis/touchable/set/lineStyle ";
524  switch (vamVisAtts.GetLineStyle()) {
526  oss << "unbroken";
527  break;
529  oss << "dashed";
530  break;
532  oss << "dotted";
533  }
534  break;
536  oss << "\n/vis/touchable/set/lineWidth "
537  << vamVisAtts.GetLineWidth();
538  break;
541  oss << "\n/vis/touchable/set/forceWireframe ";
542  if (vamVisAtts.IsForceDrawingStyle()) {
543  oss << "true";
544  } else {
545  oss << "false";
546  }
547  }
548  break;
550  if (vamVisAtts.GetForcedDrawingStyle() == G4VisAttributes::solid) {
551  oss << "\n/vis/touchable/set/forceSolid ";
552  if (vamVisAtts.IsForceDrawingStyle()) {
553  oss << "true";
554  } else {
555  oss << "false";
556  }
557  }
558  break;
560  oss << "\n/vis/touchable/set/forceAuxEdgeVisible ";
561  if (vamVisAtts.IsForceAuxEdgeVisible()) {
562  oss << "true";
563  } else {
564  oss << "false";
565  }
566  break;
568  oss << "\n/vis/touchable/set/lineSegmentsPerCircle "
569  << vamVisAtts.GetForcedLineSegmentsPerCircle();
570  break;
571  }
572  }
573 
574  oss << std::endl;
575 
576  return oss.str();
577 }
ForcedDrawingStyle GetForcedDrawingStyle() const
G4bool IsForceAuxEdgeVisible() const
G4bool IsForceDrawingStyle() const
G4double GetAlpha() const
Definition: G4Colour.hh:142
G4double GetGreen() const
Definition: G4Colour.hh:140
G4double GetRed() const
Definition: G4Colour.hh:139
G4bool IsDaughtersInvisible() const
G4double GetBlue() const
Definition: G4Colour.hh:141
std::vector< PVNameCopyNo > PVNameCopyNoPath
G4double GetLineWidth() const
LineStyle GetLineStyle() const
G4bool IsVisible() const
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
std::vector< G4ModelingParameters::VisAttributesModifier > fVisAttributesModifiers
G4int GetForcedLineSegmentsPerCircle() const
const G4Colour & GetColour() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnsetExplodeFactor()

void G4ViewParameters::UnsetExplodeFactor ( )

◆ UnsetSectionPlane()

void G4ViewParameters::UnsetSectionPlane ( )
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  os,
const DrawingStyle style 
)
friend

Definition at line 646 of file G4ViewParameters.cc.

647  {
648  switch (style) {
650  os << "wireframe"; break;
652  os << "hlr - hidden lines removed"; break;
654  os << "hsr - hidden surfaces removed"; break;
656  os << "hlhsr - hidden line, hidden surface removed"; break;
657  default: os << "unrecognised"; break;
658  }
659  return os;
660 }

◆ operator<< [2/2]

std::ostream& operator<< ( std::ostream &  os,
const G4ViewParameters v 
)
friend

Definition at line 662 of file G4ViewParameters.cc.

662  {
663  os << "View parameters and options:";
664 
665  os << "\n Drawing style: ";
666  switch (v.fDrawingStyle) {
668  os << "edges, wireframe"; break;
670  os << "edges, hidden line removal"; break;
672  os << "surfaces, hidden surface removal"; break;
674  os << "surfaces and edges, hidden line and surface removal"; break;
675  default: os << "unrecognised"; break;
676  }
677 
678  os << "\n Auxiliary edges: ";
679  if (!v.fAuxEdgeVisible) os << "in";
680  os << "visible";
681 
682  os << "\n Culling: ";
683  if (v.fCulling) os << "on";
684  else os << "off";
685 
686  os << "\n Culling invisible objects: ";
687  if (v.fCullInvisible) os << "on";
688  else os << "off";
689 
690  os << "\n Density culling: ";
691  if (v.fDensityCulling) {
692  os << "on - invisible if density less than "
693  << v.fVisibleDensity / (1. * g / cm3) << " g cm^-3";
694  }
695  else os << "off";
696 
697  os << "\n Culling daughters covered by opaque mothers: ";
698  if (v.fCullCovered) os << "on";
699  else os << "off";
700 
701  os << "\n Section flag: ";
702  if (v.fSection) os << "true, section/cut plane: " << v.fSectionPlane;
703  else os << "false";
704 
705  if (v.IsCutaway()) {
706  os << "\n Cutaway planes: ";
707  for (size_t i = 0; i < v.fCutawayPlanes.size (); i++) {
708  os << ' ' << v.fCutawayPlanes[i];
709  }
710  }
711  else {
712  os << "\n No cutaway planes";
713  }
714 
715  os << "\n Explode factor: " << v.fExplodeFactor
716  << " about centre: " << v.fExplodeCentre;
717 
718  os << "\n No. of sides used in circle polygon approximation: "
719  << v.fNoOfSides;
720 
721  os << "\n Viewpoint direction: " << v.fViewpointDirection;
722 
723  os << "\n Up vector: " << v.fUpVector;
724 
725  os << "\n Field half angle: " << v.fFieldHalfAngle;
726 
727  os << "\n Zoom factor: " << v.fZoomFactor;
728 
729  os << "\n Scale factor: " << v.fScaleFactor;
730 
731  os << "\n Current target point: " << v.fCurrentTargetPoint;
732 
733  os << "\n Dolly distance: " << v.fDolly;
734 
735  os << "\n Light ";
736  if (v.fLightsMoveWithCamera) os << "moves";
737  else os << "does not move";
738  os << " with camera";
739 
740  os << "\n Relative lightpoint direction: "
742 
743  os << "\n Actual lightpoint direction: "
745 
746  os << "\n Derived parameters for standard view of object of unit radius:";
747  G4ViewParameters tempVP = v;
748  tempVP.fDolly = 0.;
749  tempVP.fZoomFactor = 1.;
750  const G4double radius = 1.;
751  const G4double cameraDistance = tempVP.GetCameraDistance (radius);
752  const G4double nearDistance =
753  tempVP.GetNearDistance (cameraDistance, radius);
754  const G4double farDistance =
755  tempVP.GetFarDistance (cameraDistance, nearDistance, radius);
756  const G4double right = tempVP.GetFrontHalfHeight (nearDistance, radius);
757  os << "\n Camera distance: " << cameraDistance;
758  os << "\n Near distance: " << nearDistance;
759  os << "\n Far distance: " << farDistance;
760  os << "\n Front half height: " << right;
761 
762  os << "\n Default VisAttributes:\n " << v.fDefaultVisAttributes;
763 
764  os << "\n Default TextVisAttributes:\n " << v.fDefaultTextVisAttributes;
765 
766  os << "\n Default marker: " << v.fDefaultMarker;
767 
768  os << "\n Global marker scale: " << v.fGlobalMarkerScale;
769 
770  os << "\n Global lineWidth scale: " << v.fGlobalLineWidthScale;
771 
772  os << "\n Marker ";
773  if (v.fMarkerNotHidden) os << "not ";
774  os << "hidden by surfaces.";
775 
776  os << "\n Window size hint: "
777  << v.fWindowSizeHintX << 'x'<< v.fWindowSizeHintX;
778 
779  os << "\n X geometry string: " << v.fXGeometryString;
780  os << "\n X geometry mask: "
781  << std::showbase << std::hex << v.fGeometryMask
782  << std::noshowbase << std::dec;
783 
784  os << "\n Auto refresh: ";
785  if (v.fAutoRefresh) os << "true";
786  else os << "false";
787 
788  os << "\n Background colour: " << v.fBackgroundColour;
789 
790  os << "\n Picking requested: ";
791  if (v.fPicking) os << "true";
792  else os << "false";
793 
794  os << "\n Rotation style: ";
795  switch (v.fRotationStyle) {
797  os << "constrainUpDirection (conventional HEP view)"; break;
799  os << "freeRotation (Google-like rotation, using mouse-grab)"; break;
800  default: os << "unrecognised"; break;
801  }
802 
803  os << "\n Vis attributes modifiers: ";
804  const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
806  if (vams.empty()) {
807  os << "None";
808  } else {
809  os << vams;
810  }
811 
812  return os;
813 }
G4bool IsCutaway() const
G4double GetCameraDistance(G4double radius) const
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
G4double GetNearDistance(G4double cameraDistance, G4double radius) const
G4Point3D fCurrentTargetPoint
static const double cm3
Definition: G4SIunits.hh:120
G4VisAttributes fDefaultVisAttributes
G4double fGlobalLineWidthScale
G4Vector3D fRelativeLightpointDirection
RotationStyle fRotationStyle
G4Vector3D fViewpointDirection
G4double GetFrontHalfHeight(G4double nearDistance, G4double radius) const
G4double GetFarDistance(G4double cameraDistance, G4double nearDistance, G4double radius) const
double G4double
Definition: G4Types.hh:76
G4VisAttributes fDefaultTextVisAttributes
G4Vector3D fActualLightpointDirection
std::vector< G4ModelingParameters::VisAttributesModifier > fVisAttributesModifiers
DrawingStyle fDrawingStyle

Member Data Documentation

◆ fActualLightpointDirection

G4Vector3D G4ViewParameters::fActualLightpointDirection
private

Definition at line 295 of file G4ViewParameters.hh.

◆ fAutoRefresh

G4bool G4ViewParameters::fAutoRefresh
private

Definition at line 314 of file G4ViewParameters.hh.

◆ fAuxEdgeVisible

G4bool G4ViewParameters::fAuxEdgeVisible
private

Definition at line 271 of file G4ViewParameters.hh.

◆ fBackgroundColour

G4Colour G4ViewParameters::fBackgroundColour
private

Definition at line 315 of file G4ViewParameters.hh.

◆ fCullCovered

G4bool G4ViewParameters::fCullCovered
private

Definition at line 276 of file G4ViewParameters.hh.

◆ fCulling

G4bool G4ViewParameters::fCulling
private

Definition at line 272 of file G4ViewParameters.hh.

◆ fCullInvisible

G4bool G4ViewParameters::fCullInvisible
private

Definition at line 273 of file G4ViewParameters.hh.

◆ fCurrentTargetPoint

G4Point3D G4ViewParameters::fCurrentTargetPoint
private

Definition at line 290 of file G4ViewParameters.hh.

◆ fCutawayMode

CutawayMode G4ViewParameters::fCutawayMode
private

Definition at line 279 of file G4ViewParameters.hh.

◆ fCutawayPlanes

G4Planes G4ViewParameters::fCutawayPlanes
private

Definition at line 280 of file G4ViewParameters.hh.

◆ fDefaultMarker

G4VMarker G4ViewParameters::fDefaultMarker
private

Definition at line 298 of file G4ViewParameters.hh.

◆ fDefaultTextVisAttributes

G4VisAttributes G4ViewParameters::fDefaultTextVisAttributes
private

Definition at line 297 of file G4ViewParameters.hh.

◆ fDefaultVisAttributes

G4VisAttributes G4ViewParameters::fDefaultVisAttributes
private

Definition at line 296 of file G4ViewParameters.hh.

◆ fDensityCulling

G4bool G4ViewParameters::fDensityCulling
private

Definition at line 274 of file G4ViewParameters.hh.

◆ fDolly

G4double G4ViewParameters::fDolly
private

Definition at line 291 of file G4ViewParameters.hh.

◆ fDrawingStyle

DrawingStyle G4ViewParameters::fDrawingStyle
private

Definition at line 270 of file G4ViewParameters.hh.

◆ fExplodeCentre

G4Point3D G4ViewParameters::fExplodeCentre
private

Definition at line 282 of file G4ViewParameters.hh.

◆ fExplodeFactor

G4double G4ViewParameters::fExplodeFactor
private

Definition at line 281 of file G4ViewParameters.hh.

◆ fFieldHalfAngle

G4double G4ViewParameters::fFieldHalfAngle
private

Definition at line 287 of file G4ViewParameters.hh.

◆ fGeometryMask

G4int G4ViewParameters::fGeometryMask
private

Definition at line 313 of file G4ViewParameters.hh.

◆ fGlobalLineWidthScale

G4double G4ViewParameters::fGlobalLineWidthScale
private

Definition at line 300 of file G4ViewParameters.hh.

◆ fGlobalMarkerScale

G4double G4ViewParameters::fGlobalMarkerScale
private

Definition at line 299 of file G4ViewParameters.hh.

◆ fLightsMoveWithCamera

G4bool G4ViewParameters::fLightsMoveWithCamera
private

Definition at line 292 of file G4ViewParameters.hh.

◆ fMarkerNotHidden

G4bool G4ViewParameters::fMarkerNotHidden
private

Definition at line 301 of file G4ViewParameters.hh.

◆ fNoOfSides

G4int G4ViewParameters::fNoOfSides
private

Definition at line 283 of file G4ViewParameters.hh.

◆ fPicking

G4bool G4ViewParameters::fPicking
private

Definition at line 316 of file G4ViewParameters.hh.

◆ fRelativeLightpointDirection

G4Vector3D G4ViewParameters::fRelativeLightpointDirection
private

Definition at line 293 of file G4ViewParameters.hh.

◆ fRotationStyle

RotationStyle G4ViewParameters::fRotationStyle
private

Definition at line 317 of file G4ViewParameters.hh.

◆ fScaleFactor

G4Vector3D G4ViewParameters::fScaleFactor
private

Definition at line 289 of file G4ViewParameters.hh.

◆ fSection

G4bool G4ViewParameters::fSection
private

Definition at line 277 of file G4ViewParameters.hh.

◆ fSectionPlane

G4Plane3D G4ViewParameters::fSectionPlane
private

Definition at line 278 of file G4ViewParameters.hh.

◆ fUpVector

G4Vector3D G4ViewParameters::fUpVector
private

Definition at line 285 of file G4ViewParameters.hh.

◆ fViewpointDirection

G4Vector3D G4ViewParameters::fViewpointDirection
private

Definition at line 284 of file G4ViewParameters.hh.

◆ fVisAttributesModifiers

std::vector<G4ModelingParameters::VisAttributesModifier> G4ViewParameters::fVisAttributesModifiers
private

Definition at line 319 of file G4ViewParameters.hh.

◆ fVisibleDensity

G4double G4ViewParameters::fVisibleDensity
private

Definition at line 275 of file G4ViewParameters.hh.

◆ fWindowLocationHintX

G4int G4ViewParameters::fWindowLocationHintX
private

Definition at line 308 of file G4ViewParameters.hh.

◆ fWindowLocationHintXNegative

G4bool G4ViewParameters::fWindowLocationHintXNegative
private

Definition at line 310 of file G4ViewParameters.hh.

◆ fWindowLocationHintY

G4int G4ViewParameters::fWindowLocationHintY
private

Definition at line 309 of file G4ViewParameters.hh.

◆ fWindowLocationHintYNegative

G4bool G4ViewParameters::fWindowLocationHintYNegative
private

Definition at line 311 of file G4ViewParameters.hh.

◆ fWindowSizeHintX

G4int G4ViewParameters::fWindowSizeHintX
private

Definition at line 306 of file G4ViewParameters.hh.

◆ fWindowSizeHintY

G4int G4ViewParameters::fWindowSizeHintY
private

Definition at line 307 of file G4ViewParameters.hh.

◆ fXGeometryString

G4String G4ViewParameters::fXGeometryString
private

Definition at line 312 of file G4ViewParameters.hh.

◆ fZoomFactor

G4double G4ViewParameters::fZoomFactor
private

Definition at line 288 of file G4ViewParameters.hh.


The documentation for this class was generated from the following files: