Public Member Functions | |
BLCMDendgroup () | |
G4String | commandName () |
int | command (BLArgumentVector &argv, BLArgumentMap &namedArgs) |
BLCMDendgroup::BLCMDendgroup | ( | ) |
References BLCMDTYPE_CONTROL, BLCommand::registerCommand(), BLCommand::setDescription(), and BLCommand::setSynopsis().
00039 { 00040 registerCommand(BLCMDTYPE_CONTROL); 00041 setSynopsis("ends a group definition."); 00042 setDescription("The group may then be placed as any other element.\n" 00043 "If the group was not given a length via an argument,\n" 00044 "endgroup computes the length and adjusts the offsets\n" 00045 "of all elements in the group so they refer to the center\n" 00046 "of the group."); 00047 }
G4String BLCMDendgroup::commandName | ( | ) | [inline, virtual] |
int BLCMDendgroup::command | ( | BLArgumentVector & | argv, | |
BLArgumentMap & | namedArgs | |||
) | [virtual] |
Implements BLCommand.
References BLGroup::end(), BLGroup::getCurrent(), BLElement::getName(), BLGroup::getWorld(), BLGroup::height, BLGroup::length, BLCommand::printError(), and BLGroup::width.
00050 { 00051 if(argv.size() != 0 || namedArgs.size() != 0) { 00052 printError("Invalid endgroup command"); 00053 return -1; 00054 } 00055 00056 BLGroup *c = BLGroup::getCurrent(); 00057 if(c == BLGroup::getWorld()) { 00058 printError("Invalid endgroup command"); 00059 return -1; 00060 } 00061 c->end(); 00062 00063 printf("endgroup %-6s length=%.1f width=%.1f height=%.1f\n", 00064 c->getName().c_str(),c->length,c->width,c->height); 00065 00066 return 0; 00067 }