Back to index

salome-smesh  6.5.0
StdMeshers_SegmentAroundVertex_0D.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SMESH SMESH : implementaion of SMESH idl descriptions
00024 // File      : StdMeshers_SegmentAroundVertex_0D.cxx
00025 // Module    : SMESH
00026 // Created   : Fri Oct 20 11:37:07 2006
00027 // Author    : Edward AGAPOV (eap)
00028 //
00029 #include "StdMeshers_SegmentAroundVertex_0D.hxx"
00030 
00031 //=======================================================================
00032 //function : StdMeshers_SegmentAroundVertex_0D
00033 //purpose  : 
00034 //=======================================================================
00035 
00036 StdMeshers_SegmentAroundVertex_0D::StdMeshers_SegmentAroundVertex_0D
00037                                    (int hypId, int studyId, SMESH_Gen* gen)
00038   :SMESH_0D_Algo(hypId, studyId, gen)
00039 {
00040   _name = "SegmentAroundVertex_0D";
00041   // it is assigned to vertices but influence a state of EDGE submeshes 
00042   _shapeType = (1 << TopAbs_VERTEX);    // 1 bit per shape type
00043 
00044   _compatibleHypothesis.push_back("SegmentLengthAroundVertex");
00045 }
00046 
00047 //================================================================================
00051 //================================================================================
00052 
00053 StdMeshers_SegmentAroundVertex_0D::~StdMeshers_SegmentAroundVertex_0D()
00054 {}
00055 
00056 //=======================================================================
00057 //function : CheckHypothesis
00058 //purpose  : 
00059 //=======================================================================
00060 
00061 bool StdMeshers_SegmentAroundVertex_0D::CheckHypothesis(SMESH_Mesh&                          aMesh,
00062                                                         const TopoDS_Shape&                  aShape,
00063                                                         SMESH_Hypothesis::Hypothesis_Status& aStatus)
00064 {
00065   list <const SMESHDS_Hypothesis * >::const_iterator itl;
00066 
00067   const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
00068   if ( hyps.size() == 0 )
00069   {
00070     aStatus = SMESH_Hypothesis::HYP_MISSING;
00071     return false;  // can't work with no hypothesis
00072   }
00073 
00074   if ( hyps.size() > 1 )
00075   {
00076     aStatus = SMESH_Hypothesis::HYP_ALREADY_EXIST;
00077   }
00078   else
00079   {
00080     aStatus = SMESH_Hypothesis::HYP_OK;
00081   }
00082   return ( aStatus == HYP_OK );
00083 }
00084 
00085 //=======================================================================
00086 //function : Compute
00087 //purpose  : 
00088 //=======================================================================
00089 
00090 bool StdMeshers_SegmentAroundVertex_0D::Compute(SMESH_Mesh&, const TopoDS_Shape&)
00091 {
00092   // This algorithm exists in order just to enable assignation of
00093   // StdMeshers_SegmentLengthAroundVertex hypothesis
00094   return true;
00095 }
00096 
00097 
00098 //=======================================================================
00099 //function : Evaluate
00100 //purpose  : 
00101 //=======================================================================
00102 
00103 bool StdMeshers_SegmentAroundVertex_0D::Evaluate(SMESH_Mesh&,
00104                                                  const TopoDS_Shape&,
00105                                                  MapShapeNbElems&)
00106 {
00107   // This algorithm exists in order just to enable assignation of
00108   // StdMeshers_SegmentLengthAroundVertex hypothesis
00109   return false;
00110 }