-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
46 lines (34 loc) · 1.03 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
#include <iostream>
#include <queue>
#include "Painter.h"
#include <Inventor/Win/SoWin.h>
#include <Inventor/Win/SoWin.h>
#include <Inventor/Win/viewers/SoWinExaminerViewer.h>
int main()
{
HWND window = SoWin::init("");
SoWinExaminerViewer* viewer = new SoWinExaminerViewer(window);
//make a dead simple scene graph by using the Coin library, only containing a single cone under the scenegraph root
SoSeparator* root = new SoSeparator;
root->ref();
Painter* painter = new Painter();
Mesh* mesh = new Mesh();
std::string name = "bunny-1.obj";
mesh->loadObj(name.c_str());
vector<Eigen::Vector3i> filled;
filled = holyFiller(mesh, ANGLE, REFINE, SCALE_WHOLE, 1);
SoSeparator* thickEdgeSep = new SoSeparator();
SoSeparator* sep = painter->getShapeSep(mesh, filled, thickEdgeSep);
root->addChild(sep);
root->addChild(thickEdgeSep);
viewer->setSize(SbVec2s(640, 480));
viewer->setSceneGraph(root);
viewer->show();
SoWin::show(window);
SoWin::mainLoop();
delete viewer;
root->unref();
char k;
scanf_s(" %c", &k);
return 0;
}