Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Friends
G4ViewParameters Class Reference

#include <G4ViewParameters.hh>

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
 

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

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  };
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  };
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 ( )

Definition at line 42 of file G4ViewParameters.cc.

References G4VMarker::SetScreenSize().

42  :
43  fDrawingStyle (wireframe),
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 (),
52  fCutawayMode (cutawayUnion),
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.)),
61  fCurrentTargetPoint (),
62  fDolly (0.),
63  fLightsMoveWithCamera (false),
64  fRelativeLightpointDirection (G4Vector3D (1., 1., 1.)),
65  fActualLightpointDirection (G4Vector3D (1., 1., 1.)),
66  fDefaultVisAttributes (),
67  fDefaultTextVisAttributes (G4Colour (0., 0., 1.)),
68  fDefaultMarker (),
69  fGlobalMarkerScale (1.),
70  fGlobalLineWidthScale (1.),
71  fMarkerNotHidden (true),
72  fWindowSizeHintX (600),
73  fWindowSizeHintY (600),
74  fWindowLocationHintX(0),
75  fWindowLocationHintY(0),
76  fWindowLocationHintXNegative(true),
77  fWindowLocationHintYNegative(false),
78  fGeometryMask(0),
79  fAutoRefresh (false),
80  fBackgroundColour (G4Colour(0.,0.,0.)), // Black
81  fPicking (false),
82  fRotationStyle (constrainUpDirection)
83 {
84  fDefaultMarker.SetScreenSize (5.);
85  // Markers are 5 pixels "overall" size, i.e., diameter.
86 }
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
void SetScreenSize(G4double)
G4ViewParameters::~G4ViewParameters ( )

Definition at line 88 of file G4ViewParameters.cc.

88 {}

Member Function Documentation

void G4ViewParameters::AddCutawayPlane ( const G4Plane3D cutawayPlane)

Definition at line 150 of file G4ViewParameters.cc.

References G4cout, and G4endl.

Referenced by G4VisCommandViewerAddCutawayPlane::SetNewValue().

