Salome HOME
Mise a jour du plugin Hexa 6
authorabuhsing <abuhsing>
Tue, 25 Jun 2013 12:21:17 +0000 (12:21 +0000)
committerabuhsing <abuhsing>
Tue, 25 Jun 2013 12:21:17 +0000 (12:21 +0000)
idl/HEXABLOCKPlugin_Algorithm.idl
idl/Makefile.am
src/GUI/Makefile.am
src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.cxx
src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.hxx
src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.cxx
src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.hxx
src/HEXABLOCKPlugin/HEXABLOCKPlugin_i.cxx
src/HEXABLOCKPlugin/HEXABLOCKPlugin_mesh.cxx

index d37eb96b31e1e36040af71d796b8cb88f1ab5ea2..87a27cabb1767ff99e54b1a9f95ae5f4d57b9e57 100755 (executable)
@@ -27,7 +27,6 @@
 #include "SALOME_Exception.idl"
 #include "SMESH_Hypothesis.idl"
 
-#include "Document.idl"
 /*!
  * HEXABLOCKPlugin: interfaces to HEXABLOCK related hypotheses and algorithms
  */
@@ -49,8 +48,8 @@ module HEXABLOCKPlugin
     /*!
      * Define the document to be meshed, mandatory
      */
-    void SetDocument(in HEXABLOCK_ORB::Document doc);
-    HEXABLOCK_ORB::Document GetDocument();
+    void SetDocument(in string doc);
+    string GetDocument();
 
     /*!
      * To define the hight dimension to generated: 3 = hexas, 2 = quads, 1 = segments, 0 = nodes
index 38666bea4d9f9980a7b037ab55b3c2244b486fd4..f50a842fc7204fc636f7847a7f85374402d7de6b 100755 (executable)
@@ -49,14 +49,12 @@ libSalomeIDLHEXABLOCKPLUGIN_la_CPPFLAGS = \
        $(CORBA_INCLUDES) \
        $(KERNEL_CXXFLAGS) \
        $(GEOM_CXXFLAGS) \
-       $(HEXABLOCK_CXXFLAGS) \
        $(SMESH_CXXFLAGS)
 
 libSalomeIDLHEXABLOCKPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0
 libSalomeIDLHEXABLOCKPLUGIN_la_LIBADD  = \
        $(KERNEL_LDFLAGS) -lSalomeIDLKernel \
        $(GEOM_LDFLAGS) -lSalomeIDLGEOM \
-       $(HEXABLOCK_LDFLAGS) -lSalomeIDLHEXABLOCK \
        $(SMESH_LDFLAGS) -lSalomeIDLSMESH \
        @CORBA_LIBS@
 
@@ -68,7 +66,6 @@ OMNIORB_IDLPYFLAGS  = \
        -I$(top_builddir)/idl/salome \
        -I$(KERNEL_ROOT_DIR)/idl/salome \
        -I$(GEOM_ROOT_DIR)/idl/salome \
-       -I$(HEXABLOCK_ROOT_DIR)/idl/salome \
        -I$(SMESH_ROOT_DIR)/idl/salome
 
 IDLCXXFLAGS = \
@@ -77,13 +74,11 @@ IDLCXXFLAGS = \
        -I$(top_builddir)/idl/salome \
        -I$(KERNEL_ROOT_DIR)/idl/salome \
        -I$(GEOM_ROOT_DIR)/idl/salome \
-       -I$(HEXABLOCK_ROOT_DIR)/idl/salome \
        -I$(SMESH_ROOT_DIR)/idl/salome
 IDLPYFLAGS  = \
        @IDLPYFLAGS@ \
        -I$(KERNEL_ROOT_DIR)/idl/salome \
        -I$(GEOM_ROOT_DIR)/idl/salome \
-       -I$(HEXABLOCK_ROOT_DIR)/idl/salome \
        -I$(SMESH_ROOT_DIR)/idl/salome
 
 # potential problem on parallel make on the following - multiple outputs
@@ -121,7 +116,7 @@ mostlyclean-local:
        @for dep in $^ dummy; do \
          if [ $$dep != "dummy" ]; then \
            echo Building dependencies for $$dep; \
-           $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(HEXABLOCK_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \
+           $(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome $$dep 2>/dev/null | \
            sed 's/\.o/\SK.cc/' >>$@; \
          fi; \
        done ;
index 61c9a56e9f451abc7871edbf5005b4f5aac17262..dfd1c18896ccbb42d3f8c350d45d14e23fec94c0 100755 (executable)
@@ -55,7 +55,6 @@ libHEXABLOCKPluginGUI_la_LDFLAGS  = \
        ../../idl/libSalomeIDLHEXABLOCKPLUGIN.la \
        $(QT_LIBS) \
        $(KERNEL_LDFLAGS) -lSALOMELocalTrace \
-       $(HEXABLOCK_LDFLAGS) -lSalomeIDLHEXABLOCK \
        $(MED_LDFLAGS) -lSalomeIDLMED \
        $(SMESH_LDFLAGS) -lSMESH \
        $(GUI_LDFLAGS) -lsuit -lqtx -lSalomeApp \
index a913aeb198329a53ea79cd20b6a07ba23ec20662..1ab52c5ef008ae0c10f8d7e0d7fcdbf3c635ebfe 100755 (executable)
 //=============================================================================
 //
 #include "HEXABLOCKPlugin_Hypothesis.hxx"
+#include "Hex.hxx"
 
 //=======================================================================
 //function : HEXABLOCKPlugin_Hypothesis
 //=======================================================================
 
 HEXABLOCKPlugin_Hypothesis::HEXABLOCKPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen)
-  : SMESH_Hypothesis(hypId, studyId, gen),
-  _document(NULL),
-  _dimension(3)
+  : SMESH_Hypothesis(hypId, studyId, gen)
 {
-  _name = "HEXABLOCK_Parameters";
-  _param_algo_dim = 3;
+   hexa_root     = HEXA_NS::Hex::getInstance ();
+   hyp_document  = NULL;
+   hyp_dimension = 3;
+
+   // PutData (hexa_root->countDocument ());
+
+   _name = "HEXABLOCK_Parameters";
+   _param_algo_dim = 3;
 }
 
 //=======================================================================
@@ -44,16 +49,25 @@ HEXABLOCKPlugin_Hypothesis::HEXABLOCKPlugin_Hypothesis(int hypId, int studyId, S
 
 HEXA_NS::Document* HEXABLOCKPlugin_Hypothesis::GetDocument() const
 {
-  return(_document);
+  return hyp_document;
 }
 
 //=======================================================================
-//function : SetDocument
+//function : SetXmlFlow
 //=======================================================================
+void HEXABLOCKPlugin_Hypothesis::SetXmlFlow (cpchar xml)
+{
+   if (hyp_document ==NULL)
+       hyp_document  = hexa_root->addDocument ("tobe_meshed");
+   hyp_document->setXml (xml); 
+}
 
-void HEXABLOCKPlugin_Hypothesis::SetDocument(HEXA_NS::Document* doc)
+//=======================================================================
+//function : SetDocument
+//=======================================================================
+void HEXABLOCKPlugin_Hypothesis::SetDocument (cpchar name)
 {
-  _document = doc;
+   hyp_document = hexa_root->findDocument (name);
 }
 
 //=======================================================================
@@ -62,7 +76,7 @@ void HEXABLOCKPlugin_Hypothesis::SetDocument(HEXA_NS::Document* doc)
 
 int HEXABLOCKPlugin_Hypothesis::GetDimension() const
 {
-  return(_dimension);
+   return hyp_dimension;
 }
 
 //=======================================================================
@@ -71,7 +85,7 @@ int HEXABLOCKPlugin_Hypothesis::GetDimension() const
 
 void HEXABLOCKPlugin_Hypothesis::SetDimension(int dim)
 {
-  _dimension = dim;
+   hyp_dimension = dim;
 }
 
 //=======================================================================
@@ -80,8 +94,8 @@ void HEXABLOCKPlugin_Hypothesis::SetDimension(int dim)
 
 std::ostream & HEXABLOCKPlugin_Hypothesis::SaveTo(std::ostream & save)
 {
-//save << _document->getXML() << " ";
-  save <<_dimension           << " ";
+//save << hyp_document->getXML() << " ";
+  save << hyp_dimension           << " ";
 
   return save;
 }
@@ -98,13 +112,13 @@ std::istream & HEXABLOCKPlugin_Hypothesis::LoadFrom(std::istream & load)
 //     char* str;
 //     isOK = (load >> str);
 //     if (isOK)
-//         _document = xml_2_doc(str);
+//         hyp_document = xml_2_doc(str);
 //     else
 //         load.clear(ios::badbit | load.rdstate());
     
     isOK = (load >> i);
     if (isOK)
-        _dimension = i;
+        hyp_dimension = i;
     else
         load.clear(ios::badbit | load.rdstate());
     
index 84594590cb8f853cc17741262a7266333cd1c14d..63d514b4900b290411e6084f7e058190e06bb58c 100755 (executable)
@@ -45,9 +45,13 @@ public:
   /*!
    * Define the document to be meshed, mandatory
    */
