G4VGraphicsScene.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 // John Allison  19th July 1996
00029 //
00030 // Class Description:
00031 // Abstract interface class for a graphics scene handler.
00032 // It is a minimal scene handler for the GEANT4 kernel.
00033 // See G4VSceneHandler for a fuller description.  G4VSceneHandler is
00034 // the full abstract interface to graphics systems.
00035 
00036 #ifndef G4VGRAPHICSSCENE_HH
00037 #define G4VGRAPHICSSCENE_HH
00038 
00039 #include "globals.hh"
00040 #include "G4Transform3D.hh"
00041 
00042 class G4VisAttributes;
00043 class G4VSolid;
00044 class G4Box;
00045 class G4Cons;
00046 class G4Tubs;
00047 class G4Trd;
00048 class G4Trap;
00049 class G4Sphere;
00050 class G4Ellipsoid;
00051 class G4Para;
00052 class G4Torus;
00053 class G4PhysicalVolumeModel;
00054 class G4Polycone;
00055 class G4Polyhedra;
00056 class G4VTrajectory;
00057 class G4VHit;
00058 class G4VDigi;
00059 template <typename T> class G4THitsMap;
00060 class G4Polyline;
00061 class G4Scale;
00062 class G4Text;
00063 class G4Circle;
00064 class G4Square;
00065 class G4Polymarker;
00066 class G4Polyhedron;
00067 class G4NURBS;
00068 
00069 class G4VGraphicsScene {
00070 
00071 public: // With description
00072 
00073   G4VGraphicsScene();
00074   virtual ~G4VGraphicsScene();
00075 
00077   // Methods for adding solids to the scene handler.  They
00078   // must always be called in the triplet PreAddSolid, AddSolid and
00079   // PostAddSolid.  The transformation and visualization attributes
00080   // must be set by the call to PreAddSolid.  A possible default
00081   // implementation is to request the solid to provide a G4Polyhedron
00082   // or similar primitive - see, for example, G4VSceneHandler in the
00083   // Visualization Category.
00084 
00085   virtual void PreAddSolid (const G4Transform3D& objectTransformation,
00086                             const G4VisAttributes& visAttribs) = 0;
00087   // objectTransformation is the transformation in the world
00088   // coordinate system of the object about to be added, and
00089   // visAttribs is its visualization attributes.
00090 
00091   virtual void PostAddSolid () = 0;
00092 
00093   virtual void AddSolid (const G4Box&)       = 0;
00094   virtual void AddSolid (const G4Cons&)      = 0;
00095   virtual void AddSolid (const G4Tubs&)      = 0;
00096   virtual void AddSolid (const G4Trd&)       = 0;
00097   virtual void AddSolid (const G4Trap&)      = 0;
00098   virtual void AddSolid (const G4Sphere&)    = 0;
00099   virtual void AddSolid (const G4Para&)      = 0;
00100   virtual void AddSolid (const G4Torus&)     = 0;
00101   virtual void AddSolid (const G4Polycone&)  = 0;
00102   virtual void AddSolid (const G4Polyhedra&) = 0;
00103   virtual void AddSolid (const G4VSolid&)    = 0;  // For solids not above.
00104 
00106   // Methods for adding "compound" GEANT4 objects to the scene
00107   // handler.  These methods may either (a) invoke "user code" that
00108   // uses the "user interface", G4VVisManager (see, for example,
00109   // G4VSceneHandler in the Visualization Category, which for
00110   // trajectories uses G4VTrajectory::DrawTrajectory, via
00111   // G4TrajectoriesModel in the Modeling Category) or (b) invoke
00112   // AddPrimitives below (between calls to Begin/EndPrimitives) or (c)
00113   // use graphics-system-specific code or (d) any combination of the
00114   // above.
00115 
00116   virtual void AddCompound (const G4VTrajectory&)        = 0;
00117   virtual void AddCompound (const G4VHit&)               = 0;
00118   virtual void AddCompound (const G4VDigi&)              = 0;
00119   virtual void AddCompound (const G4THitsMap<G4double>&) = 0;
00120 
00122   // Methods for adding graphics primitives to the scene handler.  A
00123   // sequence of calls to AddPrimitive must be sandwiched between
00124   // calls to BeginPrimitives and EndPrimitives.  A sequence is any
00125   // number of calls that have the same transformation.
00126 
00127   virtual void BeginPrimitives
00128   (const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
00129   // objectTransformation is the transformation in the world
00130   // coordinate system of the object about to be added.
00131 
00132   virtual void EndPrimitives () = 0;
00133 
00134   virtual void BeginPrimitives2D
00135   (const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
00136 
00137   virtual void EndPrimitives2D () = 0;
00138   // The x,y coordinates of the primitives passed to AddPrimitive are
00139   // intrepreted as screen coordinates, -1 < x,y < 1.  The
00140   // z-coordinate is ignored.
00141 
00142   virtual void AddPrimitive (const G4Polyline&)   = 0;
00143   virtual void AddPrimitive (const G4Scale&)      = 0;
00144   virtual void AddPrimitive (const G4Text&)       = 0;
00145   virtual void AddPrimitive (const G4Circle&)     = 0;
00146   virtual void AddPrimitive (const G4Square&)     = 0;
00147   virtual void AddPrimitive (const G4Polymarker&) = 0;
00148   virtual void AddPrimitive (const G4Polyhedron&) = 0;
00149   virtual void AddPrimitive (const G4NURBS&)      = 0;
00150 
00151 };
00152 
00153 #endif

Generated on Mon May 27 17:50:13 2013 for Geant4 by  doxygen 1.4.7