43 fDrawingStyle (wireframe),
44 fAuxEdgeVisible (false),
46 fCullInvisible (true),
47 fDensityCulling (false),
48 fVisibleDensity (0.01 *
g /
cm3),
52 fCutawayMode (cutawayUnion),
61 fCurrentTargetPoint (),
63 fLightsMoveWithCamera (false),
64 fRelativeLightpointDirection (
G4Vector3D (1., 1., 1.)),
65 fActualLightpointDirection (
G4Vector3D (1., 1., 1.)),
66 fDefaultVisAttributes (),
67 fDefaultTextVisAttributes (
G4Colour (0., 0., 1.)),
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),
80 fBackgroundColour (
G4Colour(0.,0.,0.)),
82 fRotationStyle (constrainUpDirection)
118 return cameraDistance;
125 if (nearDistance < small) nearDistance = small;
133 if (farDistance < nearDistance) farDistance = nearDistance;
146 return frontHalfHeight;
156 "ERROR: G4ViewParameters::AddCutawayPlane:" 157 "\n A maximum of 3 cutaway planes supported." <<
G4endl;
165 "ERROR: G4ViewParameters::ChangeCutawayPlane:" 166 "\n Plane " << index <<
" does not exist." <<
G4endl;
174 if (visibleDensity < 0) {
175 G4cout <<
"G4ViewParameters::SetVisibleDensity: attempt to set negative " 176 "density - ignored." <<
G4endl;
179 if (visibleDensity > reasonableMaximum) {
180 G4cout <<
"G4ViewParameters::SetVisibleDensity: density > " 181 <<
G4BestUnit (reasonableMaximum,
"Volumic Mass")
182 <<
" - did you mean this?" 191 if (nSides < nSidesMin) {
193 G4cout <<
"G4ViewParameters::SetNoOfSides: attempt to set the" 194 "\nnumber of sides per circle < " << nSidesMin
195 <<
"; forced to " << nSides <<
G4endl;
210 "WARNING: Viewpoint direction is very close to the up vector direction." 211 "\n Consider setting the up vector to obtain definable behaviour." 254 std::ostringstream oss;
256 oss <<
"#\n# Camera and lights commands";
258 oss <<
"\n/vis/viewer/set/viewpointVector " 263 oss <<
"\n/vis/viewer/set/upVector " 268 oss <<
"\n/vis/viewer/set/projection ";
279 oss <<
"\n/vis/viewer/zoomTo " 282 oss <<
"\n/vis/viewer/scaleTo " 287 oss <<
"\n/vis/viewer/set/targetPoint " 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.";
293 oss <<
"\n/vis/viewer/dollyTo " 296 oss <<
"\n/vis/viewer/set/lightsMove ";
303 oss <<
"\n/vis/viewer/set/lightsVector " 308 oss <<
"\n/vis/viewer/set/rotationStyle ";
310 oss <<
"constrainUpDirection";
312 oss <<
"freeRotation";
316 oss <<
"\n/vis/viewer/set/background " 323 oss <<
"\n/vis/viewer/set/defaultColour " 330 oss <<
"\n/vis/viewer/set/defaultTextColour " 343 std::ostringstream oss;
345 oss <<
"#\n# Drawing style commands";
347 oss <<
"\n/vis/viewer/set/style ";
354 oss <<
"\n/vis/viewer/set/hiddenEdge ";
361 oss <<
"\n/vis/viewer/set/auxiliaryEdge ";
368 oss <<
"\n/vis/viewer/set/hiddenMarker ";
375 oss <<
"\n/vis/viewer/set/globalLineWidthScale " 378 oss <<
"\n/vis/viewer/set/globalMarkerScale " 388 std::ostringstream oss;
390 oss <<
"#\n# Scene-modifying commands";
392 oss <<
"\n/vis/viewer/set/culling global ";
399 oss <<
"\n/vis/viewer/set/culling invisible ";
406 oss <<
"\n/vis/viewer/set/culling density ";
413 oss <<
"\n/vis/viewer/set/culling coveredDaughters ";
420 oss <<
"\n/vis/viewer/set/sectionPlane ";
431 oss <<
"\n/vis/viewer/set/cutawayMode ";
435 oss <<
"intersection";
438 oss <<
"\n/vis/viewer/clearCutawayPlanes";
441 oss <<
"\n/vis/viewer/addCutawayPlane " 448 oss <<
"\n# No cutaway planes defined.";
451 oss <<
"\n/vis/viewer/set/explodeFactor " 455 oss <<
"\n/vis/viewer/set/lineSegmentsPerCircle " 465 std::ostringstream oss;
467 oss <<
"#\n# Touchable commands";
469 const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
479 std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
481 for (iModifier = vams.begin();
482 iModifier != vams.end();
485 iModifier->GetPVNameCopyNoPath();
486 if (vamPath != lastPath) {
488 oss <<
"\n/vis/set/touchable";
490 for (iVAM = vamPath.begin();
491 iVAM != vamPath.end();
493 oss <<
' ' << iVAM->GetName() <<
' ' << iVAM->GetCopyNo();
498 switch (iModifier->GetVisAttributesSignifier()) {
500 oss <<
"\n/vis/touchable/set/visibility ";
508 oss <<
"\n/vis/touchable/set/daughtersInvisible ";
516 oss <<
"\n/vis/touchable/set/colour " 523 oss <<
"\n/vis/touchable/set/lineStyle ";
536 oss <<
"\n/vis/touchable/set/lineWidth " 541 oss <<
"\n/vis/touchable/set/forceWireframe ";
551 oss <<
"\n/vis/touchable/set/forceSolid ";
560 oss <<
"\n/vis/touchable/set/forceAuxEdgeVisible ";
568 oss <<
"\n/vis/touchable/set/lineSegmentsPerCircle " 623 G4cout <<
"Difference in section planes batch." <<
G4endl;
628 G4cout <<
"Difference in no of cutaway planes." <<
G4endl;
633 G4cout <<
"Difference in cutaway plane no. " << i << G4endl;
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;
663 os <<
"View parameters and options:";
665 os <<
"\n Drawing style: ";
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;
678 os <<
"\n Auxiliary edges: ";
682 os <<
"\n Culling: ";
686 os <<
"\n Culling invisible objects: ";
690 os <<
"\n Density culling: ";
692 os <<
"on - invisible if density less than " 697 os <<
"\n Culling daughters covered by opaque mothers: ";
701 os <<
"\n Section flag: ";
706 os <<
"\n Cutaway planes: ";
712 os <<
"\n No cutaway planes";
718 os <<
"\n No. of sides used in circle polygon approximation: " 733 os <<
"\n Dolly distance: " << v.
fDolly;
737 else os <<
"does not move";
738 os <<
" with camera";
740 os <<
"\n Relative lightpoint direction: " 743 os <<
"\n Actual lightpoint direction: " 746 os <<
"\n Derived parameters for standard view of object of unit 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;
774 os <<
"hidden by surfaces.";
776 os <<
"\n Window size hint: " 780 os <<
"\n X geometry mask: " 782 << std::noshowbase << std::dec;
784 os <<
"\n Auto refresh: ";
790 os <<
"\n Picking requested: ";
794 os <<
"\n Rotation style: ";
797 os <<
"constrainUpDirection (conventional HEP view)";
break;
799 os <<
"freeRotation (Google-like rotation, using mouse-grab)";
break;
800 default: os <<
"unrecognised";
break;
803 os <<
"\n Vis attributes modifiers: ";
804 const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
887 unsigned int w,h = 0;
888 G4String geomString = geomStringArg;
891 G4String::size_type i = geomString.find_first_of(delimiters);
892 if (i == G4String::npos) {
893 std::istringstream iss(geomString);
898 G4cout <<
"Unrecognised windowSizeHint string: \"" 900 <<
"\". Asuuming " << size <<
G4endl;
902 std::ostringstream oss;
903 oss << size <<
'x' << size;
904 geomString = oss.str();
930 G4cout <<
"Unrecognised geometry string \"" 932 <<
"\". No Height found. Using Width value instead" 1000 unsigned int *height)
1005 unsigned int tempWidth = 0;
1006 unsigned int tempHeight = 0;
1009 char *nextCharacter;
1010 if ( (
string == NULL) || (*
string ==
'\0')) {
1015 strind = (
char *)
string;
1016 if (*strind !=
'+' && *strind !=
'-' && *strind !=
'x') {
1018 if (strind == nextCharacter)
1020 strind = nextCharacter;
1023 if (*strind ==
'x' || *strind ==
'X') {
1026 if (strind == nextCharacter)
1028 strind = nextCharacter;
1032 if ((*strind ==
'+') || (*strind ==
'-')) {
1033 if (*strind ==
'-') {
1036 if (strind == nextCharacter)
1038 strind = nextCharacter;
1045 if (strind == nextCharacter)
1047 strind = nextCharacter;
1050 if ((*strind ==
'+') || (*strind ==
'-')) {
1051 if (*strind ==
'-') {
1054 if (strind == nextCharacter)
1056 strind = nextCharacter;
1063 if (strind == nextCharacter)
1065 strind = nextCharacter;
1072 if (*strind !=
'\0')
return (0);
1080 *height = tempHeight;
1095 else if (*
string ==
'-')
1100 for (; (*
string >=
'0') && (*
string <=
'9');
string++)
1102 Result = (Result * 10) + (*
string -
'0');
1104 *NextString = string;
G4Colour fBackgroundColour
ForcedDrawingStyle GetForcedDrawingStyle() const
void IncrementPan(G4double right, G4double up)
G4bool IsForceAuxEdgeVisible() const
G4Vector3D & GetActualLightpointDirection()
void AddCutawayPlane(const G4Plane3D &cutawayPlane)
void SetLightpointDirection(const G4Vector3D &lightpointDirection)
G4bool operator!=(const G4ViewParameters &) const
void SetPan(G4double right, G4double up)
Normal3D< T > normal() const
G4int SetNoOfSides(G4int nSides)
G4String CameraAndLightingCommands(const G4Point3D standardTargetPoint) const
G4bool fLightsMoveWithCamera
G4bool IsForceDrawingStyle() const
G4double fGlobalMarkerScale
G4double GetAlpha() const
G4int ReadInteger(char *string, char **NextString)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double GetGreen() const
void SetVisibleDensity(G4double visibleDensity)
G4int GetWindowAbsoluteLocationHintX(G4int) const
G4String fXGeometryString
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
void SetViewAndLights(const G4Vector3D &viewpointDirection)
G4double GetCameraDistance(G4double radius) const
G4int fWindowLocationHintX
G4bool IsDaughtersInvisible() const
Point3D< T > point(const Point3D< T > &p) const
G4GLOB_DLL std::ostream G4cout
G4double GetNearDistance(G4double cameraDistance, G4double radius) const
static G4int GetMinLineSegmentsPerCircle()
void ChangeCutawayPlane(size_t index, const G4Plane3D &cutawayPlane)
G4Point3D fCurrentTargetPoint
void PrintDifferences(const G4ViewParameters &v) const
void SetXGeometryString(const G4String &)
G4VisAttributes fDefaultVisAttributes
G4int GetWindowAbsoluteLocationHintY(G4int) const
G4double fGlobalLineWidthScale
G4int fWindowLocationHintY
std::vector< PVNameCopyNo > PVNameCopyNoPath
G4String DrawingStyleCommands() const
G4Vector3D fRelativeLightpointDirection
G4bool fWindowLocationHintYNegative
RotationStyle fRotationStyle
G4Vector3D fViewpointDirection
G4double GetFrontHalfHeight(G4double nearDistance, G4double radius) const
G4double GetFarDistance(G4double cameraDistance, G4double nearDistance, G4double radius) const
void MultiplyScaleFactor(const G4Vector3D &scaleFactorMultiplier)
G4bool fWindowLocationHintXNegative
G4VisAttributes fDefaultTextVisAttributes
BasicVector3D< T > unit() const
G4int ParseGeometry(const char *string, G4int *x, G4int *y, unsigned int *width, unsigned int *height)
friend std::ostream & operator<<(std::ostream &, const DrawingStyle &)
G4double GetLineWidth() const
LineStyle GetLineStyle() const
G4String TouchableCommands() const
G4Vector3D fActualLightpointDirection
PVNameCopyNoPath::const_iterator PVNameCopyNoPathConstIterator
std::vector< G4ModelingParameters::VisAttributesModifier > fVisAttributesModifiers
G4String SceneModifyingCommands() const
DrawingStyle fDrawingStyle
G4GLOB_DLL std::ostream G4cerr
G4int GetForcedLineSegmentsPerCircle() const
void SetScreenSize(G4double)
const G4Colour & GetColour() const