150  {
151  if (fCutawayPlanes.size () < 3 ) {
152  fCutawayPlanes.push_back (cutawayPlane);
153  }
154  else {
155  G4cout <<
156  "ERROR: G4ViewParameters::AddCutawayPlane:"
157  "\n A maximum of 3 cutaway planes supported." << G4endl;
158  }
159 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4ViewParameters::AddVisAttributesModifier ( const G4ModelingParameters::VisAttributesModifier )
G4String G4ViewParameters::CameraAndLightingCommands ( const G4Point3D  standardTargetPoint) const

Definition at line 252 of file G4ViewParameters.cc.

References test::c, python.hepunit::deg, G4BestUnit, G4Colour::GetAlpha(), G4Colour::GetBlue(), G4Colour::GetColour(), G4Colour::GetGreen(), and G4Colour::GetRed().

253 {
254  std::ostringstream oss;
255 
256  oss << "#\n# Camera and lights commands";
257 
258  oss << "\n/vis/viewer/set/viewpointVector "
259  << fViewpointDirection.x()
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 "
275  << fFieldHalfAngle/deg
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 "
304  << fRelativeLightpointDirection.x()
305  << ' ' << fRelativeLightpointDirection.y()
306  << ' ' << fRelativeLightpointDirection.z();
307 
308  oss << "\n/vis/viewer/set/rotationStyle ";
309  if (fRotationStyle == constrainUpDirection) {
310  oss << "constrainUpDirection";
311  } else {
312  oss << "freeRotation";
313  }
314 
315  G4Colour c = fBackgroundColour;
316  oss << "\n/vis/viewer/set/background "
317  << c.GetRed()
318  << ' ' << c.GetGreen()
319  << ' ' << c.GetBlue()
320  << ' ' << c.GetAlpha();
321 
322  c = fDefaultVisAttributes.GetColour();
323  oss << "\n/vis/viewer/set/defaultColour "
324  << c.GetRed()
325  << ' ' << c.GetGreen()
326  << ' ' << c.GetBlue()
327  << ' ' << c.GetAlpha();
328 
329  c = fDefaultTextVisAttributes.GetColour();
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
const G4Colour & GetColour() const
G4double GetBlue() const
Definition: G4Colour.hh:141
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double GetRed() const
Definition: G4Colour.hh:139
G4double GetGreen() const
Definition: G4Colour.hh:140
void G4ViewParameters::ChangeCutawayPlane ( size_t  index,
const G4Plane3D cutawayPlane 
)

Definition at line 162 of file G4ViewParameters.cc.

References G4cout, and G4endl.

Referenced by G4VisCommandViewerChangeCutawayPlane::SetNewValue().

162  {
163  if (index >= fCutawayPlanes.size()) {
164  G4cout <<
165  "ERROR: G4ViewParameters::ChangeCutawayPlane:"
166  "\n Plane " << index << " does not exist." << G4endl;
167  } else {
168  fCutawayPlanes[index] = cutawayPlane;
169  }
170 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4ViewParameters::ClearCutawayPlanes ( )
G4String G4ViewParameters::DrawingStyleCommands ( ) const

Definition at line 341 of file G4ViewParameters.cc.

References hlhsr, hlr, and wireframe.

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 "
376  << fGlobalLineWidthScale;
377 
378  oss << "\n/vis/viewer/set/globalMarkerScale "
379  << fGlobalMarkerScale;
380 
381  oss << std::endl;
382 
383  return oss.str();
384 }
G4Vector3D & G4ViewParameters::GetActualLightpointDirection ( )

Definition at line 97 of file G4ViewParameters.cc.

References SetViewAndLights().

Referenced by G4VisCommandsViewerSet::SetNewValue(), and G4RayTracerViewer::SetView().

97  {
98  SetViewAndLights (fViewpointDirection);
99  return fActualLightpointDirection;
100 }
void SetViewAndLights(const G4Vector3D &viewpointDirection)
const G4Colour& G4ViewParameters::GetBackgroundColour ( ) const
G4double G4ViewParameters::GetCameraDistance ( G4double  radius) const

Definition at line 110 of file G4ViewParameters.cc.

Referenced by operator<<(), and G4RayTracerViewer::SetView().

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
const G4Point3D& G4ViewParameters::GetCurrentTargetPoint ( ) const
CutawayMode G4ViewParameters::GetCutawayMode ( ) const
const G4Planes& G4ViewParameters::GetCutawayPlanes ( ) const
const G4VMarker& G4ViewParameters::GetDefaultMarker ( ) const
const G4VisAttributes* G4ViewParameters::GetDefaultTextVisAttributes ( ) const
const G4VisAttributes* G4ViewParameters::GetDefaultVisAttributes ( ) const
G4double G4ViewParameters::GetDolly ( ) const
DrawingStyle G4ViewParameters::GetDrawingStyle ( ) const
const G4Point3D& G4ViewParameters::GetExplodeCentre ( ) const
G4double G4ViewParameters::GetExplodeFactor ( ) const
G4double G4ViewParameters::GetFarDistance ( G4double  cameraDistance,
G4double  nearDistance,
G4double  radius 
) const

Definition at line 129 of file G4ViewParameters.cc.

Referenced by operator<<().

131  {
132  G4double farDistance = cameraDistance + radius;
133  if (farDistance < nearDistance) farDistance = nearDistance;
134  return farDistance;
135 }
double G4double
Definition: G4Types.hh:76
G4double G4ViewParameters::GetFieldHalfAngle ( ) const
G4double G4ViewParameters::GetFrontHalfHeight ( G4double  nearDistance,
G4double  radius 
) const

Definition at line 137 of file G4ViewParameters.cc.

Referenced by operator<<(), and G4RayTracerViewer::SetView().

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
G4double G4ViewParameters::GetGlobalLineWidthScale ( ) const
G4double G4ViewParameters::GetGlobalMarkerScale ( ) const
const G4Vector3D& G4ViewParameters::GetLightpointDirection ( ) const
G4bool G4ViewParameters::GetLightsMoveWithCamera ( ) const
G4double G4ViewParameters::GetNearDistance ( G4double  cameraDistance,
G4double  radius 
) const

Definition at line 121 of file G4ViewParameters.cc.

Referenced by operator<<(), and G4RayTracerViewer::SetView().

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
G4int G4ViewParameters::GetNoOfSides ( ) const
RotationStyle G4ViewParameters::GetRotationStyle ( ) const
const G4Vector3D& G4ViewParameters::GetScaleFactor ( ) const
const G4Plane3D& G4ViewParameters::GetSectionPlane ( ) const
const G4Vector3D& G4ViewParameters::GetUpVector ( ) const
const G4Vector3D& G4ViewParameters::GetViewpointDirection ( ) const
const std::vector<G4ModelingParameters::VisAttributesModifier>& G4ViewParameters::GetVisAttributesModifiers ( ) const
G4double G4ViewParameters::GetVisibleDensity ( ) const
G4int G4ViewParameters::GetWindowAbsoluteLocationHintX ( G4int  sizeX) const

Definition at line 967 of file G4ViewParameters.cc.

967  {
968  if ( fWindowLocationHintXNegative ) {
969  return sizeX + fWindowLocationHintX - fWindowSizeHintX;
970  }
971  return fWindowLocationHintX;
972 }
G4int G4ViewParameters::GetWindowAbsoluteLocationHintY ( G4int  sizeY) const

Definition at line 974 of file G4ViewParameters.cc.

974  {
975  if ( fWindowLocationHintYNegative ) {
976  return sizeY + fWindowLocationHintY - fWindowSizeHintY;
977  }
978  return fWindowLocationHintY;
979 }
G4int G4ViewParameters::GetWindowLocationHintX ( ) const
G4int G4ViewParameters::GetWindowLocationHintY ( ) const
unsigned int G4ViewParameters::GetWindowSizeHintX ( ) const
unsigned int G4ViewParameters::GetWindowSizeHintY ( ) const
const G4String& G4ViewParameters::GetXGeometryString ( ) const
G4double G4ViewParameters::GetZoomFactor ( ) const
void G4ViewParameters::IncrementDolly ( G4double  dollyIncrement)
void G4ViewParameters::IncrementPan ( G4double  right,
G4double  up 
)

Definition at line 241 of file G4ViewParameters.cc.

Referenced by G4VisCommandViewerPan::SetNewValue().

241  {
242  IncrementPan (right,up, 0);
243 }
void IncrementPan(G4double right, G4double up)
void G4ViewParameters::IncrementPan ( G4double  right,
G4double  up,
G4double  forward 
)

Definition at line 245 of file G4ViewParameters.cc.

References HepGeom::BasicVector3D< T >::cross().

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
G4bool G4ViewParameters::IsAutoRefresh ( ) const
G4bool G4ViewParameters::IsAuxEdgeVisible ( ) const
G4bool G4ViewParameters::IsCulling ( ) const
G4bool G4ViewParameters::IsCullingCovered ( ) const
G4bool G4ViewParameters::IsCullingInvisible ( ) const
G4bool G4ViewParameters::IsCutaway ( ) const
G4bool G4ViewParameters::IsDensityCulling ( ) const
G4bool G4ViewParameters::IsExplode ( ) const
G4bool G4ViewParameters::IsMarkerNotHidden ( ) const
G4bool G4ViewParameters::IsPicking ( ) const
G4bool G4ViewParameters::IsSection ( ) const
bool G4ViewParameters::IsWindowLocationHintX ( ) const
bool G4ViewParameters::IsWindowLocationHintY ( ) const
bool G4ViewParameters::IsWindowSizeHintX ( ) const
bool G4ViewParameters::IsWindowSizeHintY ( ) const
void G4ViewParameters::MultiplyScaleFactor ( const G4Vector3D scaleFactorMultiplier)

Definition at line 91 of file G4ViewParameters.cc.

References HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

Referenced by G4VisCommandViewerScale::SetNewValue().

91  {
92  fScaleFactor.setX(fScaleFactor.x() * scaleFactorMultiplier.x());
93  fScaleFactor.setY(fScaleFactor.y() * scaleFactorMultiplier.y());
94  fScaleFactor.setZ(fScaleFactor.z() * scaleFactorMultiplier.z());
95 }
void G4ViewParameters::MultiplyZoomFactor ( G4double  zoomFactorMultiplier)
G4bool G4ViewParameters::operator!= ( const G4ViewParameters v) const

Definition at line 815 of file G4ViewParameters.cc.

References IsCutaway(), and IsExplode().

815  {
816 
817  // Put performance-sensitive parameters first.
818  if (
819  // This first to optimise spin, etc.
820  (fViewpointDirection != v.fViewpointDirection) ||
821 
822  // No particular order from here on.
823  (fDrawingStyle != v.fDrawingStyle) ||
824  (fAuxEdgeVisible != v.fAuxEdgeVisible) ||
825  (fCulling != v.fCulling) ||
826  (fCullInvisible != v.fCullInvisible) ||
827  (fDensityCulling != v.fDensityCulling) ||
828  (fCullCovered != v.fCullCovered) ||
829  (fSection != v.fSection) ||
830  (IsCutaway() != v.IsCutaway()) ||
831  (IsExplode() != v.IsExplode()) ||
832  (fNoOfSides != v.fNoOfSides) ||
833  (fUpVector != v.fUpVector) ||
834  (fFieldHalfAngle != v.fFieldHalfAngle) ||
835  (fZoomFactor != v.fZoomFactor) ||
836  (fScaleFactor != v.fScaleFactor) ||
837  (fCurrentTargetPoint != v.fCurrentTargetPoint) ||
838  (fDolly != v.fDolly) ||
839  (fRelativeLightpointDirection != v.fRelativeLightpointDirection) ||
840  (fLightsMoveWithCamera != v.fLightsMoveWithCamera) ||
841  (fDefaultVisAttributes != v.fDefaultVisAttributes) ||
842  (fDefaultTextVisAttributes != v.fDefaultTextVisAttributes) ||
843  (fDefaultMarker != v.fDefaultMarker) ||
844  (fGlobalMarkerScale != v.fGlobalMarkerScale) ||
845  (fGlobalLineWidthScale != v.fGlobalLineWidthScale) ||
846  (fMarkerNotHidden != v.fMarkerNotHidden) ||
847  (fWindowSizeHintX != v.fWindowSizeHintX) ||
848  (fWindowSizeHintY != v.fWindowSizeHintY) ||
849  (fXGeometryString != v.fXGeometryString) ||
850  (fGeometryMask != v.fGeometryMask) ||
851  (fAutoRefresh != v.fAutoRefresh) ||
852  (fBackgroundColour != v.fBackgroundColour) ||
853  (fPicking != v.fPicking) ||
854  (fRotationStyle != v.fRotationStyle)
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
void G4ViewParameters::PrintDifferences ( const G4ViewParameters v) const

Definition at line 579 of file G4ViewParameters.cc.

References G4cout, G4endl, IsCutaway(), and IsExplode().

579  {
580 
581  // Put performance-sensitive parameters first.
582  if (
583  // This first to optimise spin, etc.
584  (fViewpointDirection != v.fViewpointDirection) ||
585 
586  // No particular order from here on.
587  (fDrawingStyle != v.fDrawingStyle) ||
588  (fAuxEdgeVisible != v.fAuxEdgeVisible) ||
589  (fCulling != v.fCulling) ||
590  (fCullInvisible != v.fCullInvisible) ||
591  (fDensityCulling != v.fDensityCulling) ||
592  (fVisibleDensity != v.fVisibleDensity) ||
593  (fCullCovered != v.fCullCovered) ||
594  (fSection != v.fSection) ||
595  (fNoOfSides != v.fNoOfSides) ||
596  (fUpVector != v.fUpVector) ||
597  (fFieldHalfAngle != v.fFieldHalfAngle) ||
598  (fZoomFactor != v.fZoomFactor) ||
599  (fScaleFactor != v.fScaleFactor) ||
600  (fCurrentTargetPoint != v.fCurrentTargetPoint) ||
601  (fDolly != v.fDolly) ||
602  (fRelativeLightpointDirection != v.fRelativeLightpointDirection) ||
603  (fLightsMoveWithCamera != v.fLightsMoveWithCamera) ||
604  (fDefaultVisAttributes != v.fDefaultVisAttributes) ||
605  (fDefaultTextVisAttributes != v.fDefaultTextVisAttributes) ||
606  (fDefaultMarker != v.fDefaultMarker) ||
607  (fGlobalMarkerScale != v.fGlobalMarkerScale) ||
608  (fGlobalLineWidthScale != v.fGlobalLineWidthScale) ||
609  (fMarkerNotHidden != v.fMarkerNotHidden) ||
610  (fWindowSizeHintX != v.fWindowSizeHintX) ||
611  (fWindowSizeHintY != v.fWindowSizeHintY) ||
612  (fXGeometryString != v.fXGeometryString) ||
613  (fGeometryMask != v.fGeometryMask) ||
614  (fAutoRefresh != v.fAutoRefresh) ||
615  (fBackgroundColour != v.fBackgroundColour) ||
616  (fPicking != v.fPicking) ||
617  (fRotationStyle != v.fRotationStyle)
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()) {
639  if (fExplodeFactor != v.fExplodeFactor)
640  G4cout << "Difference in explode factor." << G4endl;
641  if (fExplodeCentre != v.fExplodeCentre)
642  G4cout << "Difference in explode centre." << G4endl;
643  }
644 }
G4GLOB_DLL std::ostream G4cout
G4bool IsExplode() const
G4bool IsCutaway() const
#define G4endl
Definition: G4ios.hh:61
G4String G4ViewParameters::SceneModifyingCommands ( ) const

Definition at line 386 of file G4ViewParameters.cc.

References python.hepunit::cm3, cutawayUnion, g(), G4BestUnit, HepGeom::Plane3D< T >::normal(), and HepGeom::Plane3D< T >::point().

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
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
Point3D< T > point(const Point3D< T > &p) const
Definition: Plane3D.h:108
void G4ViewParameters::SetAutoRefresh ( G4bool  )
void G4ViewParameters::SetAuxEdgeVisible ( G4bool  )
void G4ViewParameters::SetBackgroundColour ( const G4Colour )
void G4ViewParameters::SetCulling ( G4bool  )
void G4ViewParameters::SetCullingCovered ( G4bool  )
void G4ViewParameters::SetCullingInvisible ( G4bool  )
void G4ViewParameters::SetCurrentTargetPoint ( const G4Point3D currentTargetPoint)
void G4ViewParameters::SetCutawayMode ( CutawayMode  )
void G4ViewParameters::SetDefaultColour ( const G4Colour )
void G4ViewParameters::SetDefaultMarker ( const G4VMarker defaultMarker)
void G4ViewParameters::SetDefaultTextColour ( const G4Colour )
void G4ViewParameters::SetDefaultTextVisAttributes ( const G4VisAttributes )
void G4ViewParameters::SetDefaultVisAttributes ( const G4VisAttributes )
void G4ViewParameters::SetDensityCulling ( G4bool  )
void G4ViewParameters::SetDolly ( G4double  dolly)
void G4ViewParameters::SetDrawingStyle ( G4ViewParameters::DrawingStyle  style)
void G4ViewParameters::SetExplodeCentre ( const G4Point3D explodeCentre)
void G4ViewParameters::SetExplodeFactor ( G4double  explodeFactor)
void G4ViewParameters::SetFieldHalfAngle ( G4double  fieldHalfAngle)
void G4ViewParameters::SetGlobalLineWidthScale ( G4double  globalLineWidthScale)
void G4ViewParameters::SetGlobalMarkerScale ( G4double  globalMarkerScale)
void G4ViewParameters::SetLightpointDirection ( const G4Vector3D lightpointDirection)

Definition at line 230 of file G4ViewParameters.cc.

Referenced by G4VisCommandsViewerSet::SetNewValue(), and G4VisCommandViewerCopyViewFrom::SetNewValue().

230  {
231  fRelativeLightpointDirection = lightpointDirection;
232  SetViewAndLights (fViewpointDirection);
233 }
void SetViewAndLights(const G4Vector3D &viewpointDirection)
void G4ViewParameters::SetLightsMoveWithCamera ( G4bool  moves)
void G4ViewParameters::SetMarkerHidden ( )
void G4ViewParameters::SetMarkerNotHidden ( )
G4int G4ViewParameters::SetNoOfSides ( G4int  nSides)

Definition at line 189 of file G4ViewParameters.cc.

References G4cout, and G4endl.

Referenced by G4VisCommandsViewerSet::SetNewValue().

189  {
190  const G4int nSidesMin = 12;
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
#define G4endl
Definition: G4ios.hh:61
void G4ViewParameters::SetOrthogonalProjection ( )
void G4ViewParameters::SetPan ( G4double  right,
G4double  up 
)

Definition at line 235 of file G4ViewParameters.cc.

References HepGeom::BasicVector3D< T >::cross().

Referenced by G4VisCommandViewerPan::SetNewValue().

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
void G4ViewParameters::SetPerspectiveProjection ( G4double  fieldHalfAngle = 30.*CLHEP::deg)
void G4ViewParameters::SetPicking ( G4bool  )
void G4ViewParameters::SetRotationStyle ( RotationStyle  )
void G4ViewParameters::SetScaleFactor ( const G4Vector3D scaleFactor)
void G4ViewParameters::SetSectionPlane ( const G4Plane3D sectionPlane)
void G4ViewParameters::SetUpVector ( const G4Vector3D upVector)
void G4ViewParameters::SetViewAndLights ( const G4Vector3D viewpointDirection)

Definition at line 202 of file G4ViewParameters.cc.

References HepGeom::BasicVector3D< T >::cross(), G4cout, G4endl, HepGeom::BasicVector3D< T >::unit(), HepGeom::BasicVector3D< T >::x(), and HepGeom::BasicVector3D< T >::y().

Referenced by GetActualLightpointDirection(), and G4VisCommandsViewerSet::SetNewValue().

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);
220  fActualLightpointDirection =
221  fRelativeLightpointDirection.x () * xprime +
222  fRelativeLightpointDirection.y () * yprime +
223  fRelativeLightpointDirection.x () * zprime;
224  } else {
225  fActualLightpointDirection = fRelativeLightpointDirection;
226  }
227 }
BasicVector3D< T > unit() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
void G4ViewParameters::SetViewpointDirection ( const G4Vector3D viewpointDirection)
void G4ViewParameters::SetVisibleDensity ( G4double  visibleDensity)

Definition at line 172 of file G4ViewParameters.cc.

References python.hepunit::cm3, g(), G4BestUnit, G4cout, and G4endl.

Referenced by G4VisCommandsViewerSet::SetNewValue().

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:5205
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void G4ViewParameters::SetWindowLocationHint ( G4int  xHint,
G4int  yHint 
)
void G4ViewParameters::SetWindowSizeHint ( G4int  xHint,
G4int  yHint 
)
void G4ViewParameters::SetXGeometryString ( const G4String geomStringArg)

Definition at line 884 of file G4ViewParameters.cc.

References G4cout, G4endl, and test::x.

Referenced by G4VisManager::CreateViewer().

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
912  y = fWindowLocationHintY;
913  }
914  if ((fGeometryMask & fXValue) == 0)
915  { // Using default
916  x = fWindowLocationHintX;
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
939  x = fWindowLocationHintX;
940  y = fWindowLocationHintY;
941  }
942  // Set the string
943  fXGeometryString = geomString;
944 
945  // Set values
946  fWindowSizeHintX = w;
947  fWindowSizeHintY = h;
948  fWindowLocationHintX = x;
949  fWindowLocationHintY = y;
950 
951  if ( ((fGeometryMask & fXValue)) &&
952  ((fGeometryMask & fYValue))) {
953 
954  if ( (fGeometryMask & fXNegative) ) {
955  fWindowLocationHintXNegative = true;
956  } else {
957  fWindowLocationHintXNegative = false;
958  }
959  if ( (fGeometryMask & fYNegative) ) {
960  fWindowLocationHintYNegative = true;
961  } else {
962  fWindowLocationHintYNegative = false;
963  }
964  }
965 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4ViewParameters::SetZoomFactor ( G4double  zoomFactor)
G4String G4ViewParameters::TouchableCommands ( ) const

Definition at line 463 of file G4ViewParameters.cc.

References test::c, G4VisAttributes::dashed, G4VisAttributes::dotted, G4Colour::GetAlpha(), G4Colour::GetBlue(), G4VisAttributes::GetColour(), G4VisAttributes::GetForcedDrawingStyle(), G4VisAttributes::GetForcedLineSegmentsPerCircle(), G4Colour::GetGreen(), G4VisAttributes::GetLineStyle(), G4VisAttributes::GetLineWidth(), G4Colour::GetRed(), G4VisAttributes::IsDaughtersInvisible(), G4VisAttributes::IsForceAuxEdgeVisible(), G4VisAttributes::IsForceDrawingStyle(), G4VisAttributes::IsVisible(), G4VisAttributes::solid, G4VisAttributes::unbroken, G4ModelingParameters::VASColour, G4ModelingParameters::VASDaughtersInvisible, G4ModelingParameters::VASForceAuxEdgeVisible, G4ModelingParameters::VASForceLineSegmentsPerCircle, G4ModelingParameters::VASForceSolid, G4ModelingParameters::VASForceWireframe, G4ModelingParameters::VASLineStyle, G4ModelingParameters::VASLineWidth, G4ModelingParameters::VASVisibility, and G4VisAttributes::wireframe.

464 {
465  std::ostringstream oss;
466 
467  oss << "#\n# Touchable commands";
468 
469  const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
470  fVisAttributesModifiers;
471 
472  if (vams.empty()) {
473  oss << "\n# None";
474  oss << std::endl;
475  return oss.str();
476  }
477 
478  std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
479  iModifier;
480  for (iModifier = vams.begin();
481  iModifier != vams.end();
482  ++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 }
G4bool IsForceAuxEdgeVisible() const
G4double GetAlpha() const
Definition: G4Colour.hh:142
G4double GetLineWidth() const
G4bool IsVisible() const
const G4Colour & GetColour() const
G4double GetBlue() const
Definition: G4Colour.hh:141
LineStyle GetLineStyle() const
G4double GetRed() const
Definition: G4Colour.hh:139
G4bool IsDaughtersInvisible() const
G4double GetGreen() const
Definition: G4Colour.hh:140
G4int GetForcedLineSegmentsPerCircle() const
std::vector< PVNameCopyNo > PVNameCopyNoPath
G4bool IsForceDrawingStyle() const
ForcedDrawingStyle GetForcedDrawingStyle() const
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
void G4ViewParameters::UnsetExplodeFactor ( )
void G4ViewParameters::UnsetSectionPlane ( )

Friends And Related Function Documentation

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 }
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: "
741  << v.fRelativeLightpointDirection;
742 
743  os << "\n Actual lightpoint direction: "
744  << v.fActualLightpointDirection;
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 =
805  v.fVisAttributesModifiers;
806  if (vams.empty()) {
807  os << "None";
808  } else {
809  os << vams;
810  }
811 
812  return os;
813 }
G4double GetFarDistance(G4double cameraDistance, G4double nearDistance, G4double radius) const
G4double GetCameraDistance(G4double radius) const
G4double GetNearDistance(G4double cameraDistance, G4double radius) const
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
G4double GetFrontHalfHeight(G4double nearDistance, G4double radius) const
G4bool IsCutaway() const
double G4double
Definition: G4Types.hh:76

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