Salome HOME
Copyright update 2021
[modules/smesh.git] / src / SMESHUtils / SMESH_ControlPnt.hxx
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D, 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 {
38   /*!
39    * \brief Control point: coordinates and element size at these coordinates
40    */
41   struct SMESHUtils_EXPORT ControlPnt : public gp_Pnt
42   {
43     ControlPnt()
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