#include <utilities.h>
+#include <limits>
+
#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
namespace {
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const int id,
- const bool force3d)
+ const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshFace* elem = 0;
+
+ if( n1==n2 || n2==n3 || n3==n1 )
+ return elem;
+
if(!myCreateQuadratic) {
if(id)
elem = meshDS->AddFaceWithID(n1, n2, n3, id);
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
const int id,
- const bool force3d)
+ const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshFace* elem = 0;
+
+ if( n1==n2 ) {
+ return AddFace(n1,n3,n4,id,force3d);
+ }
+ if( n1==n3 ) {
+ return AddFace(n1,n2,n4,id,force3d);
+ }
+ if( n1==n4 ) {
+ return AddFace(n1,n2,n3,id,force3d);
+ }
+ if( n2==n3 ) {
+ return AddFace(n1,n2,n4,id,force3d);
+ }
+ if( n2==n4 ) {
+ return AddFace(n1,n2,n3,id,force3d);
+ }
+ if( n3==n4 ) {
+ return AddFace(n1,n2,n3,id,force3d);
+ }
+
if(!myCreateQuadratic) {
if(id)
elem = meshDS->AddFaceWithID(n1, n2, n3, n4, id);
const SMDS_MeshNode* n5,
const SMDS_MeshNode* n6,
const int id,
- const bool force3d)
+ const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshVolume* elem = 0;
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
const int id,
- const bool force3d)
+ const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshVolume* elem = 0;
const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5,
const int id,
- const bool force3d)
+ const bool force3d)
{
SMDS_MeshVolume* elem = 0;
if(!myCreateQuadratic) {
const SMDS_MeshNode* n7,
const SMDS_MeshNode* n8,
const int id,
- const bool force3d)
+ const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshVolume* elem = 0;
bool IsBoundary() const { return !_qfaces[1]; }
void RemoveFace( const QFace* face ) const
- { _qfaces[(face == _qfaces[1])] = 0; if (!_qfaces[0]) swap(_qfaces[0],_qfaces[1]); }
+ { _qfaces[(face == _qfaces[1])] = 0; if (!_qfaces[0]) std::swap(_qfaces[0],_qfaces[1]); }
const QFace* NextFace( const QFace* f ) const
{ return _qfaces[0]==f ? _qfaces[1] : _qfaces[0]; }
// --------------------------------------------------------------------
typedef list< TChainLink > TChain;
typedef set < TChainLink > TLinkSet;
- typedef TLinkSet::iterator TLinkInSet;
+ typedef TLinkSet::const_iterator TLinkInSet;
const int theFirstStep = 5;
ostream& operator << (ostream& out, const QFace& f)
{
out <<"QFace nodes: "/*<< &f << " "*/;
- for ( TIDSortedElemSet::iterator n = f.begin(); n != f.end(); ++n )
+ for ( TIDSortedElemSet::const_iterator n = f.begin(); n != f.end(); ++n )
out << (*n)->GetID() << " ";
out << " \tvolumes: "
<< (f._volumes[0] ? f._volumes[0]->GetID() : 0) << " "
if ( iFaceCont > 0 ) // continues faces found, set one by the other
{
if ( iFaceCont != 1 )
- swap( _faces[1], _faces[iFaceCont] );
+ std::swap( _faces[1], _faces[iFaceCont] );
}
else if ( _faces.size() > 1 ) // not found, set NULL by the first face
{
}
}
curBndLinks->clear();
- swap( curBndLinks, newBndLinks );
+ std::swap( curBndLinks, newBndLinks );
}
}