本文整理汇总了C++中Arrow::assign方法的典型用法代码示例。如果您正苦于以下问题:C++ Arrow::assign方法的具体用法?C++ Arrow::assign怎么用?C++ Arrow::assign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arrow
的用法示例。
在下文中一共展示了Arrow::assign方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createNormalsC
void SurfacePlot::createNormalsC()
{
if (!normals() || actualData_p->empty())
return;
if (actualDataC_->nodes.size() != actualDataC_->normals.size())
return;
Arrow arrow;
arrow.setQuality(normalQuality());
Triple basev, topv, norm;
double diag = (actualData_p->hull().maxVertex-actualData_p->hull().minVertex).length() * normalLength();
RGBA col;
arrow.assign(*this);
arrow.drawBegin();
for (unsigned i = 0; i != actualDataC_->normals.size(); ++i)
{
basev = actualDataC_->nodes[i];
topv = basev + actualDataC_->normals[i];
norm = topv-basev;
norm.normalize();
norm *= diag;
arrow.setTop(basev+norm);
arrow.setColor((*datacolor_p)(basev.x,basev.y,basev.z));
arrow.draw(basev);
}
arrow.drawEnd();
}
示例2: createNormalsG
void Curve::createNormalsG()
{
if (!normals() || actualDataG_->empty())
return;
Arrow arrow;
arrow.setQuality(normalQuality());
Triple basev, topv, norm;
int step = resolution();
double diag = (actualDataG_->hull().maxVertex-actualDataG_->hull().minVertex).length() * normalLength();
arrow.assign(*this);
arrow.drawBegin();
for (int i = 0; i <= actualDataG_->columns() - step; i += step){
for (int j = 0; j <= actualDataG_->rows() - step; j += step){
basev = Triple(actualDataG_->vertices[i][j][0],actualDataG_->vertices[i][j][1],actualDataG_->vertices[i][j][2]);
topv = Triple(actualDataG_->vertices[i][j][0]+actualDataG_->normals[i][j][0],
actualDataG_->vertices[i][j][1]+actualDataG_->normals[i][j][1],
actualDataG_->vertices[i][j][2]+actualDataG_->normals[i][j][2]);
norm = topv-basev;
norm.normalize();
norm *= diag;
arrow.setTop(basev+norm);
arrow.setColor((*datacolor_p)(basev.x,basev.y,basev.z));
arrow.draw(basev);
}
}
arrow.drawEnd();
}
示例3: createNormals
void GridPlot::createNormals(const Plotlet& pl)
{
if (!normals())
return;
Arrow arrow;
arrow.setQuality(normalQuality());
Triple /*basev, topv, */ norm;
int step = resolution();
const GridData& data = dynamic_cast<const GridData&>(*pl.data);
const Color& color = *pl.appearance->dataColor();
double diag = (data.hull().maxVertex-data.hull().minVertex).length() * normalLength();
arrow.assign(*this);
arrow.drawBegin();
for (int i = 0; i <= data.columns() - step; i += step)
{
for (int j = 0; j <= data.rows() - step; j += step)
{
norm = data.normals[i][j];//topv-basev;
norm.normalize();
norm *= diag;
const Triple &vert = data.vertices[i][j];
arrow.setTop(vert+norm);
arrow.setColor(color.rgba(vert.x, vert.y, vert.z));
arrow.draw(vert);
}
}
arrow.drawEnd();
}