Version: 9.16.0
StdMeshers_CartesianParameters3D.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 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// File : StdMeshers_CartesianParameters3D.hxx
24// Author : Edward AGAPOV
25// Module : SMESH
26//
27#ifndef _SMESH_CartesianParameters3D_HXX_
28#define _SMESH_CartesianParameters3D_HXX_
29
30#include "SMESH_StdMeshers.hxx"
31
32#include "SMESH_Hypothesis.hxx"
33#include "Utils_SALOME_Exception.hxx"
34
35#include <vector>
36
37class SMESH_Gen;
38class Bnd_Box;
39
40// =========================================================
46// =========================================================
47
49{
50public:
51 // Constructor
53
57 void SetGrid(std::vector<double>& xNodes, int axis);
61 void GetGrid(std::vector<double>& xNodes, int axis) const;
62
71 void SetGridSpacing(std::vector<std::string>& spaceFunctions,
72 std::vector<double>& internalPoints,
73 const int axis);
74
75 void GetGridSpacing(std::vector<std::string>& spaceFunctions,
76 std::vector<double>& internalPoints,
77 const int axis) const;
78
79 bool IsGridBySpacing(const int axis) const;
80
85 void SetFixedPoint(const double p[3], bool toUnset);
86 bool GetFixedPoint(double p[3]) const;
87
96 static void ComputeCoordinates(const double x0,
97 const double x1,
98 std::vector<std::string>& spaceFuns,
99 std::vector<double>& points,
100 std::vector<double>& coords,
101 const std::string& axis,
102 const double* xForced=0);
107 void GetCoordinates(std::vector<double>& xNodes,
108 std::vector<double>& yNodes,
109 std::vector<double>& zNodes,
110 const Bnd_Box& bndBox) const;
111
115 void SetAxisDirs(const double* the9DirComps);
116 const double* GetAxisDirs() const { return _axisDirs; }
120 static void ComputeOptimalAxesDirs(const TopoDS_Shape& shape,
121 const bool isOrthogonal,
122 double dirCoords[9]);
128 void SetSizeThreshold(const double threshold);
132 double GetSizeThreshold() const;
133
139 void SetToAddEdges(bool toAdd);
140 bool GetToAddEdges() const;
141
145 void SetToConsiderInternalFaces(bool toTreat);
146 bool GetToConsiderInternalFaces() const { return _toConsiderInternalFaces; }
147
151 void SetToUseThresholdForInternalFaces(bool toUse);
152 bool GetToUseThresholdForInternalFaces() const { return _toUseThresholdForInternalFaces; }
153
157 void SetToCreateFaces(bool toCreate);
158 bool GetToCreateFaces() const { return _toCreateFaces; }
159
163 void SetToUseQuanta(bool toUseQuanta);
164 bool GetToUseQuanta() const { return _toUseQuanta; }
165
170 void SetQuanta(const double quanta );
171 double GetQuanta() const { return _quanta; }
172
173
177 bool IsDefined() const;
178
182 virtual std::ostream & SaveTo(std::ostream & save);
183 virtual std::istream & LoadFrom(std::istream & load);
184
188 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
189
193 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
194
195 protected:
196
197 std::vector<double> _coords[3];
198 std::vector<std::string> _spaceFunctions[3];
199 std::vector<double> _internalPoints[3];
200
201 double _axisDirs [9];
202 double _fixedPoint[3];
203
210 double _quanta;
211};
212
213#endif
214
#define STDMESHERS_EXPORT
Definition: SMESH_StdMeshers.hxx:38
virtual std::istream & LoadFrom(std::istream &load)=0
virtual std::ostream & SaveTo(std::ostream &save)=0
Definition: SMESH_Gen.hxx:68
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
This hypothesis specifies.
Definition: StdMeshers_CartesianParameters3D.hxx:49
bool GetToConsiderInternalFaces() const
Definition: StdMeshers_CartesianParameters3D.hxx:146
bool _toConsiderInternalFaces
Definition: StdMeshers_CartesianParameters3D.hxx:206
bool GetToCreateFaces() const
Definition: StdMeshers_CartesianParameters3D.hxx:158
bool _toUseQuanta
Definition: StdMeshers_CartesianParameters3D.hxx:209
bool GetToUseQuanta() const
Definition: StdMeshers_CartesianParameters3D.hxx:164
bool GetToUseThresholdForInternalFaces() const
Definition: StdMeshers_CartesianParameters3D.hxx:152
double _quanta
Definition: StdMeshers_CartesianParameters3D.hxx:210
bool _toUseThresholdForInternalFaces
Definition: StdMeshers_CartesianParameters3D.hxx:207
bool _toAddEdges
Definition: StdMeshers_CartesianParameters3D.hxx:205
double _sizeThreshold
Definition: StdMeshers_CartesianParameters3D.hxx:204
const double * GetAxisDirs() const
Definition: StdMeshers_CartesianParameters3D.hxx:116
double GetQuanta() const
Definition: StdMeshers_CartesianParameters3D.hxx:171
bool _toCreateFaces
Definition: StdMeshers_CartesianParameters3D.hxx:208