-  void SetDocument(HEXA_NS::Document* doc);
   HEXA_NS::Document* GetDocument() const;
 
+  // void SetDocument(HEXA_NS::Document* doc); .. replaced by :
+  void  SetDocument (cpchar name);
+  void  SetXmlFlow  (cpchar xml);
+  char* GetXmlFlow  () const;
+
   /*!
    * To define the hight dimension to generated: 3 = hexas, 2 = quads, 1 = segments, 0 = nodes
    */
@@ -71,8 +75,9 @@ public:
   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
 
 private:
-  HEXA_NS::Document* _document;
-  int _dimension;
+  HEXA_NS::Hex*      hexa_root;
+  HEXA_NS::Document* hyp_document;
+  int                hyp_dimension;
 };
 
 
index 205f62d487add49b3595e004ae0b8faa90ccc727..becebf1162b57362de79a99891f374dfdf7e167e 100755 (executable)
 #include <SMESH_PythonDump.hxx>
 #include <SMESH_Mesh_i.hxx>
 
-#include "HEXABLOCK.hxx"
+// #include "HEXABLOCK.hxx"
 #include "HEXABLOCKPlugin_Hypothesis_i.hxx"
-#include "HexDocument_impl.hxx"
+// #include "HexDocument_impl.hxx"    // Perime
+#include "HexDocument.hxx"
 
 #include <Utils_CorbaException.hxx>
 #include <utilities.h>
