diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 984dd89bc..0782f1ad2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -278,7 +278,9 @@ jobs: t27_Hits_2SD, t28_Singles_2SD, t29_optical_digi, - t30_dna] + t30_dna, + t32_isotopes, + t33_invert_filter] steps: - name: Checkout github repo diff --git a/docs/tools_to_interact_with_the_simulation_actors.rst b/docs/tools_to_interact_with_the_simulation_actors.rst index a5523f499..c052eea73 100644 --- a/docs/tools_to_interact_with_the_simulation_actors.rst +++ b/docs/tools_to_interact_with_the_simulation_actors.rst @@ -933,6 +933,10 @@ Filters Filters are used to add selectrion criteria on actors. They are also used with reduction variance techniques. They are filters on particle type, particle ID, energy, direction.... +All filters listed below can be inverted and generate exact opposite selection:: + + /gate/actor/[Actor Name]/[Filter Name]/invert + Filter on particle type ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/general/include/GateAngleFilterMessenger.hh b/source/general/include/GateAngleFilterMessenger.hh index f7b9533ef..256ac0983 100644 --- a/source/general/include/GateAngleFilterMessenger.hh +++ b/source/general/include/GateAngleFilterMessenger.hh @@ -23,6 +23,7 @@ See LICENSE.md for further details #include "G4UIcmdWithADoubleAndUnit.hh" #include "G4UIcmdWith3Vector.hh" +#include "G4UIcmdWithoutParameter.hh" class GateAngleFilter; @@ -41,6 +42,7 @@ protected: G4UIcmdWithADoubleAndUnit * pSetAngleCmd; G4UIcmdWith3Vector * pSetDirectionCmd; + G4UIcmdWithoutParameter* pInvertCmd; }; #endif /* end #define GATEANGLEFILTERMESSENGER_HH */ diff --git a/source/general/include/GateCreatorProcessFilterMessenger.hh b/source/general/include/GateCreatorProcessFilterMessenger.hh index 5bba40fac..53ec8904a 100644 --- a/source/general/include/GateCreatorProcessFilterMessenger.hh +++ b/source/general/include/GateCreatorProcessFilterMessenger.hh @@ -19,6 +19,7 @@ #include "G4UImessenger.hh" #include "G4UIcmdWithAString.hh" +#include "G4UIcmdWithoutParameter.hh" class GateCreatorProcessFilter; @@ -36,6 +37,7 @@ class GateCreatorProcessFilterMessenger : GateCreatorProcessFilter *pFilter; G4UIcmdWithAString* pAddCreatorProcessCmd; + G4UIcmdWithoutParameter* pInvertCmd; }; #endif diff --git a/source/general/include/GateEnergyFilterMessenger.hh b/source/general/include/GateEnergyFilterMessenger.hh index 7d2128f90..f5f60f657 100644 --- a/source/general/include/GateEnergyFilterMessenger.hh +++ b/source/general/include/GateEnergyFilterMessenger.hh @@ -21,6 +21,7 @@ See LICENSE.md for further details #include "G4UImessenger.hh" #include "G4UIcmdWithADoubleAndUnit.hh" +#include "G4UIcmdWithoutParameter.hh" class GateEnergyFilter; @@ -39,6 +40,7 @@ protected: G4UIcmdWithADoubleAndUnit * pSetEminCmd; G4UIcmdWithADoubleAndUnit * pSetEmaxCmd; + G4UIcmdWithoutParameter* pInvertCmd; }; #endif /* end #define GATEENEFILTERMESSENGER_HH */ diff --git a/source/general/include/GateIDFilterMessenger.hh b/source/general/include/GateIDFilterMessenger.hh index 3672a65d7..8d3c410b2 100644 --- a/source/general/include/GateIDFilterMessenger.hh +++ b/source/general/include/GateIDFilterMessenger.hh @@ -21,6 +21,7 @@ See LICENSE.md for further details #include "G4UImessenger.hh" #include "G4UIcmdWithAnInteger.hh" +#include "G4UIcmdWithoutParameter.hh" class GateIDFilter; @@ -39,6 +40,7 @@ protected: G4UIcmdWithAnInteger* pAddIDCmd; G4UIcmdWithAnInteger* pAddParentIDCmd; + G4UIcmdWithoutParameter* pInvertCmd; }; #endif /* end #define GATEIDFILTERMESSENGER_HH */ diff --git a/source/general/include/GateMaterialFilterMessenger.hh b/source/general/include/GateMaterialFilterMessenger.hh index 51634f2df..0aede3375 100644 --- a/source/general/include/GateMaterialFilterMessenger.hh +++ b/source/general/include/GateMaterialFilterMessenger.hh @@ -16,6 +16,7 @@ See LICENSE.md for further details #include "globals.hh" #include "G4UImessenger.hh" #include "G4UIcmdWithAString.hh" +#include "G4UIcmdWithoutParameter.hh" class GateMaterialFilter; @@ -33,6 +34,7 @@ protected: GateMaterialFilter * pMaterialFilter; G4UIcmdWithAString* pAddMaterialCmd; + G4UIcmdWithoutParameter* pInvertCmd; }; #endif /* end #define GATEMATFILTERMESSENGER_HH */ diff --git a/source/general/include/GateParticleFilterMessenger.hh b/source/general/include/GateParticleFilterMessenger.hh index 50fef6dc5..fbbbc8e73 100644 --- a/source/general/include/GateParticleFilterMessenger.hh +++ b/source/general/include/GateParticleFilterMessenger.hh @@ -22,6 +22,7 @@ See LICENSE.md for further details #include "G4UIcmdWithAString.hh" #include "G4UIcmdWithAnInteger.hh" +#include "G4UIcmdWithoutParameter.hh" class GateParticleFilter; @@ -43,6 +44,7 @@ protected: G4UIcmdWithAnInteger* pAddParticlePDGCmd; G4UIcmdWithAString* pAddParentParticleCmd; G4UIcmdWithAString* pAddDirectParentParticleCmd; + G4UIcmdWithoutParameter* pInvertCmd; }; #endif /* end #define GATEPARTFILTERMESSENGER_HH */ diff --git a/source/general/include/GateVFilter.hh b/source/general/include/GateVFilter.hh index f94d6da0f..f9321f284 100644 --- a/source/general/include/GateVFilter.hh +++ b/source/general/include/GateVFilter.hh @@ -27,6 +27,8 @@ See LICENSE.md for further details #include "G4Step.hh" #include "G4Track.hh" +#define _FILTER_RETURN_WITH_INVERSION return IsInverted != + class GateVFilter : public GateNamedObject { @@ -40,10 +42,14 @@ public: virtual void show(); + void setInvert(){IsInverted = true;} private: +protected: + bool IsInverted = false; + }; diff --git a/source/general/include/GateVolumeFilterMessenger.hh b/source/general/include/GateVolumeFilterMessenger.hh index 515d7f664..d689605ff 100644 --- a/source/general/include/GateVolumeFilterMessenger.hh +++ b/source/general/include/GateVolumeFilterMessenger.hh @@ -21,6 +21,7 @@ See LICENSE.md for further details #include "G4UImessenger.hh" #include "G4UIcmdWithAString.hh" +#include "G4UIcmdWithoutParameter.hh" class GateVolumeFilter; @@ -38,6 +39,7 @@ protected: GateVolumeFilter * pVolumeFilter; G4UIcmdWithAString* pAddVolumeCmd; + G4UIcmdWithoutParameter* pInvertCmd; }; #endif /* end #define GATEVOLUMEFILTERMESSENGER_HH */ diff --git a/source/general/src/GateAngleFilter.cc b/source/general/src/GateAngleFilter.cc index 36ff0c7dc..b38360042 100644 --- a/source/general/src/GateAngleFilter.cc +++ b/source/general/src/GateAngleFilter.cc @@ -27,9 +27,9 @@ G4bool GateAngleFilter::Accept(const G4Track* aTrack) G4ThreeVector stepdirection = aTrack->GetMomentumDirection(); if(stepdirection.x()*mDirection.x() + stepdirection.y()*mDirection.y() - + stepdirection.z()*mDirection.z() < std::cos(mAngle) ) return false; + + stepdirection.z()*mDirection.z() < std::cos(mAngle) ) _FILTER_RETURN_WITH_INVERSION false; - return true; + _FILTER_RETURN_WITH_INVERSION true; } //--------------------------------------------------------------------------- diff --git a/source/general/src/GateAngleFilterMessenger.cc b/source/general/src/GateAngleFilterMessenger.cc index b80d38726..fcdbb629f 100644 --- a/source/general/src/GateAngleFilterMessenger.cc +++ b/source/general/src/GateAngleFilterMessenger.cc @@ -31,6 +31,7 @@ GateAngleFilterMessenger::~GateAngleFilterMessenger() { delete pSetDirectionCmd; delete pSetAngleCmd; + delete pInvertCmd; } //----------------------------------------------------------------------------- @@ -54,6 +55,11 @@ void GateAngleFilterMessenger::BuildCommands(G4String base) pSetDirectionCmd->SetGuidance(guidance); pSetDirectionCmd->SetParameterName("direction_x","direction_y", "direction_z", false, false); + bb = base+"/invert"; + pInvertCmd = new G4UIcmdWithoutParameter(bb,this); + guidance = "Invert the filter"; + pInvertCmd->SetGuidance(guidance); + } //----------------------------------------------------------------------------- @@ -70,6 +76,9 @@ void GateAngleFilterMessenger::SetNewValue(G4UIcommand* command, G4String param) { pAngleFilter->SetMomentum( pSetDirectionCmd->GetNew3VectorValue(param) ); } + + if(command==pInvertCmd) + pAngleFilter->setInvert(); } //----------------------------------------------------------------------------- diff --git a/source/general/src/GateCreatorProcessFilter.cc b/source/general/src/GateCreatorProcessFilter.cc index ce12d4e95..1c2003c02 100644 --- a/source/general/src/GateCreatorProcessFilter.cc +++ b/source/general/src/GateCreatorProcessFilter.cc @@ -31,14 +31,14 @@ GateCreatorProcessFilter::~GateCreatorProcessFilter() G4bool GateCreatorProcessFilter::Accept(const G4Track* aTrack) { const G4VProcess *creatorProcess = aTrack->GetCreatorProcess(); - if (!creatorProcess) return false; + if (!creatorProcess) _FILTER_RETURN_WITH_INVERSION false; G4String creatorProcessName = creatorProcess->GetProcessName(); for (CreatorProcesses::const_iterator iter=creatorProcesses.begin(); iter!=creatorProcesses.end(); iter++) if (*iter==creatorProcessName) - return true; + _FILTER_RETURN_WITH_INVERSION true; - return false; + _FILTER_RETURN_WITH_INVERSION false; } //--------------------------------------------------------------------------- diff --git a/source/general/src/GateCreatorProcessFilterMessenger.cc b/source/general/src/GateCreatorProcessFilterMessenger.cc index 2f754ab5c..f40d0d46c 100644 --- a/source/general/src/GateCreatorProcessFilterMessenger.cc +++ b/source/general/src/GateCreatorProcessFilterMessenger.cc @@ -21,6 +21,11 @@ GateCreatorProcessFilterMessenger::GateCreatorProcessFilterMessenger(GateCreator G4String guidance = "Add creator process"; pAddCreatorProcessCmd->SetGuidance(guidance); pAddCreatorProcessCmd->SetParameterName("Creator process name",false); + + bb = base+"/invert"; + pInvertCmd = new G4UIcmdWithoutParameter(bb,this); + guidance = "Invert the filter"; + pInvertCmd->SetGuidance(guidance); } } //----------------------------------------------------------------------------- @@ -30,6 +35,7 @@ GateCreatorProcessFilterMessenger::GateCreatorProcessFilterMessenger(GateCreator GateCreatorProcessFilterMessenger::~GateCreatorProcessFilterMessenger() { delete pAddCreatorProcessCmd; + delete pInvertCmd; } //----------------------------------------------------------------------------- @@ -38,6 +44,7 @@ GateCreatorProcessFilterMessenger::~GateCreatorProcessFilterMessenger() void GateCreatorProcessFilterMessenger::SetNewValue(G4UIcommand* command, G4String param) { if(command==pAddCreatorProcessCmd) pFilter->AddCreatorProcess(param); + if(command==pInvertCmd) pFilter->setInvert(); } //----------------------------------------------------------------------------- diff --git a/source/general/src/GateEnergyFilter.cc b/source/general/src/GateEnergyFilter.cc index d9cee3887..312726457 100644 --- a/source/general/src/GateEnergyFilter.cc +++ b/source/general/src/GateEnergyFilter.cc @@ -30,10 +30,10 @@ G4bool GateEnergyFilter::Accept(const G4Step* aStep) G4double kinetic = aStep->GetPreStepPoint()->GetKineticEnergy(); - if ( fLowEnergy!=0. && kinetic < fLowEnergy ) return false; - if ( fHighEnergy!= 0. && kinetic >= fHighEnergy ) return false; + if ( fLowEnergy!=0. && kinetic < fLowEnergy ) _FILTER_RETURN_WITH_INVERSION false; + if ( fHighEnergy!= 0. && kinetic >= fHighEnergy ) _FILTER_RETURN_WITH_INVERSION false; - return true; + _FILTER_RETURN_WITH_INVERSION true; } //--------------------------------------------------------------------------- @@ -43,10 +43,10 @@ G4bool GateEnergyFilter::Accept(const G4Track* aTrack) G4double kinetic = aTrack->GetKineticEnergy(); - if ( fLowEnergy!=0. && kinetic < fLowEnergy ) return false; - if ( fHighEnergy!= 0. && kinetic >= fHighEnergy ) return false; + if ( fLowEnergy!=0. && kinetic < fLowEnergy ) _FILTER_RETURN_WITH_INVERSION false; + if ( fHighEnergy!= 0. && kinetic >= fHighEnergy ) _FILTER_RETURN_WITH_INVERSION false; - return true; + _FILTER_RETURN_WITH_INVERSION true; } //--------------------------------------------------------------------------- diff --git a/source/general/src/GateEnergyFilterMessenger.cc b/source/general/src/GateEnergyFilterMessenger.cc index 5e9472db0..caa050b15 100644 --- a/source/general/src/GateEnergyFilterMessenger.cc +++ b/source/general/src/GateEnergyFilterMessenger.cc @@ -31,6 +31,7 @@ GateEnergyFilterMessenger::~GateEnergyFilterMessenger() { delete pSetEminCmd; delete pSetEmaxCmd; + delete pInvertCmd; } //----------------------------------------------------------------------------- @@ -55,6 +56,11 @@ void GateEnergyFilterMessenger::BuildCommands(G4String base) pSetEmaxCmd->SetParameterName("Emax", false); pSetEmaxCmd->SetDefaultUnit("MeV"); + bb = base+"/invert"; + pInvertCmd = new G4UIcmdWithoutParameter(bb,this); + guidance = "Invert the filter"; + pInvertCmd->SetGuidance(guidance); + } //----------------------------------------------------------------------------- @@ -71,6 +77,8 @@ void GateEnergyFilterMessenger::SetNewValue(G4UIcommand* command, G4String param { pEnergyFilter->SetEmax(pSetEmaxCmd->GetNewDoubleValue(param) ); } + if(command==pInvertCmd) + pEnergyFilter->setInvert(); } //----------------------------------------------------------------------------- diff --git a/source/general/src/GateIDFilter.cc b/source/general/src/GateIDFilter.cc index f6d0d3f2d..ee05a78f5 100644 --- a/source/general/src/GateIDFilter.cc +++ b/source/general/src/GateIDFilter.cc @@ -28,13 +28,13 @@ GateIDFilter::GateIDFilter(G4String name) G4bool GateIDFilter::Accept(const G4Track* aTrack) { - if(mID!=0) if(aTrack->GetTrackID()!=mID) return false; + if(mID!=0) if(aTrack->GetTrackID()!=mID) _FILTER_RETURN_WITH_INVERSION false; if(mParentID!=0) - if(aTrack->GetParentID()!=mParentID) return false; + if(aTrack->GetParentID()!=mParentID) _FILTER_RETURN_WITH_INVERSION false; - return true; + _FILTER_RETURN_WITH_INVERSION true; } //--------------------------------------------------------------------------- diff --git a/source/general/src/GateIDFilterMessenger.cc b/source/general/src/GateIDFilterMessenger.cc index 1ab575455..08e60862d 100644 --- a/source/general/src/GateIDFilterMessenger.cc +++ b/source/general/src/GateIDFilterMessenger.cc @@ -30,6 +30,8 @@ GateIDFilterMessenger::GateIDFilterMessenger(GateIDFilter* idFilter) GateIDFilterMessenger::~GateIDFilterMessenger() { delete pAddIDCmd; + delete pAddParentIDCmd; + delete pInvertCmd; } //----------------------------------------------------------------------------- @@ -52,6 +54,11 @@ void GateIDFilterMessenger::BuildCommands(G4String base) pAddParentIDCmd->SetGuidance(guidance); pAddParentIDCmd->SetParameterName("Parent ID",false); + bb = base+"/invert"; + pInvertCmd = new G4UIcmdWithoutParameter(bb,this); + guidance = "Invert the filter"; + pInvertCmd->SetGuidance(guidance); + } //----------------------------------------------------------------------------- @@ -64,6 +71,8 @@ void GateIDFilterMessenger::SetNewValue(G4UIcommand* command, G4String param) pIDFilter->addID(pAddIDCmd->GetNewIntValue(param)); if(command==pAddParentIDCmd) pIDFilter->addParentID(pAddParentIDCmd->GetNewIntValue(param)); + if(command==pInvertCmd) + pIDFilter->setInvert(); } //----------------------------------------------------------------------------- diff --git a/source/general/src/GateMaterialFilter.cc b/source/general/src/GateMaterialFilter.cc index c4d4ee1bf..0a9828610 100644 --- a/source/general/src/GateMaterialFilter.cc +++ b/source/general/src/GateMaterialFilter.cc @@ -40,10 +40,10 @@ G4bool GateMaterialFilter::Accept(const G4Step* aStep) for ( size_t i = 0; i < theMdef.size(); i++){ if ( theMdef[i] == aStep->GetPreStepPoint()->GetMaterial()->GetName() ) { nFilteredParticles++; - return true; + _FILTER_RETURN_WITH_INVERSION true; } } - return false; + _FILTER_RETURN_WITH_INVERSION false; } //--------------------------------------------------------------------------- @@ -53,10 +53,10 @@ G4bool GateMaterialFilter::Accept(const G4Track* aTrack) for ( size_t i = 0; i < theMdef.size(); i++){ if ( theMdef[i] == aTrack->GetMaterial()->GetName() ) { nFilteredParticles++; - return true; + _FILTER_RETURN_WITH_INVERSION true; } } - return false; + _FILTER_RETURN_WITH_INVERSION false; } //--------------------------------------------------------------------------- diff --git a/source/general/src/GateMaterialFilterMessenger.cc b/source/general/src/GateMaterialFilterMessenger.cc index feb80c485..308291847 100644 --- a/source/general/src/GateMaterialFilterMessenger.cc +++ b/source/general/src/GateMaterialFilterMessenger.cc @@ -32,6 +32,7 @@ GateMaterialFilterMessenger::GateMaterialFilterMessenger(GateMaterialFilter* mat GateMaterialFilterMessenger::~GateMaterialFilterMessenger() { delete pAddMaterialCmd; + delete pInvertCmd; } //----------------------------------------------------------------------------- @@ -47,6 +48,11 @@ void GateMaterialFilterMessenger::BuildCommands(G4String base) pAddMaterialCmd->SetGuidance(guidance); pAddMaterialCmd->SetParameterName("Material name",false); + bb = base+"/invert"; + pInvertCmd = new G4UIcmdWithoutParameter(bb,this); + guidance = "Invert the filter"; + pInvertCmd->SetGuidance(guidance); + } //----------------------------------------------------------------------------- @@ -55,6 +61,8 @@ void GateMaterialFilterMessenger::SetNewValue(G4UIcommand* command, G4String par { if(command==pAddMaterialCmd) pMaterialFilter->Add(param); + if(command==pInvertCmd) + pMaterialFilter->setInvert(); } //----------------------------------------------------------------------------- diff --git a/source/general/src/GateParticleFilter.cc b/source/general/src/GateParticleFilter.cc index 031dde38c..ccb7eaf51 100644 --- a/source/general/src/GateParticleFilter.cc +++ b/source/general/src/GateParticleFilter.cc @@ -47,7 +47,7 @@ G4bool GateParticleFilter::Accept(const G4Track *aTrack) } } } // end thePdef !empty - if (!acceptTemp.back()) return false; + if (!acceptTemp.back()) _FILTER_RETURN_WITH_INVERSION false; // Test the particle Z, keep the particle if Z is in the list acceptTemp.push_back(true); @@ -61,7 +61,7 @@ G4bool GateParticleFilter::Accept(const G4Track *aTrack) } } } // end thePdefZ !empty - if (!acceptTemp.back()) return false; + if (!acceptTemp.back()) _FILTER_RETURN_WITH_INVERSION false; //// Test the particle A acceptTemp.push_back(true); @@ -75,7 +75,7 @@ G4bool GateParticleFilter::Accept(const G4Track *aTrack) } } } // end thePdefA !empty - if (!acceptTemp.back()) return false; + if (!acceptTemp.back()) _FILTER_RETURN_WITH_INVERSION false; // Test the particle PDG acceptTemp.push_back(true); @@ -89,7 +89,7 @@ G4bool GateParticleFilter::Accept(const G4Track *aTrack) } } } // end thePdefPFG !empty - if (!acceptTemp.back()) return false; + if (!acceptTemp.back()) _FILTER_RETURN_WITH_INVERSION false; // Test the parent acceptTemp.push_back(true); @@ -110,7 +110,7 @@ G4bool GateParticleFilter::Accept(const G4Track *aTrack) trackInfo = GateUserActions::GetUserActions()->GetTrackIDInfo(id); } } // end theParentPdef !empty - if (!acceptTemp.back()) return false; + if (!acceptTemp.back()) _FILTER_RETURN_WITH_INVERSION false; // Test the directParent acceptTemp.push_back(true); @@ -128,10 +128,10 @@ G4bool GateParticleFilter::Accept(const G4Track *aTrack) } } } // end theDirectParentPdef !empty - if (!acceptTemp.back()) return false; + if (!acceptTemp.back()) _FILTER_RETURN_WITH_INVERSION false; // Keep the track ! - return true; + _FILTER_RETURN_WITH_INVERSION true; } //--------------------------------------------------------------------------- diff --git a/source/general/src/GateParticleFilterMessenger.cc b/source/general/src/GateParticleFilterMessenger.cc index 333d5e1af..1072ab0af 100644 --- a/source/general/src/GateParticleFilterMessenger.cc +++ b/source/general/src/GateParticleFilterMessenger.cc @@ -30,6 +30,7 @@ GateParticleFilterMessenger::GateParticleFilterMessenger(GateParticleFilter* par GateParticleFilterMessenger::~GateParticleFilterMessenger() { delete pAddParticleCmd; + delete pInvertCmd; } //----------------------------------------------------------------------------- @@ -76,6 +77,11 @@ void GateParticleFilterMessenger::BuildCommands(G4String base) guidance = "Add direct parent particle"; pAddDirectParentParticleCmd->SetGuidance(guidance); pAddDirectParentParticleCmd->SetParameterName("Particle name",false); + + bb = base+"/invert"; + pInvertCmd = new G4UIcmdWithoutParameter(bb,this); + guidance = "Invert the filter"; + pInvertCmd->SetGuidance(guidance); } //----------------------------------------------------------------------------- @@ -95,6 +101,8 @@ void GateParticleFilterMessenger::SetNewValue(G4UIcommand* command, G4String par pParticleFilter->AddParent(param); if(command==pAddDirectParentParticleCmd) pParticleFilter->AddDirectParent(param); + if(command==pInvertCmd) + pParticleFilter->setInvert(); } //----------------------------------------------------------------------------- diff --git a/source/general/src/GateVolumeFilter.cc b/source/general/src/GateVolumeFilter.cc index d42ad8da7..1804e801e 100644 --- a/source/general/src/GateVolumeFilter.cc +++ b/source/general/src/GateVolumeFilter.cc @@ -33,9 +33,9 @@ G4bool GateVolumeFilter::Accept(const G4Step* aStep) G4LogicalVolume * currentVol = theTouchable->GetVolume(0)->GetLogicalVolume(); for(unsigned int k =0 ; kGetVolume(0)->GetLogicalVolume(); for(unsigned int k =0 ; kSetGuidance(guidance); pAddVolumeCmd->SetParameterName("Volume name",false); + + bb = base+"/invert"; + pInvertCmd = new G4UIcmdWithoutParameter(bb,this); + guidance = "Invert the filter"; + pInvertCmd->SetGuidance(guidance); } //----------------------------------------------------------------------------- @@ -53,6 +59,7 @@ void GateVolumeFilterMessenger::BuildCommands(G4String base) void GateVolumeFilterMessenger::SetNewValue(G4UIcommand* command, G4String param) { if(command==pAddVolumeCmd) pVolumeFilter->addVolume(param); + if(command==pInvertCmd) pVolumeFilter->setInvert(); } //-----------------------------------------------------------------------------