Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __INTERPOLATIONOPTIONS_HXX__
00021 #define __INTERPOLATIONOPTIONS_HXX__
00022
00023 #include "INTERPKERNELDefines.hxx"
00024
00025 #include <string>
00026
00027 namespace INTERP_KERNEL
00028 {
00029 typedef enum { Triangulation, Convex, Geometric2D, PointLocator } IntersectionType;
00034 typedef enum { PLANAR_FACE_5 = 5, PLANAR_FACE_6 = 6, GENERAL_24 = 24, GENERAL_48 = 48 } SplittingPolicy;
00035
00036 class INTERPKERNEL_EXPORT InterpolationOptions
00037 {
00038 private:
00039 int _print_level ;
00040 IntersectionType _intersection_type;
00041 double _precision;
00042 double _median_plane ;
00043 bool _do_rotate ;
00045 double _bounding_box_adjustment ;
00047 double _bounding_box_adjustment_abs ;
00048 double _max_distance_for_3Dsurf_intersect;
00049 int _orientation ;
00050 bool _measure_abs;
00051 SplittingPolicy _splitting_policy ;
00052 bool _P1P0_bary_method;
00053
00054 public:
00055 InterpolationOptions() { init(); }
00056 int getPrintLevel() const { return _print_level; }
00057 void setPrintLevel(int pl) { _print_level=pl; }
00058
00059 IntersectionType getIntersectionType() const { return _intersection_type; }
00060 void setIntersectionType(IntersectionType it) { _intersection_type=it; }
00061
00062 double getPrecision() const { return _precision; }
00063 void setPrecision(double p) { _precision=p; }
00064
00065 double getMedianPlane() const { return _median_plane; }
00066 void setMedianPlane(double mp) { _median_plane=mp; }
00067
00068 bool getDoRotate() const { return _do_rotate; }
00069 void setDoRotate( bool dr) { _do_rotate = dr; }
00070
00071 double getBoundingBoxAdjustment() const { return _bounding_box_adjustment; }
00072 void setBoundingBoxAdjustment(double bba) { _bounding_box_adjustment=bba; }
00073
00074 double getBoundingBoxAdjustmentAbs() const { return _bounding_box_adjustment_abs; }
00075 void setBoundingBoxAdjustmentAbs(double bba) { _bounding_box_adjustment_abs=bba; }
00076
00077 double getMaxDistance3DSurfIntersect() const { return _max_distance_for_3Dsurf_intersect; }
00078 void setMaxDistance3DSurfIntersect(double bba) { _max_distance_for_3Dsurf_intersect=bba; }
00079
00080 int getOrientation() const { return _orientation; }
00081 void setOrientation(int o) { _orientation=o; }
00082
00083 bool getMeasureAbsStatus() const { return _measure_abs; }
00084 void setMeasureAbsStatus(bool newStatus) { _measure_abs=newStatus; }
00085
00086 SplittingPolicy getSplittingPolicy() const { return _splitting_policy; }
00087 void setSplittingPolicy(SplittingPolicy sp) { _splitting_policy=sp; }
00088
00089 void setP1P0BaryMethod(bool isP1P0) { _P1P0_bary_method=isP1P0; }
00090 bool getP1P0BaryMethod() const { return _P1P0_bary_method; }
00091
00092 std::string filterInterpolationMethod(const std::string& meth) const;
00093
00094 void init()
00095 {
00096 _print_level=0;
00097 _intersection_type=Triangulation;
00098 _precision=1e-12;
00099 _median_plane=DFT_MEDIAN_PLANE;
00100 _do_rotate=true;
00101 _bounding_box_adjustment=DFT_SURF3D_ADJ_EPS;
00102 _bounding_box_adjustment_abs=0.;
00103 _max_distance_for_3Dsurf_intersect=DFT_MAX_DIST_3DSURF_INTERSECT;
00104 _orientation=0;
00105 _measure_abs=true;
00106 _splitting_policy=GENERAL_48;
00107 _P1P0_bary_method=false;
00108 }
00109 bool setInterpolationOptions(long print_level,
00110 std::string intersection_type,
00111 double precision,
00112 double median_plane,
00113 bool do_rotate,
00114 double bounding_box_adjustment,
00115 double bounding_box_adjustment_abs,
00116 double max_distance_for_3Dsurf_intersect,
00117 long orientation,
00118 bool measure_abs,
00119 std::string splitting_policy,
00120 bool P1P0_bary_method );
00121 void copyOptions(const InterpolationOptions & other) { *this = other; }
00122 bool setOptionDouble(const std::string& key, double value);
00123 bool setOptionInt(const std::string& key, int value);
00124 bool setOptionString(const std::string& key, const std::string& value);
00125 private:
00126 static const double DFT_MEDIAN_PLANE;
00127 static const double DFT_SURF3D_ADJ_EPS;
00128 static const double DFT_MAX_DIST_3DSURF_INTERSECT;
00129 public:
00130 static const char PRECISION_STR[];
00131 static const char MEDIANE_PLANE_STR[];
00132 static const char BOUNDING_BOX_ADJ_STR[];
00133 static const char BOUNDING_BOX_ADJ_ABS_STR[];
00134 static const char MAX_DISTANCE_3DSURF_INSECT_STR[];
00135 static const char PRINT_LEV_STR[];
00136 static const char DO_ROTATE_STR[];
00137 static const char ORIENTATION_STR[];
00138 static const char MEASURE_ABS_STR[];
00139 static const char INTERSEC_TYPE_STR[];
00140 static const char SPLITTING_POLICY_STR[];
00141 static const char TRIANGULATION_INTERSECT2D_STR[];
00142 static const char CONVEX_INTERSECT2D_STR[];
00143 static const char GEOMETRIC_INTERSECT2D_STR[];
00144 static const char POINTLOCATOR_INTERSECT_STR[];
00145 static const char PLANAR_SPLIT_FACE_5_STR[];
00146 static const char PLANAR_SPLIT_FACE_6_STR[];
00147 static const char GENERAL_SPLIT_24_STR[];
00148 static const char GENERAL_SPLIT_48_STR[];
00149 };
00150
00151 }
00152 #endif