-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMeshToolsMain.cxx
More file actions
151 lines (119 loc) · 4.17 KB
/
Copy pathMeshToolsMain.cxx
File metadata and controls
151 lines (119 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//
// "$Id: MeshToolsMain.cxx,v 1.2.2.5.2.4 2004/04/11 04:39:00 easysw Exp $"
//
// MeshToolsUI class definitions for the Fast Light Tool Kit (FLTK).
//
//
#include "config.h"
#include <ctime>
#include <FL/Fl.H>
#define GLEW_STATIC
#include <GL/glew.h>
#include <FL/gl.h>
//#include "Struct.h"
#include "MeshToolsUI.h"
//#include "Struct.h"
void myGLInit(void)
{
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat light_position[] = { 0.0, 0.3, 0.3, 0.0 };
GLfloat lmodel_ambient[] = { 0.4, 0.4, 0.4, 1.0 };
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
glEnable(GL_NORMALIZE);
#if 0
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
#endif
glShadeModel(GL_SMOOTH);
#if 0
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
#endif
// SetupMaterials();
// CreateTreeLists();
glFlush();
}
int CharToInt(char d)
{
char c[2];
c[0] = d;
c[1] = '\0';
if (strcmp(c, "0")==0){return 0;}
if (strcmp(c, "1")==0){return 1;}
if (strcmp(c, "2")==0){return 2;}
if (strcmp(c, "3")==0){return 3;}
if (strcmp(c, "4")==0){return 4;}
if (strcmp(c, "5")==0){return 5;}
if (strcmp(c, "6")==0){return 6;}
if (strcmp(c, "7")==0){return 7;}
if (strcmp(c, "8")==0){return 8;}
if (strcmp(c, "9")==0){return 9;}
if (strcmp(c, "A")==0){return 10;}
if (strcmp(c, "B")==0){return 11;}
if (strcmp(c, "C")==0){return 12;}
if (strcmp(c, "D")==0){return 13;}
if (strcmp(c, "E")==0){return 14;}
if (strcmp(c, "F")==0){return 15;}
return 0;
}
int main(int argc, char **argv) {
//0.7 = initial 64 bits version
//0.8 = write a few filters
//1.0.1 => update_rgb missing dans lasso tag et fill holes
//1.0.3 => pb with path
//1.0.4 => small behavious with selected objets
// => norms saved inside .ply files
// => .flg formats : normal direction normalized.
// 1.0.5 => does not crash when selecting thousands of objets
// 1.2.1 => version which should compile under linux, thanks to Stephan
// 1.3 => crossplatform version (windows, linux, mac), VBO colours corrections,
// MeshTools.ini is now located at a user's specific location + when non existing default values are created
// possibility to reinitialize a tag colours and labels, and object/grid/background colours
// camera now can rotate around objects center of mass (and not only around 0,0,0),
// automatically adjustable landmark display size
// project files now include tags/landmarks/flags/curves/orientation labels/
// 1.3.1 => Zoom correction (should function correctly with very large and very small objects)
// => Colours should be saved correctly now within .PLY files
// => Possibility to edit landmarks coordinate
// => Possibility to add landmarks at user-defined xyz coordinates.
// 1.3.2 => Possibility to apply a position/transposed positions to landmarks and flags
// => Edit flags 1 by 1
// => Get colour of closest vertex for 1 flag or for all flags.
// => Some colours are rendered badly for flags... where does it come from ?
// 1.3.3 => Open .ntw file know accepts file names and paths containing spaces... + minor compatibility issues with vtk 7.X.X
// 1.3.4 => Acknowledgements to FoRM-IT in the About window
strcpy (Version,"1.3.4");
printf("Version : %s\n",Version);
MeshToolsUI *MeshToolsui=new MeshToolsUI;
//MeshToolsui->show(argc, argv);
//glewInit();
//return Fl::run();
time_t t = time(0); // get time now
struct tm * now = localtime( & t );
int year = now->tm_year + 1900;
int month = now->tm_mon + 1;
//printf ("Year : %d Month:%d\n",year, month);
// Fl::visual(FL_DOUBLE|FL_INDEX);
if (argc ==1)
{
MeshToolsui->show(argc, argv);
return Fl::run();
}
else
{
exit(0);
}
}
//
// End of "$Id: CubeMain.cxx,v 1.2.2.5.2.4 2004/04/11 04:39:00 easysw Exp $".
//