1 // Copyright (C) 2007-2010 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.
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 : implementaion of SMESH idl descriptions
21 // File : StdMeshers_FixedPoints1D.hxx
22 // Author : Damien COQUERET, OCC
25 #ifndef _SMESH_FIXEDPOINTS1D_HXX_
26 #define _SMESH_FIXEDPOINTS1D_HXX_
30 #include "SMESH_StdMeshers.hxx"
32 #include "SMESH_Hypothesis.hxx"
33 #include "Utils_SALOME_Exception.hxx"
37 class STDMESHERS_EXPORT StdMeshers_FixedPoints1D:
38 public SMESH_Hypothesis
41 StdMeshers_FixedPoints1D(int hypId, int studyId, SMESH_Gen* gen);
42 virtual ~StdMeshers_FixedPoints1D();
44 void SetPoints(std::vector<double>& listParams)
45 throw(SALOME_Exception);
47 void SetNbSegments(std::vector<int>& listNbSeg)
48 throw(SALOME_Exception);
50 const std::vector<double>& GetPoints() const { return _params; }
52 const std::vector<int>& GetNbSegments() const { return _nbsegs; }
54 void SetReversedEdges( std::vector<int>& ids);
56 void SetObjectEntry( const char* entry ) { _objEntry = entry; }
58 const char* GetObjectEntry() { return _objEntry.c_str(); }
60 const std::vector<int>& GetReversedEdges() const { return _edgeIDs; }
62 virtual std::ostream & SaveTo(std::ostream & save);
63 virtual std::istream & LoadFrom(std::istream & load);
64 friend std::ostream& operator << (std::ostream & save, StdMeshers_FixedPoints1D & hyp);
65 friend std::istream& operator >> (std::istream & load, StdMeshers_FixedPoints1D & hyp);
68 * \brief Initialize start and end length by the mesh built on the geometry
69 * \param theMesh - the built mesh
70 * \param theShape - the geometry of interest
71 * \retval bool - true if parameter values have been successfully defined
73 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
76 * \brief Initialize my parameter values by default parameters.
77 * \retval bool - true if parameter values have been successfully defined
79 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
82 std::vector<double> _params;
83 std::vector<int> _nbsegs;
84 std::vector<int> _edgeIDs;
85 std::string _objEntry;