From: ageay Date: Mon, 16 Jan 2012 16:03:52 +0000 (+0000) Subject: Addition of printOption method. X-Git-Tag: V6_main_FINAL~913 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a2ea44b4dc969aee75e6350a4ea5ea6d76ccdeab;p=tools%2Fmedcoupling.git Addition of printOption method. --- diff --git a/src/INTERP_KERNEL/InterpolationOptions.cxx b/src/INTERP_KERNEL/InterpolationOptions.cxx index f4b492320..61afd78fd 100644 --- a/src/INTERP_KERNEL/InterpolationOptions.cxx +++ b/src/INTERP_KERNEL/InterpolationOptions.cxx @@ -19,6 +19,8 @@ #include "InterpolationOptions.hxx" +#include + const double INTERP_KERNEL::InterpolationOptions::DFT_MEDIAN_PLANE=0.5; const double INTERP_KERNEL::InterpolationOptions::DFT_SURF3D_ADJ_EPS=1.e-4; @@ -63,6 +65,20 @@ const char INTERP_KERNEL::InterpolationOptions::GENERAL_SPLIT_24_STR[]="GENERAL_ const char INTERP_KERNEL::InterpolationOptions::GENERAL_SPLIT_48_STR[]="GENERAL_48"; +std::string INTERP_KERNEL::InterpolationOptions::getIntersectionTypeRepr() const +{ + if(_intersection_type==INTERP_KERNEL::Triangulation) + return std::string(TRIANGULATION_INTERSECT2D_STR); + else if(_intersection_type==INTERP_KERNEL::Convex) + return std::string(CONVEX_INTERSECT2D_STR); + else if(_intersection_type==INTERP_KERNEL::Geometric2D) + return std::string(GEOMETRIC_INTERSECT2D_STR); + else if(_intersection_type==INTERP_KERNEL::PointLocator) + return std::string(POINTLOCATOR_INTERSECT_STR); + else + return std::string("UNKNOWN_INTERSECT_TYPE"); +} + bool INTERP_KERNEL::InterpolationOptions::setOptionDouble(const std::string& key, double value) { if(key==PRECISION_STR) @@ -174,6 +190,20 @@ bool INTERP_KERNEL::InterpolationOptions::setOptionString(const std::string& key return false; } +std::string INTERP_KERNEL::InterpolationOptions::getSplittingPolicyRepr() const +{ + if(_splitting_policy==INTERP_KERNEL::PLANAR_FACE_5) + return std::string(PLANAR_SPLIT_FACE_5_STR); + else if(_splitting_policy==INTERP_KERNEL::PLANAR_FACE_6) + return std::string(PLANAR_SPLIT_FACE_6_STR); + else if(_splitting_policy==INTERP_KERNEL::GENERAL_24) + return std::string(GENERAL_SPLIT_24_STR); + else if(_splitting_policy==INTERP_KERNEL::GENERAL_48) + return std::string(GENERAL_SPLIT_48_STR); + else + return std::string("UNKNOWN_SPLITTING_POLICY"); +} + std::string INTERP_KERNEL::InterpolationOptions::filterInterpolationMethod(const std::string& meth) const { if ( _P1P0_bary_method && meth == "P1P0" ) @@ -207,3 +237,21 @@ bool INTERP_KERNEL::InterpolationOptions::setInterpolationOptions(long print_lev return(setOptionString(INTERSEC_TYPE_STR,intersection_type) && setOptionString(SPLITTING_POLICY_STR,splitting_policy)); } +std::string INTERP_KERNEL::InterpolationOptions::printOptions() const +{ + std::ostringstream oss; oss.precision(15); oss << "Interpolation Options ******" << std::endl; + oss << "Print level : " << _print_level << std::endl; + oss << "Intersection type : " << getIntersectionTypeRepr() << std::endl; + oss << "Precision : " << _precision << std::endl; + oss << "Median plane : " << _median_plane << std::endl; + oss << "Do Rotate status : " << std::boolalpha << _do_rotate << std::endl; + oss << "Bounding box adj : " << _bounding_box_adjustment << std::endl; + oss << "Bounding box adj abs : " << _bounding_box_adjustment_abs << std::endl; + oss << "Max distance for 3DSurf intersect : " << _max_distance_for_3Dsurf_intersect << std::endl; + oss << "Orientation : " << _orientation << std::endl; + oss << "Measure abs : " << _measure_abs << std::endl; + oss << "Splitting policy : " << getSplittingPolicyRepr() << std::endl; + oss << "P1P0 Barycentric method : " << _P1P0_bary_method << std::endl; + oss << "****************************" << std::endl; + return oss.str(); +} diff --git a/src/INTERP_KERNEL/InterpolationOptions.hxx b/src/INTERP_KERNEL/InterpolationOptions.hxx index 9cb706a41..4e1e01bcb 100644 --- a/src/INTERP_KERNEL/InterpolationOptions.hxx +++ b/src/INTERP_KERNEL/InterpolationOptions.hxx @@ -58,6 +58,7 @@ namespace INTERP_KERNEL IntersectionType getIntersectionType() const { return _intersection_type; } void setIntersectionType(IntersectionType it) { _intersection_type=it; } + std::string getIntersectionTypeRepr() const; double getPrecision() const { return _precision; } void setPrecision(double p) { _precision=p; } @@ -85,6 +86,7 @@ namespace INTERP_KERNEL SplittingPolicy getSplittingPolicy() const { return _splitting_policy; } void setSplittingPolicy(SplittingPolicy sp) { _splitting_policy=sp; } + std::string getSplittingPolicyRepr() const; void setP1P0BaryMethod(bool isP1P0) { _P1P0_bary_method=isP1P0; } bool getP1P0BaryMethod() const { return _P1P0_bary_method; } @@ -122,6 +124,7 @@ namespace INTERP_KERNEL bool setOptionDouble(const std::string& key, double value); bool setOptionInt(const std::string& key, int value); bool setOptionString(const std::string& key, const std::string& value); + std::string printOptions() const; private: static const double DFT_MEDIAN_PLANE; static const double DFT_SURF3D_ADJ_EPS;