-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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
+// 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
//
// SMESH SMESH : implementaion of SMESH idl descriptions
-// File : StdMeshers_Regular_1D.cxx
-// Moved here from SMESH_Regular_1D.cxx
-// Author : Paul RASCLE, EDF
+// File : StdMeshers_CompositeSegment_1D.cxx
// Module : SMESH
-// $Header$
//
#include "StdMeshers_CompositeSegment_1D.hxx"
#include "StdMeshers_FaceSide.hxx"
struct VertexNodesRestoringListener : public SMESH_subMeshEventListener
{
- VertexNodesRestoringListener():SMESH_subMeshEventListener(0) // won't be deleted by submesh
+ VertexNodesRestoringListener():
+ SMESH_subMeshEventListener(0, // won't be deleted by submesh
+ "StdMeshers_CompositeSegment_1D::VertexNodesRestoringListener")
{}
/*!
* \brief Restore nodes on internal vertices of a complex side
EventListenerData* data,
const SMESH_Hypothesis* /*hyp*/)
{
- bool hypRemoved = ( eventType == SMESH_subMesh::ALGO_EVENT &&
- subMesh->GetAlgoState() != SMESH_subMesh::HYP_OK );
- if ( hypRemoved && data )
+ if ( data && eventType == SMESH_subMesh::ALGO_EVENT )
{
- list<SMESH_subMesh*>::iterator smIt = data->mySubMeshes.begin();
- for ( ; smIt != data->mySubMeshes.end(); ++smIt )
+ bool hypRemoved;
+ if ( subMesh->GetAlgoState() != SMESH_subMesh::HYP_OK )
+ hypRemoved = true;
+ else {
+ SMESH_Algo* algo = subMesh->GetAlgo();
+ hypRemoved = ( string( algo->GetName() ) != StdMeshers_CompositeSegment_1D::AlgoName());
+ }
+ if ( hypRemoved )
{
- if ( SMESH_subMesh* sm = *smIt ) {
- sm->SetIsAlwaysComputed( false );
- sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
- }
+ list<SMESH_subMesh*>::iterator smIt = data->mySubMeshes.begin();
+ for ( ; smIt != data->mySubMeshes.end(); ++smIt )
+ if ( SMESH_subMesh* sm = *smIt ) {
+ sm->SetIsAlwaysComputed( false );
+ sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
+ }
}
}
// at study restoration:
:StdMeshers_Regular_1D(hypId, studyId, gen)
{
MESSAGE("StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D");
- _name = "CompositeSegment_1D";
+ _name = AlgoName();
_EventListener = new VertexNodesRestoringListener();
}
+//=======================================================================
+//function : AlgoName
+//purpose : Returns algo type name
+//=======================================================================
+
+std::string StdMeshers_CompositeSegment_1D::AlgoName()
+{
+ return "CompositeSegment_1D";
+}
//=============================================================================
/*!
*
// Create mesh
+ // compute and get nodes on extremity VERTEX'es
+ SMESH_subMesh* smVFirst = aMesh.GetSubMesh( VFirst );
+ smVFirst->SetIsAlwaysComputed( false );
+ smVFirst->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+ //
+ SMESH_subMesh* smVLast = aMesh.GetSubMesh( VLast );
+ smVLast->SetIsAlwaysComputed( false );
+ smVLast->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+ //
const SMDS_MeshNode * nFirst = SMESH_Algo::VertexNode( VFirst, meshDS );
const SMDS_MeshNode * nLast = SMESH_Algo::VertexNode( VLast, meshDS );
if (!nFirst)