void CCurve::SplineLine(HDC hDC) { Spline(Points, NumPoints, nSCALE, SplinePoints, MaxNumSplinePoints); if(NumPoints) Polyline(hDC, SplinePoints, MaxNumSplinePoints); else Polyline(hDC, SplinePoints, 0); }
void SplineGrid::initialize(int mode) { for (int i = 0; i < this->nRows; i++) { this->splineVectorArray[mode].push_back(Spline()); this->splineVectorArray[mode].back().create(mode, this->dataArray[i], this->nCols, i - (this->nRows / 2), this->cellSize); } if (mode == SplineGrid::MODE_LINEAR or mode == SplineGrid::MODE_QUADRATIC) { float* tempArray = new float[this->nRows]; for (int j = 0; j < this->nCols; j++) { for (int i = 0; i < this->nRows; i++) { tempArray[i] = this->dataArray[i][j]; } this->splineVectorArray[mode].push_back(Spline()); this->splineVectorArray[mode].back().create(mode, tempArray, this->nRows, j - (this->nCols / 2), this->cellSize, true); } delete[] tempArray; } this->initialized[mode] = true; }
//This is where splines are created and added to a vector void SplineManager::addSplines() { std::vector<Point> tempControlPoints = std::vector<Point> { { -10.0f, 5.0f, 0.0f }, //A0 { -10.0f, 5.0f, 4.0f }, //A1 { -4.0f, 5.0f, 10.0f }, //A2 { 0.0f, 5.0f, 10.0f } //A3 }; glm::vec3 splineColour{ 1.0f, 0.0f, 0.0f }; std::vector<Point> tempControlPoints2 = std::vector<Point>{ tempControlPoints[3], //B0 { 4.0f, 5.0f, 10.0f }, //B1 { 10.0f, 5.0f, 4.0f }, //B2 { 10.0f, 5.0f, 0.0f }, //B3 }; glm::vec3 splineColour2 = glm::vec3{ 0.0f, 1.0f, 0.0f }; mSplines.push_back(Spline(framesPerSpline, tempControlPoints, mBasisMatrix, mResolution, splineColour)); mSplines.push_back(Spline(framesPerSpline, tempControlPoints2, mBasisMatrix, mResolution, splineColour2)); }