1 // SMESH SMESH : implementaion of SMESH idl descriptions
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : StdMeshers_SegmentAroundVertex_0D.cxx
26 // Created : Fri Oct 20 11:37:07 2006
27 // Author : Edward AGAPOV (eap)
30 #include "StdMeshers_SegmentAroundVertex_0D.hxx"
32 //=======================================================================
33 //function : StdMeshers_SegmentAroundVertex_0D
35 //=======================================================================
37 StdMeshers_SegmentAroundVertex_0D::StdMeshers_SegmentAroundVertex_0D
38 (int hypId, int studyId, SMESH_Gen* gen)
39 :SMESH_0D_Algo(hypId, studyId, gen)
41 _name = "SegmentAroundVertex_0D";
42 // it is assigned to vertices but influence a state of EDGE submeshes
43 _shapeType = (1 << TopAbs_VERTEX); // 1 bit per shape type
45 _compatibleHypothesis.push_back("SegmentLengthAroundVertex");
48 //================================================================================
52 //================================================================================
54 StdMeshers_SegmentAroundVertex_0D::~StdMeshers_SegmentAroundVertex_0D()
57 //=======================================================================
58 //function : CheckHypothesis
60 //=======================================================================
62 bool StdMeshers_SegmentAroundVertex_0D::CheckHypothesis(SMESH_Mesh& aMesh,
63 const TopoDS_Shape& aShape,
64 SMESH_Hypothesis::Hypothesis_Status& aStatus)
66 list <const SMESHDS_Hypothesis * >::const_iterator itl;
68 const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
69 if ( hyps.size() == 0 )
71 aStatus = SMESH_Hypothesis::HYP_MISSING;
72 return false; // can't work with no hypothesis
75 if ( hyps.size() > 1 )
77 aStatus = SMESH_Hypothesis::HYP_ALREADY_EXIST;
81 aStatus = SMESH_Hypothesis::HYP_OK;
83 return ( aStatus == HYP_OK );
86 //=======================================================================
89 //=======================================================================
91 bool StdMeshers_SegmentAroundVertex_0D::Compute(SMESH_Mesh&, const TopoDS_Shape&)
93 // This algorithm exists in order just to enable assignation of
94 // StdMeshers_SegmentLengthAroundVertex hypothesis