void SurfacePlot::createEnrichment(Enrichment& p) { if (!actualData_p) return; //todo future work if (p.type() != Enrichment::VERTEXENRICHMENT) return; p.assign(*this); p.drawBegin(); VertexEnrichment* ve = (VertexEnrichment*)&p; if (actualData_p->datatype == Qwt3D::POLYGON) { for (unsigned i = 0; i != actualDataC_->normals.size(); ++i) ve->draw(actualDataC_->nodes[i]); } else if (actualData_p->datatype == Qwt3D::GRID) { int step = resolution(); for (int i = 0; i <= actualDataG_->columns() - step; i += step) for (int j = 0; j <= actualDataG_->rows() - step; j += step) ve->draw(Triple(actualDataG_->vertices[i][j][0], actualDataG_->vertices[i][j][1], actualDataG_->vertices[i][j][2])); } p.drawEnd(); }
void Curve::createEnrichment(Enrichment& p) { if (!actualData_p) return; //todo future work if (p.type() != Enrichment::VERTEXENRICHMENT) return; p.assign(*this); p.drawBegin(); int step = resolution(); VertexEnrichment* ve = (VertexEnrichment*)&p; if (actualData_p->datatype == Qwt3D::POLYGON) { unsigned int size = actualDataC_->nodes.size(); for (unsigned i = 0; i < size; i += step) ve->draw(actualDataC_->nodes[i]); } else if (actualData_p->datatype == Qwt3D::GRID) { unsigned int cols = actualDataG_->columns(); unsigned int rows = actualDataG_->rows(); for (unsigned int i = 0; i <= cols - step; i += step) { for (unsigned int j = 0; j <= rows - step; j += step) { double *v = actualDataG_->vertices[i][j]; ve->draw(Triple(v[0], v[1], v[2])); } } } p.drawEnd(); }