本文整理汇总了C++中vec3_t::data方法的典型用法代码示例。如果您正苦于以下问题:C++ vec3_t::data方法的具体用法?C++ vec3_t::data怎么用?C++ vec3_t::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec3_t
的用法示例。
在下文中一共展示了vec3_t::data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setNewPosition
bool LaplaceSmoother::setNewPosition(vtkIdType id_node, vec3_t x_new)
{
using namespace GeometryTools;
vec3_t x_old;
m_Grid->GetPoint(id_node, x_old.data());
EG_VTKDCN(vtkCharArray, node_type, m_Grid, "node_type");
bool move = true;
if(m_NoCheck) {
return move;
}
QVector<vec3_t> old_cell_normals(m_Part.n2cGSize(id_node));
EG_VTKDCC(vtkIntArray, cell_code, m_Grid, "cell_code");
for (int i = 0; i < m_Part.n2cGSize(id_node); ++i) {
old_cell_normals[i] = GeometryTools::cellNormal(m_Grid, m_Part.n2cGG(id_node, i));
}
m_Grid->GetPoints()->SetPoint(id_node, x_new.data());
for (int i = 0; i < m_Part.n2cGSize(id_node); ++i) {
vec3_t n = GeometryTools::cellNormal(m_Grid, m_Part.n2cGG(id_node, i));
if (n*old_cell_normals[i] < 0.2*old_cell_normals[i].abs2()) {
move = false;
break;
}
}
if (!move) {
m_Grid->GetPoints()->SetPoint(id_node, x_old.data());
}
return move;
}
示例2: min
//x_new = GuiMainWindow::pointer()->getCadInterface(bc)->correctCurvature(GuiMainWindow::pointer()->getCadInterface(bc)->lastProjTriangle(), x_new);
x_new = GuiMainWindow::pointer()->getCadInterface(bc)->correctCurvature(x_new);
}
}
}
}
}
// compute the minimal length of any edge adjacent to this node
// .. This will be used to limit the node movement.
// .. Hopefully jammed topologies can be avoided this way.
//
EG_VTKDCN(vtkDoubleArray, cl, m_Grid, "node_meshdensity_desired");
vec3_t x_old;
m_Grid->GetPoint(id_node, x_old.data());
double L_min = cl->GetValue(id_node);
for (int i = 0; i < m_Part.n2nGSize(id_node); ++i) {
vtkIdType id_neigh = m_Part.n2nGG(id_node, i);
vec3_t x_neigh;
m_Grid->GetPoint(id_neigh, x_neigh.data());
L_min = min(L_min, (x_old - x_neigh).abs());
}
// limit node displacement
vec3_t dx = x_new - x_old;
if (dx.abs() > m_Limit*L_min) {
x_new -= dx;
dx.normalise();
x_new += m_Limit*L_min*dx;
}