1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SMESH StdMeshers : implementaion of SMESH idl descriptions
24 // File : StdMeshers_ImportSource1D.hxx
27 #ifndef _StdMeshers_ImportSource_HXX_
28 #define _StdMeshers_ImportSource_HXX_
30 #include "SMESH_StdMeshers.hxx"
32 #include "SMESH_Hypothesis.hxx"
33 #include "Utils_SALOME_Exception.hxx"
41 //==============================================================================
43 * \brief Stores groups to import elements from
45 //==============================================================================
47 class STDMESHERS_EXPORT StdMeshers_ImportSource1D : public SMESH_Hypothesis
50 StdMeshers_ImportSource1D(int hypId, int studyId, SMESH_Gen * gen);
51 virtual ~ StdMeshers_ImportSource1D();
53 void SetGroups(const std::vector<SMESH_Group*>& groups);
54 const std::vector<SMESH_Group*>& GetGroups() const;
56 void SetCopySourceMesh(bool toCopyMesh, bool toCopyGroups);
57 void GetCopySourceMesh(bool& toCopyMesh, bool& toCopyGroups) const;
59 virtual std::ostream & SaveTo(std::ostream & save);
60 virtual std::istream & LoadFrom(std::istream & load);
61 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
62 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
63 void RestoreGroups(const std::vector<SMESH_Group*>& groups);
65 void StoreResultGroups(const std::vector<SMESH_Group*>& groups,
66 const SMESHDS_Mesh& srcMesh,
67 const SMESHDS_Mesh& tgtMesh);
68 std::vector<SMESH_Group*>* GetResultGroups(const SMESHDS_Mesh& srcMesh,
69 const SMESHDS_Mesh& tgtMesh);
71 std::vector<SMESH_Mesh*> GetSourceMeshes() const;
75 std::vector<SMESH_Group*> _groups;
76 bool _toCopyMesh, _toCopyGroups;
78 // groups imported using this hypothesis
79 typedef std::map< std::pair<int, int>, std::vector<SMESH_Group*> > TResGroupMap;
80 TResGroupMap _resultGroups;
81 std::vector<int> _resultGroupsStorage; // persistent representation of _resultGroups
83 void resultGroupsToIntVec();
86 //==============================================================================
88 * \brief Redefines name and dimension of inherited StdMeshers_ImportSource1D
90 //==============================================================================
92 class STDMESHERS_EXPORT StdMeshers_ImportSource2D : public StdMeshers_ImportSource1D
95 StdMeshers_ImportSource2D(int hypId, int studyId, SMESH_Gen * gen);