]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorageay <ageay>
Tue, 25 Aug 2009 14:59:46 +0000 (14:59 +0000)
committerageay <ageay>
Tue, 25 Aug 2009 14:59:46 +0000 (14:59 +0000)
src/INTERP_KERNEL/InterpolationOptions.cxx
src/INTERP_KERNEL/InterpolationOptions.hxx

index a23422564e2c832b87f1b0c03ae67b40360390c2..6bbb520b60850e318f36d6db21777876391a400d 100644 (file)
@@ -23,3 +23,137 @@ const double INTERP_KERNEL::InterpolationOptions::DFT_MEDIAN_PLANE=0.5;
 const double INTERP_KERNEL::InterpolationOptions::DFT_SURF3D_ADJ_EPS=1.e-4;
 
 const double INTERP_KERNEL::InterpolationOptions::DFT_MAX_DIST_3DSURF_INTERSECT=-1.;
+
+const char INTERP_KERNEL::InterpolationOptions::PRECISION_STR[]="Precision";
+
+const char INTERP_KERNEL::InterpolationOptions::MEDIANE_PLANE_STR[]="MedianPlane";
+
+const char INTERP_KERNEL::InterpolationOptions::BOUNDING_BOX_ADJ_STR[]="BoundingBoxAdjustment";
+
+const char INTERP_KERNEL::InterpolationOptions::BOUNDING_BOX_ADJ_ABS_STR[]="BoundingBoxAdjustmentAbs";
+
+const char INTERP_KERNEL::InterpolationOptions::MAX_DISTANCE_3DSURF_INSECT_STR[]="MaxDistance3DSurfIntersect";
+
+const char INTERP_KERNEL::InterpolationOptions::PRINT_LEV_STR[]="PrintLevel";
+
+const char INTERP_KERNEL::InterpolationOptions::DO_ROTATE_STR[]="DoRotate";
+
+const char INTERP_KERNEL::InterpolationOptions::ORIENTATION_STR[]="Orientation";
+
+const char INTERP_KERNEL::InterpolationOptions::INTERSEC_TYPE_STR[]="IntersectionType";
+
+const char INTERP_KERNEL::InterpolationOptions::SPLITTING_POLICY_STR[]="SplittingPolicy";
+
+const char INTERP_KERNEL::InterpolationOptions::TRIANGULATION_INTERSECT2D_STR[]="Triangulation";
+
+const char INTERP_KERNEL::InterpolationOptions::CONVEX_INTERSECT2D_STR[]="Convex";
+
+const char INTERP_KERNEL::InterpolationOptions::GEOMETRIC_INTERSECT2D_STR[]="Geometric2D";
+
+const char INTERP_KERNEL::InterpolationOptions::PLANAR_SPLIT_FACE_5_STR[]="PLANAR_FACE_5";
+
+const char INTERP_KERNEL::InterpolationOptions::PLANAR_SPLIT_FACE_6_STR[]="PLANAR_FACE_6";
+
+const char INTERP_KERNEL::InterpolationOptions::GENERAL_SPLIT_24_STR[]="GENERAL_24";
+
+const char INTERP_KERNEL::InterpolationOptions::GENERAL_SPLIT_48_STR[]="GENERAL_48";
+
+bool INTERP_KERNEL::InterpolationOptions::setOptionDouble(const std::string& key, double value)
+{
+  if(key==PRECISION_STR) 
+    {
+      setPrecision(value);
+      return true;
+    }
+  else if(key==MEDIANE_PLANE_STR) 
+    {
+      setMedianPlane(value);
+      return true;
+    }
+  else if(key==BOUNDING_BOX_ADJ_STR) 
+    {
+      setBoundingBoxAdjustment(value);
+      return true;
+    }
+  else if(key==BOUNDING_BOX_ADJ_ABS_STR) 
+    {
+      setBoundingBoxAdjustmentAbs(value);
+      return true;
+    }
+  else if(key==MAX_DISTANCE_3DSURF_INSECT_STR) 
+    {
+      setMaxDistance3DSurfIntersect(value);
+      return true;
+    }
+  else 
+    return false;
+}
+
+bool INTERP_KERNEL::InterpolationOptions::setOptionInt(const std::string& key, int value)
+{
+  if(key==PRINT_LEV_STR) 
+    {
+      setPrintLevel(value);
+      return true;
+    }
+    else if(key==DO_ROTATE_STR) 
+      {
+        setDoRotate(value);
+        return true;
+      }
+    else if(key==ORIENTATION_STR) 
+      {
+        setOrientation(value);
+        return true;
+      }
+    else
+      return false;
+}
+
+bool INTERP_KERNEL::InterpolationOptions::setOptionString(const std::string& key, std::string& value)
+{
+  if(key==INTERSEC_TYPE_STR) 
+    {
+      if(value==TRIANGULATION_INTERSECT2D_STR)
+        {
+          setIntersectionType(INTERP_KERNEL::Triangulation);
+          return true;
+        }
+      else if(value==CONVEX_INTERSECT2D_STR)
+        {
+          setIntersectionType(INTERP_KERNEL::Convex);
+          return true;
+        }
+      else if(value==GEOMETRIC_INTERSECT2D_STR)
+        {
+          setIntersectionType(INTERP_KERNEL::Geometric2D);
+          return true;
+        }
+    }
+  else if(key==SPLITTING_POLICY_STR) 
+    {
+      if(value==PLANAR_SPLIT_FACE_5_STR)
+        {
+          setSplittingPolicy(INTERP_KERNEL::PLANAR_FACE_5);
+          return true;
+        }
+      else if(value==PLANAR_SPLIT_FACE_6_STR)
+        {
+          setSplittingPolicy(INTERP_KERNEL::PLANAR_FACE_6);
+          return true;
+        }
+      else if(value==GENERAL_SPLIT_24_STR)
+        {
+          setSplittingPolicy(INTERP_KERNEL::GENERAL_24);
+          return true;
+        }
+      else if(value==GENERAL_SPLIT_48_STR)
+        {
+          setSplittingPolicy(INTERP_KERNEL::GENERAL_48);
+          return true;
+        }
+      else
+        return false;
+    }
+  return false;
+}
index 3aa5e1cbcd5b4c08a671e7731124f17c517f1907..bfc8435080857c365e206a9833b616807b6794f5 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "INTERPKERNELDefines.hxx"
 
