#include "SALOME_Exception.idl"
#include "SMESH_Hypothesis.idl"
-#include "Document.idl"
/*!
* HEXABLOCKPlugin: interfaces to HEXABLOCK related hypotheses and algorithms
*/
/*!
* 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
$(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@
-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 = \
-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
@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 ;
../../idl/libSalomeIDLHEXABLOCKPLUGIN.la \
$(QT_LIBS) \
$(KERNEL_LDFLAGS) -lSALOMELocalTrace \
- $(HEXABLOCK_LDFLAGS) -lSalomeIDLHEXABLOCK \
$(MED_LDFLAGS) -lSalomeIDLMED \
$(SMESH_LDFLAGS) -lSMESH \
$(GUI_LDFLAGS) -lsuit -lqtx -lSalomeApp \
//=============================================================================
//
#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;
}
//=======================================================================
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);
}
//=======================================================================
int HEXABLOCKPlugin_Hypothesis::GetDimension() const
{
- return(_dimension);
+ return hyp_dimension;
}
//=======================================================================
void HEXABLOCKPlugin_Hypothesis::SetDimension(int dim)
{
- _dimension = dim;
+ hyp_dimension = dim;
}
//=======================================================================
std::ostream & HEXABLOCKPlugin_Hypothesis::SaveTo(std::ostream & save)
{
-//save << _document->getXML() << " ";
- save <<_dimension << " ";
+//save << hyp_document->getXML() << " ";
+ save << hyp_dimension << " ";
return save;
}
// 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());
/*!
* 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
*/
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;
};
#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>
//=======================================================================
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 )
{
* 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);
}
//================================================================================
#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"
/*!
* 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
// File : HEXABLOCKPlugin.cxx
// Author : Lioka RAZAFINDRAZAKA (CEA)
// Module : SMESH
-// $Header$
//
#include "SMESH_Hypothesis_i.hxx"