-// 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
//
// SMESH SMESH : implementaion of SMESH idl descriptions
// Module : SMESH
// Created : Tue Nov 25 11:04:59 2008
// Author : Edward AGAPOV (eap)
-//
+
#include "StdMeshers_CompositeHexa_3D.hxx"
#include "SMDS_Mesh.hxx"
private:
- bool error(std::string& text, int code = COMPERR_ALGO_FAILED)
+ bool error(const std::string& text, int code = COMPERR_ALGO_FAILED)
{ myError = SMESH_ComputeError::New( code, text ); return false; }
bool error(const SMESH_ComputeErrorPtr& err)
// ----------------------------
// Add internal nodes of a box
// ----------------------------
- // projection points of internal nodes on box subshapes by which
+ // projection points of internal nodes on box sub-shapes by which
// coordinates of internal nodes are computed
vector<gp_XYZ> pointsOnShapes( SMESH_Block::ID_Shell );
int iMyCommon;
if ( mySides.Contain( otherSide, &iMyCommon ) ) {
// check if normals of two faces are collinear at all vertices of a otherSide
- const double angleTol = PI / 180 / 2;
+ const double angleTol = M_PI / 180. / 2.;
int iV, nbV = otherSide.NbVertices(), nbCollinear = 0;
for ( iV = 0; iV < nbV; ++iV )
{
if ( !myGrid.empty() )
return true;
+ SMESHDS_SubMesh* faceSubMesh = mesh.GetSubMesh( myFace )->GetSubMeshDS();
+ // check that all faces are quadrangular
+ SMDS_ElemIteratorPtr fIt = faceSubMesh->GetElements();
+ while ( fIt->more() )
+ if ( fIt->next()->NbNodes() % 4 > 0 )
+ return error("Non-quadrangular mesh faces are not allowed on sides of a composite block");
+
myIndexer._xSize = 1 + mySides.GetSide( Q_BOTTOM )->GetNbSegments( mesh );
myIndexer._ySize = 1 + mySides.GetSide( Q_LEFT )->GetNbSegments( mesh );
// store the rest nodes row by row
- SMESHDS_SubMesh* faceSubMesh = mesh.GetSubMesh( myFace )->GetSubMeshDS();
-
- SMDS_MeshNode dummy(0,0,0);
- const SMDS_MeshElement* firstQuad = &dummy;// most left face above the last row of found nodes
+ const SMDS_MeshNode* dummy = mesh.GetMeshDS()->AddNode(0,0,0);
+ const SMDS_MeshElement* firstQuad = dummy; // most left face above the last row of found nodes
int nbFoundNodes = myIndexer._xSize;
while ( nbFoundNodes != myGrid.size() )
n1up = n2up;
}
}
-
+ mesh.GetMeshDS()->RemoveNode(dummy);
DumpGrid(); // debug
return true;