Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ViewParameters.cc File Reference
#include <sstream>
#include "G4ViewParameters.hh"
#include "G4VisManager.hh"
#include "G4VPhysicalVolume.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
Include dependency graph for G4ViewParameters.cc:

Go to the source code of this file.

Macros

#define INTERPOLATE(param)
 
#define INTERPOLATEUNITVECTOR(vector)
 
#define INTERPOLATEVECTOR(vector)
 
#define INTERPOLATEPOINT(point)
 
#define INTERPOLATECOLOUR(colour)
 
#define CONTINUITY(quantity)
 
#define INTERPOLATEPLANE(plane)
 

Functions

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

Macro Definition Documentation

#define CONTINUITY (   quantity)
Value:
continuous = false; \
/* This follows the logic of the INTERPOLATE macro above; see comments therein */ \
if (i == 0) { \
if (v[1].quantity == v[0].quantity) { \
if (n == 1) continuous = true; \
else if (v[2].quantity == v[0].quantity) \
continuous = true; \
} \
} else if (i >= n - 1) { \
if (v[i+1].quantity == v[i].quantity) { \
if (n == 1) continuous = true; \
else if (v[i+1].quantity == v[i-1].quantity) \
continuous = true; \
} \
} else { \
if (v[i-1].quantity == v[i].quantity && \
v[i+1].quantity == v[i].quantity && \
v[i+2].quantity == v[i].quantity) \
continuous = true; \
}
if(nIso!=0)
const G4int n
tuple v
Definition: test.py:18
#define INTERPOLATE (   param)
Value:
/* This works out the interpolated param in i'th interval */ \
/* Assumes n >= 1 */ \
if (i == 0) { \
/* First interval */ \
mi = v[1].param - v[0].param; \
/* If there is only one interval, make start and end slopes equal */ \
/* (This results in a linear interpolation) */ \
if (n == 1) mi1 = mi; \
/* else the end slope of the interval takes account of the next waypoint along */ \
else mi1 = 0.5 * (v[2].param - v[0].param); \
} else if (i >= n - 1) { \
/* Similarly for last interval */ \
mi1 = v[i+1].param - v[i].param; \
/* If there is only one interval, make start and end slopes equal */ \
if (n == 1) mi = mi1; \
/* else the start slope of the interval takes account of the previous waypoint */ \
else mi = 0.5 * (v[i+1].param - v[i-1].param); \
} else { \
/* Full Catmull-Rom slopes use previous AND next waypoints */ \
mi = 0.5 * (v[i+1].param - v[i-1].param); \
mi1 = 0.5 * (v[i+2].param - v[i ].param); \
} \
real = h00 * v[i].param + h10 * mi + h01 * v[i+1].param + h11 * mi1;
if(nIso!=0)
const G4int n
tuple v
Definition: test.py:18
#define INTERPOLATECOLOUR (   colour)
Value:
INTERPOLATE(colour.GetRed()); red = real; \
INTERPOLATE(colour.GetGreen()); green = real; \
INTERPOLATE(colour.GetBlue()); blue = real; \
INTERPOLATE(colour.GetAlpha()); alpha = real;
Definition: test07.cc:36
Definition: test07.cc:36
#define INTERPOLATE(param)
static const G4double alpha
#define INTERPOLATEPLANE (   plane)
Value:
INTERPOLATE(plane.a()); a = real; \
INTERPOLATE(plane.b()); b = real; \
INTERPOLATE(plane.c()); c = real; \
INTERPOLATE(plane.d()); d = real;
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
tuple b
Definition: test.py:12
#define INTERPOLATE(param)
tuple c
Definition: test.py:13
#define INTERPOLATEPOINT (   point)
Value:
INTERPOLATE(point.x()); x = real; \
INTERPOLATE(point.y()); y = real; \
INTERPOLATE(point.z()); z = real;
tuple x
Definition: test.py:50
#define INTERPOLATE(param)
tuple z
Definition: test.py:28
#define INTERPOLATEUNITVECTOR (   vector)
Value:
INTERPOLATE(vector.x()); x = real; \
INTERPOLATE(vector.y()); y = real; \
INTERPOLATE(vector.z()); z = real;
tuple x
Definition: test.py:50
#define INTERPOLATE(param)
tuple z
Definition: test.py:28
#define INTERPOLATEVECTOR (   vector)
Value:
INTERPOLATE(vector.x()); x = real; \
INTERPOLATE(vector.y()); y = real; \
INTERPOLATE(vector.z()); z = real;
tuple x
Definition: test.py:50
#define INTERPOLATE(param)
tuple z
Definition: test.py:28

Function Documentation

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

Definition at line 681 of file G4ViewParameters.cc.

682  {
683  switch (style) {
685  os << "wireframe"; break;
687  os << "hlr - hidden lines removed"; break;
689  os << "hsr - hidden surfaces removed"; break;
691  os << "hlhsr - hidden line, hidden surface removed"; break;
692  default: os << "unrecognised"; break;
693  }
694  return os;
695 }
std::ostream& operator<< ( std::ostream &  os,
const G4ViewParameters v 
)

Definition at line 697 of file G4ViewParameters.cc.

