BLCMDendgroup Class Reference

Inheritance diagram for BLCMDendgroup:

BLCommand

List of all members.


Detailed Description

class BLCMDendgroup implements the endgroup command.

Public Member Functions

 BLCMDendgroup ()
G4String commandName ()
int command (BLArgumentVector &argv, BLArgumentMap &namedArgs)

Constructor & Destructor Documentation

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 }


Member Function Documentation

G4String BLCMDendgroup::commandName (  )  [inline, virtual]

Implements BLCommand.

00029 { return "endgroup"; }

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 }


The documentation for this class was generated from the following file:
g4beamline