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; }
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]); } }
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; } }
/***************Triangle**************************/ Triangle::Triangle(Point3 &v1, Point3 &v2,Point3 &v3,int id) { setTriangle(v1,v2,v3,id); }