Back to index

salome-smesh  6.5.0
StdMeshers_QuadrangleParams.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 //  File   : StdMeshers_QuadrangleParams.hxx
00020 //  Author : Sergey KUUL, OCC
00021 //  Module : SMESH
00022 
00023 #ifndef _SMESH_QUADRANGLEPARAMS_HXX_
00024 #define _SMESH_QUADRANGLEPARAMS_HXX_
00025 
00026 #include "SMESH_StdMeshers.hxx"
00027 
00028 #include "SMESH_Hypothesis.hxx"
00029 #include "Utils_SALOME_Exception.hxx"
00030 
00031 enum StdMeshers_QuadType
00032   {
00033     QUAD_STANDARD,
00034     QUAD_TRIANGLE_PREF,
00035     QUAD_QUADRANGLE_PREF,
00036     QUAD_QUADRANGLE_PREF_REVERSED,
00037     QUAD_REDUCED,
00038     QUAD_NB_TYPES
00039   };
00040 
00041 class STDMESHERS_EXPORT StdMeshers_QuadrangleParams:
00042   public SMESH_Hypothesis
00043 {
00044 public:
00045   StdMeshers_QuadrangleParams(int hypId, int studyId, SMESH_Gen* gen);
00046   virtual ~StdMeshers_QuadrangleParams();
00047 
00048   void SetTriaVertex (int id);
00049   int GetTriaVertex() const { return _triaVertexID; }
00050 
00051   void SetObjectEntry (const char* entry) { _objEntry = entry; }
00052   const char* GetObjectEntry() { return _objEntry.c_str(); }
00053 
00054   void SetQuadType (StdMeshers_QuadType type);
00055   StdMeshers_QuadType GetQuadType() const { return _quadType; }
00056 
00057   virtual std::ostream & SaveTo(std::ostream & save);
00058   virtual std::istream & LoadFrom(std::istream & load);
00059   friend std::ostream& operator << (std::ostream & save,
00060                                     StdMeshers_QuadrangleParams & hyp);
00061   friend std::istream& operator >> (std::istream & load,
00062                                     StdMeshers_QuadrangleParams & hyp);
00063 
00070   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh,
00071                                    const TopoDS_Shape& theShape);
00072 
00077   virtual bool SetParametersByDefaults(const TDefaults& dflts,
00078                                        const SMESH_Mesh* theMesh=0);
00079 
00080 protected:
00081   int                 _triaVertexID;
00082   std::string         _objEntry;
00083   StdMeshers_QuadType _quadType;
00084 };
00085 
00086 #endif