1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #ifndef __INTERPOLATIONOPTIONS_HXX__
22 #define __INTERPOLATIONOPTIONS_HXX__
24 #include "INTERPKERNELDefines.hxx"
25 #include "NormalizedUnstructuredMesh.hxx"
29 namespace INTERP_KERNEL
31 typedef enum { Triangulation, Convex, Geometric2D, PointLocator } IntersectionType;
34 * \class InterpolationOptions
35 * Class defining the options for all interpolation algorithms.
37 * List of options, possible values and default values can be found on this page:
38 * \ref InterpKerIntersectors
40 class INTERPKERNEL_EXPORT InterpolationOptions
44 IntersectionType _intersection_type;
46 double _median_plane ;
48 //! this measure is relative to the caracteristic dimension
49 double _bounding_box_adjustment ;
50 //! this measure is absolute \b not relative to the cell size
51 double _bounding_box_adjustment_abs ;
52 double _max_distance_for_3Dsurf_intersect;
55 SplittingPolicy _splitting_policy ;
56 bool _P1P0_bary_method; // issue 0020440
59 InterpolationOptions() { init(); }
60 int getPrintLevel() const { return _print_level; }
61 void setPrintLevel(int pl) { _print_level=pl; }
63 IntersectionType getIntersectionType() const { return _intersection_type; }
64 void setIntersectionType(IntersectionType it) { _intersection_type=it; }
65 std::string getIntersectionTypeRepr() const;
67 double getPrecision() const { return _precision; }
68 void setPrecision(double p) { _precision=p; }
70 double getMedianPlane() const { return _median_plane; }
71 void setMedianPlane(double mp) { _median_plane=mp; }
73 bool getDoRotate() const { return _do_rotate; }
74 void setDoRotate( bool dr) { _do_rotate = dr; }
76 double getBoundingBoxAdjustment() const { return _bounding_box_adjustment; }
77 void setBoundingBoxAdjustment(double bba) { _bounding_box_adjustment=bba; }
79 double getBoundingBoxAdjustmentAbs() const { return _bounding_box_adjustment_abs; }
80 void setBoundingBoxAdjustmentAbs(double bba) { _bounding_box_adjustment_abs=bba; }
82 double getMaxDistance3DSurfIntersect() const { return _max_distance_for_3Dsurf_intersect; }
83 void setMaxDistance3DSurfIntersect(double bba) { _max_distance_for_3Dsurf_intersect=bba; }
85 int getOrientation() const { return _orientation; }
86 void setOrientation(int o) { _orientation=o; }
88 bool getMeasureAbsStatus() const { return _measure_abs; }
89 void setMeasureAbsStatus(bool newStatus) { _measure_abs=newStatus; }
91 SplittingPolicy getSplittingPolicy() const { return _splitting_policy; }
92 void setSplittingPolicy(SplittingPolicy sp) { _splitting_policy=sp; }
93 std::string getSplittingPolicyRepr() const;
95 void setP1P0BaryMethod(bool isP1P0) { _P1P0_bary_method=isP1P0; }
96 bool getP1P0BaryMethod() const { return _P1P0_bary_method; }
98 std::string filterInterpolationMethod(const std::string& meth) const;
102 bool setInterpolationOptions(long print_level,
103 std::string intersection_type,
107 double bounding_box_adjustment,
108 double bounding_box_adjustment_abs,
109 double max_distance_for_3Dsurf_intersect,
112 std::string splitting_policy,
113 bool P1P0_bary_method );
114 void copyOptions(const InterpolationOptions & other) { *this = other; }
115 bool setOptionDouble(const std::string& key, double value);
116 bool setOptionInt(const std::string& key, int value);
117 bool setOptionString(const std::string& key, const std::string& value);
118 std::string printOptions() const;
120 static const double DFT_MEDIAN_PLANE;
121 static const double DFT_SURF3D_ADJ_EPS;
122 static const double DFT_MAX_DIST_3DSURF_INTERSECT;
124 static const char PRECISION_STR[];
125 static const char MEDIANE_PLANE_STR[];
126 static const char BOUNDING_BOX_ADJ_STR[];
127 static const char BOUNDING_BOX_ADJ_ABS_STR[];
128 static const char MAX_DISTANCE_3DSURF_INSECT_STR[];
129 static const char PRINT_LEV_STR[];
130 static const char DO_ROTATE_STR[];
131 static const char ORIENTATION_STR[];
132 static const char MEASURE_ABS_STR[];
133 static const char INTERSEC_TYPE_STR[];
134 static const char SPLITTING_POLICY_STR[];
135 static const char TRIANGULATION_INTERSECT2D_STR[];
136 static const char CONVEX_INTERSECT2D_STR[];
137 static const char GEOMETRIC_INTERSECT2D_STR[];
138 static const char POINTLOCATOR_INTERSECT_STR[];
139 static const char PLANAR_SPLIT_FACE_5_STR[];
140 static const char PLANAR_SPLIT_FACE_6_STR[];
141 static const char GENERAL_SPLIT_24_STR[];
142 static const char GENERAL_SPLIT_48_STR[];