Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
G4ViewParameters.cc File Reference
#include <sstream>
#include "G4ViewParameters.hh"
#include "G4VisManager.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 646 of file G4ViewParameters.cc.

References G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, and G4ViewParameters::wireframe.

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 
)

Definition at line 662 of file G4ViewParameters.cc.

References python.hepunit::cm3, G4ViewParameters::constrainUpDirection, G4ViewParameters::freeRotation, g(), G4ViewParameters::GetCameraDistance(), G4ViewParameters::GetFarDistance(), G4ViewParameters::GetFrontHalfHeight(), G4ViewParameters::GetNearDistance(), G4ViewParameters::hlhsr, G4ViewParameters::hlr, G4ViewParameters::hsr, G4ViewParameters::IsCutaway(), right, test::v, and G4ViewParameters::wireframe.

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