Beispiel #1
0
PGL_USING_NAMESPACE
TOOLS_USING_NAMESPACE

/* ----------------------------------------------------------------------- */
ViewCameraMenu::ViewCameraMenu(ViewCameraGL * camera,QWidget * parent, const char * name):
  QMenu(parent)
{
  if(name)setObjectName(name);

  QPixmap home(ViewerIcon::getPixmap(ViewerIcon::home));
  QPixmap read(ViewerIcon::getPixmap(ViewerIcon::fileopen));
  QPixmap save(ViewerIcon::getPixmap(ViewerIcon::filefloppy));
  QPixmap persp(ViewerIcon::getPixmap(ViewerIcon::perspective));
  QPixmap ortho(ViewerIcon::getPixmap(ViewerIcon::orthographic));
  QPixmap linked(ViewerIcon::getPixmap(ViewerIcon::linked));
  QPixmap eyef(ViewerIcon::getPixmap(ViewerIcon::eyef));

  QAction * action = addAction(home,tr("Home"),      camera,SLOT(home()), Qt::CTRL+Qt::Key_I);

  addAction(tr("&Front View (YZ)"),camera,SLOT(YZView()));
  addAction(tr("&Right View (XZ)"),camera,SLOT(XZView()));
  addAction(tr("&Top View (XY)"),  camera,SLOT(XYView()));
  addSeparator();
  QMenu * __coordMenu = new QMenu(this);
  idGEOMcoord = __coordMenu->addAction(tr("GEOM System"),   camera,SLOT(setGEOMCoordSys()));
  idGLcoord   = __coordMenu->addAction(tr("GL System"),     camera,SLOT(setGLCoordSys()));
  __coordMenu->addSeparator();
  __coordMenu->addAction(tr("&Change"),       camera,SLOT(changeCoordSys()));
  idGEOMcoord->setCheckable(true);
  idGLcoord->setCheckable(true);
  setCoordSys(camera->getCoordSys());
  __coordMenu->setTitle(tr("Coordinates System"));
  addMenu(__coordMenu);
  addSeparator();
  QMenu * __projectionMenu = new QMenu(this);
  idPerspective = __projectionMenu->addAction(persp,tr("&Perspective"),  camera,SLOT(setPerspectiveMode()));
  idOrtho       = __projectionMenu->addAction(ortho,tr("Ort&hographic"), camera,SLOT(setOrthographicMode()));
  __projectionMenu->addSeparator();
  __projectionMenu->addAction(tr("&Change"),       camera,SLOT(changeCameraMode()),Qt::CTRL+Qt::Key_D);
  idPerspective->setCheckable(true);
  idOrtho->setCheckable(true);
  __projectionMenu->setTitle(tr("Projection"));
  addMenu(__projectionMenu);

  setProjectionMode(camera->getProjectionMode());
  QObject::connect(camera,SIGNAL(projectionChanged(bool)),this,SLOT(setProjectionMode(bool)));
  QObject::connect(camera,SIGNAL(coordSysChanged(int)),this,SLOT(setCoordSys(int)));
  addSeparator();
  addAction(save,tr("&Save"),       camera,SLOT(save()));
  addAction(read,tr("&Read"),       camera,SLOT(read()));
  addSeparator();
  QAction * idLock = addAction(linked,tr("&Auto Fit to Window"),       camera,SLOT(lockDim()));
  if(camera)idLock->setChecked(camera->isDimLock());
  QObject::connect(camera,SIGNAL(lockDimChanged(bool)),idLock,SLOT(setChecked(bool)));
  addAction(eyef,tr("&Fit to Window"),       camera,SLOT(reDim()));

}
DrawHandler::DrawHandler(GLFWwindow* nWindow) {
	// TODO Auto-generated constructor stub
	window = nWindow;
	setPerspectiveMode(PH_FRUSTRUM);
}