Version: 8.3.0
SMESH_ControlPnt.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
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)
46  : gp_Pnt( aPnt ), size( theSize ) {}
47  ControlPnt(double theX,double theY,double theZ)
48  : gp_Pnt(theX, theY, theZ), size(0) {}
49  ControlPnt(double theX,double theY,double theZ, double theSize)
50  : gp_Pnt(theX, theY, theZ), size( theSize ) {}
51 
52  double Size() const { return size; };
53  void SetSize( double theSize ) { size = theSize; };
54 
55  double size;
56  };
57 
58  // Functions to get sample point from shapes
59  SMESHUtils_EXPORT void createControlPoints( const TopoDS_Shape& theShape,
60  const double& theSize,
61  std::vector< ControlPnt >& thePoints );
62 
63  SMESHUtils_EXPORT void createPointsSampleFromEdge( const TopoDS_Edge& theEdge,
64  const double& theSize,
65  std::vector<ControlPnt>& thePoints );
66 
67  SMESHUtils_EXPORT void createPointsSampleFromFace( const TopoDS_Face& theFace,
68  const double& theSize,
69  std::vector<ControlPnt>& thePoints );
70 
71  SMESHUtils_EXPORT void createPointsSampleFromSolid( const TopoDS_Solid& theSolid,
72  const double& theSize,
73  std::vector<ControlPnt>& thePoints );
74 
75 }
76 #endif