Ignore:
Timestamp:
Jan 8, 2010, 11:56:51 AM (14 years ago)
Author:
garnier
Message:

update geant4.9.3 tag

Location:
trunk/source/visualization
Files:
37 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/GNUmakefile

    r1140 r1228  
    1 # $Id: GNUmakefile,v 1.24 2009/10/12 10:28:38 akimura Exp $
     1# $Id: GNUmakefile,v 1.26 2009/11/17 11:31:20 gcosmo Exp $
    22# -----------------------------------------------------------------------
    33# GNUmakefile for visualization and modeling.  John Allison, 5/7/95.
     
    3030# CPPFLAGS += -DG4DEBUG_VIS_MANAGEMENT
    3131
    32 # Libraries which can be used without external packages or libraries...
    3332ifdef G4VIS_BUILD
     33# Drivers that can be used without external libraries...
    3434  SUBDIRS += management
    3535  SUBLIBS += G4vis_management
     
    4848  SUBDIRS += gMocren
    4949  SUBLIBS += G4GMocren
    50 
     50# Drivers needing external libraries...
    5151ifdef G4VIS_BUILD_OPENGL_DRIVER
    5252  SUBDIRS += externals/gl2ps
    5353  SUBDIRS += OpenGL
    5454  SUBLIBS += G4OpenGL
     55  SUBLIBS += G4gl2ps
    5556endif
    5657ifdef G4VIS_BUILD_OI_DRIVER
     
    5859  SUBDIRS += OpenInventor
    5960  SUBLIBS += G4OpenInventor
     61  SUBLIBS += G4gl2ps
    6062endif
    6163endif #G4VIS_BUILD
  • trunk/source/visualization/HepRep/History

    r1140 r1228  
    1 .$Id: History,v 1.131 2009/10/21 15:13:36 allison Exp $
     1.$Id: History,v 1.132 2009/11/23 05:42:28 perl Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/HepRep sub-category
    2121--------------------------------------------------
     22
     2322nd November 2009  Joseph Perl  (vis-HepRep-V09-02-03)
     24- Changed messenger to a singleton.
     25- Added messenger commands to HepRepFile.
     26- Render G4Tubs as polygons if G4Tubs is not at a standard angle.
    2227
    232821st October 2009  John Allison  (vis-HepRep-V09-02-02 coworks greps-V09-02-02)
  • trunk/source/visualization/HepRep/include/G4HepRep.hh

    r944 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRep.hh,v 1.17 2006/06/29 21:17:04 gunter Exp $
     26// $Id: G4HepRep.hh,v 1.18 2009/11/23 05:42:28 perl Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    3636//G4
    3737#include "G4VGraphicsSystem.hh"
    38 
    39 class G4HepRepMessenger;
    4038
    4139class G4HepRep: public G4VGraphicsSystem {
     
    5250        G4VSceneHandler* sceneHandler;
    5351        G4VViewer* viewer;
    54         G4HepRepMessenger* messenger;       
    5552};
    5653
  • trunk/source/visualization/HepRep/include/G4HepRepMessenger.hh

    r944 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRepMessenger.hh,v 1.7 2006/06/29 21:17:14 gunter Exp $
     26// $Id: G4HepRepMessenger.hh,v 1.8 2009/11/23 05:42:28 perl Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4040   
    4141    public:
    42         G4HepRepMessenger();
     42                static G4HepRepMessenger* GetInstance();  // Singleton constructor.
    4343        virtual ~G4HepRepMessenger();
    4444
     
    4646        virtual void SetNewValue(G4UIcommand * command, G4String newValue);
    4747       
     48        // Used by HepRepFile
     49        virtual G4String getFileDir();
     50        virtual G4String getFileName();
     51        virtual G4bool getOverwrite();
     52        virtual G4bool getCullInvisibles();
     53       
     54        // Used by HepRepXML
    4855        virtual G4String getEventNumberSuffix();
    4956        virtual G4bool appendGeometry();
     
    5360
    5461    private:           
     62                G4HepRepMessenger();  // Private constructor.
     63                static G4HepRepMessenger* fpInstance;
     64       
    5565        G4UIdirectory* heprepDirectory;
     66       
     67                G4String fileDir;
     68                G4UIcmdWithAString* setFileDirCommand;
     69       
     70                G4String fileName;
     71                G4UIcmdWithAString* setFileNameCommand;
     72       
     73                G4bool overwrite;
     74                G4UIcmdWithABool* setOverwriteCommand;
     75       
     76                G4bool cullInvisibles;
     77                G4UIcmdWithABool* setCullInvisiblesCommand;
    5678       
    5779        G4String suffix;
     
    6688        G4bool solids;
    6789        G4UIcmdWithABool* useSolidsCommand;
    68 
     90       
    6991        G4bool invisibles;
    7092        G4UIcmdWithABool* writeInvisiblesCommand;
  • trunk/source/visualization/HepRep/include/G4HepRepSceneHandler.hh

    r1140 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRepSceneHandler.hh,v 1.43 2009/10/21 15:08:35 allison Exp $
     26// $Id: G4HepRepSceneHandler.hh,v 1.44 2009/11/23 05:42:28 perl Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    6363#include "G4PhysicalVolumeModel.hh"
    6464
    65 #include "G4HepRepMessenger.hh"
    66 
    6765class G4HepRepSceneHandler: public G4VSceneHandler {
    6866
    6967    public:
    70         G4HepRepSceneHandler (G4VGraphicsSystem& system, G4HepRepMessenger& messenger, const G4String& name = "");
     68        G4HepRepSceneHandler (G4VGraphicsSystem& system, const G4String& name = "");
    7169        virtual ~G4HepRepSceneHandler ();
    7270
     
    187185
    188186        // initialized Member Variables
    189         G4HepRepMessenger& messenger;
    190187        G4String geometryLayer, eventLayer, calHitLayer;
    191188        G4String trajectoryLayer, hitLayer;
  • trunk/source/visualization/HepRep/include/G4HepRepViewer.hh

    r944 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRepViewer.hh,v 1.18 2006/06/29 21:17:18 gunter Exp $
     26// $Id: G4HepRepViewer.hh,v 1.19 2009/11/23 05:42:28 perl Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4141#include "G4VViewer.hh"
    4242
    43 #include "G4HepRepMessenger.hh"
    44 
    4543class G4HepRepViewer: public G4VViewer {
    4644    public:
    47         G4HepRepViewer (G4VSceneHandler& scene, G4HepRepMessenger& messenger, const G4String& name = "");
     45        G4HepRepViewer (G4VSceneHandler& scene, const G4String& name = "");
    4846        virtual ~G4HepRepViewer ();
    4947        void SetView ();
     
    5755    private:
    5856        bool geometryIncluded;
    59         G4HepRepMessenger& messenger;
    6057};
    6158
  • trunk/source/visualization/HepRep/src/G4HepRep.cc

    r944 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRep.cc,v 1.22 2006/06/29 21:17:20 gunter Exp $
     26// $Id: G4HepRep.cc,v 1.23 2009/11/23 05:42:28 perl Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    5454          sceneHandler(NULL),
    5555          viewer(NULL) {
    56     messenger = new G4HepRepMessenger();
     56                G4HepRepMessenger::GetInstance();
    5757}
    5858
    5959G4HepRep::~G4HepRep () {
    60     delete messenger;
    6160}
    6261
     
    6665        return NULL;
    6766    }
    68     sceneHandler = new G4HepRepSceneHandler (*this, *messenger, name);
     67    sceneHandler = new G4HepRepSceneHandler (*this, name);
    6968    return sceneHandler;
    7069}
     
    7574        return NULL;
    7675    }
    77     viewer  = new G4HepRepViewer ((G4HepRepSceneHandler&)scene, *messenger, name);
     76    viewer  = new G4HepRepViewer ((G4HepRepSceneHandler&)scene, name);
    7877    return viewer;
    7978}
  • trunk/source/visualization/HepRep/src/G4HepRepFile.cc

    r944 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRepFile.cc,v 1.11 2007/05/22 17:05:26 allison Exp $
     26// $Id: G4HepRepFile.cc,v 1.12 2009/11/23 05:42:28 perl Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    3838#include "G4HepRepFileSceneHandler.hh"
    3939#include "G4HepRepFileViewer.hh"
     40#include "G4HepRepMessenger.hh"
    4041
    4142static G4HepRepFileXMLWriter* hepRepXMLWriter;
     
    4647                    "A HepRep (format 1) ascii file driver",
    4748                    G4VGraphicsSystem::threeD) {
     49                G4HepRepMessenger::GetInstance();
    4850        hepRepXMLWriter = new G4HepRepFileXMLWriter();
    4951}
  • trunk/source/visualization/HepRep/src/G4HepRepFileSceneHandler.cc

    r944 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRepFileSceneHandler.cc,v 1.66 2008/01/04 22:11:31 allison Exp $
     26// $Id: G4HepRepFileSceneHandler.cc,v 1.68 2009/12/16 17:51:21 gunter Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    3434#include "G4HepRepFileSceneHandler.hh"
    3535#include "G4HepRepFile.hh"
     36#include "G4HepRepMessenger.hh"
     37#include "G4UIcommand.hh"
    3638
    3739#include "G4Version.hh"
     
    7173        hepRepXMLWriter = ((G4HepRepFile*)(&system))->GetHepRepXMLWriter();
    7274        fileCounter = 0;
    73         int length;
    74        
    75         if (getenv("G4HEPREPFILE_DIR") == NULL)
    76                 strcpy(fileDir, "");
    77         else
    78                 length = sprintf (fileDir, "%s%s", getenv("G4HEPREPFILE_DIR"),"/");
    79        
    80         if (getenv("G4HEPREPFILE_NAME") == NULL)
    81                 strcpy(fileName, "G4Data");
    82         else
    83                 strcpy(fileName, getenv("G4HEPREPFILE_NAME"));
    84        
    85         if (getenv("G4HEPREPFILE_OVERWRITE") == NULL)
    86                 fileOverwrite = false;
    87         else
    88                 fileOverwrite = strcmp(getenv("G4HEPREPFILE_OVERWRITE"),"0");
    89        
    90         if (getenv("G4HEPREPFILE_CULL") == NULL)
    91                 cullInvisibleObjects = false;
    92         else
    93                 cullInvisibleObjects = strcmp(getenv("G4HEPREPFILE_CULL"),"0");
    9475       
    9576        inPrimitives2D = false;
     
    180161        AddHepRepInstance("Prism", NULL);
    181162       
    182         if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     163        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     164       
     165        if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    183166                return;
    184167       
     
    243226                AddHepRepInstance("Cylinder", NULL);
    244227               
    245                 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     228                G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     229               
     230                if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    246231                        return;
    247232               
     
    278263#endif
    279264       
     265        // HepRApp does not correctly represent the end faces of cylinders at
     266        // non-standard angles, let the base class convert these solids to polygons.   
     267        CLHEP::HepRotation r = fpObjectTransformation->getRotation();   
     268        G4bool linedUpWithAnAxis = (std::fabs(r.phiX())<=.001 || 
     269                                                                std::fabs(r.phiY())<=.001 ||
     270                                                                std::fabs(r.phiZ())<=.001 ||
     271                                                                std::fabs(r.phiX()-pi)<=.001 ||
     272                                                                std::fabs(r.phiY()-pi)<=.001 ||
     273                                                                std::fabs(r.phiZ()-pi)<=.001); 
     274        //G4cout << "Angle X:" << r.phiX() << ", Angle Y:" << r.phiY() << ", Angle Z:" << r.phiZ() << G4endl;
     275        //G4cout << "linedUpWithAnAxis:" << linedUpWithAnAxis << G4endl;
     276       
    280277        // HepRep does not have a primitive for a cut cylinder,
    281278        // so if this cylinder is cut, let the base class convert this
    282279        // solid to polygons.
    283         if (tubs.GetDeltaPhiAngle() < twopi) {
     280        if (tubs.GetDeltaPhiAngle() < twopi || !linedUpWithAnAxis)
     281        {
    284282                G4VSceneHandler::AddSolid(tubs);  // Invoke default action.
    285283        } else {
     
    294292                AddHepRepInstance("Cylinder", NULL);
    295293               
    296                 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     294                G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     295               
     296                if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    297297                        return;
    298298               
     
    340340        AddHepRepInstance("Prism", NULL);
    341341       
    342         if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     342        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     343       
     344        if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    343345                return;
    344346       
     
    10041006#endif
    10051007       
    1006         if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     1008        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1009       
     1010        if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    10071011                return;
    10081012       
     
    10421046#endif
    10431047       
    1044         if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     1048        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1049       
     1050        if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    10451051                return;
    10461052       
     
    11441150#endif
    11451151       
    1146         if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     1152        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1153       
     1154        if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    11471155                return;
    11481156       
     
    11881196#endif
    11891197       
    1190         if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     1198        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1199       
     1200        if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    11911201                return;
    11921202       
     
    12311241#endif
    12321242       
    1233         if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     1243        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1244       
     1245        if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    12341246                return;
    12351247       
     
    14301442                hepRepXMLWriter->addInstance();
    14311443               
    1432                 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects)
     1444                G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1445               
     1446                if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles())
    14331447                        return;
    14341448               
     
    15121526       
    15131527        if (!hepRepXMLWriter->isOpen) {
    1514                 char* newFileSpec;
    1515                 newFileSpec = new char [256];
    1516                 int length;
    1517                
    1518                 if (fileOverwrite)
    1519                         length = sprintf (newFileSpec, "%s%s%s",fileDir,fileName,".heprep");
    1520                 else
    1521                         length = sprintf (newFileSpec, "%s%s%d%s",fileDir,fileName,fileCounter,".heprep");
     1528                G4String newFileSpec;
     1529
     1530                G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1531               
     1532                if (messenger->getOverwrite()) {
     1533                        newFileSpec = messenger->getFileDir()+messenger->getFileName()+".heprep";
     1534                } else {
     1535                        newFileSpec = messenger->getFileDir()+messenger->getFileName()+G4UIcommand::ConvertToString(fileCounter)+".heprep";
     1536                }
     1537               
    15221538                G4cout << "HepRepFile writing to " << newFileSpec << G4endl;
    15231539               
    15241540                hepRepXMLWriter->open(newFileSpec);
    1525                 fileCounter++;
     1541               
     1542                if (!messenger->getOverwrite())
     1543                        fileCounter++;
    15261544               
    15271545                hepRepXMLWriter->addAttDef("Generator", "HepRep Data Generator", "Physics","");
  • trunk/source/visualization/HepRep/src/G4HepRepMessenger.cc

    r944 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRepMessenger.cc,v 1.10 2006/06/29 21:17:30 gunter Exp $
     26// $Id: G4HepRepMessenger.cc,v 1.11 2009/11/23 05:42:28 perl Exp $
    2727// GEANT4 tag $Name:  $
    2828//
    2929#include "G4HepRepMessenger.hh"
    3030
     31G4HepRepMessenger*
     32G4HepRepMessenger::fpInstance = 0;
     33
     34G4HepRepMessenger*
     35G4HepRepMessenger::GetInstance()
     36{
     37        if (!fpInstance) fpInstance = new G4HepRepMessenger;
     38        return fpInstance;
     39}
     40
    3141G4HepRepMessenger::G4HepRepMessenger() :
     42    fileDir(""),
     43        fileName("G4Data"),
     44        overwrite(false),
     45        cullInvisibles(false),
    3246    suffix (""),
    3347    geometry(true),
     
    3751    heprepDirectory = new G4UIdirectory("/vis/heprep/");
    3852    heprepDirectory->SetGuidance("HepRep commands.");
    39 
     53               
     54        setFileDirCommand = new G4UIcmdWithAString("/vis/heprep/setFileDir", this);
     55        setFileDirCommand->SetGuidance("Set directory for output.");
     56        setFileDirCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML.");
     57        setFileDirCommand->SetParameterName("directory",false);
     58        if ( getenv( "G4HEPREPFILE_DIR" ) == NULL ) {
     59                setFileDirCommand->SetDefaultValue("");
     60        } else {
     61                setFileDirCommand->SetDefaultValue(getenv("G4HEPREPFILE_DIR"));
     62                fileDir = getenv("G4HEPREPFILE_DIR");
     63        }
     64        setFileDirCommand->AvailableForStates(G4State_Idle);
     65               
     66        setFileNameCommand = new G4UIcmdWithAString("/vis/heprep/setFileName", this);
     67        setFileNameCommand->SetGuidance("Set file name for output.");
     68        setFileNameCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML.");
     69        setFileNameCommand->SetParameterName("directory",false);
     70        if ( getenv( "G4HEPREPFILE_NAME" ) == NULL ) {
     71                setFileNameCommand->SetDefaultValue("G4Data");
     72        } else {
     73                setFileNameCommand->SetDefaultValue(getenv("G4HEPREPFILE_NAME"));
     74                fileName = getenv("G4HEPREPFILE_NAME");
     75        }
     76        setFileNameCommand->AvailableForStates(G4State_Idle);
     77
     78        setOverwriteCommand = new G4UIcmdWithABool("/vis/heprep/setOverwrite", this);
     79        setOverwriteCommand->SetGuidance("Set true to write all output to exact same file name.");
     80        setOverwriteCommand->SetGuidance("Set false to increment the file name for each new output.");
     81        setOverwriteCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML.");
     82        setOverwriteCommand->SetParameterName("flag",false);
     83        if ( getenv( "G4HEPREPFILE_OVERWRITE" ) == NULL ) {
     84                setOverwriteCommand->SetDefaultValue(false);
     85        } else {
     86                setOverwriteCommand->SetDefaultValue(getenv("G4HEPREPFILE_OVERWRITE"));
     87                overwrite = setOverwriteCommand->ConvertToBool(getenv("G4HEPREPFILE_OVERWRITE"));
     88        }
     89        setOverwriteCommand->AvailableForStates(G4State_Idle);
     90               
     91        setCullInvisiblesCommand = new G4UIcmdWithABool("/vis/heprep/setCullInvisibles", this);
     92        setCullInvisiblesCommand->SetGuidance("Remove invisible objects from output file.");
     93        setCullInvisiblesCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML.");
     94        setCullInvisiblesCommand->SetParameterName("flag",false);
     95        if ( getenv( "G4HEPREPFILE_CULL" ) == NULL ) {
     96                setCullInvisiblesCommand->SetDefaultValue(false);
     97        } else {
     98                setCullInvisiblesCommand->SetDefaultValue(getenv("G4HEPREPFILE_CULL"));
     99                cullInvisibles = setCullInvisiblesCommand->ConvertToBool(getenv("G4HEPREPFILE_CULL"));
     100        }
     101        setCullInvisiblesCommand->AvailableForStates(G4State_Idle);
     102               
    40103    setEventNumberSuffixCommand = new G4UIcmdWithAString("/vis/heprep/setEventNumberSuffix", this);
    41104    setEventNumberSuffixCommand->SetGuidance("Write separate event files, appended with given suffix.");
    42105    setEventNumberSuffixCommand->SetGuidance("Define the suffix with a pattern such as '-0000'.");
     106        setEventNumberSuffixCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile.");
    43107    setEventNumberSuffixCommand->SetParameterName("suffix",false);
    44108    setEventNumberSuffixCommand->SetDefaultValue("");
     
    47111    appendGeometryCommand = new G4UIcmdWithABool("/vis/heprep/appendGeometry", this);
    48112    appendGeometryCommand->SetGuidance("Appends copy of geometry to every event.");
     113        appendGeometryCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile.");
    49114    appendGeometryCommand->SetParameterName("flag",false);
    50115    appendGeometryCommand->SetDefaultValue(true);
     
    53118    addPointAttributesCommand = new G4UIcmdWithABool("/vis/heprep/addPointAttributes", this);
    54119    addPointAttributesCommand->SetGuidance("Adds point attributes to the points of trajectories.");
     120        addPointAttributesCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile.");
    55121    addPointAttributesCommand->SetParameterName("flag",false);
    56122    addPointAttributesCommand->SetDefaultValue(false);
     
    59125    useSolidsCommand = new G4UIcmdWithABool("/vis/heprep/useSolids", this);
    60126    useSolidsCommand->SetGuidance("Use HepRep Solids, rather than Geant4 Primitives.");
     127        useSolidsCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile.");
    61128    useSolidsCommand->SetParameterName("flag",false);
    62129    useSolidsCommand->SetDefaultValue(true);
    63130    useSolidsCommand->AvailableForStates(G4State_Idle);
    64 
    65 /* Not Enabled Yet
    66     writeInvisiblesCommand = new G4UIcmdWithABool("/vis/heprep/writeInvisibles", this);
    67     writeInvisiblesCommand->SetGuidance("Write invisible objects.");
    68     writeInvisiblesCommand->SetParameterName("flag",false);
    69     writeInvisiblesCommand->SetDefaultValue(true);
    70     writeInvisiblesCommand->AvailableForStates(G4State_Idle);
    71 */
    72131}
    73132
    74133G4HepRepMessenger::~G4HepRepMessenger() {
     134        delete setFileDirCommand;
     135        delete setFileNameCommand;
     136        delete setOverwriteCommand;
     137        delete setCullInvisiblesCommand;
    75138    delete setEventNumberSuffixCommand;
    76139    delete appendGeometryCommand;
    77140    delete addPointAttributesCommand;
    78141    delete useSolidsCommand;
    79 //    delete writeInvisiblesCommand;
    80142    delete heprepDirectory;
    81143}
    82144
    83145G4String G4HepRepMessenger::GetCurrentValue(G4UIcommand * command) {
    84     if (command==setEventNumberSuffixCommand) {
    85         return suffix;
     146    if (command==setFileDirCommand) {
     147        return fileDir;
     148    } else if (command==setFileNameCommand) {
     149        return fileName;
     150    } else if (command==setOverwriteCommand) {
     151        return overwrite;
     152    } else if (command==setCullInvisiblesCommand) {
     153        return cullInvisibles;
     154    } else if (command==setEventNumberSuffixCommand) {
     155        return suffix;
    86156    } else if (command==appendGeometryCommand) {
    87157        return appendGeometryCommand->ConvertToString(geometry);
     
    90160    } else if (command==useSolidsCommand) {
    91161        return useSolidsCommand->ConvertToString(solids);
    92 //    } else if (command==writeInvisiblesCommand) {
    93 //        return writeInvisiblesCommand->ConvertToString(invisibles);
    94162    } else {
    95163        return "";
     
    98166
    99167void G4HepRepMessenger::SetNewValue(G4UIcommand * command, G4String newValue) {
    100     if (command==setEventNumberSuffixCommand) {
     168    if (command==setFileDirCommand) {
     169        fileDir = newValue;
     170    } else if (command==setFileNameCommand) {
     171        fileName = newValue;
     172    } else if (command==setOverwriteCommand) {
     173        overwrite = setOverwriteCommand->GetNewBoolValue(newValue);
     174    } else if (command==setCullInvisiblesCommand) {
     175                cullInvisibles = setCullInvisiblesCommand->GetNewBoolValue(newValue);
     176    } else if (command==setEventNumberSuffixCommand) {
    101177        suffix = newValue;
    102178    } else if (command==appendGeometryCommand) {
     
    106182    } else if (command==useSolidsCommand) {
    107183        solids = useSolidsCommand->GetNewBoolValue(newValue);
    108 //    } else if (command==writeInvisiblesCommand) {
    109 //        invisibles = writeInvisiblesCommand->GetNewBoolValue(newValue);
    110184    }
     185}
     186
     187G4String G4HepRepMessenger::getFileDir() {
     188    return fileDir;
     189}
     190
     191G4String G4HepRepMessenger::getFileName() {
     192    return fileName;
     193}
     194
     195G4bool G4HepRepMessenger::getOverwrite() {
     196    return overwrite;
     197}
     198
     199G4bool G4HepRepMessenger::getCullInvisibles() {
     200    return cullInvisibles;
    111201}
    112202
  • trunk/source/visualization/HepRep/src/G4HepRepSceneHandler.cc

    r944 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRepSceneHandler.cc,v 1.101 2007/11/16 20:29:04 perl Exp $
     26// $Id: G4HepRepSceneHandler.cc,v 1.102 2009/11/23 05:42:28 perl Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4545//HepRep
    4646#include "HEPREP/HepRep.h"
     47#include "G4HepRepMessenger.hh"
    4748
    4849//G4
     
    9091//#define PDEBUG 1
    9192
    92 G4HepRepSceneHandler::G4HepRepSceneHandler (G4VGraphicsSystem& system, G4HepRepMessenger& heprepMessenger, const G4String& name)
     93G4HepRepSceneHandler::G4HepRepSceneHandler (G4VGraphicsSystem& system, const G4String& name)
    9394        : G4VSceneHandler (system, sceneIdCount++, name),
    94           messenger             (heprepMessenger),
    9595          geometryLayer         ("Geometry"),
    9696          eventLayer            ("Event"),
     
    247247            writeMultipleFiles = false;
    248248            int startDigit = -1; int endDigit = -1;
    249             string suffix = messenger.getEventNumberSuffix();
     249
     250                        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     251
     252            string suffix = messenger->getEventNumberSuffix();
    250253            if (suffix != "") {
    251254                // look for 0000 pattern in suffix
     
    331334        }
    332335    } else {
     336               
     337                G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
    333338
    334339        // add geometry to the heprep if there is an event (separate geometries are written
     
    338343       
    339344            // couple geometry
    340             if (messenger.appendGeometry()) {
     345
     346            if ( messenger->appendGeometry()) {
    341347                // couple geometry to event if geometry was written
    342348                if ((_geometryInstanceTree != NULL)) {
     
    374380
    375381        // write out separate geometry
    376         if (!messenger.appendGeometry() && (_heprepGeometry != NULL)) {
     382        if (! messenger->appendGeometry() && (_heprepGeometry != NULL)) {
    377383            if (writeMultipleFiles) {
    378384                char fileName[128];
     
    493499
    494500    if (dontWrite()) return;
    495 
    496     if (!messenger.useSolids()) {
     501       
     502        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     503
     504    if (! messenger->useSolids()) {
    497505        G4VSceneHandler::AddSolid(box);
    498506        return;
     
    547555
    548556    if (dontWrite()) return;
    549 
    550     if (!messenger.useSolids() || (cons.GetDeltaPhiAngle() < twopi)) {
     557       
     558        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     559
     560    if (! messenger->useSolids() || (cons.GetDeltaPhiAngle() < twopi)) {
    551561        G4VSceneHandler::AddSolid(cons);
    552562        return;
     
    609619
    610620    if (dontWrite()) return;
    611 
    612     if (!messenger.useSolids() || (tubs.GetDeltaPhiAngle() < twopi)) {
     621       
     622        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     623
     624    if (! messenger->useSolids() || (tubs.GetDeltaPhiAngle() < twopi)) {
    613625        G4VSceneHandler::AddSolid(tubs);
    614626        return;
     
    666678#endif
    667679    if (dontWrite()) return;
    668 
    669     if (!messenger.useSolids()) {
     680       
     681        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     682
     683    if (! messenger->useSolids()) {
    670684        G4VSceneHandler::AddSolid(trd);
    671685        return;
     
    9941008
    9951009
    996 G4bool G4HepRepSceneHandler::dontWrite() {
    997     return !(messenger.writeInvisibles() || (fpVisAttribs ? (bool)fpVisAttribs->IsVisible() : true));
     1010G4bool G4HepRepSceneHandler::dontWrite() {     
     1011        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1012    return !( messenger->writeInvisibles() || (fpVisAttribs ? (bool)fpVisAttribs->IsVisible() : true));
    9981013}
    9991014
     
    13671382    type->addAttDef(  "PointUnit", "Length", "Physics", "");
    13681383    type->addAttValue("PointUnit", G4String("m"));
     1384       
     1385        G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
    13691386
    13701387    type->addAttDef(  "UseSolids", "Use HepRep Solids rather than Geant4 Primitives", "Draw", "");
    1371     type->addAttValue("UseSolids", messenger.useSolids());
     1388    type->addAttValue("UseSolids", messenger->useSolids());
    13721389
    13731390    type->addAttDef(  "WriteInvisibles", "Write Invisible Objects", "Draw", "");
    1374     type->addAttValue("WriteInvisibles", messenger.writeInvisibles());
     1391    type->addAttValue("WriteInvisibles", messenger->writeInvisibles());
    13751392}           
    13761393
     
    14091426        // Create the Geometry InstanceTree.
    14101427        _geometryInstanceTree = factory->createHepRepInstanceTree("G4GeometryData", "1.0", getGeometryTypeTree());
    1411         if (messenger.appendGeometry()) {
     1428               
     1429                G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1430        if ( messenger->appendGeometry()) {
    14121431            getHepRep()->addInstanceTree(_geometryInstanceTree);
    14131432        } else {
     
    14761495        HepRepTreeID* geometryTreeID = factory->createHepRepTreeID("G4GeometryTypes", "1.0");
    14771496        _geometryTypeTree = factory->createHepRepTypeTree(geometryTreeID);
    1478         if (messenger.appendGeometry()) {
     1497               
     1498                G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     1499        if ( messenger->appendGeometry()) {
    14791500            getHepRep()->addTypeTree(_geometryTypeTree);
    14801501        } else {
  • trunk/source/visualization/HepRep/src/G4HepRepViewer.cc

    r944 r1228  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HepRepViewer.cc,v 1.26 2006/06/29 21:17:34 gunter Exp $
     26// $Id: G4HepRepViewer.cc,v 1.27 2009/11/23 05:42:28 perl Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4040#include "G4Scene.hh"
    4141#include "G4HepRep.hh"
     42#include "G4HepRepMessenger.hh"
    4243#include "G4HepRepSceneHandler.hh"
    4344//This
     
    4748using namespace std;
    4849
    49 G4HepRepViewer::G4HepRepViewer (G4VSceneHandler& sceneHandler, G4HepRepMessenger& heprepMessenger, const G4String& name)
     50G4HepRepViewer::G4HepRepViewer (G4VSceneHandler& sceneHandler, const G4String& name)
    5051        : G4VViewer (sceneHandler, sceneHandler.IncrementViewCount(), name),
    51         geometryIncluded(false),
    52         messenger(heprepMessenger) {
     52        geometryIncluded(false) {
    5353
    5454#ifdef SDEBUG
     
    111111    if (sceneHandler->closeHepRep()) {
    112112        sceneHandler->openHepRep();
    113         if (messenger.appendGeometry()) geometryIncluded = false;
     113               
     114                G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance();
     115        if (messenger->appendGeometry()) geometryIncluded = false;
    114116    }
    115117}
  • trunk/source/visualization/History

    r1196 r1228  
    1 $Id: History,v 1.456 2009/11/17 14:37:06 lgarnier Exp $
     1$Id: History,v 1.460 2009/11/23 05:56:37 perl Exp $
    22-------------------------------------------------------------------
    33
     
    2525---------------------------------------
    2626
     2722nd November 2009  Joseph Perl (vis-V09-02-12)
     28- vis-HepRep-V09-02-03
     29  o Changed messenger to a singleton.
     30  o Added messenger commands to HepRepFile.
     31  o Render G4Tubs as polygons if G4Tubs is not at a standard angle.
     32
     3322nd November 2009  John Allison
     34- visman-V09-02-08: /vis/scene/add/trajectories rich:
     35  o Added G4RichTrajectoryPoint().GetAttDefs() to informational.
     36
     3718th November 2009  Gabriele Cosmo
     38- visexternal-V09-02-06:
     39  o Added GLOBLIBS dependencies.
     40  o Re-instated fix to gl2ps.cc (always #define GL2PS_HAVE_ZLIB).
     41
     4217th November 2009  John Allison  (vis-V09-02-11)
     43- visman-V09-02-07:
     44  o Many small bug fixes.
     45  o Enhanced functionality for gMocren driver:
     46    . Introduced the concept of end-of-run model.
     47- opengl-V09-02-10: Fixes build problem with gl2ps on Windows.
     48- openinventor-V09-02-03: Fixes build problem with gl2ps on Windows.
     49- Tagged for vis tag.
     50- visexternal-V09-02-05:
     51  o gl2ps: Added dependency on zlib if G4LIB_BUILD_ZLIB is set.
     52
    275317th November 2009  Laurent Garnier
    28 - Fix SceneHandler removing viewer if class destructor call
    29   before G4VSceneHandler calls it
     54- Allow arbitrary viewer deletion (fixes crash)
     55
     5617th November 2009  Gabriele Cosmo
     57- GNUmakefile: Added SUBLIBS += G4gl2ps for OPENGL and OI.
     58
     5915th November 2009  John Allison
     60- raytracer-V09-02-02: Formal tag to record fixing of bugzilla Problem 1072.
    3061
    31626th November 2009  John Allison
    32  - vistest-V09-02-01: test19.cc: Use G4UIExecutive.
     63- vistest-V09-02-01: test19.cc: Use G4UIExecutive.
    3364
    34653rd November 2009  John Allison  (vis-V09-02-10, greps-V09-02-03, digits_hits-V09-02-02)
  • trunk/source/visualization/OpenGL/GNUmakefile

    r1227 r1228  
    1 # $Id: GNUmakefile,v 1.10 2009/03/05 11:17:42 lgarnier Exp $
     1# $Id: GNUmakefile,v 1.12 2010/01/06 15:05:29 lgarnier Exp $
    22
    33name := G4OpenGL
     
    3939CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
    4040
    41 #INTYLIBS += -L$(G4LIBDIR)
    42 
    4341include $(G4INSTALL)/config/moc.gmk
    4442include $(G4INSTALL)/config/common.gmk
  • trunk/source/visualization/OpenGL/History

    r1196 r1228  
    1 $Id: History,v 1.160 2009/11/17 11:52:51 gcosmo Exp $
     1$Id: History,v 1.162 2010/01/06 15:05:29 lgarnier Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     206th January 2010  Laurent Garnier (needs interfaces-V09-02-07 + laurent-QtUI_with_tabs_v1)
     21- GNUMakefile : Add include for interfaces/basic
     22- G4OpenGLQtWiewer : Integration into QtUI Tab
     23
     2417th November 2009  John Allison  (opengl-V09-02-10)
     25- Tagged for vis tag.
    1926
    202717th November 2009  Gabriele Cosmo
  • trunk/source/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh

    r1130 r1228  
    5656  void initializeGL ();
    5757  void DrawView ();
    58   void FinishView ();
     58  //  void FinishView ();
    5959  void resizeGL(int width,int height);
    6060  void paintGL();
     
    7070  void contextMenuEvent(QContextMenuEvent *e);
    7171  void keyPressEvent (QKeyEvent * event);
     72  void paintEvent(QPaintEvent *event);
    7273private:
    7374  void ComputeView ();
  • trunk/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh

    r1160 r1228  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.hh,v 1.20 2009/10/21 08:14:44 lgarnier Exp $
     27// $Id: G4OpenGLQtViewer.hh,v 1.21 2010/01/06 15:05:29 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
  • trunk/source/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc

    r1227 r1228  
    107107
    108108  updateQWidget();
     109
    109110#ifdef G4DEBUG_VIS_OGL
    110111  printf("G4OpenGLImmediateQtViewer::DrawView  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
     
    150151#endif
    151152  fHasToRepaint = true;
    152 }
    153 
    154 void G4OpenGLImmediateQtViewer::FinishView()
    155 {
    156 #ifdef G4DEBUG_VIS_OGL
    157   printf("G4OpenGLImmediateQtViewer::FinishView() BEGIN\n");
    158 #endif
    159   glFlush ();
    160 #ifdef G4DEBUG_VIS_OGL
    161   printf("G4OpenGLImmediateQtViewer::FinishView() END\n");
    162 #endif
    163 
    164153}
    165154
     
    172161,int aHeight)
    173162
     163#ifdef G4DEBUG_VIS_OGL
     164  printf("\n\nG4OpenGLImmediateQtViewer::resizeGL VVVV\n");
     165#endif
    174166  ResizeWindow(aWidth,aHeight);
    175167  fHasToRepaint = sizeHasChanged();
     168#ifdef G4DEBUG_VIS_OGL
     169  printf("\n\nG4OpenGLImmediateQtViewer::resizeGL ^^^^^\n");
     170#endif
    176171}
    177172
     
    180175{
    181176#ifdef G4DEBUG_VIS_OGL
    182   printf("\n\nG4OpenGLImmediateQtViewer::paintGL ??\n");
     177  printf("\n\nG4OpenGLImmediateQtViewer::paintGL ?? %d W:%d H:%d \n",fHasToRepaint,getWinWidth(),getWinHeight());
    183178#endif
    184179  if (!fReadyToPaint) {
     
    186181    return;
    187182  }
     183  if ((getWinWidth() == 0) && (getWinHeight() == 0)) {
     184      return;
     185  }
     186
    188187  // DO NOT RESIZE IF SIZE HAS NOT CHANGE
    189188  if ( !fHasToRepaint) {
     
    209208    } else if ((sw == 0) && (sh == 0)) { // NOT A TOP LEVEL WIDGET
    210209      if (((getWinWidth() == (unsigned int)width())) &&(getWinHeight() == (unsigned int) height())) {
    211         //        return;
     210        return;
    212211      }
    213212    }
     
    270269}
    271270
     271void G4OpenGLImmediateQtViewer::paintEvent(QPaintEvent *event) {
     272  //  fHasToRepaint= false;
     273#ifdef G4DEBUG_VIS_OGL
     274  printf("\n\nG4OpenGLImmediateQtViewer::paintEvent VVVVVVVVV\n");
     275#endif
     276  updateGL();
     277#ifdef G4DEBUG_VIS_OGL
     278  printf("\n\nG4OpenGLImmediateQtViewer::paintEvent ^^^^^^^^^\n");
     279#endif
     280}
     281
     282
    272283void G4OpenGLImmediateQtViewer::updateQWidget() {
    273284  fHasToRepaint= true;
     285#ifdef G4DEBUG_VIS_OGL
     286  printf("\n\nG4OpenGLImmediateQtViewer::updateQWidget VVVVVVVVV\n");
     287#endif
    274288  updateGL();
     289#ifdef G4DEBUG_VIS_OGL
     290  printf("\n\nG4OpenGLImmediateQtViewer::updateQWidget ^^^^^^^^^\n");
     291#endif
    275292  fHasToRepaint= false;
    276293}
     
    282299//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    283300{
     301#ifdef G4DEBUG_VIS_OGL
     302  printf("\n\nG4OpenGLImmediateQtViewer::ShowView VVVV\n");
     303#endif
    284304#if QT_VERSION < 0x040000
    285305  setActiveWindow();
     
    287307  activateWindow();
    288308#endif
    289 }
    290 #endif
     309#ifdef G4DEBUG_VIS_OGL
     310  printf("\n\nG4OpenGLImmediateQtViewer::ShowView ^^^^^\n");
     311#endif
     312}
     313#endif
  • trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r1225 r1228  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.cc,v 1.45 2009/10/21 08:14:44 lgarnier Exp $
     27// $Id: G4OpenGLQtViewer.cc,v 1.46 2010/01/06 15:05:29 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    104104//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
    105105{
    106   // G4Qt* interactorManager = G4Qt::getInstance ();
    107 
    108 #ifdef G4DEBUG_VIS_OGL
    109   printf("G4OpenGLQtViewer::CreateMainWindow :: BEGIN \n");
    110 #endif
     106
    111107  if(fWindow) return; //Done.
    112108
     
    133129  if (!res) { // we have to do a dialog
    134130
    135 #ifdef G4DEBUG_VIS_OGL
    136     printf("G4OpenGLQtViewer::CreateMainWindow :: NO UI get Parent ? \n");
    137 #endif
    138131    QWidget *myParent = getParentWidget();
    139132#ifdef G4DEBUG_VIS_OGL
     
    149142    QHBoxLayout *mainLayout = new QHBoxLayout(fGLWindow);
    150143   
    151 #ifdef G4DEBUG_VIS_OGL
    152     printf("G4OpenGLQtViewer::CreateMainWindow :: After create Layout fGLWindow:%d \n",fGLWindow);
    153 #endif
    154144    mainLayout->setMargin(0);
    155145    mainLayout->setSpacing(0);   
     
    160150#else
    161151      fGLWindow->setWindowTitle( name);
    162 #ifdef G4DEBUG_VIS_OGL
    163       printf("G4OpenGLQtViewer::CreateMainWindow :: is QMainWindow \n");
    164 #endif
    165152#endif
    166153    }
    167154#if QT_VERSION >= 0x040000
    168 #ifdef G4DEBUG_VIS_OGL
    169     printf("G4OpenGLQtViewer::CreateMainWindow ::  set layout to fGLWindow:%d \n",fGLWindow);
    170 #endif
    171155    fGLWindow->setLayout(mainLayout);
    172156#endif
     
    190174    fGLWindow = fWindow;
    191175  }
    192  
    193  
    194  
     176
    195177  if(!fWindow) return;
    196178 
    197179  if (!fContextMenu)
    198180    createPopupMenu();
    199  
    200 #ifdef G4DEBUG_VIS_OGL
    201   printf("G4OpenGLQtViewer::CreateMainWindow :: END \n");
    202 #endif
     181
    203182}
    204183
     
    257236
    258237#ifdef G4DEBUG_VIS_OGL
    259   G4UImanager* UI = G4UImanager::GetUIpointer();
    260   printf("G4OpenGLQtViewer::getParentWidget :: UImanager %d++++++++++++\n",UI);
    261 #endif
    262 
    263 #ifdef G4DEBUG_VIS_OGL
    264238  printf("G4OpenGLQtViewer::G4OpenGLQtViewer END\n");
    265239#endif
     
    26692643#endif
    26702644 
    2671   //   if (interactorManager) {
    2672   //     if (interactorManager->GetUIVisWidget()) {
    2673   //       fGLWindow = interactorManager->GetUIVisWidget();
    2674   //       return interactorManager->GetUIVisWidget();
    2675   //     }
    2676   //   }
    2677   //
    2678 
    2679 
    26802645  bool found = false;
    26812646 
  • trunk/source/visualization/OpenInventor/GNUmakefile

    r1051 r1228  
    1 # $Id: GNUmakefile,v 1.9 2009/02/16 15:31:05 lgarnier Exp $
     1# $Id: GNUmakefile,v 1.10 2009/11/17 11:33:18 gcosmo Exp $
    22
    33name := G4OpenInventor
     
    77endif
    88
    9 # For debug mode
    10 CPPFLAGS += -DG4DEBUG_VIS_OI
    11 
    12 GLOBLIBS  = libG4vis_management.lib libG4modeling.lib
    13 GLOBLIBS += libG4interfaces.lib libG4run.lib libG4event.lib
     9GLOBLIBS  = libG4vis_management.lib libG4modeling.lib libG4gl2ps.lib
     10GLOBLIBS += libG4zlib.lib libG4interfaces.lib libG4run.lib libG4event.lib
    1411GLOBLIBS += libG4tracking.lib libG4processes.lib libG4digits_hits.lib
    1512GLOBLIBS += libG4track.lib libG4particles.lib libG4geometry.lib
     
    3734CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include
    3835
    39 INTYLIBS += -L$(G4LIBDIR) -lG4gl2ps
    40 
    4136include $(G4INSTALL)/config/common.gmk
    4237
  • trunk/source/visualization/OpenInventor/History

    r1196 r1228  
    1 $Id: History,v 1.102 2009/09/29 21:23:36 allison Exp $
     1$Id: History,v 1.104 2009/11/17 17:47:49 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/OpenInventor
    2121-------------------------------------------
     22
     2317th November 2009  John Allison  (openinventor-V09-02-03)
     24- Tagged for vis tag.
     25
     2617th November 2009  Gabriele Cosmo
     27- Fixed GNUmakefile.  Fixes build problem with gl2ps on Windows.
    2228
    232929 September 2009  John Allison  (openinventor-V09-02-02)
  • trunk/source/visualization/RayTracer/History

    r1140 r1228  
    1 $Id: History,v 1.59 2009/10/21 15:24:53 allison Exp $
     1$Id: History,v 1.60 2009/11/15 12:33:54 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2525---------------------------------------
    2626
     2715th November 2009  John Allison  (raytracer-V09-02-02)
     28- Formal tag to record fixing of bugzilla Problem 1072.
     29  o There is no change of source code.
     30  o This was actullay fixed in raytracer-V09-02-00, which is already accepted.
     31
    273221st October 2009  John Allison  (raytracer-V09-02-01 coworks greps-V09-02-02)
    2833- Added AddCompound (const G4THitsMap<G4double>&) methods.
     
    343919 August 2009 Laurent Garnier
    3540- G4RayTracerViewer.cc, G4RayTracerXViewer.cc : Fix an bad use of fVP
    36   parameters
     41  parameters [bugzilla Problem 1072]
    3742
    384318 August 2009 Laurent Garnier
  • trunk/source/visualization/externals/gl2ps/GNUmakefile

    r1169 r1228  
    1 # $Id: GNUmakefile,v 1.2 2009/11/02 14:54:31 lgarnier Exp $
     1# $Id: GNUmakefile,v 1.5 2009/11/18 17:15:11 gcosmo Exp $
    22# -------------------------------------------------------------
    33# GNUmakefile for gl2ps.  Laurent Garnier, 6/2/09.
     
    1212endif
    1313
    14 ifdef G4LIB_BUILD_ZLIB
    15   CPPFLAGS += -I$(G4BASE)/visualization/externals/zlib/include
    16 endif
     14GLOBLIBS = libG4zlib.lib
    1715
    1816include $(G4INSTALL)/config/architecture.gmk
     
    2018include $(G4INSTALL)/config/interactivity.gmk
    2119
     20ifdef G4LIB_BUILD_ZLIB
     21  CPPFLAGS += -I$(G4BASE)/visualization/externals/zlib/include
     22endif
     23
    2224include $(G4INSTALL)/config/common.gmk
  • trunk/source/visualization/externals/gl2ps/History

    r1140 r1228  
    1 $Id: History,v 1.10 2009/11/02 14:54:31 lgarnier Exp $
     1$Id: History,v 1.15 2009/11/18 17:23:36 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     2018 Nov 2009, Gabriele Cosmo (visexternal-V09-02-06)
     21 - Added GLOBLIBS dependencies to GNUmakefile to allow for building
     22   DLLs on Windows. Removed redundant CPPFLAGS addition.
     23 - Re-instated fix to gl2ps.cc.
     24
     2517 Nov 2009, John Allison, Gabriele Cosmo (visexternal-V09-02-05)
     26 - Added dependency on zlib if G4LIB_BUILD_ZLIB is set and corrected
     27   inclusion of zlib.h in gl2ps.cc
    1928
    20292 Nov 2009, Laurent Garnier
  • trunk/source/visualization/externals/gl2ps/src/G4OpenGL2PSAction.cc

    r1196 r1228  
    125125     GL2PS_BEST_ROOT | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND;
    126126  int sort = GL2PS_BSP_SORT;
    127   sort = GL2PS_SIMPLE_SORT;
     127  //int sort = GL2PS_SIMPLE_SORT;
    128128  GLint buffsize = 0;
    129129  buffsize += 1024*1024;
  • trunk/source/visualization/externals/gl2ps/src/gl2ps.cc

    r1174 r1228  
    9292#include "Geant4_gl2ps.h"
    9393
    94 #include <math.h>
     94#include <cmath>
    9595#include <string.h>
    9696#include <sys/types.h>
     
    9999#include <float.h>
    100100
    101 #if defined(G4LIB_USE_ZLIB)
    102101#define GL2PS_HAVE_ZLIB
    103102#include <zlib.h>
    104 #endif
    105103
    106104#if defined(GL2PS_HAVE_LIBPNG)
     
    121119#define GL2PS_ZOFFSET       5.0e-2F
    122120#define GL2PS_ZOFFSET_LARGE 20.0F
    123 #define GL2PS_ZERO(arg)     (fabs(arg) < 1.e-20)
     121#define GL2PS_ZERO(arg)     (std::fabs(arg) < 1.e-20)
    124122
    125123/* Primitive types */
     
    749747 
    750748  for(i = 1; i < n; i++){
    751     if(fabs(rgba[0][0] - rgba[i][0]) > threshold[0] ||
    752        fabs(rgba[0][1] - rgba[i][1]) > threshold[1] ||
    753        fabs(rgba[0][2] - rgba[i][2]) > threshold[2])
     749    if(std::fabs(rgba[0][0] - rgba[i][0]) > threshold[0] ||
     750       std::fabs(rgba[0][1] - rgba[i][1]) > threshold[1] ||
     751       std::fabs(rgba[0][2] - rgba[i][2]) > threshold[2])
    754752      return GL_FALSE;
    755753  }
  • trunk/source/visualization/gMocren/History

    r1161 r1228  
    1 $Id: History,v 1.7 2009/11/05 11:37:12 gcosmo Exp $
     1$Id: History,v 1.9 2009/12/03 11:44:42 akimura Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/gMocren sub-category
    2121---------------------------------------------------
     22
     233 December 2009  Akinori Kimura
     24Line 363 of G4GMocrenFileSceneHandler.cc was deleted.
     25It was a debug code with G4cout.
     26Another file I/O bug was fixed. The following files were committed.
     27G4GMocrenFileViewer.cc
     28G4GMocrenFileSceneHandler.cc
     29G4GMocrenIO.{cc,hh}
    2230
    23315 November 2009  Gabriele Cosmo (gMocren-V09-02-03)
  • trunk/source/visualization/gMocren/include/G4GMocrenIO.hh

    r1142 r1228  
    4343
    4444  void clear();
     45  void clearImage();
    4546  void setSize(int _size[3]);
    4647  void getSize(int _size[3]);
     
    292293  void setModalityImage(short * _image);
    293294  short * getModalityImage(int _z);
     295  void clearModalityImage();
    294296  // set/get the modality image density map
    295297  void setModalityImageDensityMap(std::vector<float> & _map);
  • trunk/source/visualization/gMocren/src/G4GMocrenFileCTtoDensityMap.cc

    r1142 r1228  
     1//
     2// ********************************************************************
     3// * License and Disclaimer                                           *
     4// *                                                                  *
     5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
     6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
     7// * conditions of the Geant4 Software License,  included in the file *
     8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
     9// * include a list of copyright holders.                             *
     10// *                                                                  *
     11// * Neither the authors of this software system, nor their employing *
     12// * institutes,nor the agencies providing financial support for this *
     13// * work  make  any representation or  warranty, express or implied, *
     14// * regarding  this  software system or assume any liability for its *
     15// * use.  Please see the license in the file  LICENSE  and URL above *
     16// * for the full disclaimer and the limitation of liability.         *
     17// *                                                                  *
     18// * This  code  implementation is the result of  the  scientific and *
     19// * technical work of the GEANT4 collaboration.                      *
     20// * By using,  copying,  modifying or  distributing the software (or *
     21// * any work based  on the software)  you  agree  to acknowledge its *
     22// * use  in  resulting  scientific  publications,  and indicate your *
     23// * acceptance of all terms of the Geant4 Software license.          *
     24// ********************************************************************
     25//
    126#include "G4GMocrenFileCTtoDensityMap.hh"
    227
  • trunk/source/visualization/gMocren/src/G4GMocrenFileSceneHandler.cc

    r1161 r1228  
    2525//
    2626//
    27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.10 2009/11/05 11:34:01 gcosmo Exp $
     27// $Id: G4GMocrenFileSceneHandler.cc,v 1.12 2009/12/03 11:44:42 akimura Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    301301   
    302302    // initializations
     303    //kgMocrenIO->clearModalityImage();
    303304    kgMocrenIO->clearDoseDistAll();
    304305    kgMocrenIO->clearROIAll();
     
    361362            modality[ixy] = kgMocrenIO->convertDensityToHU(itr->second);
    362363          } else {
    363             G4cout << "ABC : " << x << ", " <<  y << ", " << z << G4endl;
    364364            modality[ixy] = -1024;
    365365          }
  • trunk/source/visualization/gMocren/src/G4GMocrenFileViewer.cc

    r1142 r1228  
    2525//
    2626//
    27 // $Id: G4GMocrenFileViewer.cc,v 1.2 2009/10/12 10:04:35 akimura Exp $
     27// $Id: G4GMocrenFileViewer.cc,v 1.3 2009/12/03 11:44:42 akimura Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    107107    G4cerr << "***** G4GMocrenFileViewer::ClearView (): No effects " << G4endl;
    108108
    109   if(kSceneHandler.kGddDest) {
    110     kSceneHandler.kGddDest.close();
     109  //if(kSceneHandler.kGddDest) {
     110    //kSceneHandler.kGddDest.close();
    111111    // Re-open with same filename...
    112     kSceneHandler.kGddDest.open(kSceneHandler.kGddFileName);
     112    //kSceneHandler.kGddDest.open(kSceneHandler.kGddFileName);
    113113    kSceneHandler.kFlagInModeling = false;
    114114    kSceneHandler.GFBeginModeling();
    115   }
     115    //}
    116116}
    117117
  • trunk/source/visualization/gMocren/src/G4GMocrenIO.cc

    r1161 r1228  
    2525//
    2626//
    27 // $Id: G4GMocrenIO.cc,v 1.4 2009/11/05 03:14:12 akimura Exp $
     27// $Id: G4GMocrenIO.cc,v 1.5 2009/12/03 11:44:42 akimura Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    170170  kMinmax[1] = (T)-32109;
    171171
    172   /*
    173     if(!image.empty()) {
    174     typename std::vector<T *>::iterator itr;
    175     for(itr = image.begin(); itr != image.end(); itr++) {
     172  clearImage();
     173}
     174template <typename T>
     175void GMocrenDataPrimitive<T>::clearImage() {
     176  typename std::vector<T *>::iterator itr;
     177  for(itr = kImage.begin(); itr != kImage.end(); itr++) {
    176178    delete [] *itr;
    177     }
    178     }
    179   */
     179  }
    180180  kImage.clear();
    181181}
     
    33683368  return kModality.getImage(_z);
    33693369}
     3370void G4GMocrenIO::clearModalityImage() {
     3371 
     3372  kModality.clearImage();
     3373}
    33703374// set/get the modality image density map
    33713375void G4GMocrenIO::setModalityImageDensityMap(std::vector<float> & _map) {
  • trunk/source/visualization/management/History

    r1196 r1228  
    1 $Id: History,v 1.134 2009/11/17 14:37:06 lgarnier Exp $
     1$Id: History,v 1.137 2009/11/22 14:08:09 allison Exp $
    22
    33-------------------------------------------------------------------
     
    2727------------------------------------------------------
    2828
     2922nd November 2009  John Allison  (visman-V09-02-08)
     30- G4VisCommandsSceneAdd.cc: /vis/scene/add/trajectories rich:
     31  o Added G4RichTrajectoryPoint().GetAttDefs() to informational.
     32
     3317th November 2009  John Allison  (visman-V09-02-07)
     34- Tagged.
     35
    293617th November 2009  Laurent Garnier
    30 - G4VViewer::Fix SceneHandler removing viewer if class destructor call
    31   before G4VSceneHandler calls it
     37- Allow arbitrary viewer deletion (fixes crash).
     38  o G4VViewer::~G4VViewer: Removes itself from viewer list.
     39  o G4VSceneHandler::~G4VSceneHandler: better algorithm for removing viewers
     40  to handle viewer self removal.
    3241
    334216th November 2009  Laurent Garnier
  • trunk/source/visualization/management/include/G4VisExecutive.hh

    r944 r1228  
    2525//
    2626//
    27 // $Id: G4VisExecutive.hh,v 1.8 2009/03/14 11:43:42 allison Exp $
     27// $Id: G4VisExecutive.hh,v 1.9 2009/11/17 15:34:06 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    6969//
    7070// Notes:
    71 
    7271// (a) After instantiation, all references to this object should be as
    7372//     a G4VisManager.  The functions RegisterGraphicsSystems and
  • trunk/source/visualization/management/src/G4VisCommandsSceneAdd.cc

    r1170 r1228  
    2525//
    2626//
    27 // $Id: G4VisCommandsSceneAdd.cc,v 1.77 2009/11/04 13:15:02 allison Exp $
     27// $Id: G4VisCommandsSceneAdd.cc,v 1.78 2009/11/22 14:02:30 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929// /vis/scene commands - John Allison  9th August 1998
     
    6666#include "G4PropagatorInField.hh"
    6767#include "G4RichTrajectory.hh"
     68#include "G4RichTrajectoryPoint.hh"
    6869#include "G4AttDef.hh"
    6970#include "G4ios.hh"
     
    14151416        "\n\"/vis/modeling/trajectories/create/drawByAttribute\" and"
    14161417        "\n\"/vis/filtering/trajectories/create/attributeFilter\" commands:\n"
    1417              << G4RichTrajectory().GetAttDefs();
     1418             << G4RichTrajectory().GetAttDefs()
     1419             << G4RichTrajectoryPoint().GetAttDefs();
    14181420    }
    14191421  }
  • trunk/source/visualization/test/History

    r1140 r1228  
    1 $Id: History,v 1.119 2009/09/29 21:36:38 allison Exp $
     1$Id: History,v 1.121 2009/11/06 16:02:33 allison Exp $
    22
    33History file for visualization/test subdirectory
     
    55
    66$Log: History,v $
     7Revision 1.121  2009/11/06 16:02:33  allison
     8vistest-V09-02-01
     9
     10Revision 1.120  2009/11/06 16:01:57  allison
     11Use G4UIExecutive in a more refined way.
     12
    713Revision 1.119  2009/09/29 21:36:38  allison
    814vistest-V09-02-00
  • trunk/source/visualization/test/test19.cc

    r1140 r1228  
    2525//
    2626//
    27 // $Id: test19.cc,v 1.31 2009/09/29 21:35:56 allison Exp $
     27// $Id: test19.cc,v 1.32 2009/11/06 16:01:57 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    3232// Usage: test19 [<session>] [<verbosity>]
    3333// Without verbosity, verbosity=warnings.
    34 // Without session, session=new G4UIterminal(), or if G4UI_USE_TCSH is set
    35 //                  session=new G4UIterminal(new G4UItcsh),
    3634
    3735#include <stdio.h>
     
    8280#ifdef G4UI_USE
    8381  // Choose (G)UI.
    84   G4UIExecutive* UIexecutive = new G4UIExecutive(argc, argv);
    85   G4UImanager::GetUIpointer()->SetSession(UIexecutive->GetSession());  //So that Pause works..
     82  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
    8683#endif
    8784
     
    119116#endif
    120117
    121   G4UImanager* UI = G4UImanager::GetUIpointer ();
     118  G4UImanager* UImanager = G4UImanager::GetUIpointer ();
    122119#ifdef G4UI_USE_WIN32
    123120  G4cout << "Reading win32.g4m file...." << G4endl;
    124   UI -> ApplyCommand ("/control/execute win32.g4m");
     121  UImanager -> ApplyCommand ("/control/execute win32.g4m");
    125122#else
    126123  G4cout << "Reading test19.g4m file...." << G4endl;
    127   UI -> ApplyCommand ("/control/execute test19.g4m");
     124  UImanager -> ApplyCommand ("/control/execute test19.g4m");
    128125#endif
    129126
     
    135132#ifdef G4UI_USE
    136133  // Start an interactive session.
    137   UIexecutive -> SessionStart();
     134  ui -> SessionStart();
    138135#endif
    139136
     
    148145  G4cout << "vis_test19: Deleting session..." << G4endl;
    149146#ifdef G4UI_USE
    150   delete UIexecutive;
     147  delete ui;
    151148  G4cout << "vis_test19: Session deleted." << G4endl;
    152149#endif
Note: See TracChangeset for help on using the changeset viewer.