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, 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;
55 SplittingPolicy _splitting_policy ;
57 InterpolationOptions() { init(); }
58 int getPrintLevel() const { return _print_level; }
59 void setPrintLevel(int pl) { _print_level=pl; }
61 IntersectionType getIntersectionType() const { return _intersection_type; }
62 void setIntersectionType(IntersectionType it) { _intersection_type=it; }
63 std::string getIntersectionTypeRepr() const;
65 double getPrecision() const { return _precision; }
66 void setPrecision(double p) { _precision=p; }
68 double getMedianPlane() const { return _median_plane; }
69 void setMedianPlane(double mp) { _median_plane=mp; }
71 bool getDoRotate() const { return _do_rotate; }
72 void setDoRotate( bool dr) { _do_rotate = dr; }
74 double getBoundingBoxAdjustment() const { return _bounding_box_adjustment; }
75 void setBoundingBoxAdjustment(double bba) { _bounding_box_adjustment=bba; }
77 double getBoundingBoxAdjustmentAbs() const { return _bounding_box_adjustment_abs; }
78 void setBoundingBoxAdjustmentAbs(double bba) { _bounding_box_adjustment_abs=bba; }
80 double getMaxDistance3DSurfIntersect() const { return _max_distance_for_3Dsurf_intersect; }
81 void setMaxDistance3DSurfIntersect(double bba) { _max_distance_for_3Dsurf_intersect=bba; }
83 int getOrientation() const { return _orientation; }
84 void setOrientation(int o) { _orientation=o; }
86 bool getMeasureAbsStatus() const { return _measure_abs; }
87 void setMeasureAbsStatus(bool newStatus) { _measure_abs=newStatus; }
89 SplittingPolicy getSplittingPolicy() const { return _splitting_policy; }
90 void setSplittingPolicy(SplittingPolicy sp) { _splitting_policy=sp; }
91 std::string getSplittingPolicyRepr() const;
93 std::string filterInterpolationMethod(const std::string& meth) const;
97 bool setInterpolationOptions(long print_level,
98 std::string intersection_type,
102 double bounding_box_adjustment,
103 double bounding_box_adjustment_abs,
104 double max_distance_for_3Dsurf_intersect,
107 std::string splitting_policy);
108 void copyOptions(const InterpolationOptions & other) { *this = other; }
109 bool setOptionDouble(const std::string& key, double value);
110 bool setOptionInt(const std::string& key, int value);
111 bool setOptionString(const std::string& key, const std::string& value);
112 std::string printOptions() const;
114 static void CheckAndSplitInterpolationMethod(const char *method, std::string& srcMeth, std::string& trgMeth);
116 static const double DFT_MEDIAN_PLANE;
117 static const double DFT_SURF3D_ADJ_EPS;
118 static const double DFT_MAX_DIST_3DSURF_INTERSECT;
120 static const char PRECISION_STR[];
121 static const char MEDIANE_PLANE_STR[];
122 static const char BOUNDING_BOX_ADJ_STR[];
123 static const char BOUNDING_BOX_ADJ_ABS_STR[];
124 static const char MAX_DISTANCE_3DSURF_INSECT_STR[];
125 static const char PRINT_LEV_STR[];
126 static const char DO_ROTATE_STR[];
127 static const char ORIENTATION_STR[];
128 static const char MEASURE_ABS_STR[];
129 static const char INTERSEC_TYPE_STR[];
130 static const char SPLITTING_POLICY_STR[];
131 static const char TRIANGULATION_INTERSECT2D_STR[];
132 static const char CONVEX_INTERSECT2D_STR[];
133 static const char GEOMETRIC_INTERSECT2D_STR[];
134 static const char POINTLOCATOR_INTERSECT_STR[];
135 static const char BARYCENTRIC_INTERSECT_STR[];
136 static const char BARYCENTRICGEO2D_INTERSECT_STR[];
137 static const char PLANAR_SPLIT_FACE_5_STR[];
138 static const char PLANAR_SPLIT_FACE_6_STR[];
139 static const char GENERAL_SPLIT_24_STR[];
140 static const char GENERAL_SPLIT_48_STR[];