Example #1
0
bool NFCGridModule::Init()
{
    // init all grid
    for (int nWidthPos = 0; nWidthPos < mnSceneWidth; nWidthPos += nGridWidth)
    {
        for (int nHeightPos = 0; nHeightPos < mnSceneWidth; nHeightPos += nGridWidth)
        {
            NFIDENTID gridID = ComputerGridID(nWidthPos, 0, nHeightPos);
            if (!GetGridInfo(gridID))
            {
                RegisterGrid(gridID);
            }
        }
    }
    //     for (int nWidthPos = -mnSceneWidth + 1; nWidthPos < mnSceneWidth; nWidthPos++)
    //     {
    //         for (int nHeightPos = -mnSceneWidth + 1; nHeightPos < mnSceneWidth; nHeightPos++)
    //         {
    //             NFIDENTID gridID = ComputerGridID(nWidthPos, 0, nHeightPos);
    //             if (!GetGridInfo(gridID))
    //             {
    //                 RegisterGrid(gridID);
    //             }
    //         }
    //     }

    // connect all grid
    TMAP_GRID_INFO::iterator it = mtGridInfoMap.begin();
    for (it; it != mtGridInfoMap.end(); it++)
    {
        NFCSceneGridInfo* aroundGrid[EGRID_DIRECTION_MAXCOUNT] = { 0 };

        for (int  i = 0; i < EGRID_DIRECTION_MAXCOUNT; i++)
        {
            aroundGrid[i] = GetConnectGrid(it->first, (EGRID_DIRECTION)i);
        }

        it->second->Init(aroundGrid);
    }

    return true;
}
Example #2
0
int	main(     int     argc,
		  char    *argv[])
{
	
    MrmInitialize();
	
	appshell = XtAppInitialize(&appContext,"GreatSPN_Motif",NULL,0,&argc,argv,fallback,NULL,0);
#ifdef Linux
   /* Enables the application to talk with editres.
      For debug purposes only */
/*   XmdRegisterEditres(appshell);*/
#endif
	OpenHierarchy();

  	if (MrmRegisterNames (regvec, regnum)
			!= MrmSUCCESS)
			    XtError("can't register names\n");	
	RegisterArcChangeDialog();
	RegisterColorChangeDialog();
	RegisterPlaceChangeDialog();
	RegisterTransChangeDialog();
	RegisterShowDialog();
	RegisterResultDialog();
	RegisterRateDialog();
	RegisterPrintDialog();
	RegisterMDGrammarDialog();
	RegisterMarkDialog();
	RegisterViewLayerDialog();
	RegisterEditLayerDialog();
	RegisterConsoleDialog();
	RegisterCommentDialog();
	RegisterZooomMenuCallbacks();
	RegisterMenuCallbacks();
	RegisterRescale();
	RegisterGrid();
	RegisterMenuValues();
	RegisterOptionsDialog();
	RegisterSimulationDialog();
	RegisterSwnSimOptionsDialog();
	RegisterSwnRGOptionsDialog();
	RegisterSwnUnfoldOptionsDialog();
	
/*    puts(" ...  start FetchWidget"); fflush(stdout);*/
	mainwin = FetchWidget(appshell,"MainWin");
	
/*    puts(" ...  start InitMainWindow"); fflush(stdout);*/
    InitMainWindow();
/*    puts(" ...  start InitWorkWindow"); fflush(stdout);*/
    InitWorkWindow();
/*    puts(" ...  start InitFonts"); fflush(stdout);*/
    InitFonts();
/*    puts(" ...  start InitMenuBar"); fflush(stdout);*/
    InitMenuBar();
/*    puts(" ...  start InitPopups"); fflush(stdout);*/
    InitPopups();
			
/*    puts(" ...  start XtManageChild"); fflush(stdout);*/
	XtManageChild( mainwin );
/*    puts(" ...  start XtRealizeWidget"); fflush(stdout);*/
    XtRealizeWidget( appshell );
/*    puts(" ...  start InitFilesPath"); fflush(stdout);*/
	InitFilesPath();
/*    puts(" ...  start InitGSPNShellErrors"); fflush(stdout);*/
	InitGSPNShellErrors();
/*    puts(" ...  start gdiInitEngine"); fflush(stdout);*/
	gdiInitEngine(appshell);
/*    puts(" ...  start gdiInitDrawingAreaGC"); fflush(stdout);*/
    gdiInitDrawingAreaGC();
/*    puts(" ...  start InitOther"); fflush(stdout);*/
	InitOther();  
/*
    InitMsgDB();
*/
/*    puts(" ...  start XmUpdateDisplay"); fflush(stdout);*/
    XmUpdateDisplay(mainwin);
/*    puts(" ...  start XtAppMainLoop"); fflush(stdout);*/
    XtAppMainLoop(appContext);

    return 0;
}