1 // Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // SMESH SMESH : implementation of SMESH idl descriptions
21 // File : StdMeshers_UseExisting_1D2D.cxx
23 // Created : Fri Oct 20 11:37:07 2006
24 // Author : Edward AGAPOV (eap)
26 #include "StdMeshers_UseExisting_1D2D.hxx"
28 #include "SMESH_Mesh.hxx"
29 #include "SMESH_subMesh.hxx"
31 //=======================================================================
32 //function : StdMeshers_UseExisting_1D
34 //=======================================================================
36 StdMeshers_UseExisting_1D::StdMeshers_UseExisting_1D
37 (int hypId, SMESH_Gen* gen)
38 :SMESH_1D_Algo(hypId, gen)
40 _name = "UseExisting_1D";
41 _shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
42 _requireShape = false;
45 //=======================================================================
46 //function : CheckHypothesis
48 //=======================================================================
50 bool StdMeshers_UseExisting_1D::CheckHypothesis(SMESH_Mesh& ,
52 Hypothesis_Status& aStatus)
54 return (aStatus = HYP_OK) == HYP_OK;
57 //=======================================================================
60 //=======================================================================
62 bool StdMeshers_UseExisting_1D::Compute(SMESH_Mesh& mesh, const TopoDS_Shape& edge)
64 // This algorithm exists to allow mesh generation by mesh
65 // edition functions in TUI mode
66 mesh.GetSubMesh( edge )->SetIsAlwaysComputed( true );
71 //=======================================================================
74 //=======================================================================
76 bool StdMeshers_UseExisting_1D::Evaluate(SMESH_Mesh&,
80 // This algorithm exists to allow mesh generation by mesh
81 // edition functions in TUI mode
86 //=======================================================================
87 //function : StdMeshers_UseExisting_2D
89 //=======================================================================
91 StdMeshers_UseExisting_2D::StdMeshers_UseExisting_2D
92 (int hypId, SMESH_Gen* gen)
93 :SMESH_2D_Algo(hypId, gen)
95 _name = "UseExisting_2D";
96 _shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
97 _requireShape = false;
100 //=======================================================================
101 //function : CheckHypothesis
103 //=======================================================================
105 bool StdMeshers_UseExisting_2D::CheckHypothesis(SMESH_Mesh& ,
106 const TopoDS_Shape& ,
107 Hypothesis_Status& aStatus)
109 return (aStatus = HYP_OK) == HYP_OK;
112 //=======================================================================
115 //=======================================================================
117 bool StdMeshers_UseExisting_2D::Compute(SMESH_Mesh& mesh, const TopoDS_Shape& face)
119 // This algorithm exists to allow mesh generation by mesh edition
120 // functions in TUI mode
121 mesh.GetSubMesh( face )->SetIsAlwaysComputed( true );
126 //=======================================================================
127 //function : Evaluate
129 //=======================================================================
131 bool StdMeshers_UseExisting_2D::Evaluate(SMESH_Mesh&,
135 // This algorithm exists to allow mesh generation by mesh edition
136 // functions in TUI mode