From: abuhsing Date: Tue, 25 Jun 2013 11:31:47 +0000 (+0000) Subject: Passage du document par nom X-Git-Tag: V6_main_FINAL^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3a55da0b065915829e54bfe5e1749020ff9729ec;p=plugins%2Fhexablockplugin.git Passage du document par nom Modified Files: Tag: V6_main 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 ---------------------------------------------------------------------- --- diff --git a/idl/HEXABLOCKPlugin_Algorithm.idl b/idl/HEXABLOCKPlugin_Algorithm.idl index d37eb96..87a27ca 100755 --- a/idl/HEXABLOCKPlugin_Algorithm.idl +++ b/idl/HEXABLOCKPlugin_Algorithm.idl @@ -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 diff --git a/idl/Makefile.am b/idl/Makefile.am index 38666be..f50a842 100755 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -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 ; diff --git a/src/GUI/Makefile.am b/src/GUI/Makefile.am index 61c9a56..dfd1c18 100755 --- a/src/GUI/Makefile.am +++ b/src/GUI/Makefile.am @@ -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 \ diff --git a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.cxx b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.cxx index a913aeb..1ab52c5 100755 --- a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.cxx +++ b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.cxx @@ -24,18 +24,23 @@ //============================================================================= // #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()); diff --git a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.hxx b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.hxx index 8459459..63d514b 100755 --- a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.hxx +++ b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis.hxx @@ -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; }; diff --git a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.cxx b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.cxx index 205f62d..becebf1 100755 --- a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.cxx +++ b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.cxx @@ -25,9 +25,10 @@ #include #include -#include "HEXABLOCK.hxx" +// #include "HEXABLOCK.hxx" #include "HEXABLOCKPlugin_Hypothesis_i.hxx" -#include "HexDocument_impl.hxx" +// #include "HexDocument_impl.hxx" // Perime +#include "HexDocument.hxx" #include #include @@ -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(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); } //================================================================================ diff --git a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.hxx b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.hxx index f3d1010..0517dec 100755 --- a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.hxx +++ b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_Hypothesis_i.hxx @@ -29,7 +29,7 @@ #include #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 diff --git a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_i.cxx b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_i.cxx index a5edd1c..ee7ee7f 100755 --- a/src/HEXABLOCKPlugin/HEXABLOCKPlugin_i.cxx +++ b/src/HEXABLOCKPlugin/HEXABLOCKPlugin_i.cxx @@ -21,7 +21,6 @@ // File : HEXABLOCKPlugin.cxx // Author : Lioka RAZAFINDRAZAKA (CEA) // Module : SMESH -// $Header$ // #include "SMESH_Hypothesis_i.hxx"