Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisCommandSceneRemoveModel Class Reference

#include <G4VisCommandsScene.hh>

+ Inheritance diagram for G4VisCommandSceneRemoveModel:

Public Member Functions

 G4VisCommandSceneRemoveModel ()
 
virtual ~G4VisCommandSceneRemoveModel ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandScene
 G4VVisCommandScene ()
 
virtual ~G4VVisCommandScene ()
 
- Public Member Functions inherited from G4VVisCommand
 G4VVisCommand ()
 
virtual ~G4VVisCommand ()
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static G4VisManagerGetVisManager ()
 
static void SetVisManager (G4VisManager *pVisManager)
 
static const G4ColourGetCurrentTextColour ()
 
- Protected Member Functions inherited from G4VVisCommandScene
G4String CurrentSceneName ()
 
- Protected Member Functions inherited from G4VVisCommand
void SetViewParameters (G4VViewer *viewer, const G4ViewParameters &viewParams)
 
void RefreshIfRequired (G4VViewer *viewer)
 
void InterpolateViews (G4VViewer *currentViewer, std::vector< G4ViewParameters > viewVector, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")
 
void InterpolateToNewView (G4VViewer *currentViewer, const G4ViewParameters &oldVP, const G4ViewParameters &newVP, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")
 
void Twinkle (G4VViewer *currentViewer, const G4ViewParameters &baseVP, const std::vector< std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > > &paths)
 
const G4StringConvertToColourGuidance ()
 
void ConvertToColour (G4Colour &colour, const G4String &redOrString, G4double green, G4double blue, G4double opacity)
 
G4bool ProvideValueOfUnit (const G4String &where, const G4String &unit, const G4String &category, G4double &value)
 
void CopyCameraParameters (G4ViewParameters &target, const G4ViewParameters &from)
 
void CheckSceneAndNotifyHandlers (G4Scene *=nullptr)
 
G4bool CheckView ()
 
void G4VisCommandsSceneAddUnsuccessful (G4VisManager::Verbosity verbosity)
 
void CopyGuidanceFrom (const G4UIcommand *fromCmd, G4UIcommand *toCmd, G4int startLine=0)
 
void CopyParametersFrom (const G4UIcommand *fromCmd, G4UIcommand *toCmd)
 
void DrawExtent (const G4VisExtent &)
 
- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const G4String &s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Static Protected Member Functions inherited from G4VVisCommand
static G4String ConvertToString (G4double x, G4double y, const char *unitName)
 
static G4bool ConvertToDoublePair (const G4String &paramString, G4double &xval, G4double &yval)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = nullptr
 
static G4int fCurrentArrow3DLineSegmentsPerCircle = 6
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4double fCurrentLineWidth = 1.
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentTextSize = 12.
 
static G4PhysicalVolumeModel::TouchableProperties fCurrentTouchableProperties
 
static G4VisExtent fCurrentExtentForField
 
static std::vector< G4PhysicalVolumesSearchScene::FindingsfCurrrentPVFindingsForField
 
static G4bool fThereWasAViewer = false
 
static G4ViewParameters fExistingVP
 

Detailed Description

Definition at line 128 of file G4VisCommandsScene.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneRemoveModel()

G4VisCommandSceneRemoveModel::G4VisCommandSceneRemoveModel ( )

Definition at line 779 of file G4VisCommandsScene.cc.

779 {
780 G4bool omitable;
781 fpCommand = new G4UIcommand ("/vis/scene/removeModel", this);
782 fpCommand -> SetGuidance("Remove model.");
783 fpCommand -> SetGuidance
784 ("Attempts to match search string to name of model - use unique sub-string.");
785 fpCommand -> SetGuidance
786 ("Use \"/vis/scene/list\" to see model names.");
787 G4UIparameter* parameter;
788 parameter = new G4UIparameter ("search-string", 's', omitable = false);
789 fpCommand -> SetParameter (parameter);
790}
bool G4bool
Definition: G4Types.hh:86

◆ ~G4VisCommandSceneRemoveModel()

G4VisCommandSceneRemoveModel::~G4VisCommandSceneRemoveModel ( )
virtual

Definition at line 792 of file G4VisCommandsScene.cc.

792 {
793 delete fpCommand;
794}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneRemoveModel::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 796 of file G4VisCommandsScene.cc.

796 {
797 return "";
798}

◆ SetNewValue()

void G4VisCommandSceneRemoveModel::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 800 of file G4VisCommandsScene.cc.

801 {
802
804
805 G4String searchString;
806 std::istringstream is (newValue);
807 is >> searchString;
808
810 if (!pScene) {
811 if (verbosity >= G4VisManager::errors) {
812 G4warn << "ERROR: No current scene. Please create one." << G4endl;
813 }
814 return;
815 }
816
818 if (!pSceneHandler) {
819 if (verbosity >= G4VisManager::errors) {
820 G4warn << "ERROR: No current sceneHandler. Please create one." << G4endl;
821 }
822 return;
823 }
824
825 G4bool any = false;
826
827 std::vector<G4Scene::Model>& runDurationModelList =
828 pScene->SetRunDurationModelList();
829 for (size_t i = 0; i < runDurationModelList.size(); i++) {
830 const G4String& modelName =
831 runDurationModelList[i].fpModel->GetGlobalDescription();
832 if (modelName.find(searchString) != std::string::npos) {
833 runDurationModelList.erase(runDurationModelList.begin()+i);
834 any = true;
835 if (verbosity >= G4VisManager::warnings) {
836 G4warn << "Model \"" << modelName << "\" removed." << G4endl;
837 }
838 break; // Allow only one model at a time to be removed.
839 }
840 }
841
842 std::vector<G4Scene::Model>& endOfEventModelList =
843 pScene->SetEndOfEventModelList();
844 for (size_t i = 0; i < endOfEventModelList.size(); i++) {
845 const G4String& modelName =
846 endOfEventModelList[i].fpModel->GetGlobalDescription();
847 if (modelName.find(searchString) != std::string::npos) {
848 endOfEventModelList.erase(endOfEventModelList.begin()+i);
849 any = true;
850 if (verbosity >= G4VisManager::warnings) {
851 G4warn << "Model \"" << modelName << "\" removed." << G4endl;
852 }
853 break; // Allow only one model at a time to be removed.
854 }
855 }
856
857 std::vector<G4Scene::Model>& endOfRunModelList =
858 pScene->SetEndOfRunModelList();
859 for (size_t i = 0; i < endOfRunModelList.size(); i++) {
860 const G4String& modelName =
861 endOfRunModelList[i].fpModel->GetGlobalDescription();
862 if (modelName.find(searchString) != std::string::npos) {
863 endOfRunModelList.erase(endOfRunModelList.begin()+i);
864 any = true;
865 if (verbosity >= G4VisManager::warnings) {
866 G4warn << "Model \"" << modelName << "\" removed." << G4endl;
867 }
868 break; // Allow only one model at a time to be removed.
869 }
870 }
871
872 if (!any) {
873 if (verbosity >= G4VisManager::warnings) {
874 G4warn << "WARNING: No match found." << G4endl;
875 }
876 return;
877 }
878
880}
#define G4warn
Definition: G4Scene.cc:41
#define G4endl
Definition: G4ios.hh:57
std::vector< Model > & SetEndOfRunModelList()
std::vector< Model > & SetRunDurationModelList()
std::vector< Model > & SetEndOfEventModelList()
void CheckSceneAndNotifyHandlers(G4Scene *=nullptr)
static G4VisManager * fpVisManager
G4Scene * GetCurrentScene() const
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()

The documentation for this class was generated from the following files: