Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4VMarker.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 // 
0029 // G4VMarker - base class for markers - circles, squares, etc.
0030 // John Allison  17/11/96.
0031 
0032 // Class Description:
0033 // G4VMarkers are 2-dimensional G4VVisPrims with the special
0034 // properties (a) of always facing the camera and (b) of having the
0035 // possibility of a size defined in screen units (pixels) or paper
0036 // units (points - there are 72 points per inch).  The convention is
0037 // that if a world size is not specified, then the marker will be
0038 // drawn to the given screen size or paper size independent of the
0039 // viewing transformation in effect.
0040 //
0041 // "Size" means "overall size", e.g., diameter of circle, side of
0042 // square, height of text (but diameter and radius access functions
0043 // are defined to avoid ambiguity).
0044 //
0045 // So the user who constructs the marker decides whether it should be
0046 // drawn to a given size in world coordinates by setting the world
0047 // size.  Alternatively, the user can set the screen size (internally,
0048 // the world size is set to zero) and the marker is drawn to its
0049 // screen size.  Finally, the user may decide not to set any size; in
0050 // that case, it is drawn according to the sizes specified in the
0051 // default marker specified in G4ViewParameters.
0052 //
0053 // Also in G4ViewParameters is a "global marker scale" which is a
0054 // factor by which all marker sizes are multiplied before drawing.
0055 //
0056 // Thus the graphics system driver scene handler code might look like:
0057 //
0058 // void G4XXXGraphicsSceneHandler::AddPrimitive (const G4Circle& circle) {
0059 //   G4bool hidden = !(fpView -> GetViewParameters().IsMarkerNotHidden());
0060 //   const G4Colour&     colour = GetColour (circle);  
0061 //                                   // Base class GetColour.
0062 //   G4VMarker::FillStyle style = circle.GetFillStyle();
0063 //   const G4Point3D&    centre = circle.GetPosition();
0064 //   MarkerSizeType sizeType;
0065 //   G4double size = GetMarkerSize (circle, sizeType);
0066 //   switch (sizeType) {
0067 //   default:
0068 //   case screen:
0069 //     // Draw in screen coordinates.
0070 //     // ...
0071 //     break;
0072 //   case world:
0073 //     // Draw in world coordinates.
0074 //     // ...
0075 //     break;
0076 //   }
0077 // }
0078 // Class Description - End:
0079 
0080 
0081 #ifndef G4VMARKER_HH
0082 #define G4VMARKER_HH
0083 
0084 #include "globals.hh"
0085 #include "G4Visible.hh"
0086 #include "G4Point3D.hh"
0087 #include "G4Colour.hh"
0088 #include "G4Color.hh"
0089 
0090 class G4VMarker: public G4Visible {
0091 
0092   friend std::ostream& operator << (std::ostream& os, const G4VMarker&);
0093 
0094 public: // With description
0095 
0096   enum FillStyle {noFill, hashed, filled};
0097   enum SizeType {none, world, screen};
0098 
0099   //////////////////////////////////////////////////////
0100   // Constructors...
0101   G4VMarker ();
0102   G4VMarker (const G4VMarker&) = default;
0103   G4VMarker (G4VMarker&& ) = default;
0104   G4VMarker (const G4Point3D& position);
0105 
0106   //////////////////////////////////////////////////////
0107   // Destructor...
0108   ~G4VMarker () override;
0109 
0110   //////////////////////////////////////////////////////
0111   // Assignment...
0112   G4VMarker& operator = (const G4VMarker&) = default;
0113   G4VMarker& operator = (G4VMarker&&) = default;
0114 
0115   //////////////////////////////////////////////////////
0116   // Logical...
0117   G4bool operator != (const G4VMarker&) const;
0118   G4bool operator == (const G4VMarker&) const;
0119 
0120   /////////////////////////////////////////////////////
0121   // Get functions...
0122   G4Point3D GetPosition       () const;
0123   SizeType  GetSizeType       () const;
0124   G4double  GetWorldSize      () const;
0125   G4double  GetWorldDiameter  () const;
0126   G4double  GetWorldRadius    () const;
0127   G4double  GetScreenSize     () const;
0128   G4double  GetScreenDiameter () const;
0129   G4double  GetScreenRadius   () const;
0130   FillStyle GetFillStyle      () const;
0131 
0132   /////////////////////////////////////////////////////
0133   // Set functions...
0134   void SetPosition       (const G4Point3D&);
0135   void SetSize           (SizeType, G4double);
0136   void SetDiameter       (SizeType, G4double);
0137   void SetRadius         (SizeType, G4double);
0138   void SetWorldSize      (G4double);
0139   void SetWorldDiameter  (G4double);
0140   void SetWorldRadius    (G4double);
0141   void SetScreenSize     (G4double);
0142   void SetScreenDiameter (G4double);
0143   void SetScreenRadius   (G4double);
0144   void SetFillStyle      (FillStyle);
0145 
0146 private:
0147   G4Point3D fPosition;
0148   G4double  fWorldSize;   // Default 0. means use screen size.
0149   G4double  fScreenSize;  // Default 0. means use global default.
0150   FillStyle fFillStyle;
0151 };
0152 
0153 #include "G4VMarker.icc"
0154 
0155 #endif