예제 #1
0
//-----------------------------------------------------------------------------
// log files flush and roll-up
void    Conf::check_log_size()
{
    if(_logcntn.tellp() > 0)/* log this right away*/
    {
        AutoLock __a(&_m);

        char    logf[400];
        ::sprintf(logf, "%s/LOG%d-%d.log0", _logs_path.c_str(),getppid(),getpid());
        FILE* pf = ::fopen(logf,"ab");
        long int flen=0;

        if(pf)
        {
            ::fwrite(_logcntn.str().c_str(), 1, _logcntn.str().length(), pf);
            flen = ftell(pf);
            ::fclose(pf);
        }

        _logcntn.str("");
        _logcntn.clear();
        _logcntn.seekp(0);
        _logcntn.seekg(0);

        if(flen > MAX_ROLLUP)
        {
            ::sprintf(logf, "LOG%d-%d", getppid(),getpid());
            PCFG->rollup_logs(logf);
        }
    }
}
예제 #2
0
void Line::Draw (CDC *pDC, Camera *camera, unsigned int color)
{
	Matrix a = Matrix::HomogeneousCoordinate3D (A.x, A.y, A.z) * transform;
	Matrix b = Matrix::HomogeneousCoordinate3D (B.x, B.y, B.z) * transform;

	if(camera->CullLine (&a, &b))
	{
		Matrix mat = camera->Get ();

		Matrix aa = a * mat;
		Matrix bb = b * mat;

		Point3D aaa = camera->World2Screen (aa);
		Point3D bbb = camera->World2Screen (bb);

		Matrix __a = a*camera->Get2();
		Matrix __b = b*camera->Get2();

		aaa.z = __a(1,3)/__a(1,4);
		bbb.z = __b(1,3)/__b(1,4);

		DrawLine(pDC, aaa, bbb, color, flag);
	}
}