myEnforcedVertices(DefaultEnforcedVertices()),
_enfNodes(DefaultIDSortedNodeSet()),
_enfEdges(DefaultIDSortedElemSet()),
- _enfTriangles(DefaultIDSortedElemSet())/*,*/
+ _enfTriangles(DefaultIDSortedElemSet()),
+ _nodeIDToSizeMap(DefaultID2SizeMap()),
+ _elementIDToSizeMap(DefaultID2SizeMap())
// _enfQuadrangles(DefaultIDSortedElemSet())
{
_name = "GHS3D_Parameters";
_param_algo_dim = 3;
- _edgeID2nodeIDMap.clear();
- _triID2nodeIDMap.clear();
+// _edgeID2nodeIDMap.clear();
+// _triID2nodeIDMap.clear();
// _quadID2nodeIDMap.clear();
- _nodeIDToSizeMap.clear();
- _elementIDToSizeMap.clear();
}
//=======================================================================
switch (elementType) {
case SMESH::NODE:
if (node) {
-// MESSAGE("This is a node");
_enfNodes.insert(node);
_nodeIDToSizeMap.insert(make_pair(node->GetID(), size));
added = true;
}
else {
-// MESSAGE("This is an element");
_enfNodes.insert(elem->begin_nodes(),elem->end_nodes());
SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
for (;nodeIt->more();)
}
break;
case SMESH::EDGE:
- if (node) {
-// MESSAGE("This is a node");
- }
- else {
-// MESSAGE("This is an element");
- if (elem->GetType() == SMDSAbs_Edge) {
- _enfEdges.insert(elem);
-// _enfNodes.insert(elem->begin_nodes(),elem->end_nodes());
- _elementIDToSizeMap.insert(make_pair(elem->GetID(), size));
+ if (elem->GetType() == SMDSAbs_Edge) {
+ _enfEdges.insert(elem);
+ _elementIDToSizeMap.insert(make_pair(elem->GetID(), size));
// SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
// for (int j = 0; j < 2; ++j) {
// node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
// _edgeID2nodeIDMap[elem->GetID()].push_back(node->GetID());
// _nodeIDToSizeMap.insert(make_pair(node->GetID(), size));
// }
- added = true;
- }
- else if (elem->GetType() > SMDSAbs_Edge) {
- SMDS_ElemIteratorPtr it = elem->edgesIterator();
- for (;it->more();) {
- const SMDS_MeshElement* anEdge = it->next();
- _enfEdges.insert(anEdge);
-// // _enfNodes.insert(anEdge->begin_nodes(),anEdge->end_nodes());
- _elementIDToSizeMap.insert(make_pair(anEdge->GetID(), size));
+ added = true;
+ }
+ else if (elem->GetType() > SMDSAbs_Edge) {
+ SMDS_ElemIteratorPtr it = elem->edgesIterator();
+ for (;it->more();) {
+ const SMDS_MeshElement* anEdge = it->next();
+ _enfEdges.insert(anEdge);
+ _elementIDToSizeMap.insert(make_pair(anEdge->GetID(), size));
// SMDS_ElemIteratorPtr nodeIt = anEdge->nodesIterator();
// for (int j = 0; j < 2; ++j) {
// node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
// _edgeID2nodeIDMap[anEdge->GetID()].push_back(node->GetID());
// _nodeIDToSizeMap.insert(make_pair(node->GetID(), size));
// }
- }
- added = true;
}
+ added = true;
}
break;
case SMESH::FACE:
- if (node) {
-// MESSAGE("This is a node");
- }
- else {
-// MESSAGE("This is an element");
- if (elem->GetType() == SMDSAbs_Face)
- {
- if (elem->NbCornerNodes() == 3) {
- _enfTriangles.insert(elem);
-// _enfNodes.insert(elem->begin_nodes(),elem->end_nodes());
- _elementIDToSizeMap.insert(make_pair(elem->GetID(), size));
-// TEST
+ if (elem->GetType() == SMDSAbs_Face)
+ {
+ if (elem->NbCornerNodes() == 3) {
+ _enfTriangles.insert(elem);
+ _elementIDToSizeMap.insert(make_pair(elem->GetID(), size));
// SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
// for ( int j = 0; j < 3; ++j ) {
// node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
// _triID2nodeIDMap[elem->GetID()].push_back(node->GetID());
// _nodeIDToSizeMap.insert(make_pair(node->GetID(), size));
// }
- added = true;
- }
-// else if (elem->NbCornerNodes() == 4) {
-// _enfQuadrangles.insert(elem);
-// // _enfNodes.insert(elem->begin_nodes(),elem->end_nodes());
-// _elementIDToSizeMap.insert(make_pair(elem->GetID(), size));
-// SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
-// for (int j = 0; j < 4; ++j) {
-// node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
-// _quadID2nodeIDMap[elem->GetID()].push_back(node->GetID());
-// _nodeIDToSizeMap.insert(make_pair(node->GetID(), size));
-// }
-// added = true;
-// }
+ added = true;
}
- else if (elem->GetType() > SMDSAbs_Face) { // Group of faces
- SMDS_ElemIteratorPtr it = elem->facesIterator();
- for (;it->more();) {
- const SMDS_MeshElement* aFace = it->next();
- if (aFace->NbCornerNodes() == 3) {
- _enfTriangles.insert(aFace);
-// _enfNodes.insert(aFace->begin_nodes(),aFace->end_nodes());
- _elementIDToSizeMap.insert(make_pair(aFace->GetID(), size));
+ }
+ else if (elem->GetType() > SMDSAbs_Face) { // Group of faces
+ SMDS_ElemIteratorPtr it = elem->facesIterator();
+ for (;it->more();) {
+ const SMDS_MeshElement* aFace = it->next();
+ if (aFace->NbCornerNodes() == 3) {
+ _enfTriangles.insert(aFace);
+ _elementIDToSizeMap.insert(make_pair(aFace->GetID(), size));
// SMDS_ElemIteratorPtr nodeIt = aFace->nodesIterator();
// for (int j = 0; j < 3; ++j) {
// node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
// _triID2nodeIDMap[aFace->GetID()].push_back(node->GetID());
// _nodeIDToSizeMap.insert(make_pair(node->GetID(), size));
// }
- added = true;
- }
-// else if (aFace->NbCornerNodes() == 4) {
-// _enfQuadrangles.insert(aFace);
-// // _enfNodes.insert(aFace->begin_nodes(),aFace->end_nodes());
-// _elementIDToSizeMap.insert(make_pair(aFace->GetID(), size));
-// SMDS_ElemIteratorPtr nodeIt = aFace->nodesIterator();
-// for (int j = 0; j < 4; ++j) {
-// node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
-// _quadID2nodeIDMap[aFace->GetID()].push_back(node->GetID());
-// _nodeIDToSizeMap.insert(make_pair(node->GetID(), size));
-// }
-// added = true;
-// }
+ added = true;
}
}
}
// _edgeID2nodeIDMap.clear();
// _triID2nodeIDMap.clear();
// _quadID2nodeIDMap.clear();
-// _nodeIDToSizeMap.clear();
-// _elementIDToSizeMap.clear();
+ _nodeIDToSizeMap.clear();
+ _elementIDToSizeMap.clear();
NotifySubMeshesHypothesisModification();
}
return TIDSortedElemSet();
}
+GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::DefaultID2SizeMap()
+{
+ return GHS3DPlugin_Hypothesis::TID2SizeMap();
+}
+
//=======================================================================
//function : SaveTo
//=======================================================================
// return hyp ? hyp->_GetEnforcedQuadrangles():DefaultIDSortedElemSet();
// }
-GHS3DPlugin_Hypothesis::TElemID2NodeIDMap GHS3DPlugin_Hypothesis::GetEdgeID2NodeIDMap(const GHS3DPlugin_Hypothesis* hyp)
-{
- return hyp ? hyp->_GetEdgeID2NodeIDMap(): GHS3DPlugin_Hypothesis::TElemID2NodeIDMap();
-}
-
-GHS3DPlugin_Hypothesis::TElemID2NodeIDMap GHS3DPlugin_Hypothesis::GetTri2NodeMap(const GHS3DPlugin_Hypothesis* hyp)
-{
- return hyp ? hyp->_GetTri2NodeMap(): GHS3DPlugin_Hypothesis::TElemID2NodeIDMap();
-}
+// GHS3DPlugin_Hypothesis::TElemID2NodeIDMap GHS3DPlugin_Hypothesis::GetEdgeID2NodeIDMap(const GHS3DPlugin_Hypothesis* hyp)
+// {
+// return hyp ? hyp->_GetEdgeID2NodeIDMap(): GHS3DPlugin_Hypothesis::TElemID2NodeIDMap();
+// }
+//
+// GHS3DPlugin_Hypothesis::TElemID2NodeIDMap GHS3DPlugin_Hypothesis::GetTri2NodeMap(const GHS3DPlugin_Hypothesis* hyp)
+// {
+// return hyp ? hyp->_GetTri2NodeMap(): GHS3DPlugin_Hypothesis::TElemID2NodeIDMap();
+// }
// GHS3DPlugin_Hypothesis::TElemID2NodeIDMap GHS3DPlugin_Hypothesis::GetQuad2NodeMap(const GHS3DPlugin_Hypothesis* hyp)
// {
GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::GetNodeIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp)
{
- return hyp ? hyp->_GetNodeIDToSizeMap(): GHS3DPlugin_Hypothesis::TID2SizeMap();
+ return hyp ? hyp->_GetNodeIDToSizeMap(): DefaultID2SizeMap();
}
GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::GetElementIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp)
{
- return hyp ? hyp->_GetElementIDToSizeMap(): GHS3DPlugin_Hypothesis::TID2SizeMap();
+ return hyp ? hyp->_GetElementIDToSizeMap(): DefaultID2SizeMap();
}
const TIDSortedElemSet _GetEnforcedEdges() const { return _enfEdges; }
const TIDSortedElemSet _GetEnforcedTriangles() const { return _enfTriangles; }
// const TIDSortedElemSet _GetEnforcedQuadrangles() const { return _enfQuadrangles; }
- typedef std::map<int,std::vector<int> > TElemID2NodeIDMap;
- const TElemID2NodeIDMap _GetEdgeID2NodeIDMap() const {return _edgeID2nodeIDMap; }
- const TElemID2NodeIDMap _GetTri2NodeMap() const {return _triID2nodeIDMap; }
+// typedef std::map<int,std::vector<int> > TElemID2NodeIDMap;
+// const TElemID2NodeIDMap _GetEdgeID2NodeIDMap() const {return _edgeID2nodeIDMap; }
+// const TElemID2NodeIDMap _GetTri2NodeMap() const {return _triID2nodeIDMap; }
// const TElemID2NodeIDMap _GetQuad2NodeMap() const {return _quadID2nodeIDMap; }
typedef std::map<int,double> TID2SizeMap;
const TID2SizeMap _GetNodeIDToSizeMap() const {return _nodeIDToSizeMap; }
static TEnforcedVertexValues DefaultEnforcedVertices();
static TIDSortedNodeSet DefaultIDSortedNodeSet();
static TIDSortedElemSet DefaultIDSortedElemSet();
+ static TID2SizeMap DefaultID2SizeMap();
/*!
* \brief Return command to run ghs3d mesher excluding file prefix (-f)
static TIDSortedElemSet GetEnforcedEdges(const GHS3DPlugin_Hypothesis* hyp);
static TIDSortedElemSet GetEnforcedTriangles(const GHS3DPlugin_Hypothesis* hyp);
// static TIDSortedElemSet GetEnforcedQuadrangles(const GHS3DPlugin_Hypothesis* hyp);
- static TElemID2NodeIDMap GetEdgeID2NodeIDMap(const GHS3DPlugin_Hypothesis* hyp);
- static TElemID2NodeIDMap GetTri2NodeMap(const GHS3DPlugin_Hypothesis* hyp);
- static TElemID2NodeIDMap GetQuad2NodeMap(const GHS3DPlugin_Hypothesis* hyp);
+// static TElemID2NodeIDMap GetEdgeID2NodeIDMap(const GHS3DPlugin_Hypothesis* hyp);
+// static TElemID2NodeIDMap GetTri2NodeMap(const GHS3DPlugin_Hypothesis* hyp);
+// static TElemID2NodeIDMap GetQuad2NodeMap(const GHS3DPlugin_Hypothesis* hyp);
static TID2SizeMap GetNodeIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp);
static TID2SizeMap GetElementIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp);
TIDSortedElemSet _enfEdges;
TIDSortedElemSet _enfTriangles;
// TIDSortedElemSet _enfQuadrangles;
- TElemID2NodeIDMap _edgeID2nodeIDMap;
- TElemID2NodeIDMap _triID2nodeIDMap;
+// TElemID2NodeIDMap _edgeID2nodeIDMap;
+// TElemID2NodeIDMap _triID2nodeIDMap;
// TElemID2NodeIDMap _quadID2nodeIDMap;
TID2SizeMap _nodeIDToSizeMap;
TID2SizeMap _elementIDToSizeMap;