本文整理汇总了C++中meshlib::Mesh::getMaxEdgeLength方法的典型用法代码示例。如果您正苦于以下问题:C++ Mesh::getMaxEdgeLength方法的具体用法?C++ Mesh::getMaxEdgeLength怎么用?C++ Mesh::getMaxEdgeLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meshlib::Mesh
的用法示例。
在下文中一共展示了Mesh::getMaxEdgeLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setMesh
void ElementTreeModel::setMesh(MeshLib::Mesh const& mesh)
{
this->clearView();
QList<QVariant> mesh_name;
mesh_name << "Name:" << QString::fromStdString(mesh.getName()) << "" << "" << "";
TreeItem* name_item = new TreeItem(mesh_name, _rootItem);
_rootItem->appendChild(name_item);
QList<QVariant> nodes_number;
nodes_number << "#Nodes: " << QString::number(mesh.getNumberOfNodes()) << "" << "";
TreeItem* nodes_item = new TreeItem(nodes_number, _rootItem);
_rootItem->appendChild(nodes_item);
QList<QVariant> elements_number;
elements_number << "#Elements: " << QString::number(mesh.getNumberOfElements()) << "" << "";
TreeItem* elements_item = new TreeItem(elements_number, _rootItem);
_rootItem->appendChild(elements_item);
const std::array<QString, 7> n_element_names = {{ "Lines:", "Triangles:", "Quads:", "Tetrahedra:", "Hexahedra:", "Pyramids:", "Prisms:" }};
const std::array<unsigned, 7>& n_element_types (MeshLib::MeshInformation::getNumberOfElementTypes(mesh));
for (std::size_t i=0; i<n_element_types.size(); ++i)
{
if (n_element_types[i])
{
QList<QVariant> elements_number;
elements_number << n_element_names[i] << QString::number(n_element_types[i]) << "" << "";
TreeItem* type_item = new TreeItem(elements_number, elements_item);
elements_item->appendChild(type_item);
}
}
QList<QVariant> bounding_box;
bounding_box << "Bounding Box" << "" << "" << "";
TreeItem* aabb_item = new TreeItem(bounding_box, _rootItem);
_rootItem->appendChild(aabb_item);
const GeoLib::AABB aabb (MeshLib::MeshInformation::getBoundingBox(mesh));
auto const& min = aabb.getMinPoint();
auto const& max = aabb.getMaxPoint();
QList<QVariant> min_aabb;
min_aabb << "Min:" << QString::number(min[0], 'f') << QString::number(min[1], 'f') << QString::number(min[2], 'f');
TreeItem* min_item = new TreeItem(min_aabb, aabb_item);
aabb_item->appendChild(min_item);
QList<QVariant> max_aabb;
max_aabb << "Max:" << QString::number(max[0], 'f') << QString::number(max[1], 'f') << QString::number(max[2], 'f');
TreeItem* max_item = new TreeItem(max_aabb, aabb_item);
aabb_item->appendChild(max_item);
QList<QVariant> edges;
edges << "Edge Length: " << "[" + QString::number(mesh.getMinEdgeLength(), 'f') + "," << QString::number(mesh.getMaxEdgeLength(), 'f') + "]" << "";
TreeItem* edge_item = new TreeItem(edges, _rootItem);
_rootItem->appendChild(edge_item);
std::vector<std::string> const& vec_names (mesh.getProperties().getPropertyVectorNames());
for (std::size_t i=0; i<vec_names.size(); ++i)
{
QList<QVariant> array_info;
array_info << QString::fromStdString(vec_names[i]) + ": ";
auto vec_bounds (MeshLib::MeshInformation::getValueBounds<int>(mesh, vec_names[i]));
if (vec_bounds.second != std::numeric_limits<int>::max())
array_info << "[" + QString::number(vec_bounds.first) + "," << QString::number(vec_bounds.second) + "]" << "";
else
{
auto vec_bounds (MeshLib::MeshInformation::getValueBounds<double>(mesh, vec_names[i]));
if (vec_bounds.second != std::numeric_limits<double>::max())
array_info << "[" + QString::number(vec_bounds.first) + "," << QString::number(vec_bounds.second) + "]" << "";
}
if (array_info.size() == 1)
array_info << "[ ?" << "? ]" << "";
TreeItem* vec_item = new TreeItem(array_info, _rootItem);
_rootItem->appendChild(vec_item);
}
reset();
}