source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/src/vrip/vripMain.cc @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 3.7 KB
Line 
1/*
2
3Brian Curless
4
5Computer Graphics Laboratory
6Stanford University
7
8---------------------------------------------------------------------
9
10Copyright (1997) The Board of Trustees of the Leland Stanford Junior
11University. Except for commercial resale, lease, license or other
12commercial transactions, permission is hereby given to use, copy,
13modify this software for academic purposes only.  No part of this
14software or any derivatives thereof may be used in the production of
15computer models for resale or for use in a commercial
16product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND
17CONCERNING THIS SOFTWARE.  No support is implied or provided.
18
19*/
20
21
22#include <tk.h>
23#include <stdlib.h>
24#ifdef LINUX
25#include <string.h>
26#endif
27
28#include "vripInit.h"
29
30void printNotice();
31
32bool g_bNoUI = false;
33
34/*
35 *----------------------------------------------------------------------
36 *
37 * main --
38 *
39 *      This is the main program for the application.
40 *
41 * Results:
42 *      None: Tk_Main never returns here, so this procedure never
43 *      returns either.
44 *
45 * Side effects:
46 *      Whatever the application does.
47 *
48 *----------------------------------------------------------------------
49 */
50
51int
52main(int argc, char **argv)
53{
54   if (argc < 2) {
55      printNotice();
56   }
57
58   if (!strcmp (argv[argc-1], "-noui")) {
59     g_bNoUI = true;
60     --argc;
61   }
62
63   if (g_bNoUI)
64     Tcl_Main(argc, argv, Tcl_AppInit);
65   else
66     Tk_Main(argc, argv, Tcl_AppInit);
67
68   return 0;                    /* Needed only to prevent compiler warning. */
69}
70
71
72
73/*
74 *----------------------------------------------------------------------
75 *
76 * Tcl_AppInit --
77 *
78 *      This procedure performs application-specific initialization.
79 *      Most applications, especially those that incorporate additional
80 *      packages, will have their own version of this procedure.
81 *
82 * Results:
83 *      Returns a standard Tcl completion code, and leaves an error
84 *      message in interp->result if an error occurs.
85 *
86 * Side effects:
87 *      Depends on the startup script.
88 *
89 *----------------------------------------------------------------------
90 */
91
92int
93Tcl_AppInit(Tcl_Interp *interp)
94{
95    Tk_Window main;
96
97    if (Tcl_Init(interp) == TCL_ERROR) {
98        return TCL_ERROR;
99    }
100
101    if (g_bNoUI) {
102      Tcl_SetVar (interp, "noui", "1", TCL_GLOBAL_ONLY);
103    } else {
104      Tcl_SetVar (interp, "noui", "0", TCL_GLOBAL_ONLY);
105      if (Tk_Init(interp) == TCL_ERROR) {
106        return TCL_ERROR;
107      }
108      Tcl_StaticPackage(interp, "Tk", Tk_Init, (Tcl_PackageInitProc *) NULL);
109    }
110
111    /*
112     * Call the init procedures for included packages.  Each call should
113     * look like this:
114     *
115     * if (Mod_Init(interp) == TCL_ERROR) {
116     *     return TCL_ERROR;
117     * }
118     *
119     * where "Mod" is the name of the module.
120     */
121
122    if (Vrip_Init(interp) == TCL_ERROR) {
123        return TCL_ERROR;
124    }
125
126
127    /*
128     * Call Tcl_CreateCommand for application-specific commands, if
129     * they weren't already created by the init procedures called above.
130     */
131
132    /*
133     * Specify a user-specific startup file to invoke if the application
134     * is run interactively.  Typically the startup file is "~/.apprc"
135     * where "app" is the name of the application.  If this line is deleted
136     * then no user-specific startup file will be run under any conditions.
137     */
138
139    /* Tcl_SetVar(interp, "tcl_rcFileName", "~/.vriprc", TCL_GLOBAL_ONLY);*/
140
141    return TCL_OK;
142}
143
144
145void
146printNotice()
147{
148   printf("\n");
149   printf("VRIP - Volumetric Range Image Processor\n");
150   printf("\n");
151   printf("Version 0.31 - November 25, 2006\n");
152   printf("\n");
153   printf("Copyright 2006 - University of Washington and Stanford University\n");
154   printf("\n");
155   printf("Type 'vrip_copyright' for copyright details.\n");
156   printf("\n");
157}
158
Note: See TracBrowser for help on using the repository browser.