Salome HOME
Merge from BR_V5_DEV 16Feb09
[tools/medcoupling.git] / src / INTERP_KERNEL / InterpolationOptions.hxx
1 //  Copyright (C) 2007-2008  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.
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 #ifndef __INTERPOLATIONOPTIONS_HXX__
20 #define __INTERPOLATIONOPTIONS_HXX__
21
22
23 namespace INTERP_KERNEL {
24   typedef enum { Triangulation, Convex, Geometric2D } IntersectionType;
25   /// Type describing the different ways in which the hexahedron can be split into tetrahedra.
26   /// The PLANAR_* policies persume that each face is to be considered planar, while the general
27   /// policies make no such hypothesis. The integer at the end gives the number of tetrahedra
28   /// that result from the split.
29   typedef enum  { PLANAR_FACE_5 = 5, PLANAR_FACE_6 = 6, GENERAL_24 = 24, GENERAL_48 = 48 } SplittingPolicy;
30
31   
32   class InterpolationOptions{
33   private :
34     int _print_level ;
35     IntersectionType _intersection_type;
36     double _precision;
37     double _median_plane ;
38     bool _do_rotate ;
39     double _bounding_box_adjustment ;
40     int _orientation ;
41     SplittingPolicy _splitting_policy ;
42
43   public:
44     InterpolationOptions() { init(); }
45     int getPrintLevel() const { return _print_level; }
46     void setPrintLevel(int pl) { _print_level=pl; }
47
48     IntersectionType getIntersectionType() const { return InterpolationOptions::_intersection_type; }
49     void setIntersectionType(IntersectionType it) { InterpolationOptions::_intersection_type=it; }
50
51     double getPrecision() const { return InterpolationOptions::_precision; }
52     void setPrecision(double p) { InterpolationOptions::_precision=p; }
53
54     double getMedianPlane() { return InterpolationOptions::_median_plane; }
55     void setMedianPlane(double mp) { InterpolationOptions::_median_plane=mp; }
56     
57     bool getDoRotate() { return InterpolationOptions::_do_rotate; }
58     void setDoRotate( bool dr) { InterpolationOptions::_do_rotate = dr; }
59     
60     double getBoundingBoxAdjustment() { return InterpolationOptions::_bounding_box_adjustment; }
61     void setBoundingBoxAdjustment(double bba) { InterpolationOptions::_bounding_box_adjustment=bba; }
62     
63     int getOrientation() { return InterpolationOptions::_orientation; }
64     void setOrientation(int o) { InterpolationOptions::_orientation=o; }
65     
66     SplittingPolicy getSplittingPolicy() { return _splitting_policy; }
67     void setSplittingPolicy(SplittingPolicy sp) { _splitting_policy=sp; }
68     void init()
69     {  
70       _print_level=0;
71       _intersection_type=Triangulation;
72       _precision=1e-12;;
73       _median_plane=0.5;
74       _do_rotate=true;
75       _bounding_box_adjustment=0.1;
76       _orientation=0;
77       _splitting_policy=GENERAL_48;
78     }
79   };
80
81 }
82 #endif