Changeset 1258 for trunk


Ignore:
Timestamp:
May 20, 2010, 11:49:26 AM (14 years ago)
Author:
garnier
Message:

cvs update

Location:
trunk/source/visualization
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/management/GNUmakefile

    r1242 r1258  
    1111# For debug mode
    1212# CPPFLAGS += -DG4DEBUG_VIS_MANAGEMENT
    13 CPPFLAGS += -DG4VIS_BUILD_OPTIMISE_1
    14 CPPFLAGS += -DG4VIS_BUILD_OPTIMISE_2
     13#CPPFLAGS += -DG4VIS_BUILD_OPTIMISE_2
    1514
    1615
  • trunk/source/visualization/management/History

    r1242 r1258  
    1 $Id: History,v 1.138 2010/03/08 16:34:17 lgarnier Exp $
     1$Id: History,v 1.142 2010/05/11 12:17:40 allison Exp $
    22
    33-------------------------------------------------------------------
     
    2626History file for visualization management sub-category
    2727------------------------------------------------------
     28
     2911th May 2010  John Allison  (visman-V09-03-00)
     30- G4VSceneHandler:
     31  o Follow change in generic section and cutaway interface.
     32  o Trap use of user-defined DrawTrajectory and print i_mode warning.
     33- G4VisCommandsSceneAdd.cc:
     34  o Follow change in generic section and cutaway interface.
     35  o Trap use of i_mode and print warning.
     36- G4VisManager.cc:
     37  o Trap use of i_mode and print warning.
     38
    28399th March 2010 Laurent Garnier
    2940 - G4OpenGLViewer : Fix clipping when resizing non square size windows
  • trunk/source/visualization/management/include/G4VSceneHandler.hh

    r1170 r1258  
    2525//
    2626//
    27 // $Id: G4VSceneHandler.hh,v 1.42 2009/11/04 12:55:33 allison Exp $
     27// $Id: G4VSceneHandler.hh,v 1.43 2010/05/11 10:50:57 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    309309  // Other internal routines...
    310310
    311   virtual const G4Polyhedron* CreateSectionPolyhedron ();
    312   virtual const G4Polyhedron* CreateCutawayPolyhedron ();
     311  virtual G4VSolid* CreateSectionSolid ();
     312  virtual G4VSolid* CreateCutawaySolid ();
    313313  // Generic clipping using the BooleanProcessor in graphics_reps is
    314314  // implemented in this class.  Subclasses that implement their own
    315315  // clipping should provide an override that returns zero.
     316
    316317  void LoadAtts(const G4Visible&, G4AttHolder*);
    317318  // Load G4AttValues and G4AttDefs associated with the G4Visible
  • trunk/source/visualization/management/src/G4VSceneHandler.cc

    r1241 r1258  
    2525//
    2626//
    27 // $Id: G4VSceneHandler.cc,v 1.91 2009/11/16 13:51:08 lgarnier Exp $
     27// $Id: G4VSceneHandler.cc,v 1.92 2010/05/11 10:55:07 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    6767#include "G4Polycone.hh"
    6868#include "G4Polyhedra.hh"
     69#include "G4DisplacedSolid.hh"
    6970#include "G4LogicalVolume.hh"
    7071#include "G4PhysicalVolumeModel.hh"
     
    258259
    259260void G4VSceneHandler::AddCompound (const G4VTrajectory& traj) {
    260   G4TrajectoriesModel* pTrModel =
     261  G4TrajectoriesModel* trajectoriesModel =
    261262    dynamic_cast<G4TrajectoriesModel*>(fpModel);
    262   if (!pTrModel) G4Exception
     263  if (!trajectoriesModel) G4Exception
    263264    ("G4VSceneHandler::AddCompound(const G4VTrajectory&): Not a G4TrajectoriesModel.");
    264   traj.DrawTrajectory(pTrModel->GetDrawingMode());
     265  G4VVisManager::IsDefaultDrawTrajectory = false;
     266  if (trajectoriesModel->IsDrawingModeSet()) {
     267    traj.DrawTrajectory(trajectoriesModel->GetDrawingMode());
     268  } else {
     269    traj.DrawTrajectory();
     270  }
     271  if (!G4VVisManager::IsDefaultDrawTrajectory) {
     272    static G4bool warnedAboutIMode = false;
     273    if (!warnedAboutIMode) {
     274      G4Exception
     275        ("G4VSceneHandler::AddCompound(const G4VTrajectory&)",
     276         "",
     277         JustWarning,
     278  "WARNING: DEPRECATED: The use of the i_mode argument in DrawTrajectory"
     279  "\n  is deprecated and will be removed in a future major release.");
     280      warnedAboutIMode = true;
     281    }
     282  }
    265283}
    266284
     
    741759  pModelingParams->SetExplodeCentre(vp.GetExplodeCentre());
    742760
    743   pModelingParams->SetSectionPolyhedron(CreateSectionPolyhedron());
    744   pModelingParams->SetCutawayPolyhedron(CreateCutawayPolyhedron());
     761  pModelingParams->SetSectionSolid(CreateSectionSolid());
     762  pModelingParams->SetCutawaySolid(CreateCutawaySolid());
    745763  // The polyhedron objects are deleted in the modeling parameters destructor.
    746764
     
    748766}
    749767
    750 const G4Polyhedron* G4VSceneHandler::CreateSectionPolyhedron()
    751 {
    752   /* Disable for now.  Boolean processor not up to it.
     768G4VSolid* G4VSceneHandler::CreateSectionSolid()
     769{
     770  G4VSolid* sectioner = 0;
    753771  const G4ViewParameters& vp = fpViewer->GetViewParameters();
    754772  if (vp.IsSection () ) {
    755773    G4double radius = fpScene->GetExtent().GetExtentRadius();
    756774    G4double safe = radius + fpScene->GetExtent().GetExtentCentre().mag();
    757     G4Box sectionBox("clipper",
    758                      safe, safe, 1.e-5 * radius);  // Thin in z-plane.
    759     G4Polyhedron* sectioner = sectionBox.CreatePolyhedron();
     775    G4VSolid* sectionBox =
     776      new G4Box("_sectioner", safe, safe, 1.e-5 * radius);  // Thin in z-plane.
    760777    const G4Plane3D& s = vp.GetSectionPlane ();
    761778    G4double a = s.a();
     
    770787      transform = G4Rotate3D(angle, axis) * transform;
    771788    }
    772     sectioner->Transform(transform);
    773     return sectioner;
    774   } else {
    775     return 0;
    776   }
    777   */
    778   return 0;
    779 }
    780 
    781 const G4Polyhedron* G4VSceneHandler::CreateCutawayPolyhedron()
     789    sectioner = new G4DisplacedSolid
     790      ("_displaced_sectioning_box", sectionBox, transform);
     791  }
     792  return sectioner;
     793}
     794
     795G4VSolid* G4VSceneHandler::CreateCutawaySolid()
    782796{
    783797  return 0;
  • trunk/source/visualization/management/src/G4VisCommandsSceneAdd.cc

    r1228 r1258  
    2525//
    2626//
    27 // $Id: G4VisCommandsSceneAdd.cc,v 1.78 2009/11/22 14:02:30 allison Exp $
     27// $Id: G4VisCommandsSceneAdd.cc,v 1.79 2010/05/11 10:58:49 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929// /vis/scene commands - John Allison  9th August 1998
     
    13731373  static G4IdentityTrajectoryFilter auxiliaryPointsFilter;
    13741374  G4String defaultTrajectoryType;
     1375  G4bool i_mode_found = false;
    13751376  G4int i_mode = 0;
    13761377  if (smooth && rich) {
     
    13901391      iss >> i_mode;
    13911392      if (iss) {
     1393        i_mode_found = true;
    13921394        if (verbosity >= G4VisManager::warnings) {
    1393           G4cout << "WARNING: Integer parameter " << i_mode << " found."
    1394             "\n  DEPRECATED - will be removed at next major release."
    1395             "\n  Use \"/vis/modeling/trajectories\" commands."
     1395          G4cout <<
     1396  "WARNING: Integer parameter " << i_mode << " found."
     1397  "\n  DEPRECATED - its use in this command will be removed at a future major"
     1398  "\n  release.  Use \"/vis/modeling/trajectories\" commands."
    13961399                 << G4endl;
    13971400        }
     
    14211424  }
    14221425
    1423   G4TrajectoriesModel* model = new G4TrajectoriesModel(i_mode);
     1426  G4TrajectoriesModel* model = 0;
     1427  if (i_mode_found) {
     1428    model = new G4TrajectoriesModel(i_mode);
     1429  } else {
     1430    model = new G4TrajectoriesModel();
     1431  }
    14241432  const G4String& currentSceneName = pScene -> GetName ();
    14251433  pScene -> AddEndOfEventModel (model, warn);
     
    18051813    const G4double y0 = (param4 + param3) / 2.;
    18061814    const G4double z0 = (param6 + param5) / 2.;
    1807     G4Box clippingBox("_clipping_box",dX,dY,dZ);
    1808     G4Polyhedron* clippingPolyhedron =
    1809       new G4PolyhedronBox(dX,dY,dZ);  // The model deletes.
    1810     clippingPolyhedron->Transform(G4Translate3D(x0,y0,z0));
     1815    G4VSolid* clippingSolid =
     1816      new G4DisplacedSolid
     1817      ("_displaced_clipping_box",
     1818       new G4Box("_clipping_box",dX,dY,dZ),
     1819       G4Translate3D(x0,y0,z0));
    18111820    for (size_t i = 0; i < foundVolumes.size(); ++i) {
    1812       models[i]->SetClippingPolyhedron(clippingPolyhedron);
     1821      models[i]->SetClippingSolid(clippingSolid);
    18131822      models[i]->SetClippingMode(clippingMode);
    18141823    }
  • trunk/source/visualization/management/src/G4VisManager.cc

    r1242 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VisManager.cc,v 1.123 2010/03/08 16:34:17 lgarnier Exp $
     26// $Id: G4VisManager.cc,v 1.124 2010/05/11 11:02:19 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    889889  assert (0 != fpTrajDrawModelMgr);
    890890
    891   const G4VTrajectoryModel* model = CurrentTrajDrawModel();
    892 
    893   assert (0 != model); // Should exist
    894 
    895   model->Draw(trajectory, i_mode, visible);
     891  const G4VTrajectoryModel* trajectoryModel = CurrentTrajDrawModel();
     892
     893  assert (0 != trajectoryModel); // Should exist
     894
     895  G4TrajectoriesModel* trajectoriesModel =
     896    dynamic_cast<G4TrajectoriesModel*>(fpSceneHandler->GetModel());
     897  if (trajectoriesModel) {
     898    if (trajectoriesModel->IsDrawingModeSet()) {
     899      trajectoryModel->Draw(trajectory, i_mode, visible);
     900    } else {
     901      trajectoryModel->Draw(trajectory, visible);
     902    }
     903  } else {
     904    //G4Exception("G4VisManager::DispatchToModel: Not a G4TrajectoriesModel.");
     905    // Just draw at user's request
     906    trajectoryModel->Draw(trajectory, i_mode, visible);
     907    static G4bool warnedAboutIMode = false;
     908    if (!warnedAboutIMode) {
     909      G4Exception
     910        ("G4VisManager::DispatchToModel",
     911         "",
     912         JustWarning,
     913  "WARNING: DEPRECATED: The use of the i_mode argument in DrawTrajectory"
     914  "\n  is deprecated and will be removed at the next major release.");
     915      warnedAboutIMode = true;
     916    }
     917   }
    896918}
    897919
  • trunk/source/visualization/modeling/GNUmakefile

    r1244 r1258  
    1818include $(G4INSTALL)/config/architecture.gmk
    1919
    20 CPPFLAGS += -DG4VIS_BUILD_OPTIMISE_1
    21 CPPFLAGS += -DG4VIS_BUILD_OPTIMISE_2
    22 CPPFLAGS += -DG4VIS_BUILD_OPTIMISE_3
     20#CPPFLAGS += -DG4VIS_BUILD_OPTIMISE_2
    2321
    2422CPPFLAGS += -I$(G4BASE)/global/management/include
  • trunk/source/visualization/modeling/History

    r1247 r1258  
    1 $Id: History,v 1.116 2010/04/27 15:46:18 lgarnier Exp $
     1$Id: History,v 1.117 2010/05/11 11:58:41 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/modeling
    2121---------------------------------------
     22
     2311th May 2010  John Allison  (modeling-V09-03-00)
     24- G4ModelingParameters, G4PhysicalVolumeModel:
     25  o Replace polyhedra with solids for sections and cutaways.
     26- G4TrajectoriesModel: Trap use of i_mode and print warning.
     27- G4VTrajectoryModel and derived classes G4TrajectoryDrawBy*:
     28  o Introduce Draw method *not* containing i_mode.
     29- G4TrajectoryDrawerUtils:
     30  o Remove default (0) for i_mode arguments.
     31  o Introduce functions without i_mode.
     32  o Comment out unused DrawLineAndPoints function.
     33  o Trap use of i_mode and print warning.
    2234
    233527th April 2010 Laurent Garnier
  • trunk/source/visualization/modeling/include/G4ModelingParameters.hh

    r954 r1258  
    2525//
    2626//
    27 // $Id: G4ModelingParameters.hh,v 1.17 2006/11/14 14:42:08 allison Exp $
     27// $Id: G4ModelingParameters.hh,v 1.18 2010/05/11 11:13:35 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4444class G4VPhysicalVolume;
    4545class G4VisAttributes;
    46 class G4Polyhedron;
     46class G4VSolid;
    4747class G4Event;
    4848
     
    9292  const G4Point3D& GetExplodeCentre              () const;
    9393  G4int            GetNoOfSides                  () const;
    94   const G4Polyhedron* GetSectionPolyhedron       () const;
    95   const G4Polyhedron* GetCutawayPolyhedron       () const;
     94  G4VSolid*        GetSectionSolid               () const;
     95  G4VSolid*        GetCutawaySolid               () const;
    9696  const G4Event*   GetEvent                      () const;
    9797
     
    108108  void SetExplodeCentre        (const G4Point3D& explodeCentre);
    109109  G4int SetNoOfSides           (G4int);  // Returns actual number set.
    110   void SetSectionPolyhedron    (const G4Polyhedron* pSectionPolyhedron);
    111   void SetCutawayPolyhedron    (const G4Polyhedron* pCutawayPolyhedron);
     110  void SetSectionSolid         (G4VSolid* pSectionSolid);
     111  void SetCutawaySolid         (G4VSolid* pCutawaySolid);
    112112  void SetEvent                (const G4Event* pEvent);
    113113
     
    126126  G4Point3D    fExplodeCentre;   // ...about this centre.
    127127  G4int        fNoOfSides;       // ...if polygon approximates circle.
    128   const G4Polyhedron* fpSectionPolyhedron;  // For generic section (DCUT).
    129   const G4Polyhedron* fpCutawayPolyhedron;  // For generic cutaways.
     128  G4VSolid*    fpSectionSolid;   // For generic section (DCUT).
     129  G4VSolid*    fpCutawaySolid;   // For generic cutaways.
    130130  const G4Event* fpEvent;        // Event being processed.
    131131};
  • trunk/source/visualization/modeling/include/G4ModelingParameters.icc

    r954 r1258  
    2525//
    2626//
    27 // $Id: G4ModelingParameters.icc,v 1.11 2006/11/14 14:42:08 allison Exp $
     27// $Id: G4ModelingParameters.icc,v 1.12 2010/05/11 11:13:35 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    8282}
    8383
    84 inline const G4Polyhedron* G4ModelingParameters::GetSectionPolyhedron () const
    85 {return fpSectionPolyhedron;}
     84inline G4VSolid* G4ModelingParameters::GetSectionSolid () const
     85{return fpSectionSolid;}
    8686
    87 inline const G4Polyhedron* G4ModelingParameters::GetCutawayPolyhedron () const
    88 {return fpCutawayPolyhedron;}
     87inline G4VSolid* G4ModelingParameters::GetCutawaySolid () const
     88{return fpCutawaySolid;}
    8989
    9090inline const G4Event* G4ModelingParameters::GetEvent () const
     
    131131}
    132132
    133 inline void G4ModelingParameters::SetSectionPolyhedron
    134 (const G4Polyhedron* pSectionPolyhedron) {
    135   fpSectionPolyhedron = pSectionPolyhedron;
    136 }
    137 
    138 inline void G4ModelingParameters::SetCutawayPolyhedron
    139 (const G4Polyhedron* pCutawayPolyhedron) {
    140   fpCutawayPolyhedron = pCutawayPolyhedron;
    141 }
    142 
    143133inline void G4ModelingParameters::SetEvent(const G4Event* pEvent) {
    144134  fpEvent = pEvent;
  • trunk/source/visualization/modeling/include/G4PhysicalVolumeModel.hh

    r1140 r1258  
    2525//
    2626//
    27 // $Id: G4PhysicalVolumeModel.hh,v 1.35 2009/10/10 14:29:59 allison Exp $
     27// $Id: G4PhysicalVolumeModel.hh,v 1.36 2010/05/11 11:16:51 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    6262class G4Material;
    6363class G4VisAttributes;
    64 class G4Polyhedron;
    6564class G4AttDef;
    6665class G4AttValue;
     
    137136  G4int GetRequestedDepth () const {return fRequestedDepth;}
    138137
    139   const G4Polyhedron* GetClippingPolyhedron () const
    140   {return fpClippingPolyhedron;}
     138  const G4VSolid* GetClippingSolid () const
     139  {return fpClippingSolid;}
    141140
    142141  G4int GetCurrentDepth() const {return fCurrentDepth;}
     
    182181  }
    183182
    184   void SetClippingPolyhedron (const G4Polyhedron* pClippingPolyhedron) {
    185     fpClippingPolyhedron = pClippingPolyhedron;
     183  void SetClippingSolid (G4VSolid* pClippingSolid) {
     184    fpClippingSolid = pClippingSolid;
    186185  }
    187186
     
    234233  std::vector<G4PhysicalVolumeNodeID> fDrawnPVPath;
    235234  G4bool             fCurtailDescent;// Can be set to curtail descent.
    236   const G4Polyhedron*fpClippingPolyhedron;
     235  G4VSolid*          fpClippingSolid;
    237236  ClippingMode       fClippingMode;
    238237
  • trunk/source/visualization/modeling/include/G4TrajectoriesModel.hh

    r954 r1258  
    2525//
    2626//
    27 // $Id: G4TrajectoriesModel.hh,v 1.10 2006/10/26 11:10:23 allison Exp $
     27// $Id: G4TrajectoriesModel.hh,v 1.11 2010/05/11 11:21:52 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    5050public: // With description
    5151
    52   G4TrajectoriesModel (G4int drawingMode = 0);
    53    
     52  G4TrajectoriesModel ();
     53  G4TrajectoriesModel (G4int drawingMode);
     54
    5455  virtual ~G4TrajectoriesModel ();
    5556
     
    5758  // The main task of a model is to describe itself to the graphics scene.
    5859
    59   G4int GetDrawingMode() const { return fDrawingMode;}
    60   void SetDrawingMode(G4int drawingMode) {fDrawingMode = drawingMode;}
     60  G4bool IsDrawingModeSet() const;
     61  G4int GetDrawingMode() const;
     62  void SetDrawingMode(G4int drawingMode);
    6163
    6264  const G4VTrajectory* GetCurrentTrajectory() const
     
    6567private:
    6668
     69  G4bool fDrawingModeSet;
    6770  G4int fDrawingMode;
    6871  const G4VTrajectory* fpCurrentTrajectory;
  • trunk/source/visualization/modeling/include/G4TrajectoryDrawByAttribute.hh

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByAttribute.hh,v 1.1 2006/09/11 21:52:18 tinslay Exp $
     26// $Id: G4TrajectoryDrawByAttribute.hh,v 1.2 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    5151  virtual ~G4TrajectoryDrawByAttribute();
    5252
    53   // Draw the trajectory with optional i_mode parameter
    54   virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
     53  // Draw the trajectory
     54  virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
     55                    const G4bool& visible = true) const;
     56  virtual void Draw(const G4VTrajectory& trajectory,
    5557                    const G4bool& visible = true) const;
    5658
  • trunk/source/visualization/modeling/include/G4TrajectoryDrawByCharge.hh

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByCharge.hh,v 1.7 2006/06/29 21:31:49 gunter Exp $
     26// $Id: G4TrajectoryDrawByCharge.hh,v 1.8 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    5757  virtual ~G4TrajectoryDrawByCharge();
    5858
    59   // Draw the trajectory with optional i_mode parameter
    60   virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
     59  // Draw method
     60  virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
     61                    const G4bool& visible = true) const;
     62  virtual void Draw(const G4VTrajectory& trajectory,
    6163                    const G4bool& visible = true) const;
    6264
  • trunk/source/visualization/modeling/include/G4TrajectoryDrawByOriginVolume.hh

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByOriginVolume.hh,v 1.4 2006/06/29 21:31:51 gunter Exp $
     26// $Id: G4TrajectoryDrawByOriginVolume.hh,v 1.5 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    5050  virtual ~G4TrajectoryDrawByOriginVolume();
    5151
    52   virtual void Draw(const G4VTrajectory&, const G4int& i_mode = 0,
     52  // Draw method
     53  virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
    5354                    const G4bool& visible = true) const;
    54   // Draw the trajectory with optional i_mode parameter
    55 
     55  virtual void Draw(const G4VTrajectory& trajectory,
     56                    const G4bool& visible = true) const;
     57 
    5658  virtual void Print(std::ostream& ostr) const;
    5759  // Print configuration
  • trunk/source/visualization/modeling/include/G4TrajectoryDrawByParticleID.hh

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByParticleID.hh,v 1.7 2006/06/29 21:31:53 gunter Exp $
     26// $Id: G4TrajectoryDrawByParticleID.hh,v 1.8 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    5151  virtual ~G4TrajectoryDrawByParticleID();
    5252
    53   virtual void Draw(const G4VTrajectory&, const G4int&i_mode = 0,
     53  // Draw method
     54  virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
    5455                    const G4bool& visible = true) const;
    55   // Draw the trajectory with optional i_mode parameter
    56 
     56  virtual void Draw(const G4VTrajectory& trajectory,
     57                    const G4bool& visible = true) const;
     58 
    5759  virtual void Print(std::ostream& ostr) const;
    5860  // Print configuration
  • trunk/source/visualization/modeling/include/G4TrajectoryDrawerUtils.hh

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawerUtils.hh,v 1.7 2007/05/30 08:56:55 allison Exp $
     26// $Id: G4TrajectoryDrawerUtils.hh,v 1.9 2010/05/11 11:58:18 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4949                 G4Polymarker& auxiliaryPoints, G4Polymarker& stepPoints);
    5050
     51  /***
    5152  // Draw trajectory line and points
    5253  void DrawLineAndPoints(const G4VTrajectory& traj, const G4int& i_mode,
    5354                         const G4Colour& cfg, const G4bool& visible);
     55  ***/
    5456
    5557  // Draw trajectory line and points using G4VisTrajContext object information
    56   void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext&, const G4int& i_mode=0);
     58  void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext&, const G4int& i_mode);
     59
     60  // Draw trajectory line and points using G4VisTrajContext object information
     61  void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext&);
    5762
    5863}
  • trunk/source/visualization/modeling/include/G4TrajectoryGenericDrawer.hh

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryGenericDrawer.hh,v 1.2 2006/06/29 21:31:59 gunter Exp $
     26// $Id: G4TrajectoryGenericDrawer.hh,v 1.3 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4848  virtual ~G4TrajectoryGenericDrawer();
    4949
    50   virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
     50  virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
     51                    const G4bool& visible = true) const;
     52  virtual void Draw(const G4VTrajectory& trajectory,
    5153                    const G4bool& visible = true) const;
    5254  // Draw the trajectory with optional i_mode parameter
  • trunk/source/visualization/modeling/include/G4VTrajectoryModel.hh

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4VTrajectoryModel.hh,v 1.7 2006/08/14 11:43:34 allison Exp $
     26// $Id: G4VTrajectoryModel.hh,v 1.8 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    5454 
    5555  // Draw method
    56   virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
     56  virtual void Draw(const G4VTrajectory& trajectory, const G4int& i_mode = 0,
     57                    const G4bool& visible = true) const = 0;
     58  virtual void Draw(const G4VTrajectory& trajectory,
    5759                    const G4bool& visible = true) const = 0;
    5860 
  • trunk/source/visualization/modeling/src/G4ModelingParameters.cc

    r954 r1258  
    2525//
    2626//
    27 // $Id: G4ModelingParameters.cc,v 1.15 2006/11/14 14:42:08 allison Exp $
     27// $Id: G4ModelingParameters.cc,v 1.16 2010/05/11 11:13:35 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    3737#include "G4VisAttributes.hh"
    3838#include "G4ExceptionSeverity.hh"
    39 #include "G4Polyhedron.hh"
     39#include "G4VSolid.hh"
    4040
    4141G4ModelingParameters::G4ModelingParameters ():
     
    5050  fExplodeFactor         (1.),
    5151  fNoOfSides             (24),
    52   fpSectionPolyhedron    (0),
    53   fpCutawayPolyhedron    (0),
     52  fpSectionSolid         (0),
     53  fpCutawaySolid         (0),
    5454  fpEvent                (0)
    5555{}
     
    7575  fExplodeFactor  (1.),
    7676  fNoOfSides      (noOfSides),
    77   fpSectionPolyhedron (0),
    78   fpCutawayPolyhedron (0),
    79   fpEvent             (0)
     77  fpSectionSolid (0),
     78  fpCutawaySolid (0),
     79  fpEvent         (0)
    8080{}
    8181
    8282G4ModelingParameters::~G4ModelingParameters ()
    8383{
    84   delete fpSectionPolyhedron;
    85   delete fpCutawayPolyhedron;
     84  delete fpSectionSolid;
     85  delete fpCutawaySolid;
    8686}
    8787
     
    114114  fNoOfSides = nSides;
    115115  return fNoOfSides;
     116}
     117
     118void G4ModelingParameters::SetSectionSolid
     119(G4VSolid* pSectionSolid) {
     120  delete fpSectionSolid;
     121  fpSectionSolid = pSectionSolid;
     122}
     123
     124void G4ModelingParameters::SetCutawaySolid
     125(G4VSolid* pCutawaySolid) {
     126  delete fpCutawaySolid;
     127  fpCutawaySolid = pCutawaySolid;
    116128}
    117129
     
    166178     << mp.fNoOfSides;
    167179
    168   os << "\n  Section (DCUT) polyhedron pointer: ";
    169   if (!mp.fpSectionPolyhedron) os << "non-";
     180  os << "\n  Section (DCUT) shape (G4VSolid) pointer: ";
     181  if (!mp.fpSectionSolid) os << "non-";
    170182  os << "null";
    171183
    172   os << "\n  Cutaway (DCUT) polyhedron pointer: ";
    173   if (!mp.fpCutawayPolyhedron) os << "non-";
     184  os << "\n  Cutaway (DCUT) shape (G4VSolid) pointer: ";
     185  if (!mp.fpCutawaySolid) os << "non-";
    174186  os << "null";
    175187
     
    192204      (fExplodeCentre          != mp.fExplodeCentre)          ||
    193205      (fNoOfSides              != mp.fNoOfSides)              ||
    194       (fpSectionPolyhedron     != mp.fpSectionPolyhedron)     ||
    195       (fpCutawayPolyhedron     != mp.fpCutawayPolyhedron)     ||
     206      (fpSectionSolid          != mp.fpSectionSolid)     ||
     207      (fpCutawaySolid          != mp.fpCutawaySolid)     ||
    196208      (fpEvent                 != mp.fpEvent)
    197209      )
  • trunk/source/visualization/modeling/src/G4PhysicalVolumeModel.cc

    r1171 r1258  
    2525//
    2626//
    27 // $Id: G4PhysicalVolumeModel.cc,v 1.66 2009/10/23 08:08:19 allison Exp $
     27// $Id: G4PhysicalVolumeModel.cc,v 1.67 2010/05/11 11:16:51 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4040#include "G4LogicalVolume.hh"
    4141#include "G4VSolid.hh"
     42#include "G4SubtractionSolid.hh"
     43#include "G4IntersectionSolid.hh"
    4244#include "G4Material.hh"
    4345#include "G4VisAttributes.hh"
     
    7375  fpCurrentTransform (0),
    7476  fCurtailDescent (false),
    75   fpClippingPolyhedron (0),
     77  fpClippingSolid (0),
    7678  fClippingMode   (subtraction)
    7779{
     
    8688G4PhysicalVolumeModel::~G4PhysicalVolumeModel ()
    8789{
    88   delete fpClippingPolyhedron;
     90  delete fpClippingSolid;
    8991}
    9092
     
    500502  sceneHandler.PreAddSolid (theAT, *pVisAttribs);
    501503
    502   const G4Polyhedron* pSectionPolyhedron = fpMP->GetSectionPolyhedron();
    503   const G4Polyhedron* pCutawayPolyhedron = fpMP->GetCutawayPolyhedron();
    504 
    505   if (!fpClippingPolyhedron && !pSectionPolyhedron && !pCutawayPolyhedron) {
     504  G4VSolid* pSectionSolid = fpMP->GetSectionSolid();
     505  G4VSolid* pCutawaySolid = fpMP->GetCutawaySolid();
     506
     507  if (!fpClippingSolid && !pSectionSolid && !pCutawaySolid) {
    506508
    507509    pSol -> DescribeYourselfTo (sceneHandler);  // Standard treatment.
     
    509511  } else {
    510512
    511     // Clipping, etc., performed by Boolean operations on polyhedron objects.
     513    // Clipping, etc., performed by Boolean operations.
    512514
    513515    // First, get polyhedron for current solid...
     
    517519    else
    518520      G4Polyhedron::SetNumberOfRotationSteps(fpMP->GetNoOfSides());
    519     G4Polyhedron* pOriginal = pSol->GetPolyhedron();
     521    const G4Polyhedron* pOriginal = pSol->GetPolyhedron();
    520522    G4Polyhedron::ResetNumberOfRotationSteps();
    521523
     
    532534    } else {
    533535
    534       G4Polyhedron resultant = *pOriginal;
     536      G4Polyhedron resultant(*pOriginal);
    535537      G4VisAttributes resultantVisAttribs(*pVisAttribs);
    536 
    537       if (fpClippingPolyhedron) {
    538         G4Polyhedron clipper = *fpClippingPolyhedron;  // Local copy.
    539         clipper.Transform(theAT.inverse());
    540         HepPolyhedronProcessor processor;
     538      G4VSolid* resultantSolid = 0;
     539
     540      if (fpClippingSolid) {
    541541        switch (fClippingMode) {
    542542        default:
    543         case subtraction: processor.push_back(HepPolyhedronProcessor::SUBTRACTION, clipper); break;
    544         case intersection: processor.push_back(HepPolyhedronProcessor::INTERSECTION, clipper); break;
     543        case subtraction:
     544          resultantSolid = new G4SubtractionSolid
     545            ("resultant_solid", pSol, fpClippingSolid, theAT.inverse());
     546          break;
     547        case intersection:
     548          resultantSolid = new G4IntersectionSolid
     549            ("resultant_solid", pSol, fpClippingSolid, theAT.inverse());
     550          break;
    545551        }
    546         if (!processor.execute(resultant)) {
    547           if (fpMP->IsWarning())
    548             G4cout <<
    549  "WARNING: G4PhysicalVolumeModel::DescribeSolid: clipped polyhedron for"
    550  "\n  solid \"" << pSol->GetName() <<
    551  "\" not defined due to error during Boolean processing."
    552  "\n  It will be drawn in red."
    553                    << G4endl;
    554           // Nevertheless, keep resultant, but draw it in red
    555           resultantVisAttribs.SetColour(G4Colour::Red());
    556         }
    557       }
    558 
    559       if (pSectionPolyhedron) {
    560         G4Polyhedron sectioner = *pSectionPolyhedron;  // Local copy.
    561         sectioner.Transform(theAT.inverse());
    562         HepPolyhedronProcessor processor;
    563         processor.push_back(HepPolyhedronProcessor::INTERSECTION, sectioner);
    564         if (!processor.execute(resultant)) {
    565           if (fpMP->IsWarning())
    566             G4cout <<
    567  "WARNING: G4PhysicalVolumeModel::DescribeSolid: sectioned polyhedron for"
    568  "\n  solid \"" << pSol->GetName() <<
    569  "\" not defined due to error during Boolean processing."
    570  "\n  It will be drawn in red."
    571                    << G4endl;
    572           // Nevertheless, keep resultant, but draw it in red
    573           resultantVisAttribs.SetColour(G4Colour::Red());
    574         }
    575       }
    576 
    577       if (pCutawayPolyhedron) {
    578         G4Polyhedron cutter = *pCutawayPolyhedron;  // Local copy.
    579         cutter.Transform(theAT.inverse());
    580         HepPolyhedronProcessor processor;
    581         processor.push_back(HepPolyhedronProcessor::SUBTRACTION, cutter);
    582         if (!processor.execute(resultant)) {
    583           if (fpMP->IsWarning())
    584             G4cout <<
    585  "WARNING: G4PhysicalVolumeModel::DescribeSolid: cutaway polyhedron for"
    586  "\n  solid \"" << pSol->GetName() <<
    587  "\" not defined due to error during Boolean processing."
    588  "\n  It will be drawn in red."
    589                    << G4endl;
    590           // Nevertheless, keep resultant, but draw it in red
    591           resultantVisAttribs.SetColour(G4Colour::Red());
    592         }
    593       }
     552      }
     553
     554      if (pSectionSolid) {
     555        resultantSolid = new G4IntersectionSolid
     556          ("sectioned_solid", pSol, pSectionSolid, theAT.inverse());
     557      }
     558
     559      if (pCutawaySolid) {
     560        resultantSolid = new G4SubtractionSolid
     561          ("cutaway_solid", pSol, pCutawaySolid, theAT.inverse());
     562      }
     563
     564      G4Polyhedron* tmpResultant = resultantSolid->GetPolyhedron();
     565      if (tmpResultant) resultant = *tmpResultant;
     566      else {
     567        if (fpMP->IsWarning())
     568          G4cout <<
     569            "WARNING: G4PhysicalVolumeModel::DescribeSolid: resultant polyhedron for"
     570            "\n  solid \"" << pSol->GetName() <<
     571            "\" not defined due to error during Boolean processing."
     572            "\n  Original will be drawn in red."
     573                 << G4endl;
     574        resultantVisAttribs.SetColour(G4Colour::Red());
     575      }
     576
     577      delete resultantSolid;
    594578
    595579      // Finally, force polyhedron drawing...
  • trunk/source/visualization/modeling/src/G4TrajectoriesModel.cc

    r954 r1258  
    2525//
    2626//
    27 // $Id: G4TrajectoriesModel.cc,v 1.24 2006/11/14 14:42:08 allison Exp $
     27// $Id: G4TrajectoriesModel.cc,v 1.25 2010/05/11 11:21:52 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4141#include "G4AttCheck.hh"
    4242
     43G4TrajectoriesModel::G4TrajectoriesModel ():
     44  fDrawingModeSet(false),
     45  fDrawingMode(0),
     46  fpCurrentTrajectory(0)
     47{
     48  fGlobalTag = "G4TrajectoriesModel for all trajectories.";
     49  fGlobalDescription = fGlobalTag;
     50}
     51
    4352G4TrajectoriesModel::G4TrajectoriesModel (G4int drawingMode):
    44 fDrawingMode(drawingMode), fpCurrentTrajectory(0) {
     53  fDrawingModeSet(true),
     54  fDrawingMode(drawingMode),
     55  fpCurrentTrajectory(0) {
    4556  fGlobalTag = "G4TrajectoriesModel for all trajectories.";
    4657  fGlobalDescription = fGlobalTag;
     
    6677      }
    6778    }
     79  }
     80}
     81
     82G4bool G4TrajectoriesModel::IsDrawingModeSet() const
     83{
     84  return fDrawingModeSet;
     85}
     86
     87G4int G4TrajectoriesModel::GetDrawingMode() const
     88{
     89  if (fDrawingModeSet) return fDrawingMode;
     90  else {
     91    G4Exception
     92      ("G4TrajectoriesModel::GetDrawingMode",
     93       "",
     94       FatalException,
     95       "Illegal attempt to obtain i_mode."
     96       "\n  i_mode is an old trajectories parameter that is DEPRECATED"
     97       "\n  and will be removed at the next major release."
     98       );
     99    return 0;
     100  }
     101}
     102
     103void G4TrajectoriesModel::SetDrawingMode(G4int drawingMode)
     104{
     105  if (fDrawingModeSet) fDrawingMode = drawingMode;
     106  else {
     107    G4Exception
     108      ("G4TrajectoriesModel::SetDrawingMode",
     109       "",
     110       FatalException,
     111       "Illegal attempt to set i_mode."
     112       "\n  i_mode is an old trajectories parameter that is DEPRECATED"
     113       "\n  and will be removed at the next major release."
     114       );
    68115  }
    69116}
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawByAttribute.cc

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByAttribute.cc,v 1.3 2006/09/14 15:41:42 tinslay Exp $
     26// $Id: G4TrajectoryDrawByAttribute.cc,v 1.4 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    6262
    6363void
    64 G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object, const G4int&,
     64G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
     65                                  const G4int& i_mode,
     66                                  const G4bool& visible) const
     67{
     68  Draw(object, visible);
     69}
     70
     71void
     72G4TrajectoryDrawByAttribute::Draw(const G4VTrajectory& object,
    6573                                  const G4bool& visible) const
    6674{
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawByCharge.cc

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByCharge.cc,v 1.8 2006/06/29 21:33:06 gunter Exp $
     26// $Id: G4TrajectoryDrawByCharge.cc,v 1.9 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    5757
    5858void
    59 G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& traj, const G4int& i_mode, const G4bool& visible) const
     59G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& object,
     60                               const G4int& i_mode,
     61                               const G4bool& visible) const
     62{
     63  Draw(object, visible);
     64}
     65
     66void
     67G4TrajectoryDrawByCharge::Draw(const G4VTrajectory& traj, const G4bool& visible) const
    6068{
    6169  G4Colour colour;
     
    7987  }
    8088
    81   G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext, i_mode);
     89  G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext);
    8290}
    8391
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawByOriginVolume.cc

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByOriginVolume.cc,v 1.4 2006/06/29 21:33:08 gunter Exp $
     26// $Id: G4TrajectoryDrawByOriginVolume.cc,v 1.5 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4545
    4646void
    47 G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& traj, const G4int& i_mode, const G4bool& visible) const
     47G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& object,
     48                                     const G4int& i_mode,
     49                                     const G4bool& visible) const
     50{
     51  Draw(object, visible);
     52}
     53
     54void
     55G4TrajectoryDrawByOriginVolume::Draw(const G4VTrajectory& traj, const G4bool& visible) const
    4856{
    4957  G4Colour colour(fDefault);
     
    7987  }
    8088
    81   G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext, i_mode);
     89  G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext);
    8290}
    8391
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawByParticleID.cc

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawByParticleID.cc,v 1.8 2006/06/29 21:33:10 gunter Exp $
     26// $Id: G4TrajectoryDrawByParticleID.cc,v 1.9 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4343
    4444void
    45 G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& traj, const G4int& i_mode, const G4bool& visible) const
     45G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& object,
     46                                   const G4int& i_mode,
     47                                   const G4bool& visible) const
     48{
     49  Draw(object, visible);
     50}
     51
     52void
     53G4TrajectoryDrawByParticleID::Draw(const G4VTrajectory& traj, const G4bool& visible) const
    4654{
    4755  G4Colour colour(fDefault);
     
    6270  }
    6371
    64   G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext, i_mode);
     72  G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext);
    6573}
    6674
  • trunk/source/visualization/modeling/src/G4TrajectoryDrawerUtils.cc

    r1247 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryDrawerUtils.cc,v 1.13 2010/04/27 15:46:18 lgarnier Exp $
     26// $Id: G4TrajectoryDrawerUtils.cc,v 1.14 2010/05/11 11:58:18 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    4040#include "G4UIcommand.hh"
    4141#include "G4AttValue.hh"
     42#include <sstream>
    4243
    4344namespace G4TrajectoryDrawerUtils {
     
    7980    }
    8081  }
    81  
     82
     83  /***
    8284  void DrawLineAndPoints(const G4VTrajectory& traj, const G4int& i_mode, const G4Colour& colour, const G4bool& visible) {
    8385    // If i_mode>=0, draws a trajectory as a polyline (default is blue for
     
    8789    // given by std::abs(i_mode)/1000.  E.g: i_mode = 5000 gives easily
    8890    // visible markers.
     91
     92    static G4bool warnedAboutIMode = false;
     93    std::ostringstream oss;
     94    oss << "WARNING: DEPRECATED use of i_mode (i_mode: " << i_mode
     95        << ").  Feature will be removed at a future major release.";
     96    if (!warnedAboutIMode) {
     97      G4Exception
     98        ("G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, i_mode, colour, visible)",
     99         "",
     100         JustWarning,
     101         oss.str().c_str());
     102      warnedAboutIMode = true;
     103    }
    89104   
    90105    G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
     
    130145   
    131146  }
     147  ***/
    132148 
    133149  static void GetTimes(const G4VTrajectory& traj,
     
    146162
    147163      // Pre- and Post-Point times from the trajectory point...
    148       G4double trajectoryPointPreTime = -DBL_MAX;
    149       G4double trajectoryPointPostTime = DBL_MAX;
     164      G4double trajectoryPointPreTime = -std::numeric_limits<double>::max();
     165      G4double trajectoryPointPostTime = std::numeric_limits<double>::max();
    150166      std::vector<G4AttValue>* trajectoryPointAttValues =
    151167        aTrajectoryPoint->CreateAttValues();
     
    356372  void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext& context, const G4int& i_mode)
    357373  {
     374    static G4bool warnedAboutIMode = false;
     375    std::ostringstream oss;
     376    oss << "WARNING: DEPRECATED use of i_mode (i_mode: " << i_mode
     377        << ").  Feature will be removed at a future major release.";
     378    if (!warnedAboutIMode) {
     379      G4Exception
     380        ("G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, context, i_mode)",
     381         "",
     382         JustWarning,
     383         oss.str().c_str());
     384      warnedAboutIMode = true;
     385    }
     386
    358387    // Extra copy while i_mode is still around
    359388    G4VisTrajContext myContext(context);
     
    370399      myContext.SetAuxPtsSize(markerSize);
    371400      myContext.SetStepPtsSize(markerSize);
    372 
    373       static G4bool warnedAboutIMode = false;
    374 
    375       if (!warnedAboutIMode) {
    376         G4cout<<"Trajectory drawing configuration will be based on imode value of "<<i_mode<<G4endl;
    377         warnedAboutIMode = true;
    378       }
    379401    }
    380402
     
    421443    }
    422444  }
     445
     446  void DrawLineAndPoints(const G4VTrajectory& traj, const G4VisTrajContext& context)
     447  {
     448    // Return if don't need to do anything
     449    if (!context.GetDrawLine() && !context.GetDrawAuxPts() && !context.GetDrawStepPts()) return;
     450   
     451    // Get points to draw
     452    G4Polyline trajectoryLine;
     453    G4Polymarker stepPoints;
     454    G4Polymarker auxiliaryPoints;
     455   
     456    GetPoints(traj, trajectoryLine, auxiliaryPoints, stepPoints);
     457   
     458    if (context.GetTimeSliceInterval()) {
     459
     460      // Get corresponding track time information, if any
     461      std::vector<G4double> trajectoryLineTimes;
     462      std::vector<G4double> stepPointTimes;
     463      std::vector<G4double> auxiliaryPointTimes;
     464 
     465      GetTimes(traj, trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes);
     466
     467      // Check validity
     468      if (trajectoryLineTimes.size() != trajectoryLine.size() ||
     469          stepPointTimes.size() != stepPoints.size() ||
     470          auxiliaryPointTimes.size() != auxiliaryPoints.size()) {
     471
     472        // Revert to drawing without time information...
     473        DrawWithoutTime(context, trajectoryLine, auxiliaryPoints, stepPoints);
     474      } else {
     475
     476        SliceLine(context.GetTimeSliceInterval(),
     477                  trajectoryLine, trajectoryLineTimes);
     478
     479        DrawWithTime(context,
     480                     trajectoryLine, auxiliaryPoints, stepPoints,
     481                     trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes);
     482      }
     483
     484    } else {
     485
     486      DrawWithoutTime(context, trajectoryLine, auxiliaryPoints, stepPoints);
     487
     488    }
     489  }
    423490}
  • trunk/source/visualization/modeling/src/G4TrajectoryGenericDrawer.cc

    r954 r1258  
    2424// ********************************************************************
    2525//
    26 // $Id: G4TrajectoryGenericDrawer.cc,v 1.2 2006/06/29 21:33:16 gunter Exp $
     26// $Id: G4TrajectoryGenericDrawer.cc,v 1.3 2010/05/11 11:31:31 allison Exp $
    2727// GEANT4 tag $Name:  $
    2828//
     
    5757
    5858void
     59G4TrajectoryGenericDrawer::Draw(const G4VTrajectory& traj, const G4bool& visible) const
     60{
     61  G4VisTrajContext myContext(GetContext());
     62  myContext.SetVisible(visible);
     63
     64  if (GetVerbose()) {
     65    G4cout<<"G4TrajectoryGenericDrawer named "<<Name();
     66    G4cout<<", drawing trajectory with configuration: "<<G4endl;
     67    myContext.Print(G4cout);
     68  }
     69 
     70  G4TrajectoryDrawerUtils::DrawLineAndPoints(traj, myContext);
     71}
     72
     73void
    5974G4TrajectoryGenericDrawer::Print(std::ostream& ostr) const
    6075{
Note: See TracChangeset for help on using the changeset viewer.