Version: 9.12.0
SMESH_ControlPnt.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 // Author : Lioka RAZAFINDRAZAKA (CEA)
21 
22 #ifndef SMESH_CONTROLPNT_H
23 #define SMESH_CONTROLPNT_H
24 
25 #include "SMESH_Utils.hxx"
26 
27 #include <gp_Pnt.hxx>
28 
29 class TopoDS_Shape;
30 class TopoDS_Edge ;
31 class TopoDS_Face ;
32 class TopoDS_Solid;
33 
34 #include <vector>
35 
36 namespace SMESHUtils
37 {
41  struct SMESHUtils_EXPORT ControlPnt : public gp_Pnt
42  {
44  : gp_Pnt(), size(0) {}
45  ControlPnt( const gp_Pnt& aPnt, double theSize=0)
46  : gp_Pnt( aPnt ), size( theSize ) {}
47  ControlPnt(double theX,double theY,double theZ, double theSize=0)
48  : gp_Pnt(theX, theY, theZ), size( theSize ) {}
49 
50  double Size() const { return size; };
51  void SetSize( double theSize ) { size = theSize; };
52 
53  double size;
54  };
55 
56  // Functions to get sample point from shapes
57  SMESHUtils_EXPORT void createControlPoints( const TopoDS_Shape& theShape,
58  const double& theSize,
59  std::vector< ControlPnt >& thePoints );
60 
61  SMESHUtils_EXPORT void createPointsSampleFromEdge( const TopoDS_Edge& theEdge,
62  const double& theSize,
63  std::vector<ControlPnt>& thePoints );
64 
65  SMESHUtils_EXPORT void createPointsSampleFromFace( const TopoDS_Face& theFace,
66  const double& theSize,
67  std::vector<ControlPnt>& thePoints );
68 
69  SMESHUtils_EXPORT void createPointsSampleFromSolid( const TopoDS_Solid& theSolid,
70  const double& theSize,
71  std::vector<ControlPnt>& thePoints );
72 
73 }
74 #endif
#define SMESHUtils_EXPORT
Definition: SMESH_Utils.hxx:37
Definition: SMESH_BoostTxtArchive.hxx:35
void createControlPoints(const TopoDS_Shape &theShape, const double &theSize, std::vector< ControlPnt > &thePoints)
Fills a vector of points from which a size map input file can be written.
Definition: SMESH_ControlPnt.cxx:77
void createPointsSampleFromFace(const TopoDS_Face &theFace, const double &theSize, std::vector< ControlPnt > &thePoints)
Fills a vector of points with point samples approximately.
Definition: SMESH_ControlPnt.cxx:153
void createPointsSampleFromEdge(const TopoDS_Edge &theEdge, const double &theSize, std::vector< ControlPnt > &thePoints)
Fills a vector of points with point samples approximately.
Definition: SMESH_ControlPnt.cxx:124
void createPointsSampleFromSolid(const TopoDS_Solid &theSolid, const double &theSize, std::vector< ControlPnt > &thePoints)
Fills a vector of points with point samples approximately.
Definition: SMESH_ControlPnt.cxx:191
Control point: coordinates and element size at these coordinates.
Definition: SMESH_ControlPnt.hxx:42
ControlPnt(double theX, double theY, double theZ, double theSize=0)
Definition: SMESH_ControlPnt.hxx:47
double Size() const
Definition: SMESH_ControlPnt.hxx:50
void SetSize(double theSize)
Definition: SMESH_ControlPnt.hxx:51
ControlPnt()
Definition: SMESH_ControlPnt.hxx:43
double size
Definition: SMESH_ControlPnt.hxx:51
ControlPnt(const gp_Pnt &aPnt, double theSize=0)
Definition: SMESH_ControlPnt.hxx:45