-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SMESH_ProxyMesh.cxx
// Created : Thu Dec 2 12:32:53 2010
return proxy;
}
+//================================================================================
+/*!
+ * \brief Returns number of proxy sub-meshes
+ */
+//================================================================================
+
+int SMESH_ProxyMesh::NbProxySubMeshes() const
+{
+ int nb = 0;
+ for ( size_t i = 0; i < _subMeshes.size(); ++i )
+ nb += bool( _subMeshes[i] );
+
+ return nb;
+}
+
namespace
{
//================================================================================
if ( int(_subMeshes.size()) <= index )
_subMeshes.resize( index+1, 0 );
if ( !_subMeshes[index] )
- _subMeshes[index] = new SubMesh( index );
+ _subMeshes[index] = newSubmesh( index );
return _subMeshes[index];
}
//================================================================================
/*!
- * \brief Removes tmp faces from the _mesh
+ * \brief Removes tmp elements from the _mesh
*/
//================================================================================
-void SMESH_ProxyMesh::removeTmpElement( const SMDS_MeshElement* face )
+void SMESH_ProxyMesh::removeTmpElement( const SMDS_MeshElement* elem )
{
- if ( face && face->GetID() > 0 )
+ if ( elem && elem->GetID() > 0 )
{
- set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.find( face );
+ set< const SMDS_MeshElement* >::iterator i = _elemsInMesh.find( elem );
if ( i != _elemsInMesh.end() )
{
- GetMeshDS()->RemoveFreeElement( face, 0 );
+ GetMeshDS()->RemoveFreeElement( elem, 0 );
_elemsInMesh.erase( i );
}
}
else
{
- delete face;
+ delete elem;
}
}
*/
//================================================================================
-void SMESH_ProxyMesh::storeTmpElement( const SMDS_MeshElement* face )
+void SMESH_ProxyMesh::storeTmpElement( const SMDS_MeshElement* elem )
{
- _elemsInMesh.insert( face );
+ _elemsInMesh.insert( elem );
}
//================================================================================
//================================================================================
void SMESH_ProxyMesh::setNode2Node(const SMDS_MeshNode* srcNode,
- const SMDS_MeshNode* proxyNode,
- const SubMesh* subMesh)
+ const SMDS_MeshNode* proxyNode,
+ const SubMesh* subMesh)
{
SubMesh* sm = const_cast<SubMesh*>( subMesh );
if ( !subMesh->_n2n )
//================================================================================
/*!
- * \brief Return number of elements in a proxy submesh
+ * \brief Return number of elements in a proxy sub-mesh. The method is meaningful
+ * for a sub-mesh containing tmp faces.
*/
//================================================================================
int SMESH_ProxyMesh::SubMesh::NbElements() const
{
- return _elements.size();
+ return _uvPtStructVec.empty() ? _elements.size() : _uvPtStructVec.size() - 1;
}
//================================================================================
/*!
- * \brief Return elements of a proxy submesh
+ * \brief Return elements of a proxy sub-mesh. The method is meaningful
+ * for a sub-mesh containing tmp faces.
*/
//================================================================================
( new SMDS_ElementVectorIterator( _elements.begin(), _elements.end() ));
}
+//================================================================================
+/*!
+ * \brief Return number of nodes in a proxy sub-mesh. The method is meaningful
+ * for a sub-mesh containing nodes of 2D viscous layer.
+ */
+//================================================================================
+
+int SMESH_ProxyMesh::SubMesh::NbNodes() const
+{
+ return _uvPtStructVec.size();
+}
+
+//================================================================================
+/*!
+ * \brief Return nodes of a proxy sub-mesh. The method is meaningful
+ * for a sub-mesh containing nodes of 2D viscous layer.
+ */
+//================================================================================
+
+SMDS_NodeIteratorPtr SMESH_ProxyMesh::SubMesh::GetNodes() const
+{
+ if ( !_uvPtStructVec.empty() )
+ return SMDS_NodeIteratorPtr ( new SMDS_SetIterator
+ < SMDS_pNode,
+ UVPtStructVec::const_iterator,
+ UVPtStruct::NodeAccessor >
+ ( _uvPtStructVec.begin(), _uvPtStructVec.end() ));
+
+ return SMDS_NodeIteratorPtr
+ ( new SMDS_SetIterator< SMDS_pNode, std::vector< SMDS_pElement >::const_iterator>
+ ( _elements.begin(), _elements.end() ));
+}
+
//================================================================================
/*!
* \brief Store an element