bool findCutMethod(int x, int y, const int remainingSize)
{
    if(0 == remainingSize)
    {
        return true;
    }
    if(!isSizeAvailable[remainingSize])
    {
        return false;
    }
    if(y > hexagonalWideEnd[x])
    {
        return findCutMethod(x + 1, hexagonalWideStart[x + 1], remainingSize);
    }
    if(hexagonal[x][y])
    {
        for(;hexagonal[x][y] && y<=hexagonalWideEnd[x];++y);
        return findCutMethod(x, y, remainingSize);
    }
    for(int k=0;k<triangleTypeNumber;++k)
    {
        if(couldPlaceTriangle(x,y,triangleType[k]))
        {
            setTriangle(x,y,triangleType[k],true);
            if(findCutMethod(x, y + 1, remainingSize - triangleType[k] * triangleType[k]))
            {
                return true;
            }
            setTriangle(x,y,triangleType[k],false);
        }
    }
    return false;
}
예제 #2
0
파일: mesh.cpp 프로젝트: olofn/db_public
void Mesh::setFace(int faceIndex, int *v)
{
	if (faceIndex < numTriangles)
	{
		setTriangle(faceIndex, v[0], v[1], v[2]);
	}
	else
	{
		setQuad(faceIndex - numTriangles, v[0], v[1], v[2], v[3]);
	}
}
예제 #3
0
void setWaveform(int numSamples, int mode, uint8 *currentWaveform) 
{
    switch (mode) {
        case SQUARE:
            setSquare(numSamples, currentWaveform);
            break;
        case SINE:
            setSine(numSamples, currentWaveform);
            break;
        case TRIANGLE:
            setTriangle(numSamples, currentWaveform);
            break;
        case SAWTOOTH:
            setSawtooth(numSamples, currentWaveform);
            break;
        case DC:
            setDC(numSamples, currentWaveform);
            break;
    }
}
예제 #4
0
/***************Triangle**************************/
Triangle::Triangle(Point3 &v1, Point3 &v2,Point3 &v3,int id)
{
	setTriangle(v1,v2,v3,id);
}