Salome HOME
Revert "Synchronize adm files"
[plugins/hexoticplugin.git] / src / HexoticPlugin / HexoticPlugin_Hexotic.hxx
index dae3a5b1ebc1c9a9a1bc3e65c94d8ea9bbba5c30..3c05824054bcf3a7beb243997e10e22c787604b0 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -26,6 +26,7 @@
 #define _HexoticPlugin_Hexotic_HXX_
 
 #include "HexoticPlugin_Defs.hxx"
+#include "HexoticPlugin_Hypothesis.hxx"
 
 #include "SMESH_Algo.hxx"
 #include "SMESH_Mesh.hxx"
 
 #include <string>
 
+#include "DriverGMF_Read.hxx"
+#include "DriverGMF_Write.hxx"
+
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
+#include <SMESH_Gen_i.hxx>
+
 class SMESH_Mesh;
 class HexoticPlugin_Hypothesis;
 class TCollection_AsciiString;
+class gp_Pnt;
 
 class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hexotic: public SMESH_3D_Algo
 {
@@ -62,10 +71,8 @@ public:
 
   virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
     virtual void CancelCompute();
     bool computeCanceled() { return _compute_canceled;};
-#endif
 
   virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
                         MapShapeNbElems& aResMap);
@@ -76,7 +83,42 @@ protected:
 private:
 
   std::string getHexoticCommand(const TCollection_AsciiString& Hexotic_In,
-                                const TCollection_AsciiString& Hexotic_Out) const;
+                                const TCollection_AsciiString& Hexotic_Out,
+                                const TCollection_AsciiString& Hexotic_Sol) const;
+  
+  GEOM::GEOM_Object_var entryToGeomObj(std::string entry);
+  TopoDS_Shape     entryToShape(std::string entry);
+
+  std::vector<std::string> writeSizeMapFile(std::string fileName);
+  
+  // Functions to get sample point from shapes
+  void createControlPoints( const TopoDS_Shape& theShape, 
+                            const double& theSize, 
+                            std::vector< Control_Pnt >& thePoints );
+  void createPointsSampleFromEdge( const TopoDS_Shape& aShape, 
+                                   const double& theSize, 
+                                   std::vector<Control_Pnt>& thePoints );
+  void createPointsSampleFromFace( const TopoDS_Shape& aShape, 
+                                   const double& theSize, 
+                                   std::vector<Control_Pnt>& thePoints );
+  void createPointsSampleFromSolid( const TopoDS_Shape& aShape, 
+                                    const double& theSize, 
+                                    std::vector<Control_Pnt>& thePoints );
+  
+  // Some functions for surface sampling
+  void subdivideTriangle( const gp_Pnt& p1, 
+                          const gp_Pnt& p2, 
+                          const gp_Pnt& p3, 
+                          const double& theSize, 
+                          std::vector<Control_Pnt>& thePoints );
+  
+  std::vector<gp_Pnt> computePointsForSplitting( const gp_Pnt& p1, 
+                                                 const gp_Pnt& p2, 
+                                                 const gp_Pnt& p3 );
+  gp_Pnt tangencyPoint(const gp_Pnt& p1, 
+                       const gp_Pnt& p2, 
+                       const gp_Pnt& Center);
+  
 
   int  _iShape;
   int  _nbShape;
@@ -91,16 +133,21 @@ private:
   int  _hexoticNbProc;
   std::string  _hexoticWorkingDirectory;
   int _hexoticVerbosity;
+  int _hexoticMaxMemory;
   int _hexoticSdMode;
+  HexoticPlugin_Hypothesis::THexoticSizeMaps _sizeMaps;
   SMDS_MeshNode** _tabNode;
   
 #ifdef WITH_BLSURFPLUGIN
   const BLSURFPlugin_Hypothesis* _blsurfHypo;
 #endif
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
+
   volatile bool _compute_canceled;
-#endif
+  
+  SALOMEDS::Study_var myStudy;
+  SMESH_Gen_i*        smeshGen_i;
+
 };
 
 #endif