Ignore:
Timestamp:
Nov 9, 2007, 3:32:25 PM (17 years ago)
Author:
garnier
Message:

r627@mac-90108: laurentgarnier | 2007-11-09 07:57:42 +0100
modif dans les includes directives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLViewerMessenger.cc

    r529 r593  
    2525//
    2626//
    27 // $Id: G4OpenGLViewerMessenger.cc,v 1.5 2006/10/24 06:20:42 allison Exp $
    28 // GEANT4 tag $Name: geant4-08-02-patch-01 $
     27// $Id: G4OpenGLViewerMessenger.cc,v 1.9 2007/06/15 09:52:52 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-00-ref-01 $
    2929
    3030#include "G4OpenGLViewerMessenger.hh"
     
    3535#include "G4UIcommand.hh"
    3636#include "G4UIdirectory.hh"
     37#include "G4UIcmdWithoutParameter.hh"
    3738#include "G4UIcmdWithADouble.hh"
    3839#include "G4UIcmdWithABool.hh"
     40#include "G4UIcmdWithAString.hh"
    3941#include "G4VisManager.hh"
    4042#include <sstream>
     
    5658  fpDirectory = new G4UIdirectory("/vis/ogl/");
    5759  fpDirectory->SetGuidance("G4OpenGLViewer commands.");
     60
     61  fpCommandPrintEPS =
     62    new G4UIcmdWithoutParameter("/vis/ogl/printEPS", this);
     63  fpCommandPrintEPS->SetGuidance("Print Encapsulated PostScript file.");
     64  fpCommandPrintEPS->SetGuidance
     65    ("Generates files with names G4OpenGL_n.eps, where n is a sequence"
     66     "\nnumber, starting at 0.");
    5867
    5968  fpDirectorySet = new G4UIdirectory ("/vis/ogl/set/");
     
    146155  fpCommandEndTime->SetGuidance("Set end and range of track time.");
    147156  parameter = new G4UIparameter ("end-time", 'd', omitable = false);
    148   parameter->SetDefaultValue(DBL_MAX);
     157  parameter->SetDefaultValue(G4OPENGL_DBL_MAX);
    149158  fpCommandEndTime->SetParameter(parameter);
    150159  parameter = new G4UIparameter ("end-time-unit", 's', omitable = false);
     
    165174  fpCommandFade->SetDefaultValue(0.);
    166175
     176  fpCommandPrintMode = new G4UIcmdWithAString
     177    ("/vis/ogl/set/printMode",this);
     178  fpCommandPrintMode->SetGuidance("Set print mode");
     179  fpCommandPrintMode->SetParameterName("print_mode",omitable = true);
     180  fpCommandPrintMode->SetCandidates("vectored pixmap");
     181  fpCommandPrintMode->SetDefaultValue("vectored");
     182
    167183  fpCommandStartTime =
    168184    new G4UIcommand("/vis/ogl/set/startTime", this);
    169185  fpCommandStartTime->SetGuidance("Set start and range of track time.");
    170186  parameter = new G4UIparameter ("start-time", 'd', omitable = false);
    171   parameter->SetDefaultValue(-DBL_MAX);
     187  parameter->SetDefaultValue(-G4OPENGL_DBL_MAX);
    172188  fpCommandStartTime->SetParameter(parameter);
    173189  parameter = new G4UIparameter ("start-time-unit", 's', omitable = false);
     
    192208G4OpenGLViewerMessenger::~G4OpenGLViewerMessenger ()
    193209{
     210  delete fpCommandPrintMode;
    194211  delete fpCommandTransparency;
    195212  delete fpCommandStartTime;
     
    199216  delete fpCommandDisplayHeadTime;
    200217  delete fpDirectorySet;
     218  delete fpCommandPrintEPS;
    201219  delete fpDirectory;
     220
     221  delete fpInstance;
    202222}
    203223
     
    226246    return;
    227247  }
     248
     249  if (command == fpCommandPrintEPS)
     250    {
     251      // Keep copy of print_string to preserve Xm behaviour...
     252      char* tmp_string = new char[50];
     253      strcpy (tmp_string, pOGLViewer->print_string);
     254      // Make new print string...
     255      static G4int file_count = 0;
     256      std::ostringstream oss;
     257      oss << "G4OpenGL_" << file_count++ << ".eps";
     258      strcpy (pOGLViewer->print_string, oss.str().c_str());
     259      // Print eps file...
     260      pOGLViewer->print();
     261      // Restore print_string for Xm...
     262      strcpy (pOGLViewer->print_string, tmp_string);
     263      delete tmp_string;
     264      return;
     265    }
    228266
    229267  G4OpenGLStoredViewer* pViewer =
     
    303341    }
    304342
     343  if (command == fpCommandPrintMode)
     344    {
     345      if (newValue == "vectored") pViewer->vectored_ps = true;
     346      if (newValue == "pixmap") {
     347        pViewer->vectored_ps = false;
     348        if (pVisManager->GetVerbosity() >= G4VisManager::warnings) {
     349          G4cout <<
     350            "WARNING: Only implemented for X Windows at present."
     351                 << G4endl;
     352        }
     353      }
     354    }
     355
    305356  if (command == fpCommandStartTime)
    306357    {
Note: See TracChangeset for help on using the changeset viewer.