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

cvs update

Location:
trunk/source/visualization/management/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.