1 // Copyright (C) 2007-2014 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, or (at your option) any later version.
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, Barycentric, BarycentricGeo2D } 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;
53 double _min_dot_btw_3Dsurf_intersect;
56 SplittingPolicy _splitting_policy ;
58 InterpolationOptions() { init(); }
59 int getPrintLevel() const { return _print_level; }
60 void setPrintLevel(int pl) { _print_level=pl; }
62 IntersectionType getIntersectionType() const { return _intersection_type; }
63 void setIntersectionType(IntersectionType it) { _intersection_type=it; }
64 std::string getIntersectionTypeRepr() const;
66 double getPrecision() const { return _precision; }
67 void setPrecision(double p) { _precision=p; }
69 double getArcDetectionPrecision() const;
70 void setArcDetectionPrecision(double p);
72 double getMedianPlane() const { return _median_plane; }
73 void setMedianPlane(double mp) { _median_plane=mp; }
75 bool getDoRotate() const { return _do_rotate; }
76 void setDoRotate( bool dr) { _do_rotate = dr; }
78 double getBoundingBoxAdjustment() const { return _bounding_box_adjustment; }
79 void setBoundingBoxAdjustment(double bba) { _bounding_box_adjustment=bba; }
81 double getBoundingBoxAdjustmentAbs() const { return _bounding_box_adjustment_abs; }
82 void setBoundingBoxAdjustmentAbs(double bba) { _bounding_box_adjustment_abs=bba; }
84 double getMaxDistance3DSurfIntersect() const { return _max_distance_for_3Dsurf_intersect; }
85 void setMaxDistance3DSurfIntersect(double bba) { _max_distance_for_3Dsurf_intersect=bba; }
87 double getMinDotBtwPlane3DSurfIntersect() const { return _min_dot_btw_3Dsurf_intersect; }
88 void setMinDotBtwPlane3DSurfIntersect(double v) { _min_dot_btw_3Dsurf_intersect=v; }
90 int getOrientation() const { return _orientation; }
91 void setOrientation(int o) { _orientation=o; }
93 bool getMeasureAbsStatus() const { return _measure_abs; }
94 void setMeasureAbsStatus(bool newStatus) { _measure_abs=newStatus; }
96 SplittingPolicy getSplittingPolicy() const { return _splitting_policy; }
97 void setSplittingPolicy(SplittingPolicy sp) { _splitting_policy=sp; }
98 std::string getSplittingPolicyRepr() const;
100 std::string filterInterpolationMethod(const std::string& meth) const;
104 bool setInterpolationOptions(long print_level,
105 std::string intersection_type,
109 double bounding_box_adjustment,
110 double bounding_box_adjustment_abs,
111 double max_distance_for_3Dsurf_intersect,
114 std::string splitting_policy);
115 void copyOptions(const InterpolationOptions & other) { *this = other; }
116 bool setOptionDouble(const std::string& key, double value);
117 bool setOptionInt(const std::string& key, int value);
118 bool setOptionString(const std::string& key, const std::string& value);
119 std::string printOptions() const;
121 static void CheckAndSplitInterpolationMethod(const std::string& method, std::string& srcMeth, std::string& trgMeth);
123 static const double DFT_MEDIAN_PLANE;
124 static const double DFT_SURF3D_ADJ_EPS;
125 static const double DFT_MAX_DIST_3DSURF_INTERSECT;
126 static const double DFT_MIN_DOT_BTW_3DSURF_INTERSECT;
128 static const char PRECISION_STR[];
129 static const char ARC_DETECTION_PRECISION_STR[];
130 static const char MEDIANE_PLANE_STR[];
131 static const char BOUNDING_BOX_ADJ_STR[];
132 static const char BOUNDING_BOX_ADJ_ABS_STR[];
133 static const char MAX_DISTANCE_3DSURF_INSECT_STR[];
134 static const char MIN_DOT_BTW_3DSURF_INSECT_STR[];
135 static const char PRINT_LEV_STR[];
136 static const char DO_ROTATE_STR[];
137 static const char ORIENTATION_STR[];
138 static const char MEASURE_ABS_STR[];
139 static const char INTERSEC_TYPE_STR[];
140 static const char SPLITTING_POLICY_STR[];
141 static const char TRIANGULATION_INTERSECT2D_STR[];
142 static const char CONVEX_INTERSECT2D_STR[];
143 static const char GEOMETRIC_INTERSECT2D_STR[];
144 static const char POINTLOCATOR_INTERSECT_STR[];
145 static const char BARYCENTRIC_INTERSECT_STR[];
146 static const char BARYCENTRICGEO2D_INTERSECT_STR[];
147 static const char PLANAR_SPLIT_FACE_5_STR[];
148 static const char PLANAR_SPLIT_FACE_6_STR[];
149 static const char GENERAL_SPLIT_24_STR[];
150 static const char GENERAL_SPLIT_48_STR[];