Exemplo n.º 1
0
void ProcessChannel(ChannelSearchInfo * info)
{
	switch (info->type)
	{
	case CH_LINE_TYPE:
		ViewLine(info->hChannel);
		break;
	case CH_SPECTRUM_TYPE:
		ViewSpectrum(info->hChannel);
		break;
	case CH_DOTS_TYPE:
		ViewDots(info->hChannel);
		break;
	case CH_TEXT_TYPE:
		ViewText(info->hChannel);
		break;
	default:
		ViewData(info->hChannel);
	}	
}
Exemplo n.º 2
0
void DrawScene(void)
{
	Line l;
	float angle;
	int x,z, xr,zr;
	
	cXLine.R = 0;
	cXLine.G = 0;
	cXLine.B = 0xff;
	
	cYLine.R = 0;
	cYLine.G = 0xff;
	cYLine.B = 0;
	
	cZLine.R = 0xff;
	cZLine.G = 0;
	cZLine.B = 0;
	
	cAll.R = 0;
	cAll.G = 0;
	cAll.B = 0;
	
	cCenter.R = 0xff;
	cCenter.G = 0xff;
	cCenter.B = 0;
	
	currentTextPosition = 0;
	
	Draw3DAxes();
	DrawProjection2DAxes();
	
	angle = (float)xClick*M_PI/(float)360.0;
	
	x = 70;
	z = 70;
	
	xr=x*cos(angle)+z*sin(angle);
	zr=-x*sin(angle)+z*cos(angle);
	
	l.Start.X = xr;
	l.Start.Y = yClick;
	l.Start.Z = zr;
	
	l.Stop.X = xr;
	l.Stop.Y = yClick + 70;
	l.Stop.Z = zr;
	
	DrawVector(&l, &cAll, 1);
	
	x = 70;
	z = 70;
	
	xr=x*cos(angle)+z*sin(angle);
	zr=-x*sin(angle)+z*cos(angle);

	l.Start.X = 0;
	l.Start.Y = yClick;
	l.Start.Z = 0;
	
	l.Stop.X = xr;
	l.Stop.Y = yClick;
	l.Stop.Z = zr;
	
	DrawVector(&l, &cAll, 1);

	l.Start.X = 0;
	l.Start.Y = yClick + 70;
	l.Start.Z = 0;
	
	l.Stop.X = xr;
	l.Stop.Y = yClick + 70;
	l.Stop.Z = zr;
	
	DrawVector(&l, &cAll, 1);
	
	ViewText("Object coords");
	ViewText("X1: %3d, X2: %3d",l.Start.X, l.Stop.X);
	ViewText("Y1: %3d, Y2: %3d",l.Start.Y, l.Stop.Y);
	ViewText("Z1: %3d, Z2: %3d",l.Start.Z, l.Stop.Z);
	ViewText("Angle: %3.3f, %2.5f", xClick, angle);
}