Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/visualization/management/include/G4ViewParameters.hh

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /visualization/management/include/G4ViewParameters.hh (Version 11.3.0) and /visualization/management/include/G4ViewParameters.hh (Version 10.6.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 //                                                 27 //
 28 //                                                 28 // 
 29 // John Allison  19th July 1996                    29 // John Allison  19th July 1996
 30 //                                                 30 //
 31 // Class description                               31 // Class description
 32 //                                                 32 //
 33 // View parameters and options.                    33 // View parameters and options.
 34 //                                                 34 //
 35 // THE STANDARD VIEW AND ALL THAT.                 35 // THE STANDARD VIEW AND ALL THAT.
 36 //                                                 36 //
 37 // In GEANT4 visualization, we have the concep     37 // In GEANT4 visualization, we have the concept of a "Standard
 38 // View".  This is the view when the complete      38 // View".  This is the view when the complete set of objects being
 39 // viewed is comfortably in view from any view     39 // viewed is comfortably in view from any viewpoint.  It is defined by
 40 // the "Bounding Extent" of "visible" objects      40 // the "Bounding Extent" of "visible" objects when initially
 41 // registered in the scene, and by the View Pa     41 // registered in the scene, and by the View Parameters.
 42 //                                                 42 //
 43 // There is also the "Standard Target Point",      43 // There is also the "Standard Target Point", which is the centre of
 44 // the Bounding Extent (note that this belongs     44 // the Bounding Extent (note that this belongs to the scene and is
 45 // stored in the G4Scene object).  The "Curren     45 // stored in the G4Scene object).  The "Current Target Point", defined
 46 // relative to the Standard Target Point, is c     46 // relative to the Standard Target Point, is changed by the
 47 // "dolly" and "zoom" commands, and can be res     47 // "dolly" and "zoom" commands, and can be reset to the Standard
 48 // Target Point with the "/vis/viewer/reset" c     48 // Target Point with the "/vis/viewer/reset" command.
 49 //                                                 49 //
 50 // Also, the "Standard Camera Position" is the     50 // Also, the "Standard Camera Position" is the "Standard Camera
 51 // Distance" along the Viewpoint Direction vec     51 // Distance" along the Viewpoint Direction vector from the Standard
 52 // Target Point.  The Standard Camera Distance     52 // Target Point.  The Standard Camera Distance is the radius of the
 53 // Bounding Extent divided by fFieldHalfAngle.     53 // Bounding Extent divided by fFieldHalfAngle.  It is not stored
 54 // explicitly because of the singularity at fF     54 // explicitly because of the singularity at fFieldHalfAngle = 0,
 55 // which implies parallel projection.              55 // which implies parallel projection.
 56 //                                                 56 //
 57 // Similarly, the "Current Camera Position" is     57 // Similarly, the "Current Camera Position" is the "Current Camera
 58 // Distance" along the Viewpoint Direction vec     58 // Distance" along the Viewpoint Direction vector from the Current
 59 // Target Point.  The Current Camera Distance      59 // Target Point.  The Current Camera Distance is given by the formulae
 60 // below, but note that it can be negative, me     60 // below, but note that it can be negative, meaning that the camera
 61 // has moved *beyond* the Current Target Point     61 // has moved *beyond* the Current Target Point, which is
 62 // conceptually possible, but which might give     62 // conceptually possible, but which might give some problems when
 63 // setting up the view matrix - see, for examp     63 // setting up the view matrix - see, for example, G4OpenGLView::SetView ().
 64 //                                                 64 //
 65 // All viewers are expected to keep the "Up Ve     65 // All viewers are expected to keep the "Up Vector" vertical unless
 66 // RotationStyle is freeRotation.                  66 // RotationStyle is freeRotation.
 67 //                                                 67 //
 68 // Finally, the view is magnified by the "Zoom     68 // Finally, the view is magnified by the "Zoom Factor" which is
 69 // reset to 1 by the "/vis/viewer/reset" comma     69 // reset to 1 by the "/vis/viewer/reset" command.
 70 //                                                 70 //
 71 // The algorithms for calculating various usef     71 // The algorithms for calculating various useful quantities from the
 72 // View Parameters, such as GetCameraDistance,     72 // View Parameters, such as GetCameraDistance, are described below.
 73                                                    73 
 74 #ifndef G4VIEWPARAMETERS_HH                        74 #ifndef G4VIEWPARAMETERS_HH
 75 #define G4VIEWPARAMETERS_HH                        75 #define G4VIEWPARAMETERS_HH
 76                                                    76 
 77 #include <CLHEP/Units/SystemOfUnits.h>             77 #include <CLHEP/Units/SystemOfUnits.h>
 78 #include "G4Vector3D.hh"                           78 #include "G4Vector3D.hh"
 79 #include "G4Point3D.hh"                            79 #include "G4Point3D.hh"
 80 #include "G4Plane3D.hh"                            80 #include "G4Plane3D.hh"
 81 #include "G4VisAttributes.hh"                      81 #include "G4VisAttributes.hh"
 82 #include "G4VMarker.hh"                            82 #include "G4VMarker.hh"
 83 #include "G4ModelingParameters.hh"                 83 #include "G4ModelingParameters.hh"
 84                                                    84 
 85 #include <vector>                                  85 #include <vector>
 86 #include <utility>                                 86 #include <utility>
 87                                                    87 
 88 typedef std::vector<G4Plane3D> G4Planes;           88 typedef std::vector<G4Plane3D> G4Planes;
 89                                                    89 
 90 class G4ViewParameters {                           90 class G4ViewParameters {
 91                                                    91 
 92 public: // With description                        92 public: // With description
 93                                                    93 
 94   enum DrawingStyle {                              94   enum DrawingStyle {
 95     wireframe,  // Draw edges    - no hidden l     95     wireframe,  // Draw edges    - no hidden line removal.
 96     hlr,        // Draw edges    - hidden line     96     hlr,        // Draw edges    - hidden lines removed.
 97     hsr,        // Draw surfaces - hidden surf     97     hsr,        // Draw surfaces - hidden surfaces removed.
 98     hlhsr,      // Draw surfaces and edges - h     98     hlhsr,      // Draw surfaces and edges - hidden removed.
 99     cloud       // Draw volume as a cloud of d     99     cloud       // Draw volume as a cloud of dots.
100   };                                              100   };
101                                                   101 
102   enum CutawayMode {                              102   enum CutawayMode {
103     cutawayUnion,       // Union (addition) of    103     cutawayUnion,       // Union (addition) of result of each cutaway plane.
104     cutawayIntersection // Intersection (multi << 104     cutawayIntersection // Intersection (multiplication) " .
105   };                                              105   };
106                                                   106 
107   enum RotationStyle {                            107   enum RotationStyle {
108     constrainUpDirection,  // Standard, HEP co    108     constrainUpDirection,  // Standard, HEP convention.
109     freeRotation           // Free, Google-lik    109     freeRotation           // Free, Google-like rotation, using mouse-grab.
110   };                                              110   };
111                                                   111 
112   enum SMROption {  // Special Mesh Rendering  << 
113     meshAsDefault,                             << 
114     meshAsDots,                                << 
115     meshAsSurfaces                             << 
116   };                                           << 
117                                                << 
118   friend std::ostream& operator <<             << 
119   (std::ostream&, DrawingStyle);               << 
120                                                << 
121   friend std::ostream& operator <<                112   friend std::ostream& operator <<
122   (std::ostream&, SMROption);                  << 113   (std::ostream&, const DrawingStyle&);
123                                                   114 
124   friend std::ostream& operator <<                115   friend std::ostream& operator <<
125   (std::ostream&, const G4ViewParameters&);       116   (std::ostream&, const G4ViewParameters&);
126                                                   117 
127   G4ViewParameters ();                            118   G4ViewParameters ();
128   ~G4ViewParameters ();                           119   ~G4ViewParameters ();
129                                                   120 
130   // Note: uses default assignment operator an    121   // Note: uses default assignment operator and copy constructor.
131                                                   122 
132   G4bool operator != (const G4ViewParameters&)    123   G4bool operator != (const G4ViewParameters&) const;
133                                                   124 
134   // Get and Is functions.                        125   // Get and Is functions.
135         DrawingStyle     GetDrawingStyle          126         DrawingStyle     GetDrawingStyle         () const;
136         G4int            GetNumberOfCloudPoint    127         G4int            GetNumberOfCloudPoints  () const;
137         G4bool           IsAuxEdgeVisible         128         G4bool           IsAuxEdgeVisible        () const;
138         G4bool           IsCulling                129         G4bool           IsCulling               () const;
139         G4bool           IsCullingInvisible       130         G4bool           IsCullingInvisible      () const;
140         G4bool           IsDensityCulling         131         G4bool           IsDensityCulling        () const;
141         G4double         GetVisibleDensity        132         G4double         GetVisibleDensity       () const;
142         G4bool           IsCullingCovered         133         G4bool           IsCullingCovered        () const;
143         G4int            GetCBDAlgorithmNumber    134         G4int            GetCBDAlgorithmNumber   () const;
144   const std::vector<G4double>& GetCBDParameter    135   const std::vector<G4double>& GetCBDParameters  () const;
145         G4bool           IsSection                136         G4bool           IsSection               () const;
146   const G4Plane3D&       GetSectionPlane          137   const G4Plane3D&       GetSectionPlane         () const;
147         G4bool           IsCutaway                138         G4bool           IsCutaway               () const;
148         CutawayMode      GetCutawayMode           139         CutawayMode      GetCutawayMode          () const;
149   const G4Planes&        GetCutawayPlanes         140   const G4Planes&        GetCutawayPlanes        () const;
150         G4bool           IsExplode                141         G4bool           IsExplode               () const;
151         G4double         GetExplodeFactor         142         G4double         GetExplodeFactor        () const;
152   const G4Point3D&       GetExplodeCentre         143   const G4Point3D&       GetExplodeCentre        () const;
153         G4int            GetNoOfSides             144         G4int            GetNoOfSides            () const;
154   const G4Vector3D&      GetViewpointDirection    145   const G4Vector3D&      GetViewpointDirection   () const;
155   const G4Vector3D&      GetUpVector              146   const G4Vector3D&      GetUpVector             () const;
156         G4double         GetFieldHalfAngle        147         G4double         GetFieldHalfAngle       () const;
157         G4double         GetZoomFactor            148         G4double         GetZoomFactor           () const;
158   const G4Vector3D&      GetScaleFactor           149   const G4Vector3D&      GetScaleFactor          () const;
159   const G4Point3D&       GetCurrentTargetPoint    150   const G4Point3D&       GetCurrentTargetPoint   () const;
160         G4double         GetDolly                 151         G4double         GetDolly                () const;
161         G4bool           GetLightsMoveWithCame    152         G4bool           GetLightsMoveWithCamera () const;
162   const G4Vector3D&      GetLightpointDirectio    153   const G4Vector3D&      GetLightpointDirection  () const;  // Relative...
163         G4Vector3D&      GetActualLightpointDi    154         G4Vector3D&      GetActualLightpointDirection  ();  // Actual...
164   // ... depending on GetLightsMoveWithCamera.    155   // ... depending on GetLightsMoveWithCamera.
165   const G4VisAttributes* GetDefaultVisAttribut    156   const G4VisAttributes* GetDefaultVisAttributes () const;
166   const G4VisAttributes* GetDefaultTextVisAttr    157   const G4VisAttributes* GetDefaultTextVisAttributes () const;
167   const G4VMarker&       GetDefaultMarker         158   const G4VMarker&       GetDefaultMarker        () const;
168         G4double         GetGlobalMarkerScale     159         G4double         GetGlobalMarkerScale    () const;
169         G4double         GetGlobalLineWidthSca    160         G4double         GetGlobalLineWidthScale () const;
170         G4bool           IsMarkerNotHidden        161         G4bool           IsMarkerNotHidden       () const;
171         unsigned int     GetWindowSizeHintX       162         unsigned int     GetWindowSizeHintX      () const;
172         unsigned int     GetWindowSizeHintY       163         unsigned int     GetWindowSizeHintY      () const;
173         G4int            GetWindowAbsoluteLoca    164         G4int            GetWindowAbsoluteLocationHintX (G4int) const;
174         G4int            GetWindowAbsoluteLoca    165         G4int            GetWindowAbsoluteLocationHintY (G4int) const;
175         G4int            GetWindowLocationHint    166         G4int            GetWindowLocationHintX  () const;
176         G4int            GetWindowLocationHint    167         G4int            GetWindowLocationHintY  () const;
177         G4bool           IsWindowLocationHintX << 
178         G4bool           IsWindowLocationHintY << 
179   const G4String&        GetXGeometryString       168   const G4String&        GetXGeometryString      () const;
180   // GetXGeometryString is intended to be pars    169   // GetXGeometryString is intended to be parsed by XParseGeometry.
181   // It contains the size information, as in G    170   // It contains the size information, as in GetWindowSizeHint, but
182   // may also contain the window position, e.g    171   // may also contain the window position, e.g., "600x600-0+200.  The
183   // viewer should use this in preference to G    172   // viewer should use this in preference to GetWindowSizeHint, since
184   // it contains more information.  (The size     173   // it contains more information.  (The size information in
185   // GetXGeometryString and GetWindowSizeHint     174   // GetXGeometryString and GetWindowSizeHint is guaranteed to be
186   // identical.)                                  175   // identical.)
187         bool             IsWindowSizeHintX        176         bool             IsWindowSizeHintX       () const;
188         bool             IsWindowSizeHintY        177         bool             IsWindowSizeHintY       () const;
189         bool             IsWindowLocationHintX    178         bool             IsWindowLocationHintX   () const;
190         bool             IsWindowLocationHintY    179         bool             IsWindowLocationHintY   () const;
191         G4bool           IsAutoRefresh            180         G4bool           IsAutoRefresh           () const;
192   const G4Colour&  GetBackgroundColour            181   const G4Colour&  GetBackgroundColour           () const;
193         G4bool           IsPicking                182         G4bool           IsPicking               () const;
194         RotationStyle    GetRotationStyle         183         RotationStyle    GetRotationStyle        () const;
195   const std::vector<G4ModelingParameters::VisA    184   const std::vector<G4ModelingParameters::VisAttributesModifier>&
196                          GetVisAttributesModif    185                          GetVisAttributesModifiers () const;
197         G4double         GetStartTime             186         G4double         GetStartTime            () const;
198         G4double         GetEndTime               187         G4double         GetEndTime              () const;
199         G4double         GetFadeFactor            188         G4double         GetFadeFactor           () const;
200         G4bool           IsDisplayHeadTime        189         G4bool           IsDisplayHeadTime       () const;
201         G4double         GetDisplayHeadTimeX      190         G4double         GetDisplayHeadTimeX     () const;
202         G4double         GetDisplayHeadTimeY      191         G4double         GetDisplayHeadTimeY     () const;
203         G4double         GetDisplayHeadTimeSiz    192         G4double         GetDisplayHeadTimeSize  () const;
204         G4double         GetDisplayHeadTimeRed    193         G4double         GetDisplayHeadTimeRed   () const;
205         G4double         GetDisplayHeadTimeGre    194         G4double         GetDisplayHeadTimeGreen () const;
206         G4double         GetDisplayHeadTimeBlu    195         G4double         GetDisplayHeadTimeBlue  () const;
207         G4bool           IsDisplayLightFront      196         G4bool           IsDisplayLightFront     () const;
208         G4double         GetDisplayLightFrontX    197         G4double         GetDisplayLightFrontX   () const;
209         G4double         GetDisplayLightFrontY    198         G4double         GetDisplayLightFrontY   () const;
210         G4double         GetDisplayLightFrontZ    199         G4double         GetDisplayLightFrontZ   () const;
211         G4double         GetDisplayLightFrontT    200         G4double         GetDisplayLightFrontT   () const;
212         G4double         GetDisplayLightFrontR    201         G4double         GetDisplayLightFrontRed () const;
213         G4double         GetDisplayLightFrontG    202         G4double         GetDisplayLightFrontGreen () const;
214         G4double         GetDisplayLightFrontB    203         G4double         GetDisplayLightFrontBlue () const;
215         G4bool           IsSpecialMeshRenderin << 
216         SMROption        GetSpecialMeshRenderi << 
217   const std::vector<G4ModelingParameters::PVNa << 
218                                                   204 
219   // Here Follow functions to evaluate useful     205   // Here Follow functions to evaluate useful quantities as a
220   // function of the radius of the Bounding Ex    206   // function of the radius of the Bounding Extent of the object being
221   // viewed.  Call them in the order given - f    207   // viewed.  Call them in the order given - for efficiency, later
222   // functions depend on the results of earlie    208   // functions depend on the results of earlier ones (Store the
223   // results of earlier functions in your own     209   // results of earlier functions in your own temporary variables -
224   // see, for example, G4OpenGLView::SetView (    210   // see, for example, G4OpenGLView::SetView ().)
225   G4double GetCameraDistance  (G4double radius    211   G4double GetCameraDistance  (G4double radius) const;
226   G4double GetNearDistance    (G4double camera    212   G4double GetNearDistance    (G4double cameraDistance, G4double radius) const;
227   G4double GetFarDistance     (G4double camera    213   G4double GetFarDistance     (G4double cameraDistance,
228              G4double nearDistance, G4double r    214              G4double nearDistance, G4double radius) const;
229   G4double GetFrontHalfHeight (G4double nearDi    215   G4double GetFrontHalfHeight (G4double nearDistance, G4double radius) const;
230                                                   216 
231   // Set, Add, Multiply, Increment, Unset and     217   // Set, Add, Multiply, Increment, Unset and Clear functions.
232   void SetDrawingStyle         (G4ViewParamete    218   void SetDrawingStyle         (G4ViewParameters::DrawingStyle style);
233   G4int SetNumberOfCloudPoints (G4int);  // Re    219   G4int SetNumberOfCloudPoints (G4int);  // Returns number actually set.
234   void SetAuxEdgeVisible       (G4bool);          220   void SetAuxEdgeVisible       (G4bool);
235   void SetCulling              (G4bool);          221   void SetCulling              (G4bool);
236   void SetCullingInvisible     (G4bool);          222   void SetCullingInvisible     (G4bool);
237   void SetDensityCulling       (G4bool);          223   void SetDensityCulling       (G4bool);
238   void SetVisibleDensity       (G4double visib    224   void SetVisibleDensity       (G4double visibleDensity);
239   void SetCullingCovered       (G4bool);          225   void SetCullingCovered       (G4bool);
240   void SetCBDAlgorithmNumber   (G4int);           226   void SetCBDAlgorithmNumber   (G4int);
241   void SetCBDParameters        (const std::vec    227   void SetCBDParameters        (const std::vector<G4double>&);
242   void SetSectionPlane         (const G4Plane3    228   void SetSectionPlane         (const G4Plane3D& sectionPlane);
243   void UnsetSectionPlane       ();                229   void UnsetSectionPlane       ();
244   void SetCutawayMode          (CutawayMode);     230   void SetCutawayMode          (CutawayMode);
245   void AddCutawayPlane         (const G4Plane3    231   void AddCutawayPlane         (const G4Plane3D& cutawayPlane);
246   void ChangeCutawayPlane      (size_t index,     232   void ChangeCutawayPlane      (size_t index, const G4Plane3D& cutawayPlane);
247   void ClearCutawayPlanes      ();                233   void ClearCutawayPlanes      ();
248   void SetExplodeFactor        (G4double explo    234   void SetExplodeFactor        (G4double explodeFactor);
249   void UnsetExplodeFactor      ();                235   void UnsetExplodeFactor      ();
250   void SetExplodeCentre        (const G4Point3    236   void SetExplodeCentre        (const G4Point3D& explodeCentre);
251   G4int SetNoOfSides           (G4int nSides);    237   G4int SetNoOfSides           (G4int nSides);  // Returns number actually set.
252   void SetViewpointDirection   (const G4Vector    238   void SetViewpointDirection   (const G4Vector3D& viewpointDirection);
253   // Calls the following to get lightpoint dir    239   // Calls the following to get lightpoint direction right too.
254   void SetViewAndLights        (const G4Vector    240   void SetViewAndLights        (const G4Vector3D& viewpointDirection);
255   // Also sets lightpoint direction according     241   // Also sets lightpoint direction according to G4bool fLightsMoveWithCamera.
256   void SetUpVector             (const G4Vector    242   void SetUpVector             (const G4Vector3D& upVector);
257   void SetFieldHalfAngle       (G4double field    243   void SetFieldHalfAngle       (G4double fieldHalfAngle);
258   void SetOrthogonalProjection ();  // This an    244   void SetOrthogonalProjection ();  // This and next use SetFieldHalfAngle.
259   void SetPerspectiveProjection(G4double field    245   void SetPerspectiveProjection(G4double fieldHalfAngle = 30. * CLHEP::deg);
260   void SetZoomFactor           (G4double zoomF    246   void SetZoomFactor           (G4double zoomFactor);
261   void MultiplyZoomFactor      (G4double zoomF    247   void MultiplyZoomFactor      (G4double zoomFactorMultiplier);
262   void SetScaleFactor          (const G4Vector    248   void SetScaleFactor          (const G4Vector3D& scaleFactor);
263   void MultiplyScaleFactor     (const G4Vector    249   void MultiplyScaleFactor     (const G4Vector3D& scaleFactorMultiplier);
264   void SetCurrentTargetPoint   (const G4Point3    250   void SetCurrentTargetPoint   (const G4Point3D& currentTargetPoint);
265   void SetDolly                (G4double dolly    251   void SetDolly                (G4double dolly);
266   void IncrementDolly          (G4double dolly    252   void IncrementDolly          (G4double dollyIncrement);
267   void SetLightpointDirection  (const G4Vector    253   void SetLightpointDirection  (const G4Vector3D& lightpointDirection);
268   void SetLightsMoveWithCamera (G4bool moves);    254   void SetLightsMoveWithCamera (G4bool moves);
269   void SetPan                  (G4double right    255   void SetPan                  (G4double right, G4double up);
270   void IncrementPan            (G4double right    256   void IncrementPan            (G4double right, G4double up);
271   // Increment currentTarget point perpendicul    257   // Increment currentTarget point perpendicular to viewpoint direction.
272   void IncrementPan            (G4double right    258   void IncrementPan            (G4double right, G4double up, G4double forward);
273   // Increment currentTarget point also along     259   // Increment currentTarget point also along viewpoint direction.
274   void SetDefaultVisAttributes (const G4VisAtt    260   void SetDefaultVisAttributes (const G4VisAttributes&);
275   void SetDefaultColour        (const G4Colour    261   void SetDefaultColour        (const G4Colour&);  // Uses SetDefaultVisAttributes.
276   void SetDefaultTextVisAttributes (const G4Vi    262   void SetDefaultTextVisAttributes (const G4VisAttributes&);
277   void SetDefaultTextColour    (const G4Colour    263   void SetDefaultTextColour    (const G4Colour&);  // SetDefaultTextVisAttributes.
278   void SetDefaultMarker        (const G4VMarke    264   void SetDefaultMarker        (const G4VMarker& defaultMarker);
279   void SetGlobalMarkerScale    (G4double globa    265   void SetGlobalMarkerScale    (G4double globalMarkerScale);
280   void SetGlobalLineWidthScale (G4double globa    266   void SetGlobalLineWidthScale (G4double globalLineWidthScale);
281   void SetMarkerHidden         ();                267   void SetMarkerHidden         ();
282   void SetMarkerNotHidden      ();                268   void SetMarkerNotHidden      ();
283   void SetWindowSizeHint       (G4int xHint, G    269   void SetWindowSizeHint       (G4int xHint, G4int yHint);
284   void SetWindowLocationHint   (G4int xHint, G    270   void SetWindowLocationHint   (G4int xHint, G4int yHint);
285   void SetXGeometryString      (const G4String    271   void SetXGeometryString      (const G4String&);
286   void SetAutoRefresh          (G4bool);          272   void SetAutoRefresh          (G4bool);
287   void SetBackgroundColour     (const G4Colour    273   void SetBackgroundColour     (const G4Colour&);
288   void SetPicking              (G4bool);          274   void SetPicking              (G4bool);
289   void SetRotationStyle        (RotationStyle)    275   void SetRotationStyle        (RotationStyle);
290   void ClearVisAttributesModifiers ();            276   void ClearVisAttributesModifiers ();
291   void AddVisAttributesModifier(const G4Modeli    277   void AddVisAttributesModifier(const G4ModelingParameters::VisAttributesModifier&);
292   void SetStartTime            (G4double);        278   void SetStartTime            (G4double);
293   void SetEndTime              (G4double);        279   void SetEndTime              (G4double);
294   void SetFadeFactor           (G4double);        280   void SetFadeFactor           (G4double);
295   void SetDisplayHeadTime      (G4bool);          281   void SetDisplayHeadTime      (G4bool);
296   void SetDisplayHeadTimeX     (G4double);        282   void SetDisplayHeadTimeX     (G4double);
297   void SetDisplayHeadTimeY     (G4double);        283   void SetDisplayHeadTimeY     (G4double);
298   void SetDisplayHeadTimeSize  (G4double);        284   void SetDisplayHeadTimeSize  (G4double);
299   void SetDisplayHeadTimeRed   (G4double);        285   void SetDisplayHeadTimeRed   (G4double);
300   void SetDisplayHeadTimeGreen (G4double);        286   void SetDisplayHeadTimeGreen (G4double);
301   void SetDisplayHeadTimeBlue  (G4double);        287   void SetDisplayHeadTimeBlue  (G4double);
302   void SetDisplayLightFront    (G4bool);          288   void SetDisplayLightFront    (G4bool);
303   void SetDisplayLightFrontX   (G4double);        289   void SetDisplayLightFrontX   (G4double);
304   void SetDisplayLightFrontY   (G4double);        290   void SetDisplayLightFrontY   (G4double);
305   void SetDisplayLightFrontZ   (G4double);        291   void SetDisplayLightFrontZ   (G4double);
306   void SetDisplayLightFrontT   (G4double);        292   void SetDisplayLightFrontT   (G4double);
307   void SetDisplayLightFrontRed (G4double);        293   void SetDisplayLightFrontRed (G4double);
308   void SetDisplayLightFrontGreen (G4double);      294   void SetDisplayLightFrontGreen (G4double);
309   void SetDisplayLightFrontBlue (G4double);       295   void SetDisplayLightFrontBlue (G4double);
310   void SetSpecialMeshRendering (G4bool);       << 
311   void SetSpecialMeshRenderingOption (SMROptio << 
312   void SetSpecialMeshVolumes   (const std::vec << 
313                                                   296 
314   // Command dumping functions.                   297   // Command dumping functions.
315   // For camera commands we need to provide th    298   // For camera commands we need to provide the standard target point from
316   // the current scene.                           299   // the current scene.
317   G4String CameraAndLightingCommands(const G4P    300   G4String CameraAndLightingCommands(const G4Point3D standardTargetPoint) const;
318   G4String DrawingStyleCommands  () const;        301   G4String DrawingStyleCommands  () const;
319   G4String SceneModifyingCommands() const;        302   G4String SceneModifyingCommands() const;
320   G4String TouchableCommands     () const;        303   G4String TouchableCommands     () const;
321   G4String TimeWindowCommands    () const;        304   G4String TimeWindowCommands    () const;
322                                                   305 
323   // Other functions.                             306   // Other functions.
324   void PrintDifferences (const G4ViewParameter    307   void PrintDifferences (const G4ViewParameters& v) const;
325                                                   308 
326   // Interpolation                                309   // Interpolation
327   // Returns a null pointer when no more to be    310   // Returns a null pointer when no more to be done.  For example:
328   // do {                                         311   // do {
329   //   G4ViewParameters* vp =                     312   //   G4ViewParameters* vp =
330   //   G4ViewParameters::CatmullRomCubicSpline    313   //   G4ViewParameters::CatmullRomCubicSplineInterpolation(viewVector,nInterpolationPoints);
331   //   if (!vp) break;                            314   //   if (!vp) break;
332   //     ...                                      315   //     ...
333   // } while (true);                              316   // } while (true);
334   // Assumes equal intervals                      317   // Assumes equal intervals
335   static G4ViewParameters* CatmullRomCubicSpli    318   static G4ViewParameters* CatmullRomCubicSplineInterpolation
336   (const std::vector<G4ViewParameters>& views,    319   (const std::vector<G4ViewParameters>& views,
337    G4int nInterpolationPoints = 50);  // No of    320    G4int nInterpolationPoints = 50);  // No of interpolations points per interval
338                                                   321 
339 private:                                          322 private:
340                                                   323   
341   G4int ParseGeometry ( const char *string, G4    324   G4int ParseGeometry ( const char *string, G4int *x, G4int *y, unsigned int *width, unsigned int *height);
342   G4int ReadInteger(char *string, char **NextS    325   G4int ReadInteger(char *string, char **NextString);
343                                                   326 
344   DrawingStyle fDrawingStyle;    // Drawing st    327   DrawingStyle fDrawingStyle;    // Drawing style.
345   G4int        fNumberOfCloudPoints; // For dr    328   G4int        fNumberOfCloudPoints; // For drawing in cloud style.
346                                      // <= 0 m    329                                      // <= 0 means use viewer default.
347   G4bool       fAuxEdgeVisible;  // Auxiliary     330   G4bool       fAuxEdgeVisible;  // Auxiliary edge visibility.
348   G4bool       fCulling;         // Culling re    331   G4bool       fCulling;         // Culling requested.
349   G4bool       fCullInvisible;   // Cull (don'    332   G4bool       fCullInvisible;   // Cull (don't Draw) invisible objects.
350   G4bool       fDensityCulling;  // Density cu    333   G4bool       fDensityCulling;  // Density culling requested.  If so...
351   G4double     fVisibleDensity;  // ...density    334   G4double     fVisibleDensity;  // ...density lower than this not drawn.
352   G4bool       fCullCovered;     // Cull daugh    335   G4bool       fCullCovered;     // Cull daughters covered by opaque mothers.
353   G4int        fCBDAlgorithmNumber; // Colour     336   G4int        fCBDAlgorithmNumber; // Colour by density algorithm number.
354   std::vector<G4double> fCBDParameters; // Col    337   std::vector<G4double> fCBDParameters; // Colour by density parameters.
355   G4bool       fSection;         // Section dr    338   G4bool       fSection;         // Section drawing requested (DCUT in GEANT3).
356   G4Plane3D    fSectionPlane;    // Cut plane     339   G4Plane3D    fSectionPlane;    // Cut plane for section drawing (DCUT).
357   CutawayMode  fCutawayMode;     // Cutaway mo    340   CutawayMode  fCutawayMode;     // Cutaway mode.
358   G4Planes     fCutawayPlanes;   // Set of pla    341   G4Planes     fCutawayPlanes;   // Set of planes used for cutaway.
359   G4double     fExplodeFactor;   // Explode al    342   G4double     fExplodeFactor;   // Explode along radius by this factor...
360   G4Point3D    fExplodeCentre;   // ...about t    343   G4Point3D    fExplodeCentre;   // ...about this centre.
361   G4int        fNoOfSides;       // ...if poly    344   G4int        fNoOfSides;       // ...if polygon approximates circle.
362   G4Vector3D   fViewpointDirection;               345   G4Vector3D   fViewpointDirection;
363   G4Vector3D   fUpVector;        // Up vector.    346   G4Vector3D   fUpVector;        // Up vector.  (Warning: MUST NOT be parallel
364                                  // to fViewpo    347                                  // to fViewpointDirection!)
365   G4double     fFieldHalfAngle;  // Radius / c    348   G4double     fFieldHalfAngle;  // Radius / camara distance, 0 for parallel.
366   G4double     fZoomFactor;      // Magnificat    349   G4double     fZoomFactor;      // Magnification relative to Standard View.
367   G4Vector3D   fScaleFactor;     // (Non-unifo    350   G4Vector3D   fScaleFactor;     // (Non-uniform) scale/magnification factor.
368   G4Point3D    fCurrentTargetPoint;  // Relati    351   G4Point3D    fCurrentTargetPoint;  // Relative to standard target point.
369   G4double     fDolly;           // Distance t    352   G4double     fDolly;           // Distance towards current target point.
370   G4bool       fLightsMoveWithCamera;             353   G4bool       fLightsMoveWithCamera;
371   G4Vector3D   fRelativeLightpointDirection;      354   G4Vector3D   fRelativeLightpointDirection;
372   // i.e., rel. to object or camera accoding t    355   // i.e., rel. to object or camera accoding to G4bool fLightsMoveWithCamera.
373   G4Vector3D   fActualLightpointDirection;        356   G4Vector3D   fActualLightpointDirection;
374   G4VisAttributes fDefaultVisAttributes;          357   G4VisAttributes fDefaultVisAttributes;
375   G4VisAttributes fDefaultTextVisAttributes;      358   G4VisAttributes fDefaultTextVisAttributes;
376   G4VMarker    fDefaultMarker;                    359   G4VMarker    fDefaultMarker;
377   G4double     fGlobalMarkerScale;                360   G4double     fGlobalMarkerScale;
378   G4double     fGlobalLineWidthScale;             361   G4double     fGlobalLineWidthScale;
379   G4bool       fMarkerNotHidden;                  362   G4bool       fMarkerNotHidden;
380   // True if transients are to be drawn and no    363   // True if transients are to be drawn and not hidden by
381   // hidden-line-hidden-surface removal algori    364   // hidden-line-hidden-surface removal algorithms, e.g., z-buffer
382   // testing; false if they are to be hidden-l    365   // testing; false if they are to be hidden-line-hidden-surface
383   // removed.                                     366   // removed.
384   G4int        fWindowSizeHintX; // Size hints    367   G4int        fWindowSizeHintX; // Size hints for pixel-based window systems.
385   G4int        fWindowSizeHintY;                  368   G4int        fWindowSizeHintY;
386   G4int        fWindowLocationHintX; // Locati    369   G4int        fWindowLocationHintX; // Location hints for pixel-based window systems.
387   G4int        fWindowLocationHintY;              370   G4int        fWindowLocationHintY;
388   G4bool       fWindowLocationHintXNegative; /    371   G4bool       fWindowLocationHintXNegative; //  Reference of location hints for pixel-based window systems.
389   G4bool       fWindowLocationHintYNegative;      372   G4bool       fWindowLocationHintYNegative;
390   G4String     fXGeometryString; // If non-nul    373   G4String     fXGeometryString; // If non-null, geometry string for X Windows.
391   G4int        fGeometryMask;    // Correspond    374   G4int        fGeometryMask;    // Corresponding mask.
392   G4bool       fAutoRefresh;     // ...after c    375   G4bool       fAutoRefresh;     // ...after change of view parameters.
393   G4Colour     fBackgroundColour;                 376   G4Colour     fBackgroundColour;
394   G4bool       fPicking;         // Request pi    377   G4bool       fPicking;         // Request picking.
395   RotationStyle fRotationStyle;  // Rotation s    378   RotationStyle fRotationStyle;  // Rotation style.
396   std::vector<G4ModelingParameters::VisAttribu    379   std::vector<G4ModelingParameters::VisAttributesModifier> fVisAttributesModifiers;
397   G4double     fStartTime, fEndTime;  // Time     380   G4double     fStartTime, fEndTime;  // Time range (e.g., for trajectory steps).
398   G4double     fFadeFactor;  // 0: no fade; 1:    381   G4double     fFadeFactor;  // 0: no fade; 1: maximum fade with time within range.
399   G4bool       fDisplayHeadTime;  // Display h    382   G4bool       fDisplayHeadTime;  // Display head time (fEndTime) in 2D text.
400   G4double     fDisplayHeadTimeX, fDisplayHead    383   G4double     fDisplayHeadTimeX, fDisplayHeadTimeY;  // 2D screen coords.
401   G4double     fDisplayHeadTimeSize;  // Scree    384   G4double     fDisplayHeadTimeSize;  // Screen size.
402   G4double     fDisplayHeadTimeRed, fDisplayHe    385   G4double     fDisplayHeadTimeRed, fDisplayHeadTimeGreen, fDisplayHeadTimeBlue;
403   G4bool       fDisplayLightFront;// Display l    386   G4bool       fDisplayLightFront;// Display light front at head time originating at
404   G4double     fDisplayLightFrontX, fDisplayLi    387   G4double     fDisplayLightFrontX, fDisplayLightFrontY, fDisplayLightFrontZ,
405                fDisplayLightFrontT;               388                fDisplayLightFrontT;
406   G4double     fDisplayLightFrontRed, fDisplay    389   G4double     fDisplayLightFrontRed, fDisplayLightFrontGreen, fDisplayLightFrontBlue;
407   G4bool       fSpecialMeshRendering;  // Requ << 
408   SMROption    fSpecialMeshRenderingOption;  / << 
409   std::vector<G4ModelingParameters::PVNameCopy << 
410                                                   390 
411   enum { // Constants for geometry mask in Par    391   enum { // Constants for geometry mask in ParseGeometry and related functions.
412     fNoValue     = 0,                             392     fNoValue     = 0,
413     fXValue      = 0x0001,                        393     fXValue      = 0x0001,
414     fYValue      = 0x0002,                        394     fYValue      = 0x0002,
415     fWidthValue  = 0x0004,                        395     fWidthValue  = 0x0004,
416     fHeightValue = 0x0008,                        396     fHeightValue = 0x0008,
417     fAllValues   = 0x000F,                        397     fAllValues   = 0x000F,
418     fXNegative   = 0x0010,                        398     fXNegative   = 0x0010,
419     fYNegative   = 0x0020                         399     fYNegative   = 0x0020
420   };                                              400   };
421 };                                                401 };
422                                                   402 
423 #include "G4ViewParameters.icc"                   403 #include "G4ViewParameters.icc"
424                                                   404 
425 #endif                                            405 #endif
426                                                   406