return meth;
}
-void INTERP_KERNEL::InterpolationOptions::setInterpolationOptions(long print_level,
- const char * intersection_type,
+bool INTERP_KERNEL::InterpolationOptions::setInterpolationOptions(long print_level,
+ std::string intersection_type,
double precision,
double median_plane,
bool do_rotate,
double max_distance_for_3Dsurf_intersect,
long orientation,
bool measure_abs,
- const char * splitting_policy,
+ std::string splitting_policy,
bool P1P0_bary_method )
{
- std::string interType = intersection_type;
- std::string splitPolicy = splitting_policy;
+ bool ret=true;
- _setInterpolationOptions=true;
_print_level=print_level;
- if( interType.find("Triangulation") != std::string::npos )
- _intersection_type=INTERP_KERNEL::Triangulation;
- else if( interType.find("Convex") != std::string::npos )
- _intersection_type=INTERP_KERNEL::Convex;
- else if( interType.find("Geometric2D") != std::string::npos )
- _intersection_type=INTERP_KERNEL::Geometric2D;
- else if( interType.find("PointLocator") != std::string::npos )
- _intersection_type=INTERP_KERNEL::PointLocator;
+ ret = setOptionString(INTERSEC_TYPE_STR,intersection_type);
_precision=precision;
_median_plane=median_plane;
_do_rotate=do_rotate;
_max_distance_for_3Dsurf_intersect=max_distance_for_3Dsurf_intersect;
_orientation=orientation;
_measure_abs=measure_abs;
- if( splitPolicy.find("PLANAR_FACE_5") != std::string::npos )
- _splitting_policy=INTERP_KERNEL::PLANAR_FACE_5;
- else if( splitPolicy.find("PLANAR_FACE_6") != std::string::npos )
- _splitting_policy=INTERP_KERNEL::PLANAR_FACE_6;
- else if( splitPolicy.find("GENERAL_24") != std::string::npos )
- _splitting_policy=INTERP_KERNEL::GENERAL_24;
- else if( splitPolicy.find("GENERAL_48") != std::string::npos )
- _splitting_policy=INTERP_KERNEL::GENERAL_48;
+ ret = setOptionString(SPLITTING_POLICY_STR,splitting_policy);
_P1P0_bary_method=P1P0_bary_method;
+
+ return ret;
}
class INTERPKERNEL_EXPORT InterpolationOptions
{
- protected:
+ private:
int _print_level ;
IntersectionType _intersection_type;
double _precision;
SplittingPolicy _splitting_policy ;
bool _P1P0_bary_method; // issue 0020440
- bool _setInterpolationOptions;
public:
InterpolationOptions() { init(); }
int getPrintLevel() const { return _print_level; }
_measure_abs=true;
_splitting_policy=GENERAL_48;
_P1P0_bary_method=false;
- _setInterpolationOptions=false;
}
- bool setOptionDouble(const std::string& key, double value);
- bool setOptionInt(const std::string& key, int value);
- bool setOptionString(const std::string& key, std::string& value);
- void setInterpolationOptions(long print_level,
- const char * intersection_type,
+ bool setInterpolationOptions(long print_level,
+ std::string intersection_type,
double precision,
double median_plane,
bool do_rotate,
double max_distance_for_3Dsurf_intersect,
long orientation,
bool measure_abs,
- const char * splitting_policy,
+ std::string splitting_policy,
bool P1P0_bary_method );
+ void copyOptions(InterpolationOptions & other) { *this = other; }
+ bool setOptionDouble(const std::string& key, double value);
+ bool setOptionInt(const std::string& key, int value);
+ bool setOptionString(const std::string& key, std::string& value);
private:
static const double DFT_MEDIAN_PLANE;
static const double DFT_SURF3D_ADJ_EPS;