本文整理汇总了C++中SMESHDS_Mesh::AddNodeWithID方法的典型用法代码示例。如果您正苦于以下问题:C++ SMESHDS_Mesh::AddNodeWithID方法的具体用法?C++ SMESHDS_Mesh::AddNodeWithID怎么用?C++ SMESHDS_Mesh::AddNodeWithID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMESHDS_Mesh
的用法示例。
在下文中一共展示了SMESHDS_Mesh::AddNodeWithID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddNode
SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshNode* node = 0;
if ( ID )
node = meshDS->AddNodeWithID( x, y, z, ID );
else
node = meshDS->AddNode( x, y, z );
if ( mySetElemOnShape && myShapeID > 0 ) {
switch ( myShape.ShapeType() ) {
case TopAbs_SOLID: meshDS->SetNodeInVolume( node, myShapeID); break;
case TopAbs_SHELL: meshDS->SetNodeInVolume( node, myShapeID); break;
case TopAbs_FACE: meshDS->SetNodeOnFace( node, myShapeID); break;
case TopAbs_EDGE: meshDS->SetNodeOnEdge( node, myShapeID); break;
case TopAbs_VERTEX: meshDS->SetNodeOnVertex( node, myShapeID); break;
default: ;
}
}
return node;
}
示例2: addNode
PyObject* FemMeshPy::addNode(PyObject *args)
{
double x,y,z;
int i = -1;
if (PyArg_ParseTuple(args, "ddd",&x,&y,&z)){
try {
SMESH_Mesh* mesh = getFemMeshPtr()->getSMesh();
SMESHDS_Mesh* meshDS = mesh->GetMeshDS();
SMDS_MeshNode* node = meshDS->AddNode(x,y,z);
if (!node)
throw std::runtime_error("Failed to add node");
return Py::new_reference_to(Py::Int(node->GetID()));
}
catch (const std::exception& e) {
PyErr_SetString(Base::BaseExceptionFreeCADError, e.what());
return 0;
}
}
PyErr_Clear();
if (PyArg_ParseTuple(args, "dddi",&x,&y,&z,&i)){
try {
SMESH_Mesh* mesh = getFemMeshPtr()->getSMesh();
SMESHDS_Mesh* meshDS = mesh->GetMeshDS();
SMDS_MeshNode* node = meshDS->AddNodeWithID(x,y,z,i);
if (!node)
throw std::runtime_error("Failed to add node");
return Py::new_reference_to(Py::Int(node->GetID()));
}
catch (const std::exception& e) {
PyErr_SetString(Base::BaseExceptionFreeCADError, e.what());
return 0;
}
}
PyErr_SetString(PyExc_TypeError, "addNode() accepts:\n"
"-- addNode(x,y,z)\n"
"-- addNode(x,y,z,ElemId)\n");
return 0;
}