File: sowinexamin.cpp

package info (click to toggle)
pivy 0.6.10-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,216 kB
  • sloc: python: 36,331; cpp: 787; ansic: 733; makefile: 30; sh: 27; objc: 5
file content (40 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (10)
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
#include <Inventor/SoInput.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoTransform.h>

#include <Inventor/Win/SoWin.h>
#include <Inventor/Win/viewers/SoWinExaminerViewer.h>

#include "SoPyScript.h"

int
main(int argc, char *argv[])
{
  if (argc != 2) {
    printf("Usage: %s file.iv\n", argv[0]);
    exit(1);
  }

  // initialize Inventor and Qt
  HWND window = SoWin::init(argv[0]);

  SoPyScript::initClass();

  SoInput * input = new SoInput();
  input->openFile(argv[1]);

  SoSeparator * root = new SoSeparator;
  root->ref();

  root->addChild(SoDB::readAll(input));
  
  // initialize an Examiner Viewer
  SoWinExaminerViewer * examinerViewer = new SoWinExaminerViewer(window);
  examinerViewer->setSceneGraph(root);
  examinerViewer->show();

  SoWin::show(window);
  SoWin::mainLoop();

  return 0;
}