43   fDrawingStyle (wireframe),
 
   44   fAuxEdgeVisible (false),
 
   45   fRepStyle (polyhedron),
 
   47   fCullInvisible (true),
 
   48   fDensityCulling (false),
 
   49   fVisibleDensity (0.01 * 
g / 
cm3),
 
   53   fCutawayMode (cutawayUnion),
 
   62   fCurrentTargetPoint (),
 
   64   fLightsMoveWithCamera (false),
 
   65   fRelativeLightpointDirection (
G4Vector3D (1., 1., 1.)),
 
   66   fActualLightpointDirection (
G4Vector3D (1., 1., 1.)),
 
   67   fDefaultVisAttributes (),
 
   68   fDefaultTextVisAttributes (
G4Colour (0., 0., 1.)),
 
   70   fGlobalMarkerScale (1.),
 
   71   fGlobalLineWidthScale (1.),
 
   72   fMarkerNotHidden (true),
 
   73   fWindowSizeHintX (600),
 
   74   fWindowSizeHintY (600),
 
   75   fWindowLocationHintX(0),
 
   76   fWindowLocationHintY(0),
 
   77   fWindowLocationHintXNegative(true),
 
   78   fWindowLocationHintYNegative(false),
 
   81   fBackgroundColour (
G4Colour(0.,0.,0.)),         
 
   83   fRotationStyle (constrainUpDirection)
 
   93   fScaleFactor.setX(fScaleFactor.x() * scaleFactorMultiplier.
x());
 
   94   fScaleFactor.setY(fScaleFactor.y() * scaleFactorMultiplier.
y());
 
   95   fScaleFactor.setZ(fScaleFactor.z() * scaleFactorMultiplier.
z());
 
  100   return fActualLightpointDirection;
 
  113   if (fFieldHalfAngle == 0.) {
 
  114     cameraDistance = radius;
 
  117     cameraDistance = radius / std::sin (fFieldHalfAngle) - fDolly;
 
  119   return cameraDistance;
 
  124   const G4double small = 1.e-6 * radius;
 
  125   G4double nearDistance = cameraDistance - radius;
 
  126   if (nearDistance < small) nearDistance = small;
 
  133   G4double farDistance = cameraDistance + radius;
 
  134   if (farDistance < nearDistance) farDistance = nearDistance;
 
  141   if (fFieldHalfAngle == 0.) {
 
  142     frontHalfHeight = radius / fZoomFactor;
 
  145     frontHalfHeight = nearDistance * std::tan (fFieldHalfAngle) / fZoomFactor;
 
  147   return frontHalfHeight;
 
  152   if (fCutawayPlanes.size () < 3 ) {
 
  153     fCutawayPlanes.push_back (cutawayPlane);
 
  157       "ERROR: G4ViewParameters::AddCutawayPlane:" 
  158       "\n  A maximum of 3 cutaway planes supported." << 
G4endl;
 
  164   if (index >= fCutawayPlanes.size()) {
 
  166       "ERROR: G4ViewParameters::ChangeCutawayPlane:" 
  167       "\n  Plane " << index << 
" does not exist." << 
G4endl;
 
  169     fCutawayPlanes[
index] = cutawayPlane;
 
  175   if (visibleDensity < 0) {
 
  176     G4cout << 
"G4ViewParameters::SetVisibleDensity: attempt to set negative " 
  177       "density - ignored." << 
G4endl;
 
  180     if (visibleDensity > reasonableMaximum) {
 
  181       G4cout << 
"G4ViewParameters::SetVisibleDensity: density > " 
  182          << 
G4BestUnit (reasonableMaximum, 
"Volumic Mass")
 
  183          << 
" - did you mean this?" 
  186     fVisibleDensity = visibleDensity;
 
  191   const G4int  nSidesMin = 12;
 
  192   if (nSides < nSidesMin) {
 
  194     G4cout << 
"G4ViewParameters::SetNoOfSides: attempt to set the" 
  195       "\nnumber of sides per circle < " << nSidesMin
 
  196      << 
"; forced to " << nSides << 
G4endl;
 
  205   fViewpointDirection = viewpointDirection;
 
  209   if (fViewpointDirection.unit() * fUpVector.unit() > .9999) {
 
  211       "WARNING: Viewpoint direction is very close to the up vector direction." 
  212       "\n  Consider setting the up vector to obtain definable behaviour." 
  217   if (fLightsMoveWithCamera) {
 
  219     G4Vector3D xprime = (fUpVector.cross (zprime)).unit ();
 
  221     fActualLightpointDirection =
 
  222       fRelativeLightpointDirection.
x () * xprime +
 
  223       fRelativeLightpointDirection.
y () * yprime +
 
  224       fRelativeLightpointDirection.
x () * zprime;     
 
  226     fActualLightpointDirection = fRelativeLightpointDirection;
 
  232   fRelativeLightpointDirection = lightpointDirection;
 
  233   SetViewAndLights (fViewpointDirection);
 
  239   fCurrentTargetPoint  = right * unitRight + up * unitUp;
 
  249   fCurrentTargetPoint += right * unitRight + up * unitUp + distance * fViewpointDirection;
 
  255   std::ostringstream oss;
 
  257   oss << 
"#\n# Camera and lights commands";
 
  259   oss << 
"\n/vis/viewer/set/viewpointVector " 
  260   << fViewpointDirection.x()
 
  261   << 
' ' << fViewpointDirection.y()
 
  262   << 
' ' << fViewpointDirection.z();
 
  264   oss << 
"\n/vis/viewer/set/upVector " 
  266   << 
' ' << fUpVector.y()
 
  267   << 
' ' << fUpVector.z();
 
  269   oss << 
"\n/vis/viewer/set/projection ";
 
  270     if (fFieldHalfAngle == 0.) {
 
  276     << fFieldHalfAngle/
deg 
  280   oss << 
"\n/vis/viewer/zoomTo " 
  283   oss << 
"\n/vis/viewer/scaleTo " 
  285   << 
' ' << fScaleFactor.y()
 
  286   << 
' ' << fScaleFactor.z();
 
  288   oss << 
"\n/vis/viewer/set/targetPoint " 
  289   << 
G4BestUnit(standardTargetPoint+fCurrentTargetPoint,
"Length")
 
  290   << 
"\n# Note that if you have not set a target point, the vis system sets" 
  291   << 
"\n# a target point based on the scene - plus any panning and dollying -" 
  292   << 
"\n# so don't be alarmed by strange coordinates here.";
 
  294   oss << 
"\n/vis/viewer/dollyTo " 
  297   oss << 
"\n/vis/viewer/set/lightsMove ";
 
  298   if (fLightsMoveWithCamera) {
 
  304   oss << 
"\n/vis/viewer/set/lightsVector " 
  305   << fRelativeLightpointDirection.x()
 
  306   << 
' ' << fRelativeLightpointDirection.y()
 
  307   << 
' ' << fRelativeLightpointDirection.z();
 
  309   oss << 
"\n/vis/viewer/set/rotationStyle ";
 
  310   if (fRotationStyle == constrainUpDirection) {
 
  311     oss << 
"constrainUpDirection";
 
  313     oss << 
"freeRotation";
 
  317   oss << 
"\n/vis/viewer/set/background " 
  324   oss << 
"\n/vis/viewer/set/defaultColour " 
  330   c = fDefaultTextVisAttributes.
GetColour();
 
  331   oss << 
"\n/vis/viewer/set/defaultTextColour " 
  344   std::ostringstream oss;
 
  346   oss << 
"#\n# Drawing style commands";
 
  348   oss << 
"\n/vis/viewer/set/style ";
 
  349   if (fDrawingStyle == 
wireframe || fDrawingStyle == 
hlr) {
 
  355   oss << 
"\n/vis/viewer/set/hiddenEdge ";
 
  356   if (fDrawingStyle == 
hlr || fDrawingStyle == 
hlhsr) {
 
  362   oss << 
"\n/vis/viewer/set/auxiliaryEdge ";
 
  363   if (fAuxEdgeVisible) {
 
  369   oss << 
"\n/vis/viewer/set/hiddenMarker ";
 
  370   if (fMarkerNotHidden) {
 
  376   oss << 
"\n/vis/viewer/set/globalLineWidthScale " 
  377   << fGlobalLineWidthScale;
 
  379   oss << 
"\n/vis/viewer/set/globalMarkerScale " 
  380   << fGlobalMarkerScale;
 
  389   std::ostringstream oss;
 
  391   oss << 
"#\n# Scene-modifying commands";
 
  393   oss << 
"\n/vis/viewer/set/culling global ";
 
  400   oss << 
"\n/vis/viewer/set/culling invisible ";
 
  401   if (fCullInvisible) {
 
  407   oss << 
"\n/vis/viewer/set/culling density ";
 
  408   if (fDensityCulling) {
 
  409     oss << 
"true " << fVisibleDensity/(
g/
cm3) << 
" g/cm3";
 
  414   oss << 
"\n/vis/viewer/set/culling coveredDaughters ";
 
  421   oss << 
"\n/vis/viewer/set/sectionPlane ";
 
  425     << fSectionPlane.
normal().x()
 
  426     << 
' ' << fSectionPlane.
normal().y()
 
  427     << 
' ' << fSectionPlane.
normal().z();
 
  432   oss << 
"\n/vis/viewer/set/cutawayMode ";
 
  436     oss << 
"intersection";
 
  439   oss << 
"\n/vis/viewer/clearCutawayPlanes";
 
  440   if (fCutawayPlanes.size()) {
 
  441     for (
size_t i = 0; i < fCutawayPlanes.size(); i++) {
 
  442       oss << 
"\n/vis/viewer/addCutawayPlane " 
  443       << 
G4BestUnit(fCutawayPlanes[i].point(),
"Length")
 
  444       << fCutawayPlanes[i].normal().x()
 
  445       << 
' ' << fCutawayPlanes[i].normal().y()
 
  446       << 
' ' << fCutawayPlanes[i].normal().z();
 
  449     oss << 
"\n# No cutaway planes defined.";
 
  452   oss << 
"\n/vis/viewer/set/explodeFactor " 
  454   << 
' ' << 
G4BestUnit(fExplodeCentre,
"Length");
 
  456   oss << 
"\n/vis/viewer/set/lineSegmentsPerCircle " 
  466   std::ostringstream oss;
 
  468   oss << 
"#\n# Touchable commands";
 
  470   const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
 
  471     fVisAttributesModifiers;
 
  479   std::vector<G4ModelingParameters::VisAttributesModifier>::const_iterator
 
  481   for (iModifier = vams.begin();
 
  482        iModifier != vams.end();
 
  484     oss << 
"\n/vis/set/touchable";
 
  486       iModifier->GetPVNameCopyNoPath();
 
  488     for (iVAM = vamPath.begin();
 
  489          iVAM != vamPath.end();
 
  491       oss << 
' ' << iVAM->GetName() << 
' ' << iVAM->GetCopyNo();
 
  495     switch (iModifier->GetVisAttributesSignifier()) {
 
  497         oss << 
"\n/vis/touchable/set/visibility ";
 
  505         oss << 
"\n/vis/touchable/set/daughtersInvisible ";
 
  513         oss << 
"\n/vis/touchable/set/colour " 
  520         oss << 
"\n/vis/touchable/set/lineStyle ";
 
  533         oss << 
"\n/vis/touchable/set/lineWidth " 
  538           oss << 
"\n/vis/touchable/set/forceWireframe ";
 
  548           oss << 
"\n/vis/touchable/set/forceSolid ";
 
  557         oss << 
"\n/vis/touchable/set/forceAuxEdgeVisible ";
 
  565         oss << 
"\n/vis/touchable/set/lineSegmentsPerCircle " 
  581       (fViewpointDirection   != v.fViewpointDirection)   ||
 
  584       (fDrawingStyle         != v.fDrawingStyle)         ||
 
  585       (fAuxEdgeVisible       != v.fAuxEdgeVisible)       ||
 
  586       (fRepStyle             != v.fRepStyle)             ||
 
  587       (fCulling              != v.fCulling)              ||
 
  588       (fCullInvisible        != v.fCullInvisible)        ||
 
  589       (fDensityCulling       != v.fDensityCulling)       ||
 
  590       (fVisibleDensity       != v.fVisibleDensity)       ||
 
  591       (fCullCovered          != v.fCullCovered)          ||
 
  592       (fSection              != v.fSection)              ||
 
  593       (fNoOfSides            != v.fNoOfSides)            ||
 
  594       (fUpVector             != v.fUpVector)             ||
 
  595       (fFieldHalfAngle       != v.fFieldHalfAngle)       ||
 
  596       (fZoomFactor           != v.fZoomFactor)           ||
 
  597       (fScaleFactor          != v.fScaleFactor)          ||
 
  598       (fCurrentTargetPoint   != v.fCurrentTargetPoint)   ||
 
  599       (fDolly                != v.fDolly)                ||
 
  600       (fRelativeLightpointDirection != v.fRelativeLightpointDirection)  ||
 
  601       (fLightsMoveWithCamera != v.fLightsMoveWithCamera) ||
 
  602       (fDefaultVisAttributes != v.fDefaultVisAttributes) ||
 
  603       (fDefaultTextVisAttributes != v.fDefaultTextVisAttributes) ||
 
  604       (fDefaultMarker        != v.fDefaultMarker)        ||
 
  605       (fGlobalMarkerScale    != v.fGlobalMarkerScale)    ||
 
  606       (fGlobalLineWidthScale != v.fGlobalLineWidthScale) ||
 
  607       (fMarkerNotHidden      != v.fMarkerNotHidden)      ||
 
  608       (fWindowSizeHintX      != v.fWindowSizeHintX)      ||
 
  609       (fWindowSizeHintY      != v.fWindowSizeHintY)      ||
 
  610       (fXGeometryString      != v.fXGeometryString)      ||
 
  611       (fGeometryMask         != v.fGeometryMask)         ||
 
  612       (fAutoRefresh          != v.fAutoRefresh)          ||
 
  613       (fBackgroundColour     != v.fBackgroundColour)     || 
 
  614       (fPicking              != v.fPicking)              ||
 
  615       (fRotationStyle        != v.fRotationStyle)
 
  620     if (!(fSectionPlane == v.fSectionPlane))
 
  621       G4cout << 
"Difference in section planes batch." << 
G4endl;
 
  625     if (fCutawayPlanes.size () != v.fCutawayPlanes.size ()) {
 
  626       G4cout << 
"Difference in no of cutaway planes." << 
G4endl;
 
  629       for (
size_t i = 0; i < fCutawayPlanes.size (); i++) {
 
  630     if (!(fCutawayPlanes[i] == v.fCutawayPlanes[i]))
 
  631       G4cout << 
"Difference in cutaway plane no. " << i << G4endl;
 
  637     if (fExplodeFactor != v.fExplodeFactor)
 
  639     if (fExplodeCentre != v.fExplodeCentre)
 
  648     os << 
"wireframe"; 
break;
 
  650     os << 
"hlr - hidden lines removed"; 
break;
 
  652     os << 
"hsr - hidden surfaces removed"; 
break;
 
  654     os << 
"hlhsr - hidden line, hidden surface removed"; 
break;
 
  655   default: os << 
"unrecognised"; 
break;
 
  661   os << 
"View parameters and options:";
 
  663   os << 
"\n  Drawing style: ";
 
  664   switch (v.fDrawingStyle) {
 
  666     os << 
"edges, wireframe"; 
break;
 
  668     os << 
"edges, hidden line removal"; 
break;
 
  670     os << 
"surfaces, hidden surface removal"; 
break;
 
  672     os << 
"surfaces and edges, hidden line and surface removal"; 
break;
 
  673   default: os << 
"unrecognised"; 
break;
 
  676   os << 
"\n  Auxiliary edges: ";
 
  677   if (!v.fAuxEdgeVisible) os << 
"in";
 
  680   os << 
"\n  Representation style: ";
 
  681   switch (v.fRepStyle) {
 
  683     os << 
"polyhedron"; 
break;
 
  685     os << 
"nurbs"; 
break;
 
  686   default: os << 
"unrecognised"; 
break;
 
  689   os << 
"\n  Culling: ";
 
  690   if (v.fCulling) os << 
"on";
 
  693   os << 
"\n  Culling invisible objects: ";
 
  694   if (v.fCullInvisible) os << 
"on";
 
  697   os << 
"\n  Density culling: ";
 
  698   if (v.fDensityCulling) {
 
  699     os << 
"on - invisible if density less than " 
  700        << v.fVisibleDensity / (1. * 
g / 
cm3) << 
" g cm^-3";
 
  704   os << 
"\n  Culling daughters covered by opaque mothers: ";
 
  705   if (v.fCullCovered) os << 
"on";
 
  708   os << 
"\n  Section flag: ";
 
  709   if (v.fSection) os << 
"true, section/cut plane: " << v.fSectionPlane;
 
  713     os << 
"\n  Cutaway planes: ";
 
  714     for (
size_t i = 0; i < v.fCutawayPlanes.size (); i++) {
 
  715       os << 
' ' << v.fCutawayPlanes[i];
 
  719     os << 
"\n  No cutaway planes";
 
  722   os << 
"\n  Explode factor: " << v.fExplodeFactor
 
  723      << 
" about centre: " << v.fExplodeCentre;
 
  725   os << 
"\n  No. of sides used in circle polygon approximation: " 
  728   os << 
"\n  Viewpoint direction:  " << v.fViewpointDirection;
 
  730   os << 
"\n  Up vector:            " << v.fUpVector;
 
  732   os << 
"\n  Field half angle:     " << v.fFieldHalfAngle;
 
  734   os << 
"\n  Zoom factor:          " << v.fZoomFactor;
 
  736   os << 
"\n  Scale factor:         " << v.fScaleFactor;
 
  738   os << 
"\n  Current target point: " << v.fCurrentTargetPoint;
 
  740   os << 
"\n  Dolly distance:       " << v.fDolly;
 
  743   if (v.fLightsMoveWithCamera) os << 
"moves";
 
  744   else                         os << 
"does not move";
 
  745   os << 
" with camera";
 
  747   os << 
"\n  Relative lightpoint direction: " 
  748      << v.fRelativeLightpointDirection;
 
  750   os << 
"\n  Actual lightpoint direction: " 
  751      << v.fActualLightpointDirection;
 
  753   os << 
"\n  Derived parameters for standard view of object of unit radius:";
 
  756   tempVP.fZoomFactor = 1.;
 
  764   os << 
"\n    Camera distance:   " << cameraDistance;
 
  765   os << 
"\n    Near distance:     " << nearDistance;
 
  766   os << 
"\n    Far distance:      " << farDistance;
 
  767   os << 
"\n    Front half height: " << 
right;
 
  769   os << 
"\n  Default VisAttributes:\n  " << v.fDefaultVisAttributes;
 
  771   os << 
"\n  Default TextVisAttributes:\n  " << v.fDefaultTextVisAttributes;
 
  773   os << 
"\n  Default marker: " << v.fDefaultMarker;
 
  775   os << 
"\n  Global marker scale: " << v.fGlobalMarkerScale;
 
  777   os << 
"\n  Global lineWidth scale: " << v.fGlobalLineWidthScale;
 
  780   if (v.fMarkerNotHidden) os << 
"not ";
 
  781   os << 
"hidden by surfaces.";
 
  783   os << 
"\n  Window size hint: " 
  784      << v.fWindowSizeHintX << 
'x'<< v.fWindowSizeHintX;
 
  786   os << 
"\n  X geometry string: " << v.fXGeometryString;
 
  787   os << 
"\n  X geometry mask: " 
  788      << std::showbase << std::hex << v.fGeometryMask
 
  789      << std::noshowbase << std::dec;
 
  791   os << 
"\n  Auto refresh: ";
 
  792   if (v.fAutoRefresh) os << 
"true";
 
  795   os << 
"\n  Background colour: " << v.fBackgroundColour;
 
  797   os << 
"\n  Picking requested: ";
 
  798   if (v.fPicking) os << 
"true";
 
  801   os << 
"\n  Rotation style: ";
 
  802   switch (v.fRotationStyle) {
 
  804     os << 
"constrainUpDirection (conventional HEP view)"; 
break;
 
  806     os << 
"freeRotation (Google-like rotation, using mouse-grab)"; 
break;
 
  807   default: os << 
"unrecognised"; 
break;
 
  810   os << 
"\n  Vis attributes modifiers: ";
 
  811   const std::vector<G4ModelingParameters::VisAttributesModifier>& vams =
 
  812     v.fVisAttributesModifiers;
 
  827       (fViewpointDirection   != v.fViewpointDirection)   ||
 
  830       (fDrawingStyle         != v.fDrawingStyle)         ||
 
  831       (fAuxEdgeVisible       != v.fAuxEdgeVisible)       ||
 
  832       (fRepStyle             != v.fRepStyle)             ||
 
  833       (fCulling              != v.fCulling)              ||
 
  834       (fCullInvisible        != v.fCullInvisible)        ||
 
  835       (fDensityCulling       != v.fDensityCulling)       ||
 
  836       (fCullCovered          != v.fCullCovered)          ||
 
  837       (fSection              != v.fSection)              ||
 
  840       (fNoOfSides            != v.fNoOfSides)            ||
 
  841       (fUpVector             != v.fUpVector)             ||
 
  842       (fFieldHalfAngle       != v.fFieldHalfAngle)       ||
 
  843       (fZoomFactor           != v.fZoomFactor)           ||
 
  844       (fScaleFactor          != v.fScaleFactor)          ||
 
  845       (fCurrentTargetPoint   != v.fCurrentTargetPoint)   ||
 
  846       (fDolly                != v.fDolly)                ||
 
  847       (fRelativeLightpointDirection != v.fRelativeLightpointDirection)  ||
 
  848       (fLightsMoveWithCamera != v.fLightsMoveWithCamera) ||
 
  849       (fDefaultVisAttributes != v.fDefaultVisAttributes) ||
 
  850       (fDefaultTextVisAttributes != v.fDefaultTextVisAttributes) ||
 
  851       (fDefaultMarker        != v.fDefaultMarker)        ||
 
  852       (fGlobalMarkerScale    != v.fGlobalMarkerScale)    ||
 
  853       (fGlobalLineWidthScale != v.fGlobalLineWidthScale) ||
 
  854       (fMarkerNotHidden      != v.fMarkerNotHidden)      ||
 
  855       (fWindowSizeHintX      != v.fWindowSizeHintX)      ||
 
  856       (fWindowSizeHintY      != v.fWindowSizeHintY)      ||
 
  857       (fXGeometryString      != v.fXGeometryString)      ||
 
  858       (fGeometryMask         != v.fGeometryMask)         ||
 
  859       (fAutoRefresh          != v.fAutoRefresh)          ||
 
  860       (fBackgroundColour     != v.fBackgroundColour)     ||
 
  861       (fPicking              != v.fPicking)              ||
 
  862       (fRotationStyle        != v.fRotationStyle)
 
  866   if (fDensityCulling &&
 
  867       (fVisibleDensity != v.fVisibleDensity)) 
return true;
 
  870       (!(fSectionPlane == v.fSectionPlane))) 
return true;
 
  873     if (fCutawayPlanes.size () != v.fCutawayPlanes.size ())
 
  876       for (
size_t i = 0; i < fCutawayPlanes.size (); i++) {
 
  877     if (!(fCutawayPlanes[i] == v.fCutawayPlanes[i])) 
return true;
 
  883       ((fExplodeFactor != v.fExplodeFactor) ||
 
  884        (fExplodeCentre != v.fExplodeCentre))) 
return true;
 
  887       (fVisAttributesModifiers, v.fVisAttributesModifiers))
 
  898   unsigned int w,h = 0;
 
  899   G4String geomString = geomStringArg;
 
  902   G4String::size_type i = geomString.find_first_of(delimiters);
 
  903   if (i == G4String::npos) {  
 
  904     std::istringstream iss(geomString);
 
  909       G4cout << 
"Unrecognised windowSizeHint string: \"" 
  911          << 
"\".  Asuuming " << size << 
G4endl;
 
  913     std::ostringstream oss;
 
  914     oss << size << 
'x' << size;
 
  915     geomString = oss.str();
 
  918   fGeometryMask = ParseGeometry( geomString, &x, &y, &w, &h );
 
  921   if ((fGeometryMask & fYValue) == 0)
 
  923       y =  fWindowLocationHintY;
 
  925   if ((fGeometryMask & fXValue) == 0)
 
  927       x =  fWindowLocationHintX;
 
  932   if ( ((fGeometryMask & fHeightValue) == 0 ) &&
 
  933        ((fGeometryMask & fWidthValue)  == 0 )) {
 
  934     h = fWindowSizeHintY;
 
  935     w = fWindowSizeHintX;
 
  936   } 
else  if ((fGeometryMask & fHeightValue) == 0 ) {
 
  941     G4cout << 
"Unrecognised geometry string \"" 
  943            << 
"\".  No Height found. Using Width value instead" 
  947   if ( ((fGeometryMask & fXValue) == 0 ) ||
 
  948        ((fGeometryMask & fYValue)  == 0 )) {
 
  950     x = fWindowLocationHintX;
 
  951     y = fWindowLocationHintY;
 
  954   fXGeometryString = geomString;
 
  957   fWindowSizeHintX = w;
 
  958   fWindowSizeHintY = h;
 
  959   fWindowLocationHintX = 
x;
 
  960   fWindowLocationHintY = 
y;
 
  962   if ( ((fGeometryMask & fXValue)) &&
 
  963        ((fGeometryMask & fYValue))) {
 
  965     if ( (fGeometryMask & fXNegative) ) {
 
  966       fWindowLocationHintXNegative = 
true;
 
  968       fWindowLocationHintXNegative = 
false;
 
  970     if ( (fGeometryMask & fYNegative) ) {
 
  971     fWindowLocationHintYNegative = 
true;
 
  973       fWindowLocationHintYNegative = 
false;
 
  979   if ( fWindowLocationHintXNegative ) {
 
  980     return  sizeX  + fWindowLocationHintX - fWindowSizeHintX;
 
  982   return fWindowLocationHintX;
 
  986   if (  fWindowLocationHintYNegative ) {
 
  987     return  sizeY  + fWindowLocationHintY - fWindowSizeHintY;
 
  989   return fWindowLocationHintY;
 
 1006 int G4ViewParameters::ParseGeometry (
 
 1010  unsigned int *width,
 
 1011  unsigned int *height)
 
 1014   G4int mask = fNoValue;
 
 1015   register char *strind;
 
 1016   unsigned int tempWidth  = 0;
 
 1017   unsigned int tempHeight = 0;
 
 1020   char *nextCharacter;
 
 1021   if ( (
string == NULL) || (*
string == 
'\0')) {
 
 1026   strind = (
char *)
string;
 
 1027   if (*strind != 
'+' && *strind != 
'-' && *strind != 
'x') {
 
 1028     tempWidth = ReadInteger(strind, &nextCharacter);
 
 1029     if (strind == nextCharacter)
 
 1031     strind = nextCharacter;
 
 1032     mask |= fWidthValue;
 
 1034   if (*strind == 
'x' || *strind == 
'X') {
 
 1036     tempHeight = ReadInteger(strind, &nextCharacter);
 
 1037     if (strind == nextCharacter)
 
 1039     strind = nextCharacter;
 
 1040     mask |= fHeightValue;
 
 1043   if ((*strind == 
'+') || (*strind == 
'-')) {
 
 1044     if (*strind == 
'-') {
 
 1046       tempX = -ReadInteger(strind, &nextCharacter);
 
 1047       if (strind == nextCharacter)
 
 1049       strind = nextCharacter;
 
 1055         tempX = ReadInteger(strind, &nextCharacter);
 
 1056         if (strind == nextCharacter)
 
 1058         strind = nextCharacter;
 
 1061     if ((*strind == 
'+') || (*strind == 
'-')) {
 
 1062       if (*strind == 
'-') {
 
 1064         tempY = -ReadInteger(strind, &nextCharacter);
 
 1065         if (strind == nextCharacter)
 
 1067         strind = nextCharacter;
 
 1073           tempY = ReadInteger(strind, &nextCharacter);
 
 1074           if (strind == nextCharacter)
 
 1076           strind = nextCharacter;
 
 1083   if (*strind != 
'\0') 
return (0);
 
 1088   if (mask & fWidthValue)
 
 1090   if (mask & fHeightValue)
 
 1091     *height = tempHeight;
 
 1099 G4int G4ViewParameters::ReadInteger(
char *
string, 
char **NextString)
 
 1101     register G4int Result = 0;
 
 1106     else if (*
string == 
'-')
 
 1111     for (; (*
string >= 
'0') && (*
string <= 
'9'); 
string++)
 
 1113     Result = (Result * 10) + (*
string - 
'0');
 
 1115     *NextString = string;