Salome HOME
IPAL54585: Extrusion 3D algo fails with "OCC exception. Standard_NoSuchObject: NColle...
[modules/smesh.git] / src / StdMeshers / StdMeshers_FixedPoints1D.hxx
1 // Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  SMESH SMESH : implementation of SMESH idl descriptions
21 //  File   : StdMeshers_FixedPoints1D.hxx
22 //  Author : Damien COQUERET, OCC
23 //  Module : SMESH
24 //
25 #ifndef _SMESH_FIXEDPOINTS1D_HXX_
26 #define _SMESH_FIXEDPOINTS1D_HXX_
27
28
29
30 #include "SMESH_StdMeshers.hxx"
31
32 #include "StdMeshers_Reversible1D.hxx"
33 #include "SMESH_Hypothesis.hxx"
34 #include "Utils_SALOME_Exception.hxx"
35
36 #include <vector>
37
38 class STDMESHERS_EXPORT StdMeshers_FixedPoints1D: public StdMeshers_Reversible1D
39 {
40 public:
41   StdMeshers_FixedPoints1D(int hypId, SMESH_Gen* gen);
42   virtual ~StdMeshers_FixedPoints1D();
43
44   void SetPoints(const std::vector<double>& listParams)
45     throw(SALOME_Exception);
46
47   void SetNbSegments(const std::vector<int>& listNbSeg) 
48     throw(SALOME_Exception);
49
50   const std::vector<double>& GetPoints() const { return _params; }
51
52   const std::vector<int>& GetNbSegments() const { return _nbsegs; }
53
54   virtual std::ostream & SaveTo(std::ostream & save);
55   virtual std::istream & LoadFrom(std::istream & load);
56
57   /*!
58    * \brief Initialize start and end length by the mesh built on the geometry
59    *  \param theMesh - the built mesh
60    *  \param theShape - the geometry of interest
61    *  \retval bool - true if parameter values have been successfully defined
62    */
63   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
64
65   /*!
66    * \brief Initialize my parameter values by default parameters.
67    *  \retval bool - true if parameter values have been successfully defined
68    */
69   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
70
71 protected:
72   std::vector<double> _params;
73   std::vector<int>    _nbsegs;
74 };
75
76 #endif