示例#1
0
void CameraTestTool::drawClosestFieldCamera(double pixelSize) {
  CleanupParameters *cp =
      CleanupSettingsModel::instance()->getCurrentParameters();

  double zoom = cp->m_closestField / cp->m_camera.getSize().lx;
  if (areAlmostEqual(zoom, 1.0, 1e-2)) return;

  TRectD rect(cp->m_camera.getStageRect());
  rect = rect.enlarge((zoom - 1) * (rect.x1 - rect.x0 + 1) / 2.0,
                      (zoom - 1) * (rect.y1 - rect.y0 + 1) / 2.0);

  glColor3d(0.0, 0.0, 1.0);
  glLineStipple(1, 0xFFFF);
  glEnable(GL_LINE_STIPPLE);

  // box
  glBegin(GL_LINE_STRIP);
  glVertex2d(rect.x0, rect.y0);
  glVertex2d(rect.x0, rect.y1 - pixelSize);
  glVertex2d(rect.x1 - pixelSize, rect.y1 - pixelSize);
  glVertex2d(rect.x1 - pixelSize, rect.y0);
  glVertex2d(rect.x0, rect.y0);
  glEnd();

  glDisable(GL_LINE_STIPPLE);

  // camera name
  TPointD pos = rect.getP01() + TPointD(0, 4);
  glPushMatrix();
  glTranslated(pos.x, pos.y, 0);
  glScaled(2, 2, 2);
  tglDrawText(TPointD(), "Closest Field");
  glPopMatrix();
}
示例#2
0
void CameraTestTool::drawCleanupCamera(double pixelSize) {
  CleanupParameters *cp =
      CleanupSettingsModel::instance()->getCurrentParameters();

  TRectD rect = cp->m_camera.getStageRect();

  glColor3d(1.0, 0.0, 0.0);
  glLineStipple(1, 0xFFFF);
  glEnable(GL_LINE_STIPPLE);

  // box
  glBegin(GL_LINE_STRIP);
  glVertex2d(rect.x0, rect.y0);
  glVertex2d(rect.x0, rect.y1 - pixelSize);
  glVertex2d(rect.x1 - pixelSize, rect.y1 - pixelSize);
  glVertex2d(rect.x1 - pixelSize, rect.y0);
  glVertex2d(rect.x0, rect.y0);
  glEnd();

  // central cross
  double dx = 0.05 * rect.getP00().x;
  double dy = 0.05 * rect.getP00().y;
  tglDrawSegment(TPointD(-dx, -dy), TPointD(dx, dy));
  tglDrawSegment(TPointD(-dx, dy), TPointD(dx, -dy));

  glDisable(GL_LINE_STIPPLE);

  // camera name
  TPointD pos = rect.getP01() + TPointD(0, 4);
  glPushMatrix();
  glTranslated(pos.x, pos.y, 0);
  glScaled(2, 2, 2);
  tglDrawText(TPointD(), "Cleanup Camera");
  glPopMatrix();
}
示例#3
0
void Viewer::paintGL()
{
	glClear(GL_COLOR_BUFFER_BIT);
	if (m_raster) {
		glRasterPos2d(0, 0);
		glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); // ras->getWrap());
		glDrawPixels(m_raster->getLx(), m_raster->getLy(), TGL_FMT, TGL_TYPE, m_raster->getRawData());
	}
	if (m_processor) {
		m_processor->draw();
	}

	if (m_message != "") {
		glColor3d(0, 0, 0);
		glPushMatrix();
		const double sc = 5;
		glScaled(sc, sc, sc);
		tglDrawText(TPointD(5, 5), m_message);
		glPopMatrix();
	}
}