445{
447
448 if(command == listCmd)
449 {
451 }
452 else if(command == dumpCmd)
453 {
455 }
456 else if(command == drawCmd)
457 {
463 fSMan->
DrawMesh(meshName, psName, colorMapName, axflg);
464 }
465 else if(command == drawColumnCmd)
466 {
473 fSMan->
DrawMesh(meshName, psName, iPlane, iColumn, colorMapName);
474 }
475 else if(command == dumpQtyToFileCmd)
476 {
482 auto mesh = fSMan->
FindMesh(meshName);
483 if(mesh == nullptr)
484 {
486 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
488 return;
489 }
491 }
492 else if(command == dumpQtyWithFactorCmd)
493 {
500 auto mesh = fSMan->
FindMesh(meshName);
501 if(mesh == nullptr)
502 {
504 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
506 return;
507 }
511 }
512 else if(command == dumpAllQtsToFileCmd)
513 {
518 auto mesh = fSMan->
FindMesh(meshName);
519 if(mesh == nullptr)
520 {
522 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
524 return;
525 }
527 }
528 else if(command == dumpAllQtsWithFactorCmd)
529 {
535 auto mesh = fSMan->
FindMesh(meshName);
536 if(mesh == nullptr)
537 {
539 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
541 return;
542 }
546 }
547 else if(command == fill1DCmd)
548 {
550 }
551 else if(command == verboseCmd)
552 {
554 }
555 else if(command == meshBoxCreateCmd)
556 {
558 if(currentmesh != nullptr)
559 {
561 ed <<
"ERROR[" << meshBoxCreateCmd->
GetCommandPath() <<
"] : Mesh <"
563 << "> is still open. Close it first. Command ignored.";
565 }
566 else
567 {
569 if(mesh == nullptr)
570 {
573 }
574 else
575 {
578 << "] : Scoring mesh <" << newVal
579 << "> already exists. Command ignored.";
581 }
582 }
583 }
584 else if(command == meshCylinderCreateCmd)
585 {
587 if(currentmesh != nullptr)
588 {
590 ed <<
"ERROR[" << meshCylinderCreateCmd->
GetCommandPath() <<
"] : Mesh <"
592 << "> is still open. Close it first. Command ignored.";
594 }
595 else
596 {
598 if(mesh == nullptr)
599 {
602 }
603 else
604 {
607 << "] : Scoring mesh <" << newVal
608 << "> already exists. Command ignored.";
610 }
611 }
612 }
613 else if(command == meshRWLogVolCreateCmd)
614 {
616 if(mesh != nullptr)
617 {
619 ed <<
"ERROR[" << meshRWLogVolCreateCmd->
GetCommandPath() <<
"] : Mesh <"
621 << "> is still open. Close it first. Command ignored.";
623 }
624 else
625 {
630 if(mesh == nullptr)
631 {
635 }
636 else
637 {
640 << "] : Scoring mesh <" << meshName
641 << "> already exists. Command ignored.";
643 }
644 }
645 }
646 else if(command == probeCreateCmd)
647 {
649 if(mesh != nullptr)
650 {
652 ed <<
"ERROR[" << meshRWLogVolCreateCmd->
GetCommandPath() <<
"] : Mesh <"
654 << "> is still open. Close it first. Command ignored.";
656 }
657 else
658 {
665 if(mesh == nullptr)
666 {
669 }
670 else
671 {
673 ed <<
"ERROR[" << probeCreateCmd->
GetCommandPath() <<
"] : Mesh name <"
674 << qname << "> already exists. Use another name.";
676 }
677 }
678 }
679 else if(command == probeMatCmd || command == probeLocateCmd)
680 {
682 if(mesh == nullptr)
683 {
685 ed << "ERROR : No mesh is currently open. Open/create a mesh first. "
686 "Command ignored.";
688 return;
689 }
690 if(mesh->
GetShape() != MeshShape::probe)
691 {
693 ed << "ERROR : Inconsistent mesh type. Close current mesh and open "
694 "Scoring Probe.";
696 return;
697 }
698
699 if(command == probeMatCmd)
700 {
702 if(!succ)
703 {
705 ed << "Material <" << newVal
706 << "> is not defind in G4NistManager. Command is ignored.\n"
707 << "Use /material/nist/listMaterials command to see the available "
708 "materials.";
710 return;
711 }
712 }
713 else if(command == probeLocateCmd)
714 {
717 }
718 }
719 else if(command == listColorMapCmd)
720 {
722 }
723 else if(command == floatMinMaxCmd)
724 {
726 if(colorMap != nullptr)
727 {
729 }
730 else
731 {
733 ed <<
"ERROR[" << floatMinMaxCmd->
GetCommandPath() <<
"] : color map <"
734 << newVal << "> is not defined. Command ignored.";
736 }
737 }
738 else if(command == colorMapMinMaxCmd)
739 {
745 if(colorMap != nullptr)
746 {
749 }
750 else
751 {
753 ed <<
"ERROR[" << colorMapMinMaxCmd->
GetCommandPath() <<
"] : color map <"
754 << newVal <<
"> is not defined. Command ignored." <<
G4endl;
756 }
757 }
758 else if(command == meshOpnCmd)
759 {
761 if(currentmesh != nullptr)
762 {
766 << "> is still open. Close it first. Command ignored.";
768 }
769 else
770 {
772 if(mesh == nullptr)
773 {
775 ed <<
"ERROR[" << meshOpnCmd->
GetCommandPath() <<
"] : Scoring mesh <"
776 << newVal << "> does not exist. Command ignored.";
778 }
779 else
780 {
782 }
783 }
784 }
785 else if(command == meshClsCmd)
786 {
788 }
789 else
790 {
791
792
793
795
796
797 if(mesh != nullptr)
798 {
800 if(shape == MeshShape::realWorldLogVol)
801 {
804 << "] : Number of mesh command cannot be set for this type of mesh. "
805 "Command ignored.";
807 }
808 else
809 {
810
813
814
815 if(command == mBoxSizeCmd)
816 {
817 if(shape == MeshShape::box)
818 {
825 }
826 else
827 {
830 << "] : This mesh is not Box. Command ignored.";
832 }
833 }
834 else if(command == mCylinderSizeCmd || command == mCylinderRMinCmd ||
835 command == mCylinderAngleCmd)
836 {
837 if(shape != MeshShape::cylinder)
838 {
841 << "] : This mesh is not Cylinder. Command ignored.";
843 }
844 else
845 {
846 if(command == mCylinderSizeCmd)
847 {
849 vsize[0] = (mesh->
GetSize()).x();
850 vsize[1] =
StoD(token[0]);
851 vsize[2] =
StoD(token[1]);
853 vsize[1] *= unt;
854 vsize[2] *= unt;
856 }
857 else if(command == mCylinderRMinCmd)
858 {
861 vsize[1] = (mesh->
GetSize()).y();
862 vsize[2] = (mesh->
GetSize()).z();
864 }
865 else if(command == mCylinderAngleCmd)
866 {
870 mesh->
SetAngles(stphi * unt, spphi * unt);
871 }
872 }
873 }
874 else if(command == mBinCmd)
875 {
877 }
878 else if(command == mTResetCmd)
879 {
880 G4double centerPosition[3] = { 0., 0., 0. };
882 }
883 else if(command == mTXyzCmd)
884 {
887 centerPosition[0] = xyz.
x();
888 centerPosition[1] = xyz.
y();
889 centerPosition[2] = xyz.
z();
891 }
892 else if(command == mRotXCmd)
893 {
896 }
897 else if(command == mRotYCmd)
898 {
901 }
902 else if(command == mRotZCmd)
903 {
906 }
907 }
908 }
909 else
910 {
912 ed << "ERROR: No mesh is currently open. Open/create a mesh first. "
913 "Command ignored.";
915 }
916 }
917}
std::vector< G4String > G4TokenVec
void RegisterScoringMesh(G4VScoringMesh *scm)
void SetVerboseLevel(G4int vl)
G4VScoreColorMap * GetScoreColorMap(const G4String &mapName)
void DumpAllQuantitiesToFile(const G4String &meshName, const G4String &fileName, const G4String &option="")
G4VScoringMesh * FindMesh(G4VHitsCollection *map)
void SetCurrentMesh(G4VScoringMesh *scm)
void DrawMesh(const G4String &meshName, const G4String &psName, const G4String &colorMapName, G4int axflg=111)
void SetFactor(G4double val=1.0)
G4VScoringMesh * GetCurrentMesh() const
void ListScoreColorMaps()
void DumpQuantityToFile(const G4String &meshName, const G4String &psName, const G4String &fileName, const G4String &option="")
void FillTokenVec(G4String newValues, G4TokenVec &token)
void MeshBinCommand(G4VScoringMesh *mesh, G4TokenVec &token)
void Fill1D(G4UIcommand *cmd, G4String newValues)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)
static G4double ValueOf(const char *unitName)
const G4String & GetCommandPath() const
G4double StoD(const G4String &s)
void SetMinMax(G4double minVal, G4double maxVal)
void SetFloatingMinMax(G4bool vl=true)
G4ThreeVector GetSize() const
MeshShape GetShape() const
void RotateY(G4double delta)
void SetAngles(G4double, G4double)
const G4String & GetWorldName() const
void SetCenterPosition(G4double centerPosition[3])
void SetCopyNumberLevel(G4int val)
void RotateX(G4double delta)
void SetSize(G4double size[3])
void RotateZ(G4double delta)