@@ -43,8 +44,8 @@ static int MYDEBUG = 0;
 //=======================================================================
 
 HEXABLOCKPlugin_Hypothesis_i::HEXABLOCKPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
-                                                    int                     theStudyId,
-                                                    ::SMESH_Gen*            theGenImpl)
+                                  int             theStudyId,
+                                  ::SMESH_Gen*    theGenImpl)
   : SALOME::GenericObj_i( thePOA ), 
     SMESH_Hypothesis_i( thePOA )
 {
@@ -91,22 +92,20 @@ CORBA::Boolean HEXABLOCKPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension ty
  * Define the document to be meshed, mandatory
  */
 //================================================================================
-
-HEXABLOCK_ORB::Document_ptr HEXABLOCKPlugin_Hypothesis_i::GetDocument() {
-  ASSERT(myBaseImpl);
-  HEXA_NS::Document* d = this->GetImpl()->GetDocument();
-  Document_impl* servantCorba = new Document_impl(_poa, d);
-  HEXABLOCK_ORB::Document_ptr result = servantCorba->_this();
-  return result;
+// ================================================================= GetDocument
+char* HEXABLOCKPlugin_Hypothesis_i::GetDocument ()
+{
+  ASSERT (myBaseImpl);
+  cpchar xml = this->GetImpl()->GetXmlFlow ();
+  return CORBA::string_dup (xml);
 }
 
-void HEXABLOCKPlugin_Hypothesis_i::SetDocument(HEXABLOCK_ORB::Document_ptr doc) {
-  Document_impl* docServant = ::DownCast<Document_impl*>(doc);
-  if ( docServant ) {
-    HEXA_NS::Document* d = docServant->GetImpl();
-    ASSERT(myBaseImpl);
-    this->GetImpl()->SetDocument(d);
-  }
+// ================================================================= SetDocument
+void HEXABLOCKPlugin_Hypothesis_i::SetDocument (const char* name)
+{
+    ASSERT (myBaseImpl);
+    // this->GetImpl()->SetXmlFlow (xml);
+    this->GetImpl()->SetDocument (name);
 }
 
 //================================================================================
index f3d10108a72f5bb97e978b1f6e96f8eb549002fe..0517decbf186f67f571aafcaa84f1d38bcbacd72 100755 (executable)
@@ -29,7 +29,7 @@
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(HEXABLOCKPlugin_Algorithm)
-#include CORBA_CLIENT_HEADER(Document)
+//   #include CORBA_CLIENT_HEADER(Document)
 
 #include "SMESH_Hypothesis_i.hxx"
 #include "HEXABLOCKPlugin_Hypothesis.hxx"
@@ -53,8 +53,8 @@ class HEXABLOCKPLUGIN_EXPORT HEXABLOCKPlugin_Hypothesis_i:
     /*!
      * Define the document to be meshed, mandatory
      */
-    HEXABLOCK_ORB::Document_ptr GetDocument();
-    void SetDocument(HEXABLOCK_ORB::Document_ptr doc);
+    char* GetDocument ();
+    void  SetDocument (const char* doc);
 
     /*!
      * To define the hight dimension to generated: 3 = hexas, 2 = quads, 1 = segments, 0 = nodes
index a5edd1c9efb60423c809c08ab528ccaf6b219023..ee7ee7faea2fd4b7cb5ca7a76e31d021bd10f021 100755 (executable)
@@ -21,7 +21,6 @@
 //  File   : HEXABLOCKPlugin.cxx
 //  Author : Lioka RAZAFINDRAZAKA (CEA)
 //  Module : SMESH
-//  $Header$
 //
 #include "SMESH_Hypothesis_i.hxx"
 
index fe303f0596895367ac0efae8817acd18b2182c7d..ccf971f7f06f2cb28809f8aa09f62e265319bd7f 100755 (executable)
@@ -97,7 +97,7 @@ static int  MYDEBUG = 0;
 
 
 static double HEXA_EPS      = 1.0e-3; //1E-3;
-static double HEXA_QUAD_WAY = PI/4.; //3.*PI/8.;
+static double HEXA_QUAD_WAY = M_PI/4.; //3.*PI/8.;
 
 // ============================================================ string2shape
 TopoDS_Shape string2shape( const string& brep )