447{
449
450 if(command == listCmd)
451 {
453 }
454 else if(command == dumpCmd)
455 {
457 }
458 else if(command == drawCmd)
459 {
465 fSMan->
DrawMesh(meshName, psName, colorMapName, axflg);
466 }
467 else if(command == drawColumnCmd)
468 {
475 fSMan->
DrawMesh(meshName, psName, iPlane, iColumn, colorMapName);
476 }
477 else if(command == dumpQtyToFileCmd)
478 {
484 auto mesh = fSMan->
FindMesh(meshName);
485 if(mesh == nullptr)
486 {
488 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
490 return;
491 }
493 }
494 else if(command == dumpQtyWithFactorCmd)
495 {
502 auto mesh = fSMan->
FindMesh(meshName);
503 if(mesh == nullptr)
504 {
506 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
508 return;
509 }
513 }
514 else if(command == dumpAllQtsToFileCmd)
515 {
520 auto mesh = fSMan->
FindMesh(meshName);
521 if(mesh == nullptr)
522 {
524 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
526 return;
527 }
529 }
530 else if(command == dumpAllQtsWithFactorCmd)
531 {
537 auto mesh = fSMan->
FindMesh(meshName);
538 if(mesh == nullptr)
539 {
541 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
543 return;
544 }
548 }
549 else if(command == fill1DCmd)
550 {
552 }
553 else if(command == verboseCmd)
554 {
556 }
557 else if(command == meshBoxCreateCmd)
558 {
560 if(currentmesh != nullptr)
561 {
563 ed <<
"ERROR[" << meshBoxCreateCmd->
GetCommandPath() <<
"] : Mesh <"
565 << "> is still open. Close it first. Command ignored.";
567 }
568 else
569 {
571 if(mesh == nullptr)
572 {
575 }
576 else
577 {
580 << "] : Scoring mesh <" << newVal
581 << "> already exists. Command ignored.";
583 }
584 }
585 }
586 else if(command == meshCylinderCreateCmd)
587 {
589 if(currentmesh != nullptr)
590 {
592 ed <<
"ERROR[" << meshCylinderCreateCmd->
GetCommandPath() <<
"] : Mesh <"
594 << "> is still open. Close it first. Command ignored.";
596 }
597 else
598 {
600 if(mesh == nullptr)
601 {
604 }
605 else
606 {
609 << "] : Scoring mesh <" << newVal
610 << "> already exists. Command ignored.";
612 }
613 }
614 }
615 else if(command == meshRWLogVolCreateCmd)
616 {
618 if(mesh != nullptr)
619 {
621 ed <<
"ERROR[" << meshRWLogVolCreateCmd->
GetCommandPath() <<
"] : Mesh <"
623 << "> is still open. Close it first. Command ignored.";
625 }
626 else
627 {
632 if(mesh == nullptr)
633 {
637 }
638 else
639 {
642 << "] : Scoring mesh <" << meshName
643 << "> already exists. Command ignored.";
645 }
646 }
647 }
648 else if(command == probeCreateCmd)
649 {
651 if(mesh != nullptr)
652 {
654 ed <<
"ERROR[" << meshRWLogVolCreateCmd->
GetCommandPath() <<
"] : Mesh <"
656 << "> is still open. Close it first. Command ignored.";
658 }
659 else
660 {
667 if(mesh == nullptr)
668 {
671 }
672 else
673 {
675 ed <<
"ERROR[" << probeCreateCmd->
GetCommandPath() <<
"] : Mesh name <"
676 << qname << "> already exists. Use another name.";
678 }
679 }
680 }
681 else if(command == probeMatCmd || command == probeLocateCmd)
682 {
684 if(mesh == nullptr)
685 {
687 ed << "ERROR : No mesh is currently open. Open/create a mesh first. "
688 "Command ignored.";
690 return;
691 }
692 if(mesh->
GetShape() != MeshShape::probe)
693 {
695 ed << "ERROR : Inconsistent mesh type. Close current mesh and open "
696 "Scoring Probe.";
698 return;
699 }
700
701 if(command == probeMatCmd)
702 {
704 if(!succ)
705 {
707 ed << "Material <" << newVal
708 << "> is not defind in G4NistManager. Command is ignored.\n"
709 << "Use /material/nist/listMaterials command to see the available "
710 "materials.";
712 return;
713 }
714 }
715 else if(command == probeLocateCmd)
716 {
719 }
720 }
721 else if(command == listColorMapCmd)
722 {
724 }
725 else if(command == floatMinMaxCmd)
726 {
728 if(colorMap != nullptr)
729 {
731 }
732 else
733 {
735 ed <<
"ERROR[" << floatMinMaxCmd->
GetCommandPath() <<
"] : color map <"
736 << newVal << "> is not defined. Command ignored.";
738 }
739 }
740 else if(command == colorMapMinMaxCmd)
741 {
747 if(colorMap != nullptr)
748 {
751 }
752 else
753 {
755 ed <<
"ERROR[" << colorMapMinMaxCmd->
GetCommandPath() <<
"] : color map <"
756 << newVal <<
"> is not defined. Command ignored." <<
G4endl;
758 }
759 }
760 else if(command == meshOpnCmd)
761 {
763 if(currentmesh != nullptr)
764 {
768 << "> is still open. Close it first. Command ignored.";
770 }
771 else
772 {
774 if(mesh == nullptr)
775 {
777 ed <<
"ERROR[" << meshOpnCmd->
GetCommandPath() <<
"] : Scoring mesh <"
778 << newVal << "> does not exist. Command ignored.";
780 }
781 else
782 {
784 }
785 }
786 }
787 else if(command == meshClsCmd)
788 {
790 }
791 else
792 {
793
794
795
797
798
799 if(mesh != nullptr)
800 {
802 if(shape == MeshShape::realWorldLogVol)
803 {
806 << "] : Number of mesh command cannot be set for this type of mesh. "
807 "Command ignored.";
809 }
810 else
811 {
812
815
816
817 if(command == mBoxSizeCmd)
818 {
819 if(shape == MeshShape::box)
820 {
827 }
828 else
829 {
832 << "] : This mesh is not Box. Command ignored.";
834 }
835 }
836 else if(command == mCylinderSizeCmd || command == mCylinderRMinCmd ||
837 command == mCylinderAngleCmd)
838 {
839 if(shape != MeshShape::cylinder)
840 {
843 << "] : This mesh is not Cylinder. Command ignored.";
845 }
846 else
847 {
848 if(command == mCylinderSizeCmd)
849 {
851 vsize[0] = (mesh->
GetSize()).x();
852 vsize[1] =
StoD(token[0]);
853 vsize[2] =
StoD(token[1]);
855 vsize[1] *= unt;
856 vsize[2] *= unt;
858 }
859 else if(command == mCylinderRMinCmd)
860 {
863 vsize[1] = (mesh->
GetSize()).y();
864 vsize[2] = (mesh->
GetSize()).z();
866 }
867 else if(command == mCylinderAngleCmd)
868 {
872 mesh->
SetAngles(stphi * unt, spphi * unt);
873 }
874 }
875 }
876 else if(command == mBinCmd)
877 {
879 }
880 else if(command == mTResetCmd)
881 {
882 G4double centerPosition[3] = { 0., 0., 0. };
884 }
885 else if(command == mTXyzCmd)
886 {
889 centerPosition[0] = xyz.
x();
890 centerPosition[1] = xyz.
y();
891 centerPosition[2] = xyz.
z();
893 }
894 else if(command == mRotXCmd)
895 {
898 }
899 else if(command == mRotYCmd)
900 {
903 }
904 else if(command == mRotZCmd)
905 {
908 }
909 }
910 }
911 else
912 {
914 ed << "ERROR: No mesh is currently open. Open/create a mesh first. "
915 "Command ignored.";
917 }
918 }
919}
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)