]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Addition of printOption method.
authorageay <ageay>
Mon, 16 Jan 2012 16:03:52 +0000 (16:03 +0000)
committerageay <ageay>
Mon, 16 Jan 2012 16:03:52 +0000 (16:03 +0000)
src/INTERP_KERNEL/InterpolationOptions.cxx
src/INTERP_KERNEL/InterpolationOptions.hxx

index f4b492320f577eaa15a79c526715c83cb1b70d1f..61afd78fd8cd66d0c0292e85c911cf0f94ee8a06 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "InterpolationOptions.hxx"
 
+#include <sstream>
+
 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();
+}
index 9cb706a415228d2031860a89f64e3115a248f74b..4e1e01bcb082b3fe3dc10f1320196a800610f138 100644 (file)
@@ -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;