-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
53 lines (50 loc) · 1.61 KB
/
main.cpp
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
#include <QApplication>
#include "visualizador.h"
#include <iostream>
#include <stdio.h>
#include <GL/glew.h>
#include "Utils/openglutils.h"
#include "Factories/EvaluationStrategyRegistry.h"
#include "Factories/modelexportstrategyregistry.h"
#include "Factories/ModelLoadingFactory.h"
#include "Factories/selectionstrategyregistry.h"
#include "Factories/RendererRegistry.h"
void test(int nCells){
//double cellWidth = 1.0/nCells;
float cellWidth = 2.0f/nCells;
int *values = new int[nCells];
std::cout<<"N CELL: " << nCells << std::endl;
std::cout<<"CELL WIDTH: " << cellWidth << std::endl;
for(int i = 0;i<nCells;i++){
//values[i] = ((float)(i*cellWidth))*nCells;
values[i] = (i*cellWidth)*nCells;
}
for(int i = 0;i<nCells;i++)
if(values[i]!=i)
std::cout << "Pifia!: Values["<<i<<"] = "<<values[i]<<std::endl;
delete values;
}
void printVersions();
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Visualizador w;
w.show();
if(!w.initGlewAndRendererFactory()){
w.hide();
RendererRegistry::deleteSingletonInstance();
EvaluationStrategyRegistry::deleteSingletonInstance();
ModelExportStrategyRegistry::deleteSingletonInstance();
ModelLoadingFactory::deleteSingletonInstances();
SelectionStrategyRegistry::deleteSingletonInstance();
return -1;//fail
}
int end = a.exec();
RendererRegistry::deleteSingletonInstance();
EvaluationStrategyRegistry::deleteSingletonInstance();
ModelExportStrategyRegistry::deleteSingletonInstance();
ModelLoadingFactory::deleteSingletonInstances();
SelectionStrategyRegistry::deleteSingletonInstance();
OpenGLUtils::deleteSingletonInstance();
return end;
}