Back to index

salome-smesh  6.5.0
StdMeshers_FixedPoints1D.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 //  SMESH SMESH : implementaion of SMESH idl descriptions
00021 //  File   : StdMeshers_FixedPoints1D.hxx
00022 //  Author : Damien COQUERET, OCC
00023 //  Module : SMESH
00024 //
00025 #ifndef _SMESH_FIXEDPOINTS1D_HXX_
00026 #define _SMESH_FIXEDPOINTS1D_HXX_
00027 
00028 
00029 
00030 #include "SMESH_StdMeshers.hxx"
00031 
00032 #include "SMESH_Hypothesis.hxx"
00033 #include "Utils_SALOME_Exception.hxx"
00034 
00035 #include <vector>
00036 
00037 class STDMESHERS_EXPORT StdMeshers_FixedPoints1D:
00038   public SMESH_Hypothesis
00039 {
00040 public:
00041   StdMeshers_FixedPoints1D(int hypId, int studyId, SMESH_Gen* gen);
00042   virtual ~StdMeshers_FixedPoints1D();
00043 
00044   void SetPoints(std::vector<double>& listParams)
00045     throw(SALOME_Exception);
00046 
00047   void SetNbSegments(std::vector<int>& listNbSeg) 
00048     throw(SALOME_Exception);
00049 
00050   const std::vector<double>& GetPoints() const { return _params; }
00051 
00052   const std::vector<int>& GetNbSegments() const { return _nbsegs; }
00053 
00054   void SetReversedEdges( std::vector<int>& ids);
00055 
00056   void SetObjectEntry( const char* entry ) { _objEntry = entry; }
00057 
00058   const char* GetObjectEntry() { return _objEntry.c_str(); }
00059 
00060   const std::vector<int>& GetReversedEdges() const { return _edgeIDs; }
00061 
00062   virtual std::ostream & SaveTo(std::ostream & save);
00063   virtual std::istream & LoadFrom(std::istream & load);
00064   friend std::ostream& operator << (std::ostream & save, StdMeshers_FixedPoints1D & hyp);
00065   friend std::istream& operator >> (std::istream & load, StdMeshers_FixedPoints1D & hyp);
00066 
00073   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
00074 
00079   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
00080 
00081 protected:
00082   std::vector<double> _params;
00083   std::vector<int>    _nbsegs;
00084   std::vector<int>    _edgeIDs;
00085   std::string         _objEntry;
00086 };
00087 
00088 #endif