add: */
context: int main(int argc,char **argv){    int                      i,winid;    char                    *opt;    std::vector<std::string> filenames;    std::vector<std::string> servers;    std::string              connectionType = "StreamSock";    int                      rows=1;    char                     type='M';    bool                     clientRendering=true;    bool                     compose=false;    int                      subtilesize=32;    UInt32                   balanceType=0;    bool                     sortPipe=true;    std::string              composerType="";    ImageComposerPtr         composer=NullFC;        for(i=1;i<argc;i++)    {        if(strlen(argv[i])>1 && argv[i][0]=='-')        {            switch(argv[i][1])            {                case 'D':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    if(sscanf(opt,"%f,%f,%f",&ca,&cb,&cc)!=3)                    {                        std::cout << "Copy opton -C x,y,z" << std::endl;                        return 1;                    }                    break;                case 'b':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    serviceAddress.assign(opt);                    serviceAddressValid = true;                    break;                case 'f':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    filenames.push_back(opt);                    printf("<%s>\n",opt);                    break;                case 'm':                    connectionType="Multicast";                    break;                case 'r':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    rows=atoi(opt);                    break;                case 't':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    subtilesize=atoi(opt);                    break;#ifdef FRAMEINTERLEAVE                case 'i':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    interleave=atoi(opt);                    break;#endif                case 'C':                    compose=true;                    break;                case 'F':                    type='F';                    break;                case 'P':                    type='P';                    break;                case 'L':                {                    type='L';                    int lpos=2;                    while(argv[i][lpos])                    {                        if(argv[i][lpos] == 'v')                            balanceType=1;                        if(argv[i][lpos] == 'p')                            balanceType=2;                        if(argv[i][lpos] == 's')                            sortPipe=true;                        if(argv[i][lpos] == 'B')                             composerType = "BinarySwapComposer";                        if(argv[i][lpos] == 'P')                            composerType = "PipelineComposer";                        ++lpos;                    }                    break;                }                case 'M':                    type='M';                    break;                case 'I':                    type='I';                    break;                case 's':                    doStereo=true;                    break;                case 'p':                    info=true;                    break;                case 'e':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    sscanf(opt,"%f",&eyedistance);                    break;                case 'z':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    sscanf(opt,"%f",&zeroparallax);                    break;                case 'd':                    clientRendering=false;                    break;                case 'v':                    multiport=true;                    break;                case 'x':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    sscanf(opt,"%d",&serverx);                    break;                case 'y':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    sscanf(opt,"%d",&servery);                    break;                case 'a':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    animName=opt;                    loadAnim();                    glutIdleFunc(display);                           animate=true;                    break;                case 'l':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    if(sscanf(opt,"%d,%d",&animLoops,&animLength) != 2)                    {                        animLength = 30;                        if(sscanf(opt,"%d",&animLoops) != 1)                        {                            animLoops = -1;                        }                    }                    break;                case 'g':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    sscanf(opt,"%d,%d",&winwidth,&winheight);                    break;                case 'G':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    connectionDestination = opt;                    break;                case 'i':                    opt = argv[i][2] ? opt=argv[i]+2 : opt=argv[++i];                    connectionInterface = opt;                    break;                case 'h':                    std::cout << argv[0]                               << "-ffile -m -rrows -C -M"                              << std::endl;                    std::cout << "-m  use multicast" << std::endl                              << "-G  multicast group" << std::endl                              << "-i  interface" << std::endl                              << "-M  multi display" << std::endl#ifdef FRAMEINTERLEAVE                              << "-I  frame interleave" << std::endl#endif                              << "-r  number of display rows" << std::endl                              << "-C  compose" << std::endl                              << "-F  sort-first" << std::endl                              << "-L  sort-last" << std::endl                              << "-h  this msg" << std::endl                              << "-s  stereo" << std::endl                              << "-e  eye distance" << std::endl                              << "-z  zero parallax" << std::endl                              << "-d  disable client rendering"<<std::endl                              << "-v  use two viewports" << std::endl                              << "-x  server x resolution" << std::endl                              << "-y  server y resolution" << std::endl                              << "-t  subtile size for img composition" << std::endl                              << "-D  x,y,z duplicate geometry" << std::endl;                    return 0;            }        }        else        {            servers.push_back(argv[i]);        }    }    try    {        ChangeList::setReadWriteDefault();        osgInit(argc, argv);        glutInit(&argc, argv);        glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );        glutInitWindowSize(winwidth,winheight);        winid = glutCreateWindow("OpenSG Cluster Client");        glutKeyboardFunc(key);        glutReshapeFunc(reshape);        glutDisplayFunc(display);               glutMouseFunc(mouse);           glutMotionFunc(motion);         ract = RenderAction::create();        // clear changelist from prototypes        OSG::Thread::getCurrentChangeList()->clearAll();                // create cluster window        switch(type)        {            case 'M':                 multidisplay=MultiDisplayWindow::create();                clusterWindow=multidisplay;                break;            case 'F':                sortfirst=SortFirstWindow::create();                beginEditCP(sortfirst);                if(compose)                    sortfirst->setCompose(true);                else                    sortfirst->setCompose(false);                endEditCP(sortfirst);                clusterWindow=sortfirst;                break;            case 'L':                sortlast=SortLastWindow::create();                beginEditCP(sortlast);                if(!composerType.empty())                {                    FieldContainerPtr fcPtr =                         FieldContainerFactory::the()->                        createFieldContainer(composerType.c_str());                    ImageComposerPtr icPtr = ImageComposerPtr::dcast(fcPtr);                    if(icPtr != NullFC)                    {                        beginEditCP(icPtr);//                        icPtr->setTileSize(subtilesize);                        icPtr->setStatistics(info);//                    icPtr->setShort(false);                        sortlast->setComposer(icPtr);                        endEditCP(icPtr);                    }                }                endEditCP(sortlast);                clusterWindow=sortlast;                break;#ifdef FRAMEINTERLEAVE            case 'I':                frameinterleave=FrameInterleaveWindow::create();                clusterWindow=frameinterleave;                if(compose)                    frameinterleave->setCompose(true);                else                    frameinterleave->setCompose(false);                break;#endif            case 'P':                sortfirst=SortFirstWindow::create();                beginEditCP(sortfirst);                sortfirst->setCompose(false);                endEditCP(sortfirst);                clusterWindow=sortfirst;                break;        }        beginEditCP(clusterWindow);        {            for(i=0 ; i<servers.size() ; ++i)                clusterWindow->getServers().push_back(servers[i]);            switch(type)            {                case 'M':                     multidisplay->setHServers(                        clusterWindow->getServers().size()/rows);                    multidisplay->setVServers(                        rows);                    break;            }#ifdef FRAMEINTERLEAVE            clusterWindow->setInterleave(interleave);#endif        }        endEditCP(clusterWindow);        // create client window        clientWindow=GLUTWindow::create();//        glutReshapeWindow(800,600);        glutReshapeWindow(winwidth,winheight);        clientWindow->setId(winid);        clientWindow->init();        // init scene graph        init(filenames);        // init client        clusterWindow->setConnectionType(connectionType);        if(clientRendering)        {            clusterWindow->setClientWindow(clientWindow);        }        clusterWindow->init();        clusterWindow->resize(winwidth,winheight);        clientWindow->resize(winwidth,winheight);        clusterWindow->setConnectionDestination(connectionDestination);        clusterWindow->setConnectionInterface(connectionInterface);        glutMainLoop();    }     catch(OSG_STDEXCEPTION_NAMESPACE::exception &e)    {        SLOG << e.what() << std::endl;    }    return 0;}