From 78149b37ede8fc282d7e5a56e723cd3b2c8c10b4 Mon Sep 17 00:00:00 2001 From: secher Date: Fri, 12 Feb 2010 10:48:28 +0000 Subject: [PATCH] one InterpolationOptions by coupling --- src/INTERP_KERNEL/InterpolationOptions.cxx | 30 ++++++---------------- src/INTERP_KERNEL/InterpolationOptions.hxx | 17 ++++++------ 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/src/INTERP_KERNEL/InterpolationOptions.cxx b/src/INTERP_KERNEL/InterpolationOptions.cxx index 68325eecf..5b65d6342 100644 --- a/src/INTERP_KERNEL/InterpolationOptions.cxx +++ b/src/INTERP_KERNEL/InterpolationOptions.cxx @@ -180,8 +180,8 @@ std::string INTERP_KERNEL::InterpolationOptions::filterInterpolationMethod(const 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, @@ -190,22 +190,13 @@ void INTERP_KERNEL::InterpolationOptions::setInterpolationOptions(long print_lev 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; @@ -214,14 +205,9 @@ void INTERP_KERNEL::InterpolationOptions::setInterpolationOptions(long print_lev _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; } diff --git a/src/INTERP_KERNEL/InterpolationOptions.hxx b/src/INTERP_KERNEL/InterpolationOptions.hxx index 3446c4f9b..1701a99e8 100644 --- a/src/INTERP_KERNEL/InterpolationOptions.hxx +++ b/src/INTERP_KERNEL/InterpolationOptions.hxx @@ -34,7 +34,7 @@ namespace INTERP_KERNEL class INTERPKERNEL_EXPORT InterpolationOptions { - protected: + private: int _print_level ; IntersectionType _intersection_type; double _precision; @@ -50,7 +50,6 @@ namespace INTERP_KERNEL SplittingPolicy _splitting_policy ; bool _P1P0_bary_method; // issue 0020440 - bool _setInterpolationOptions; public: InterpolationOptions() { init(); } int getPrintLevel() const { return _print_level; } @@ -105,13 +104,9 @@ namespace INTERP_KERNEL _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, @@ -120,8 +115,12 @@ namespace INTERP_KERNEL 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; -- 2.39.2