本文整理汇总了C++中mesh::PropertyMeshKernel类的典型用法代码示例。如果您正苦于以下问题:C++ PropertyMeshKernel类的具体用法?C++ PropertyMeshKernel怎么用?C++ PropertyMeshKernel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PropertyMeshKernel类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: countFaces
int PropertyMeshKernelItem::countFaces() const
{
int ctF = 0;
const std::vector<App::Property*>& props = getPropertyData();
for (std::vector<App::Property*>::const_iterator pt = props.begin(); pt != props.end(); ++pt) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)(*pt);
const MeshKernel& rMesh = pPropMesh->getValue().getKernel();
ctF += (int)rMesh.CountFacets();
}
return ctF;
}
示例2: mesh
App::DocumentObjectExecReturn *HarmonizeNormals::execute(void)
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
std::auto_ptr<MeshObject> mesh(new MeshObject);
*mesh = kernel->getValue();
mesh->harmonizeNormals();
this->Mesh.setValuePtr(mesh.release());
}
return App::DocumentObject::StdReturn;
}
示例3: mesh
App::DocumentObjectExecReturn *FixDegenerations::execute(void)
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
std::unique_ptr<MeshObject> mesh(new MeshObject);
*mesh = kernel->getValue();
mesh->validateDegenerations(static_cast<float>(Epsilon.getValue()));
this->Mesh.setValuePtr(mesh.release());
}
return App::DocumentObject::StdReturn;
}
示例4: cTria
App::DocumentObjectExecReturn *FillHoles::execute(void)
{
App::DocumentObject* link = Source.getValue();
if (!link) return new App::DocumentObjectExecReturn("No mesh linked");
App::Property* prop = link->getPropertyByName("Mesh");
if (prop && prop->getTypeId() == Mesh::PropertyMeshKernel::getClassTypeId()) {
Mesh::PropertyMeshKernel* kernel = static_cast<Mesh::PropertyMeshKernel*>(prop);
std::auto_ptr<MeshObject> mesh(new MeshObject);
*mesh = kernel->getValue();
MeshCore::ConstraintDelaunayTriangulator cTria(MaxArea.getValue());
//MeshCore::Triangulator cTria(mesh->getKernel());
mesh->fillupHoles(FillupHolesOfLength.getValue(), 1, cTria);
this->Mesh.setValuePtr(mesh.release());
}
return App::DocumentObject::StdReturn;
}
示例5: value
QVariant PropertyMeshKernelItem::value(const App::Property*) const
{
int ctP = 0;
int ctE = 0;
int ctF = 0;
const std::vector<App::Property*>& props = getPropertyData();
for (std::vector<App::Property*>::const_iterator pt = props.begin(); pt != props.end(); ++pt) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)(*pt);
const MeshKernel& rMesh = pPropMesh->getValue().getKernel();
ctP += (int)rMesh.CountPoints();
ctE += (int)rMesh.CountEdges();
ctF += (int)rMesh.CountFacets();
}
QString str = QObject::tr("[Points: %1, Edges: %2 Faces: %3]").arg(ctP).arg(ctE).arg(ctF);
return QVariant(str);
}