+#include <string>
+
 namespace INTERP_KERNEL
 {
   typedef enum { Triangulation, Convex, Geometric2D } IntersectionType;
@@ -90,10 +92,31 @@ namespace INTERP_KERNEL
       _orientation=0;
       _splitting_policy=GENERAL_48;
     }
+    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;
     static const double DFT_MAX_DIST_3DSURF_INTERSECT;
+  public:
+    static const char PRECISION_STR[];
+    static const char MEDIANE_PLANE_STR[];
+    static const char BOUNDING_BOX_ADJ_STR[];
+    static const char BOUNDING_BOX_ADJ_ABS_STR[];
+    static const char MAX_DISTANCE_3DSURF_INSECT_STR[];
+    static const char PRINT_LEV_STR[];
+    static const char DO_ROTATE_STR[];
+    static const char ORIENTATION_STR[];
+    static const char INTERSEC_TYPE_STR[];
+    static const char SPLITTING_POLICY_STR[];
+    static const char TRIANGULATION_INTERSECT2D_STR[];
+    static const char CONVEX_INTERSECT2D_STR[];
+    static const char GEOMETRIC_INTERSECT2D_STR[];
+    static const char PLANAR_SPLIT_FACE_5_STR[];
+    static const char PLANAR_SPLIT_FACE_6_STR[];
+    static const char GENERAL_SPLIT_24_STR[];
+    static const char GENERAL_SPLIT_48_STR[];
   };
 
 }