Version: 9.12.0
StdMeshers_ImportSource.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // SMESH StdMeshers : implementation of SMESH idl descriptions
24 // File : StdMeshers_ImportSource1D.hxx
25 // Module : SMESH
26 //
27 #ifndef _StdMeshers_ImportSource_HXX_
28 #define _StdMeshers_ImportSource_HXX_
29 
30 #include "SMESH_StdMeshers.hxx"
31 
32 #include "SMESH_Hypothesis.hxx"
33 #include "Utils_SALOME_Exception.hxx"
34 
35 #include <vector>
36 #include <map>
37 
38 class SMESH_Group;
39 class SMESHDS_Mesh;
40 class SMESH_subMesh;
41 
42 //==============================================================================
46 //==============================================================================
47 
49 {
50  public:
51  StdMeshers_ImportSource1D(int hypId, SMESH_Gen * gen);
53 
54  void SetGroups(const std::vector<SMESH_Group*>& groups);
55  const std::vector<SMESH_Group*>& GetGroups(bool loaded=false) const;
56 
57  void SetCopySourceMesh(bool toCopyMesh, bool toCopyGroups);
58  void GetCopySourceMesh(bool& toCopyMesh, bool& toCopyGroups) const;
59 
60  virtual std::ostream & SaveTo(std::ostream & save);
61  virtual std::istream & LoadFrom(std::istream & load);
62  virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
63  virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
64  virtual bool DataDependOnParams() const { return true; }
65  void RestoreGroups(const std::vector<SMESH_Group*>& groups);
66 
67  void StoreResultGroups(const std::vector<SMESH_Group*>& groups,
68  const SMESHDS_Mesh& srcMesh,
69  const SMESHDS_Mesh& tgtMesh);
70  std::vector<SMESH_Group*>* GetResultGroups(const SMESHDS_Mesh& srcMesh,
71  const SMESHDS_Mesh& tgtMesh);
72 
73  std::vector<SMESH_Mesh*> GetSourceMeshes() const;
74  std::vector<SMESH_subMesh*> GetSourceSubMeshes(const SMESH_Mesh* srcMesh) const;
75 
76 private:
77 
78  std::vector<SMESH_Group*> _groups;
79  bool _toCopyMesh, _toCopyGroups;
80 
81  // groups imported using this hypothesis
82  typedef std::map< std::pair<int, int>, std::vector<SMESH_Group*> > TResGroupMap;
84  std::vector<int> _resultGroupsStorage; // persistent representation of _resultGroups
85 
86  void resultGroupsToIntVec();
87 };
88 
89 //==============================================================================
93 //==============================================================================
94 
96 {
97  public:
98  StdMeshers_ImportSource2D(int hypId, SMESH_Gen * gen);
99 };
100 #endif
#define STDMESHERS_EXPORT
Definition: SMESH_StdMeshers.hxx:38
virtual std::ostream & SaveTo(std::ostream &save)=0
virtual std::istream & LoadFrom(std::istream &load)=0
Definition: SMESHDS_Mesh.hxx:68
Definition: SMESH_Gen.hxx:68
Definition: SMESH_Group.hxx:43
Definition: SMESH_Hypothesis.hxx:48
virtual bool SetParametersByDefaults(const TDefaults &dflts, const SMESH_Mesh *theMesh=0)=0
Initialize my parameter values by default parameters.
virtual bool SetParametersByMesh(const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)=0
Initialize my parameter values by the mesh built on the geometry.
Definition: SMESH_Mesh.hxx:80
Definition: SMESH_subMesh.hxx:61
Stores groups to import elements from.
Definition: StdMeshers_ImportSource.hxx:49
virtual bool DataDependOnParams() const
The returned value is used by NotifySubMeshesHypothesisModification() to decide to call subMesh->Algo...
Definition: StdMeshers_ImportSource.hxx:64
virtual ~ StdMeshers_ImportSource1D()
std::vector< int > _resultGroupsStorage
Definition: StdMeshers_ImportSource.hxx:84
TResGroupMap _resultGroups
Definition: StdMeshers_ImportSource.hxx:83
std::map< std::pair< int, int >, std::vector< SMESH_Group * > > TResGroupMap
Definition: StdMeshers_ImportSource.hxx:82
std::vector< SMESH_Group * > _groups
Definition: StdMeshers_ImportSource.hxx:78
bool _toCopyGroups
Definition: StdMeshers_ImportSource.hxx:79
Redefines name and dimension of inherited StdMeshers_ImportSource1D.
Definition: StdMeshers_ImportSource.hxx:96
Definition: SMESH_Hypothesis.hxx:100