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 // 00029 // 00030 // John Allison 30th October 1996 00031 00032 // Class Description: 00033 // Base class for all things visible, i.e., which have Vis Attributes. 00034 // 00035 // Note: a null pointer implies no attributes. Under those circumstances 00036 // the visualization system is free to choose some. 00037 // Class Description - End: 00038 00039 00040 #ifndef G4VISIBLE_HH 00041 #define G4VISIBLE_HH 00042 00043 #include "globals.hh" 00044 #include <iostream> 00045 00046 class G4VisAttributes; 00047 00048 class G4Visible { 00049 00050 friend std::ostream& operator << (std::ostream& os, const G4Visible& v); 00051 00052 public: // With description 00053 00054 G4Visible (); 00055 G4Visible (const G4Visible&); 00056 G4Visible (const G4VisAttributes*); 00057 00058 virtual ~G4Visible (); 00059 00060 G4Visible& operator= (const G4Visible&); 00061 00062 G4bool operator != (const G4Visible& right) const; 00063 00064 const G4VisAttributes* GetVisAttributes () const; 00065 00066 void SetVisAttributes (const G4VisAttributes*); 00067 // The G4VisAttributes object is not stored in a G4Visible; only a 00068 // reference, a const pointer, is kept. Therefore the 00069 // G4VisAttributes object to which it refers must have a life long 00070 // enough to satisfy all uses of the G4Visible object. E.g., if the 00071 // G4Visible object is created on the heap (using `new') then the 00072 // associated G4VisAttributes object would normally also be created 00073 // on the heap and managed in the same way. 00074 00075 void SetVisAttributes (const G4VisAttributes&); 00076 // A copy of the G4VisAttributes object is created on the heap to 00077 // ensure a long life. 00078 00079 protected: 00080 00081 const G4VisAttributes* fpVisAttributes; 00082 G4bool fAllocatedVisAttributes; 00083 }; 00084 00085 #include "G4Visible.icc" 00086 00087 #endif