501 if (!currentViewer) {
504 "ERROR: G4VisCommandsViewerSet::SetNewValue: no current viewer." 517 "ERROR: G4VisCommandsViewerSet::SetNewValue: all:" 518 "\n unrecognised from-viewer." 523 if (fromViewer == currentViewer) {
526 "WARNING: G4VisCommandsViewerSet::SetNewValue: all:" 527 "\n from-viewer and current viewer are identical." 533 G4bool currentAutoRefresh =
538 const std::vector<G4ModelingParameters::VisAttributesModifier>*
541 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator i;
542 for (i = privateVAMs->begin(); i != privateVAMs->end(); ++i) {
547 G4cout <<
"View parameters of viewer \"" << currentViewer->
GetName()
548 <<
"\"\n set to those of viewer \"" << fromViewer->
GetName()
562 << currentViewer->
GetName() <<
" is NOT auto-refesh by default" 563 <<
"\n so cannot be set to auto-refresh." 572 G4cout <<
"be automatically refreshed after a change of view parameters." 584 G4cout <<
"Auxiliary edges will ";
593 std::istringstream iss(newValue);
594 iss >> redOrString >> green >> blue >> opacity;
596 const size_t iPos0 = 0;
597 if (std::isalpha(redOrString[iPos0])) {
600 G4cout <<
"WARNING: Text colour \"" << redOrString
601 <<
"\" not found. Defaulting to black and opaque." 609 colour =
G4Colour(colour.GetRed(), colour.GetGreen(), colour.GetBlue(), opacity);
612 G4cout <<
"Background colour " 620 G4String cullingOption, stringFlag, unit;
622 std::istringstream is (newValue);
623 is >> cullingOption >> stringFlag >> density >> unit;
625 if (cullingOption ==
"global") {
629 "G4VisCommandsViewerSet::SetNewValue: culling: global culling flag" 631 ".\n Does not change specific culling flags." 635 else if (cullingOption ==
"coveredDaughters") {
639 "G4VisCommandsViewerSet::SetNewValue: culling: culling covered" 640 "\n daughters flag set to " 642 ". Daughters covered by opaque mothers" 643 "\n will be culled, i.e., not drawn, if this flag is true." 644 "\n Note: this is only effective in surface drawing style," 645 "\n and then only if the volumes are visible and opaque, and then" 646 "\n only if no sections or cutaways are in operation." 650 else if (cullingOption ==
"invisible") {
654 "G4VisCommandsViewerSet::SetNewValue: culling: culling invisible" 657 ". Volumes marked invisible will be culled," 658 "\n i.e., not drawn, if this flag is true." 662 else if (cullingOption ==
"density") {
673 "G4VisCommandsViewerSet::SetNewValue: culling: culling by density" 675 ". Volumes with density less than " <<
677 "\n will be culled, i.e., not drawn, if this flag is true." 684 "ERROR: G4VisCommandsViewerSet::SetNewValue: culling:" 685 "\n option not recognised." 692 if (newValue ==
"add" || newValue ==
"union")
694 if (newValue ==
"multiply" || newValue ==
"intersection")
698 G4cout <<
"Cutaway mode set to ";
702 G4cout <<
"cutawayIntersection";
710 std::istringstream iss(newValue);
711 iss >> redOrString >> green >> blue >> opacity;
713 const size_t iPos0 = 0;
714 if (std::isalpha(redOrString[iPos0])) {
717 G4cout <<
"WARNING: Text colour \"" << redOrString
718 <<
"\" not found. Defaulting to white and opaque." 726 colour =
G4Colour(colour.GetRed(), colour.GetGreen(), colour.GetBlue(), opacity);
731 G4cout <<
"Default colour " 741 std::istringstream iss(newValue);
742 iss >> redOrString >> green >> blue >> opacity;
744 const size_t iPos0 = 0;
745 if (std::isalpha(redOrString[iPos0])) {
748 G4cout <<
"WARNING: Text colour \"" << redOrString
749 <<
"\" not found. Defaulting to white and opaque." 757 colour =
G4Colour(colour.GetRed(), colour.GetGreen(), colour.GetBlue(), opacity);
762 G4cout <<
"Default colour " 772 switch (existingStyle) {
785 switch (existingStyle) {
798 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
807 std::istringstream is (newValue);
808 is >> explodeFactor >> x >> y >> z >> unitString;
824 G4cout <<
"Global Line Width Scale changed to " 834 G4cout <<
"Global Marker Scale changed to " 842 switch (existingStyle) {
856 switch (existingStyle) {
870 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
881 G4cout <<
"Markers will ";
888 if (newValue.find(
"cam") != G4String::npos)
890 else if(newValue.find(
"obj") != G4String::npos)
894 G4cerr <<
"ERROR: \"" << newValue <<
"\" not recognised." 895 " Looking for \"cam\" or \"obj\" in string." <<
G4endl;
899 G4cout <<
"Lights move with ";
901 G4cout <<
"camera (object appears to rotate).";
902 else G4cout <<
"object (the viewer appears to be moving).";
910 G4double x = std::sin (theta) * std::cos (phi);
911 G4double y = std::sin (theta) * std::sin (phi);
916 G4cout <<
"Lights direction set to " 925 G4cout <<
"Lights direction set to " 935 "Number of line segements per circle in polygon approximation is " 945 else G4cout <<
"inhibited.";
949 G4cout <<
"You may need to issue \"/vis/viewer/update\"." 956 const size_t iPos0 = 0;
957 if (newValue[iPos0] ==
'o') {
960 else if (newValue[iPos0] ==
'p') {
963 std::istringstream is (newValue);
964 is >> dummy >> fieldHalfAngle >> unit;
966 if (fieldHalfAngle > 89.5 *
deg || fieldHalfAngle <= 0.0) {
969 "ERROR: Field half angle should be 0 < angle <= 89.5 degrees.";
977 G4cerr <<
"ERROR: \"" << newValue <<
"\" not recognised." 978 " Looking for 'o' or 'p' first character." <<
G4endl;
984 G4cout <<
"Projection style of viewer \"" << currentViewer->
GetName()
986 if (fieldHalfAngle == 0.) {
990 G4cout <<
"perspective\n with half angle " << fieldHalfAngle /
deg 1000 std::istringstream is (newValue);
1001 is >> choice >> x >> y >> z >> unit >> nx >> ny >> nz;
1003 G4int iSelector = -1;
1008 if (iSelector < 0) {
1010 G4cout <<
"Choice not recognised (on/true or off/false)." <<
G4endl;
1011 G4cout <<
"Section drawing is currently: ";
1014 G4cout <<
".\nSection plane is currently: " 1023 switch (iSelector) {
1029 x *= F; y *= F; z *= F;
1036 G4cout <<
"Section drawing is now: ";
1039 G4cout <<
".\nSection plane is now: " 1047 if (newValue ==
"constrainUpDirection")
1049 else if (newValue ==
"freeRotation")
1053 G4cerr <<
"ERROR: \"" << newValue <<
"\" not recognised." <<
G4endl;
1059 G4cout <<
"Rotation style of viewer \"" << currentViewer->
GetName()
1067 const size_t iPos0 = 0;
1068 if (newValue[iPos0] ==
'w') {
1069 switch (existingStyle) {
1082 else if (newValue[iPos0] ==
's') {
1083 switch (existingStyle) {
1098 G4cerr <<
"ERROR: \"" << newValue <<
"\" not recognised." 1099 " Looking for 'w' or 's' first character." <<
G4endl;
1104 G4cout <<
"Drawing style of viewer \"" << currentViewer->
GetName()
1117 G4cout <<
"Target point set to " 1120 <<
"\n\"Current Target Point\" set to " 1123 <<
"\n\"Standard Target Point\" is " 1125 (standardTargetPoint)
1133 G4double x = std::sin (theta) * std::cos (phi);
1134 G4double y = std::sin (theta) * std::sin (phi);
1154 G4double x = std::sin (theta) * std::cos (phi);
1155 G4double y = std::sin (theta) * std::sin (phi);
1160 G4cout <<
"Viewpoint direction set to " 1163 G4cout <<
"Lightpoint direction set to " 1171 if (viewpointVector.
mag2() <= 0.) {
1173 G4cerr <<
"ERROR: Null viewpoint vector. No action taken." <<
G4endl;
1179 G4cout <<
"Viewpoint direction set to " 1182 G4cout <<
"Lightpoint direction set to " 1192 "ERROR: G4VisCommandsViewerSet::SetNewValue: unrecognised command." RotationStyle GetRotationStyle() const
DrawingStyle GetDrawingStyle() const
void SetMarkerNotHidden()
void SetColour(const G4Colour &)
const G4VisAttributes * GetDefaultTextVisAttributes() const
const G4ViewParameters & GetDefaultViewParameters() const
G4VViewer * GetCurrentViewer() const
G4Vector3D & GetActualLightpointDirection()
void SetLightpointDirection(const G4Vector3D &lightpointDirection)
CLHEP::Hep3Vector G4ThreeVector
void SetAuxEdgeVisible(G4bool)
G4int SetNoOfSides(G4int nSides)
G4UIcmdWithABool * fpCommandAuxEdge
G4double GetGlobalLineWidthScale() const
void SetRotationStyle(RotationStyle)
G4ThreeVector fLightsVector
G4UIcmdWithAnInteger * fpCommandLineSegments
G4UIcommand * fpCommandViewpointThetaPhi
G4Scene * GetScene() const
G4UIcommand * fpCommandViewpointVector
const G4Plane3D & GetSectionPlane() const
G4UIcommand * fpCommandSectionPlane
void SetUpVector(const G4Vector3D &upVector)
G4double GetExplodeFactor() const
static G4ThreeVector GetNew3VectorValue(const char *paramString)
static G4bool GetColour(const G4String &key, G4Colour &result)
G4UIcmdWith3VectorAndUnit * fpCommandTargetPoint
static G4String ConvertToString(G4bool boolVal)
G4int compareTo(const char *, caseCompare mode=exact) const
G4UIcmdWithABool * fpCommandPicking
void SetViewParameters(const G4ViewParameters &vp)
void SetViewParameters(G4VViewer *, const G4ViewParameters &)
HepGeom::Point3D< G4double > G4Point3D
G4UIcmdWithABool * fpCommandEdge
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SetDensityCulling(G4bool)
G4VSceneHandler * GetSceneHandler() const
void SetVisibleDensity(G4double visibleDensity)
static G4ThreeVector ConvertTo3Vector(const char *st)
void SetDefaultTextVisAttributes(const G4VisAttributes &)
void SetBackgroundColour(const G4Colour &)
G4ThreeVector fViewpointVector
void SetCutawayMode(CutawayMode)
void SetLightsMoveWithCamera(G4bool moves)
const G4Vector3D & GetUpVector() const
G4UIcmdWithAString * fpCommandStyle
void SetViewAndLights(const G4Vector3D &viewpointDirection)
G4UIcmdWithAString * fpCommandAll
const G4Vector3D & GetViewpointDirection() const
G4UIcommand * fpCommandUpThetaPhi
static G4double GetValueOf(const G4String &)
void SetExplodeFactor(G4double explodeFactor)
G4GLOB_DLL std::ostream G4cout
void SetGlobalMarkerScale(G4double globalMarkerScale)
static G4bool ConvertToBool(const char *st)
const G4Point3D & GetStandardTargetPoint() const
static G4double GetNewDoubleValue(const char *paramString)
void SetCurrentTargetPoint(const G4Point3D ¤tTargetPoint)
G4bool IsAuxEdgeVisible() const
G4UIcommand * fpCommandBackground
G4UIcommand * fpCommandLightsThetaPhi
void SetDefaultVisAttributes(const G4VisAttributes &)
void SetFieldHalfAngle(G4double fieldHalfAngle)
G4bool IsMarkerNotHidden() const
void SetExplodeCentre(const G4Point3D &explodeCentre)
G4bool IsAutoRefresh() const
const G4Point3D & GetCurrentTargetPoint() const
const G4Vector3D & GetLightpointDirection() const
static G4int ConvertToInt(const char *st)
G4UIcmdWithAString * fpCommandLightsMove
void SetCullingInvisible(G4bool)
G4UIcommand * fpCommandLightsVector
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers() const
G4UIcommand * fpCommandCulling
void SetAutoRefresh(G4bool)
void AddVisAttributesModifier(const G4ModelingParameters::VisAttributesModifier &)
G4double GetGlobalMarkerScale() const
G4VViewer * GetViewer(const G4String &viewerName) const
void SetDrawingStyle(G4ViewParameters::DrawingStyle style)
G4UIcommand * fpCommandDefaultTextColour
G4UIcmdWithABool * fpCommandAutoRefresh
const G4Point3D & GetExplodeCentre() const
G4UIcmdWithAString * fpCommandRotationStyle
G4UIcommand * fpCommandDefaultColour
static G4double ValueOf(const char *unitName)
static Verbosity GetVerbosity()
const G4ViewParameters & GetViewParameters() const
const G4VisAttributes * GetDefaultVisAttributes() const
void SetGlobalLineWidthScale(G4double globalLineWidthScale)
G4UIcmdWithADouble * fpCommandGlobalLineWidthScale
const G4String & GetName() const
HepGeom::Plane3D< G4double > G4Plane3D
const G4Colour & GetBackgroundColour() const
G4UIcmdWithABool * fpCommandHiddenEdge
G4UIcommand * fpCommandProjection
G4UIcmdWithAString * fpCommandCutawayMode
void SetSectionPlane(const G4Plane3D §ionPlane)
G4UIcommand * fpCommandUpVector
static void ConvertToDoublePair(const G4String ¶mString, G4double &xval, G4double &yval)
CutawayMode GetCutawayMode() const
G4UIcmdWithADouble * fpCommandGlobalMarkerScale
void SetCullingCovered(G4bool)
G4UIcmdWithABool * fpCommandHiddenMarker
G4double GetVisibleDensity() const
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
G4String ConvertToStringWithBestUnit(G4ThreeVector vec)
G4bool GetLightsMoveWithCamera() const
G4GLOB_DLL std::ostream G4cerr
HepGeom::Normal3D< G4double > G4Normal3D
const G4Colour & GetColour() const
static G4VisManager * fpVisManager
G4UIcommand * fpCommandExplodeFactor