本文整理汇总了C++中meshlib::Mesh::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ Mesh::setName方法的具体用法?C++ Mesh::setName怎么用?C++ Mesh::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meshlib::Mesh
的用法示例。
在下文中一共展示了Mesh::setName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertVTKToOGSMesh
void VtkVisPipelineView::convertVTKToOGSMesh()
{
VtkVisPipelineItem* item = static_cast<VtkVisPipelineItem*>(
static_cast<VtkVisPipeline*>(this->model())->getItem(this->selectionModel()->currentIndex()));
vtkSmartPointer<vtkAlgorithm> algorithm = item->algorithm();
vtkUnstructuredGrid* grid(NULL);
vtkUnstructuredGridAlgorithm* ugAlg = vtkUnstructuredGridAlgorithm::SafeDownCast(algorithm);
if (ugAlg)
grid = ugAlg->GetOutput();
else
{
// for old filetypes
vtkGenericDataObjectReader* dataReader = vtkGenericDataObjectReader::SafeDownCast(algorithm);
if (dataReader)
grid = vtkUnstructuredGrid::SafeDownCast(dataReader->GetOutput());
else
{
// for new filetypes
vtkXMLUnstructuredGridReader* xmlReader = vtkXMLUnstructuredGridReader::SafeDownCast(algorithm);
grid = vtkUnstructuredGrid::SafeDownCast(xmlReader->GetOutput());
}
}
MeshLib::Mesh* mesh = MeshLib::VtkMeshConverter::convertUnstructuredGrid(grid);
mesh->setName(item->data(0).toString().toStdString());
emit meshAdded(mesh);
}
示例2: constructMeshFromImage
void VtkVisPipelineView::constructMeshFromImage(QString msh_name, MshElemType::type element_type, UseIntensityAs::type intensity_type)
{
vtkSmartPointer<vtkAlgorithm> algorithm =
static_cast<VtkVisPipelineItem*>(static_cast<VtkVisPipeline*>(this->model())->
getItem(this->selectionModel()->currentIndex()))->algorithm();
vtkSmartPointer<VtkGeoImageSource> imageSource = VtkGeoImageSource::SafeDownCast(algorithm);
double origin[3];
imageSource->GetOutput()->GetOrigin(origin);
double spacing[3];
imageSource->GetOutput()->GetSpacing(spacing);
MeshLib::Mesh* mesh = VtkMeshConverter::convertImgToMesh(imageSource->GetOutput(), origin, spacing[0], element_type, intensity_type);
mesh->setName(msh_name.toStdString());
emit meshAdded(mesh);
}