-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 : SMDS_MeshInfo.hxx
// Created : Mon Sep 24 18:32:41 2007
// Author : Edward AGAPOV (eap)
public:
inline SMDS_MeshInfo();
+ inline SMDS_MeshInfo& operator=(const SMDS_MeshInfo& other);
inline void Clear();
int NbNodes() const { return myNbNodes; }
inline int NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbPolyhedrons() const { return myNbPolyhedrons; }
+protected:
+ inline void addWithPoly(const SMDS_MeshElement* el);
+
private:
friend class SMDS_Mesh;
myNbPrisms (0), myNbQuadPrisms (0),
myNbPolyhedrons(0)
{
- // Number of nodes in standard element types
+ // Number of nodes in standard element types (. - actual nb, * - after the shift)
// n v f e 0 n
// o o a d d o
// d l c g d
// e e e e
// s
// -----------------
- // 0 *
+ // 0 - DON't USE 0!!!
// 1 . *
- // 2 *
+ // 2 .
// 3 . *
// 4 * . .
// 5 *
// 6 * .
- // 7
+ // 7 *
// 8 * .
- // 9
+ // 9 *
// 10 *
// 11 *
// 12 *
myShift.resize(SMDSAbs_NbElementTypes, 0);
myShift[ SMDSAbs_Face ] = +8; // 3->11, 4->12, 6->14, 8->16
- myShift[ SMDSAbs_Edge ] = -2; // 2->0, 4->2
+ myShift[ SMDSAbs_Edge ] = +5; // 2->7, 4->9
myShift[ SMDSAbs_0DElement ] = +2; // 1->3
myNb.resize( index( SMDSAbs_Volume,20 ) + 1, NULL);
myNb[ index( SMDSAbs_Volume, 20)] = & myNbQuadHexas;
}
+inline SMDS_MeshInfo& // operator=
+SMDS_MeshInfo::operator=(const SMDS_MeshInfo& other)
+{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=(*other.myNb[i]);
+ myNbPolygons = other.myNbPolygons;
+ myNbPolyhedrons = other.myNbPolyhedrons;
+ return *this;
+}
+
inline void // Clear
SMDS_MeshInfo::Clear()
{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
SMDS_MeshInfo::add(const SMDS_MeshElement* el)
{ ++(*myNb[ index(el->GetType(), el->NbNodes()) ]); }
+inline void // addWithPoly
+SMDS_MeshInfo::addWithPoly(const SMDS_MeshElement* el)
+{
+ if ( el->IsPoly() )
+ ++( el->GetType()==SMDSAbs_Face ? myNbPolygons : myNbPolyhedrons );
+ else
+ add(el);
+}
inline void // RemoveEdge
SMDS_MeshInfo::RemoveEdge(const SMDS_MeshElement* el)
{ if ( el->IsQuadratic() ) --myNbQuadEdges; else --myNbEdges; }