697  {
698  os << "View parameters and options:";
699 
700  os << "\n Drawing style: ";
701  switch (v.fDrawingStyle) {
703  os << "edges, wireframe"; break;
705  os << "edges, hidden line removal"; break;
707  os << "surfaces, hidden surface removal"; break;
709  os << "surfaces and edges, hidden line and surface removal"; break;
710  default: os << "unrecognised"; break;
711  }
712 
713  os << "\n Auxiliary edges: ";
714  if (!v.fAuxEdgeVisible) os << "in";
715  os << "visible";
716 
717  os << "\n Culling: ";
718  if (v.fCulling) os << "on";
719  else os << "off";
720 
721  os << "\n Culling invisible objects: ";
722  if (v.fCullInvisible) os << "on";
723  else os << "off";
724 
725  os << "\n Density culling: ";
726  if (v.fDensityCulling) {
727  os << "on - invisible if density less than "
728  << v.fVisibleDensity / (1. * g / cm3) << " g cm^-3";
729  }
730  else os << "off";
731 
732  os << "\n Culling daughters covered by opaque mothers: ";
733  if (v.fCullCovered) os << "on";
734  else os << "off";
735 
736  os << "\n Section flag: ";
737  if (v.fSection) os << "true, section/cut plane: " << v.fSectionPlane;
738  else os << "false";
739 
740  if (v.IsCutaway()) {
741  os << "\n Cutaway planes: ";
742  for (size_t i = 0; i < v.fCutawayPlanes.size (); i++) {
743  os << ' ' << v.fCutawayPlanes[i];
744  }
745  }
746  else {
747  os << "\n No cutaway planes";
748  }
749 
750  os << "\n Explode factor: " << v.fExplodeFactor
751  << " about centre: " << v.fExplodeCentre;
752 
753  os << "\n No. of sides used in circle polygon approximation: "
754  << v.fNoOfSides;
755 
756  os << "\n Viewpoint direction: " << v.fViewpointDirection;
757 
758  os << "\n Up vector: " << v.fUpVector;
759 
760  os << "\n Field half angle: " << v.fFieldHalfAngle;
761 
762  os << "\n Zoom factor: " << v.fZoomFactor;
763 
764  os << "\n Scale factor: " << v.fScaleFactor;
765 
766  os << "\n Current target point: " << v.fCurrentTargetPoint;
767 
768  os << "\n Dolly distance: " << v.fDolly;
769 
770  os << "\n Light ";
771  if (v.fLightsMoveWithCamera) os << "moves";
772  else os << "does not move";
773  os << " with camera";
774 
775  os << "\n Relative lightpoint direction: "
776  << v.fRelativeLightpointDirection;
777 
778  os << "\n Actual lightpoint direction: "
779  << v.fActualLightpointDirection;
780 
781  os << "\n Derived parameters for standard view of object of unit radius:";
782  G4ViewParameters tempVP = v;
783  tempVP.fDolly = 0.;
784  tempVP.fZoomFactor = 1.;
785  const G4double radius = 1.;
786  const G4double cameraDistance = tempVP.GetCameraDistance (radius);
787  const G4double nearDistance =
788  tempVP.GetNearDistance (cameraDistance, radius);
789  const G4double farDistance =
790  tempVP.GetFarDistance (cameraDistance, nearDistance, radius);
791  const G4double right = tempVP.GetFrontHalfHeight (nearDistance, radius);
792  os << "\n Camera distance: " << cameraDistance;
793  os << "\n Near distance: " << nearDistance;
794  os << "\n Far distance: " << farDistance;
795  os << "\n Front half height: " << right;
796 
797  os << "\n Default VisAttributes:\n " << v.fDefaultVisAttributes;
798 
799  os << "\n Default TextVisAttributes:\n " << v.fDefaultTextVisAttributes;
800 
801  os << "\n Default marker: " << v.fDefaultMarker;
802 
803  os << "\n Global marker scale: " << v.fGlobalMarkerScale;
804 
805  os << "\n Global lineWidth scale: " << v.fGlobalLineWidthScale;
806 
807  os << "\n Marker ";
808  if (v.fMarkerNotHidden) os << "not ";
809  os << "hidden by surfaces.";
810 
811  os << "\n Window size hint: "
812  << v.fWindowSizeHintX << 'x'<< v.fWindowSizeHintX;
813 
814  os << "\n X geometry string: " << v.fXGeometryString;
815  os << "\n X geometry mask: "
816  << std::showbase << std::hex << v.fGeometryMask
817  << std::noshowbase << std::dec;
818 
819  os << "\n Auto refresh: ";
820  if (v.fAutoRefresh) os << "true";
821  else os << "false";
822 
823  os << "\n Background colour: " << v.fBackgroundColour;
824 
825  os << "\n Picking requested: ";
826  if (v.fPicking) os << "true";
827  else os << "false";
828 
829  os << "\n Rotation style: ";
830  switch (v.fRotationStyle) {
832  os << "constrainUpDirection (conventional HEP view)"; break;
834  os << "freeRotation (Google-like rotation, using mouse-grab)"; break;
835  default: os << "unrecognised"; break;
836  }
837 
838  os << "\n Vis attributes modifiers: ";
839  const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
840  v.fVisAttributesModifiers;
841  if (vams.empty()) {
842  os << "None";
843  } else {
844  os << vams;
845  }
846 
847  return os;
848 }
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
static constexpr double cm3
Definition: G4SIunits.hh:121
tuple v
Definition: test.py:18
G4bool IsCutaway() const
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function: