diff --git a/configure.ac b/configure.ac
index 1605a48f0..13db63495 100644
--- a/configure.ac
+++ b/configure.ac
@@ -359,6 +359,14 @@ echo
CHECK_KERNEL
+echo
+echo ---------------------------------------------
+echo Testing cppunit
+echo ---------------------------------------------
+echo
+
+CHECK_CPPUNIT
+
echo
echo ---------------------------------------------
echo Summary
@@ -373,7 +381,7 @@ fi
echo
obligatory_vars="cc_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok boost_ok libxml_ok occ_ok doxygen_ok graphviz_ok sphinx_ok Kernel_ok"
-optional_vars="opencv_ok"
+optional_vars="opencv_ok cppunit_ok"
gui_vars="OpenGL_ok qt_ok gui_ok"
###
@@ -496,6 +504,7 @@ AC_OUTPUT([ \
src/Makefile \
src/AdvancedGUI/Makefile \
src/XAO/Makefile \
+ src/XAO/tests/Makefile \
src/ImportExportGUI/Makefile \
src/ARCHIMEDE/Makefile \
src/BREPExport/Makefile \
diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts
index e741c1392..658891901 100644
--- a/src/GEOMGUI/GEOM_msg_en.ts
+++ b/src/GEOMGUI/GEOM_msg_en.ts
@@ -5762,21 +5762,25 @@ Do you want to create new material?
@default
+
+ MEN_IMPORTEXPORT
+ Import / Export
+
TOP_EXPORTXAO
- ExportXAO
+ Export to XAO
MEN_EXPORTXAO
- ExportXAO
+ Export XAO
STB_EXPORTXAO
- ExportXAO
+ Export shape to XAO format
GEOM_IMPORTEXPORT_204
- ExportXAO
+ Export XAO
diff --git a/src/GEOMImpl/GEOMImpl_IImportExportOperations.cxx b/src/GEOMImpl/GEOMImpl_IImportExportOperations.cxx
index ceba312da..36bf1f3b7 100644
--- a/src/GEOMImpl/GEOMImpl_IImportExportOperations.cxx
+++ b/src/GEOMImpl/GEOMImpl_IImportExportOperations.cxx
@@ -19,6 +19,10 @@
// File : GEOMImpl_IImportExportOperations.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+#include
+#include
+#include
+
#include
#include "GEOMImpl_Types.hxx"
@@ -46,6 +50,7 @@
#include "Xao.hxx"
#include "Geometry.hxx"
#include "Group.hxx"
+#include "XaoUtils.hxx"
#include
#include
@@ -68,7 +73,9 @@
#include
#include
#include
-#include
+#include
+#include
+
#include
#include
@@ -76,26 +83,25 @@
#include
#include
#include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-
//=============================================================================
/*!
* Constructor
*/
//=============================================================================
-GEOMImpl_IImportExportOperations::GEOMImpl_IImportExportOperations(GEOM_Engine* theEngine, int theDocID) :
- GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IImportExportOperations::GEOMImpl_IImportExportOperations(GEOM_Engine* engine, int docID) :
+ GEOM_IOperations(engine, docID)
{
- MESSAGE("GEOMImpl_IImportExportOperations::GEOMImpl_IImportExportOperations");
- /*myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID());
- myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine(), GetDocID());
- myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
- myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine(), GetDocID());
- myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID());
- my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID());
- myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID());
- myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine(), GetDocID());*/
- myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
- myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
+ MESSAGE("GEOMImpl_IImportExportOperations::GEOMImpl_IImportExportOperations");
+ /*myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID());
+ myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine(), GetDocID());
+ myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
+ myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine(), GetDocID());
+ myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID());
+ my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID());
+ myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID());
+ myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine(), GetDocID());*/
+ m_shapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
+ m_groupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
}
//=============================================================================
@@ -105,160 +111,224 @@ GEOMImpl_IImportExportOperations::GEOMImpl_IImportExportOperations(GEOM_Engine*
//=============================================================================
GEOMImpl_IImportExportOperations::~GEOMImpl_IImportExportOperations()
{
- MESSAGE("GEOMImpl_IImportExportOperations::~GEOMImpl_IImportExportOperations");
- /*delete myBasicOperations;
- delete myBooleanOperations;
- delete myShapesOperations;
- delete myTransformOperations;
- delete myBlocksOperations;
- delete my3DPrimOperations;
- delete myLocalOperations;
- delete myHealingOperations;*/
- delete myShapesOperations;
- delete myGroupOperations;
+ MESSAGE("GEOMImpl_IImportExportOperations::~GEOMImpl_IImportExportOperations");
+ /*delete myBasicOperations;
+ delete myBooleanOperations;
+ delete myShapesOperations;
+ delete myTransformOperations;
+ delete myBlocksOperations;
+ delete my3DPrimOperations;
+ delete myLocalOperations;
+ delete myHealingOperations;*/
+ delete m_shapesOperations;
+ delete m_groupOperations;
}
//=============================================================================
/*!
* Export a shape to XAO Format
- * \param theExportingShape Shape to export
- * \param theFileName The name of the exported file
- * \param thelGroups List of groups to export
- * \param thelFields List of fields to export
+ * \param shape The shape to export
+ * \param fileName The name of the exported file
+ * \param groupList The list of groups to export
+ * \param fieldList The list of fields to export
* \return New GEOM_Object, containing the created shape.
*/
//=============================================================================
-bool GEOMImpl_IImportExportOperations::ExportXAO (Handle(GEOM_Object) theExportingShape, const std::string theFileName, std::list thelGroups, std::list thelFields)
+bool GEOMImpl_IImportExportOperations::ExportXAO(Handle(GEOM_Object) shape,
+ const std::string fileName,
+ std::list groupList,
+ std::list fieldList)
{
- SetErrorCode(KO);
- bool isGood = false;
-
- //
+ std::cout << ">> ExportXAO" << std::endl;
+ SetErrorCode(KO);
+ bool isGood = false;
- //Add a new shape function with parameters
- Handle(GEOM_Function) aRefFunction = theExportingShape->GetLastFunction();
- if (aRefFunction.IsNull()) return false;
+ //
- //Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
-
- //Add an Export function
- Handle(GEOM_Function) aFunction = result->AddFunction(GEOMImpl_ExportXAODriver::GetID(), EXPORTXAO_EXPORTINGSHAPE_FILENAME_LGROUPS_LFIELDS);
- if (aFunction.IsNull()) return false;
-
- //Check if the function is set correctly
- if (aFunction->GetDriverGUID() != GEOMImpl_ExportXAODriver::GetID()) return false;
+ // add a new shape function with parameters
+ Handle(GEOM_Function) lastFunction = shape->GetLastFunction();
+ if (lastFunction.IsNull())
+ return false;
- /*GEOMImpl_IExportXAO aData (aRefFunction);
+ // add a new result object
+ Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
- TCollection_AsciiString FileName = theFileName.c_str();
- aData.SetExportingShape(aRefFunction);
- aData.SetFileName(FileName);
- aData.SetlGroups(thelGroups);
- aData.SetlFields(thelFields);
+ // add an Export function
+ Handle(GEOM_Function) exportFunction = result->AddFunction(GEOMImpl_ExportXAODriver::GetID(),
+ EXPORTXAO_EXPORTINGSHAPE_FILENAME_LGROUPS_LFIELDS);
+ if (exportFunction.IsNull())
+ return false;
- //Compute the resulting value
- try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
- OCC_CATCH_SIGNALS;
-#endif
- if (!GetSolver()->ComputeFunction(aFunction)) {
- SetErrorCode("ExportXAO driver failed : Not enough space on disk, or you haven't permissions to write this directory");
- return false;
- }
- }
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
- return false;
- }*/
- TCollection_AsciiString FileName = theFileName.c_str();
- XAO::Xao *myXao = new XAO::Xao();
- XAO::Geometry *myGeometry = new XAO::Geometry();
- myGeometry->setShape(theExportingShape->GetValue());
- myGeometry->setName(theExportingShape->GetName());
- Handle(TColStd_HSequenceOfTransient) subObjects = myShapesOperations->GetExistingSubObjects(theExportingShape, false);
- int nbSubObjects = subObjects->Length();
- for (int i = 1 ; i <= nbSubObjects ; i++) {
- Handle(Standard_Transient) anTransientSubObject = subObjects->Value(i);
- if (anTransientSubObject.IsNull())
- continue;
- Handle(GEOM_Object) asubObject = Handle(GEOM_Object)::DownCast(anTransientSubObject);
- if (asubObject->GetType() != GEOM_GROUP)
+ // check if the function is set correctly
+ if (exportFunction->GetDriverGUID() != GEOMImpl_ExportXAODriver::GetID())
+ return false;
+
+ /*GEOMImpl_IExportXAO aData (aRefFunction);
+
+ TCollection_AsciiString FileName = theFileName.c_str();
+ aData.SetExportingShape(aRefFunction);
+ aData.SetFileName(FileName);
+ aData.SetlGroups(thelGroups);
+ aData.SetlFields(thelFields);
+
+ //Compute the resulting value
+ try {
+ #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+ #endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("ExportXAO driver failed : Not enough space on disk, or you haven't permissions to write this directory");
+ return false;
+ }
+ }
+ catch (Standard_Failure) {
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
+ return false;
+ }*/
+ XAO::Xao* xaoObject = new XAO::Xao();
+
+ XAO::Geometry* geometry = new XAO::Geometry();
+ TopoDS_Shape topoShape = shape->GetValue();
+ std::ostringstream dumpStream;
+ BRepTools::Dump(topoShape, dumpStream);
+ geometry->setShape(dumpStream.str().c_str());
+ geometry->setName(shape->GetName());
+
+ Handle(TColStd_HSequenceOfTransient) subObjects = m_shapesOperations->GetExistingSubObjects(shape, false);
+ int nbSubObjects = subObjects->Length();
+ std::cout << "nb sub obj = " << nbSubObjects << std::endl;
+ int nbVertices = 0, nbEdges = 0, nbFaces = 0, nbSolids = 0, nbGroups = 0;
+ for (int i = 1; i <= nbSubObjects; i++)
{
- int index = myShapesOperations->GetSubShapeIndex(theExportingShape,asubObject);
- switch (asubObject->GetValue().ShapeType() )
- {
- case TopAbs_SOLID:
- break;
- case TopAbs_FACE:
- break;
- case TopAbs_EDGE:
- break;
- case TopAbs_VERTEX:
- myGeometry->setVertexName(index,asubObject->GetName());
- break;
- }
- }
- }
- myXao->setGeometry(myGeometry);
-
- // Adding groups
- std::list::iterator itG1 = thelGroups.begin();
- while (itG1 != thelGroups.end()) {
- Handle(GEOM_Object) itGroup = (*itG1++);
- XAO::Group *Group = new XAO::Group();
- Group->setName(itGroup->GetName());
- Handle(TColStd_HArray1OfInteger) groupIds = myGroupOperations->GetObjects(itGroup);
- TopAbs_ShapeEnum shapeGroup = myGroupOperations->GetType(itGroup);
- if (shapeGroup == TopAbs_VERTEX)
- {
- Group->setType(0);
- for (int i = 1; i <= groupIds->Length(); i++)
- {
- int index = myGeometry->findVertex(groupIds->Value(i));
- Group->addValue(index);
- }
+ Handle(Standard_Transient) transientSubObject = subObjects->Value(i);
+ if (transientSubObject.IsNull())
+ continue;
+
+ Handle(GEOM_Object) subObject = Handle(GEOM_Object)::DownCast(transientSubObject);
+ if (subObject->GetType() == GEOM_GROUP)
+ {
+ nbGroups++;
+ }
+ else
+ {
+ switch (subObject->GetValue().ShapeType())
+ {
+ case TopAbs_VERTEX: nbVertices++; break;
+ case TopAbs_EDGE: nbEdges++; break;
+ case TopAbs_FACE: nbFaces++; break;
+ case TopAbs_SOLID: nbSolids++; break;
+ }
+ }
}
- myXao->addGroup(Group);
- /*{
- case TopAbs_SOLID:
- Group->setType(3);
- break;
- case TopAbs_FACE:
- Group->setType(2);
- break;
- case TopAbs_EDGE:
- Group->setType(1);
- break;
- case TopAbs_VERTEX:
- Group->setType(0);
- break;
- } */
-
- }
-
+ std::cout << "Nb = " << nbVertices << ", " << nbEdges << ", " << nbFaces << ", " << nbSolids << ", " << nbGroups << std::endl;
+ if (nbVertices > 0) geometry->setCountVertices(nbVertices);
+ if (nbEdges > 0) geometry->setCountEdges(nbEdges);
+ if (nbFaces > 0) geometry->setCountFaces(nbFaces);
+ if (nbSolids > 0) geometry->setCountSolids(nbSolids);
- //Make a Python command
- GEOM::TPythonDump pd (aFunction);
- std::list::iterator itG = thelGroups.begin();
- std::list::iterator itF = thelFields.begin();
- pd << /*isGood <<*/ " = geompy.ExportXAO(" << theExportingShape << ", " << FileName.ToCString() << ", [";
+ int vInd = 0, eInd = 0, fInd = 0, sInd = 0;
+ for (int i = 1; i <= nbSubObjects; i++)
+ {
+ Handle(Standard_Transient) transientSubObject = subObjects->Value(i);
+ if (transientSubObject.IsNull())
+ continue;
- pd << (*itG++);
- while (itG != thelGroups.end()) {
- pd << ", " << (*itG++);
- }
- pd << "], [";
- pd << (*itF++);
- while (itF != thelFields.end()) {
- pd << ", " << (*itF++);
- }
- pd << "])";
+ Handle(GEOM_Object) subObject = Handle(GEOM_Object)::DownCast(transientSubObject);
+ std::cout << " sub[" << i << "] N=" << subObject->GetName()
+ //<< " E=" << subObject->GetEntry()
+ //<< " D=" << subObject->GetDocID()
+ << " T=" << subObject->GetType() << std::endl;
+ if (subObject->GetType() != GEOM_GROUP)
+ {
+ int index = m_shapesOperations->GetSubShapeIndex(shape, subObject);
+ const char* strIndex = XAO::XaoUtils::intToString(index);
+ std::cout << " index= " << index << std::endl;
+ switch (subObject->GetValue().ShapeType())
+ {
+ case TopAbs_VERTEX:
+ geometry->setVertex(vInd++, subObject->GetName(), strIndex);
+ break;
+ case TopAbs_EDGE:
+ geometry->setEdge(eInd++, subObject->GetName(), strIndex);
+ break;
+ case TopAbs_FACE:
+ geometry->setFace(fInd++, subObject->GetName(), strIndex);
+ break;
+ case TopAbs_SOLID:
+ geometry->setSolid(sInd++, subObject->GetName(), strIndex);
+ break;
+ }
+ }
+ }
+ xaoObject->setGeometry(geometry);
- SetErrorCode(OK);
+ xaoObject->exportToFile(fileName.c_str());
- return isGood;
+ /*
+ // adding groups
+ std::list::iterator itG1 = groupList.begin();
+ int gInd = 0;
+ while (itG1 != groupList.end())
+ {
+ std::cout << "Group = " << gInd++ << std::endl;
+ Handle(GEOM_Object) itGroup = (*itG1++);
+ XAO::Group* group = new XAO::Group();
+ group->setName(itGroup->GetName());
+ Handle(TColStd_HArray1OfInteger) groupIds = m_groupOperations->GetObjects(itGroup);
+ TopAbs_ShapeEnum shapeGroup = m_groupOperations->GetType(itGroup);
+ std::cout << "GroupShape = " << shapeGroup << std::endl;
+ if (shapeGroup == TopAbs_VERTEX)
+ {
+ group->setDimension(0);
+ for (int i = 1; i <= groupIds->Length(); i++)
+ {
+ const char* index = geometry->getVertexReference(groupIds->Value(i));
+ group->addElement(index);
+ }
+ }
+ xaoObject->addGroup(group);
+ /*{
+ case TopAbs_SOLID:
+ Group->setType(3);
+ break;
+ case TopAbs_FACE:
+ Group->setType(2);
+ break;
+ case TopAbs_EDGE:
+ Group->setType(1);
+ break;
+ case TopAbs_VERTEX:
+ Group->setType(0);
+ break;
+ } *
+
+ }*/
+
+ /*
+ // make a Python command
+ TCollection_AsciiString fileNameStr = fileName.c_str();
+ GEOM::TPythonDump pd(exportFunction);
+ std::list::iterator itG = groupList.begin();
+ std::list::iterator itF = fieldList.begin();
+ //pd << /*isGood <<**" = geompy.ExportXAO(" << shape << ", " << fileNameStr.ToCString() << ", [";
+
+ pd << (*itG++);
+ while (itG != groupList.end())
+ {
+ pd << ", " << (*itG++);
+ }
+ pd << "], [";
+ pd << (*itF++);
+ while (itF != fieldList.end())
+ {
+ pd << ", " << (*itF++);
+ }
+ pd << "])";*/
+
+ SetErrorCode(OK);
+
+ return isGood;
}
/*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
diff --git a/src/GEOMImpl/GEOMImpl_IImportExportOperations.hxx b/src/GEOMImpl/GEOMImpl_IImportExportOperations.hxx
index e4b1ffc0a..6167f3571 100644
--- a/src/GEOMImpl/GEOMImpl_IImportExportOperations.hxx
+++ b/src/GEOMImpl/GEOMImpl_IImportExportOperations.hxx
@@ -30,35 +30,39 @@
#include
/*class GEOMImpl_IBasicOperations;
-class GEOMImpl_IBooleanOperations;
-class GEOMImpl_IShapesOperations;
-class GEOMImpl_ITransformOperations;
-class GEOMImpl_IBlocksOperations;
-class GEOMImpl_I3DPrimOperations;
-class GEOMImpl_ILocalOperations;
-class GEOMImpl_IHealingOperations;*/
+ class GEOMImpl_IBooleanOperations;
+ class GEOMImpl_IShapesOperations;
+ class GEOMImpl_ITransformOperations;
+ class GEOMImpl_IBlocksOperations;
+ class GEOMImpl_I3DPrimOperations;
+ class GEOMImpl_ILocalOperations;
+ class GEOMImpl_IHealingOperations;*/
class GEOMImpl_IShapesOperations;
class GEOMImpl_IGroupOperations;
-class GEOMImpl_IImportExportOperations: public GEOM_IOperations {
+class GEOMImpl_IImportExportOperations: public GEOM_IOperations
+{
private:
- /*GEOMImpl_IBasicOperations* myBasicOperations;
- GEOMImpl_IBooleanOperations* myBooleanOperations;
- GEOMImpl_IShapesOperations* myShapesOperations;
- GEOMImpl_ITransformOperations* myTransformOperations;
- GEOMImpl_IBlocksOperations* myBlocksOperations;
- GEOMImpl_I3DPrimOperations* my3DPrimOperations;
- GEOMImpl_ILocalOperations* myLocalOperations;
- GEOMImpl_IHealingOperations* myHealingOperations;*/
- GEOMImpl_IShapesOperations* myShapesOperations;
- GEOMImpl_IGroupOperations* myGroupOperations;
-
+ /*GEOMImpl_IBasicOperations* myBasicOperations;
+ GEOMImpl_IBooleanOperations* myBooleanOperations;
+ GEOMImpl_IShapesOperations* myShapesOperations;
+ GEOMImpl_ITransformOperations* myTransformOperations;
+ GEOMImpl_IBlocksOperations* myBlocksOperations;
+ GEOMImpl_I3DPrimOperations* my3DPrimOperations;
+ GEOMImpl_ILocalOperations* myLocalOperations;
+ GEOMImpl_IHealingOperations* myHealingOperations;*/
+ GEOMImpl_IShapesOperations* m_shapesOperations;
+ GEOMImpl_IGroupOperations* m_groupOperations;
+
public:
- Standard_EXPORT GEOMImpl_IImportExportOperations(GEOM_Engine* theEngine, int theDocID);
- Standard_EXPORT ~GEOMImpl_IImportExportOperations();
-
- Standard_EXPORT bool ExportXAO (Handle(GEOM_Object) theExportingShape, const std::string theFileName, std::list thelGroups, std::list thelFields);
- /*@@ insert new functions before this line @@ do not remove this line @@*/
+ Standard_EXPORT GEOMImpl_IImportExportOperations(GEOM_Engine* engine, int docID);
+ Standard_EXPORT ~GEOMImpl_IImportExportOperations();
+
+ Standard_EXPORT bool ExportXAO (Handle(GEOM_Object) shape,
+ const std::string fileName,
+ std::list groupList,
+ std::list fieldList);
+ /*@@ insert new functions before this line @@ do not remove this line @@*/
};
#endif
diff --git a/src/GEOMImpl/Makefile.am b/src/GEOMImpl/Makefile.am
index 4d0821d97..599b0bf07 100644
--- a/src/GEOMImpl/Makefile.am
+++ b/src/GEOMImpl/Makefile.am
@@ -237,11 +237,12 @@ dist_libGEOMimpl_la_SOURCES += $(IMPORTEXPORT_SOURCES)
libGEOMimpl_la_CPPFLAGS = \
$(CORBA_CXXFLAGS) \
- $(CORBA_INCLUDES) \
+ $(CORBA_INCLUDES) \
$(CAS_CPPFLAGS) \
$(KERNEL_CXXFLAGS) \
$(BOOST_CPPFLAGS) \
- $(PYTHON_INCLUDES) \
+ $(PYTHON_INCLUDES) \
+ $(LIBXML_INCLUDES) \
-I$(srcdir)/../ShHealOper \
-I$(srcdir)/../NMTDS \
-I$(srcdir)/../NMTTools \
diff --git a/src/ImportExportGUI/ImportExportGUI.cxx b/src/ImportExportGUI/ImportExportGUI.cxx
index 7b9f7adb2..05eba148b 100644
--- a/src/ImportExportGUI/ImportExportGUI.cxx
+++ b/src/ImportExportGUI/ImportExportGUI.cxx
@@ -41,7 +41,8 @@
// function : ImportExportGUI()
// purpose : Constructor
//=======================================================================
-ImportExportGUI::ImportExportGUI( GeometryGUI* parent ) : GEOMGUI( parent )
+ImportExportGUI::ImportExportGUI(GeometryGUI* parent) :
+ GEOMGUI(parent)
{
}
@@ -57,30 +58,30 @@ ImportExportGUI::~ImportExportGUI()
// function : OnGUIEvent()
// purpose :
//=======================================================================
-bool ImportExportGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
+bool ImportExportGUI::OnGUIEvent(int commandId, SUIT_Desktop* parent)
{
- SalomeApp_Application* app = getGeometryGUI()->getApp();
- if ( !app ) return false;
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if (!app) return false;
- getGeometryGUI()->EmitSignalDeactivateDialog();
+ getGeometryGUI()->EmitSignalDeactivateDialog();
- QDialog* aDlg = NULL;
- switch ( theCommandID ) {
- case GEOMOp::OpExportXAO:
- cout << "test" << endl;
- aDlg = new ImportExportGUI_ExportXAODlg( getGeometryGUI(), parent );
- break;
- //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
- default:
- app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
- break;
- }
+ QDialog* dialog = NULL;
+ switch (commandId)
+ {
+ case GEOMOp::OpExportXAO:
+ dialog = new ImportExportGUI_ExportXAODlg(getGeometryGUI(), parent);
+ break;
+ //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
+ default:
+ app->putInfo(tr("GEOM_PRP_COMMAND").arg(commandId));
+ break;
+ }
- if ( aDlg != NULL )
- aDlg->show();
+ if (dialog != NULL)
+ dialog->show();
- return true;
+ return true;
}
//=====================================================================================
@@ -89,10 +90,10 @@ bool ImportExportGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
extern "C"
{
#ifdef WIN32
- __declspec( dllexport )
+ __declspec( dllexport )
#endif
- GEOMGUI* GetLibGUI( GeometryGUI* parent )
- {
- return new ImportExportGUI( parent );
- }
+ GEOMGUI* GetLibGUI(GeometryGUI* parent)
+ {
+ return new ImportExportGUI(parent);
+ }
}
diff --git a/src/ImportExportGUI/ImportExportGUI.h b/src/ImportExportGUI/ImportExportGUI.h
index 261e1cacd..a2165bd9d 100644
--- a/src/ImportExportGUI/ImportExportGUI.h
+++ b/src/ImportExportGUI/ImportExportGUI.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@ -24,18 +24,18 @@
#define IMPORTEXPORTGUI_H
#include "GEOMGUI.h"
-
+
//=================================================================================
// class : ImportExportGUI
// purpose :
//=================================================================================
-class ImportExportGUI : public GEOMGUI
+class ImportExportGUI: public GEOMGUI
{
public:
- ImportExportGUI( GeometryGUI* );
- ~ImportExportGUI();
+ ImportExportGUI(GeometryGUI* parent);
+ ~ImportExportGUI();
- bool OnGUIEvent( int, SUIT_Desktop* );
+ bool OnGUIEvent(int commandId, SUIT_Desktop* parent);
};
#endif // IMPORTEXPORTGUI_H
diff --git a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx
index 5216e1f8b..9fc2dc545 100644
--- a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx
+++ b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx
@@ -1,7 +1,4 @@
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@ -19,9 +16,6 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#include "ImportExportGUI_ExportXAODlg.h"
-//#include "ImportExportGUI_Widgets.h"
-
#include
#include
#include
@@ -47,84 +41,86 @@
#include
#include
+#include "ImportExportGUI_ExportXAODlg.h"
+//#include "ImportExportGUI_Widgets.h"
//=================================================================================
// Constructor
//=================================================================================
-ImportExportGUI_ExportXAODlg::ImportExportGUI_ExportXAODlg (GeometryGUI* theGeometryGUI, QWidget* parent)
- : GEOMBase_Skeleton(theGeometryGUI, parent, false)
+ImportExportGUI_ExportXAODlg::ImportExportGUI_ExportXAODlg(GeometryGUI* geometryGUI, QWidget* parent)
+:
+ GEOMBase_Skeleton(geometryGUI, parent, false)
{
- myMainObj = GEOM::GEOM_Object::_nil();
-
- SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QPixmap imageOp (resMgr->loadPixmap("GEOM", tr("ICON_DLG_EXPORTXAO_EXPORTINGSHAPE_FILENAME_LGROUPS_LFIELDS")));
- QPixmap iconSelect (resMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+ m_mainObj = GEOM::GEOM_Object::_nil();
- setWindowTitle(tr("GEOM_EXPORTXAO_TITLE"));
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap imageOp(resMgr->loadPixmap("GEOM", tr("ICON_DLG_EXPORTXAO_EXPORTINGSHAPE_FILENAME_LGROUPS_LFIELDS")));
+ QPixmap iconSelect(resMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
- /***************************************************************/
- mainFrame()->GroupConstructors->setTitle( tr( "GEOM_EXPORTXAO_TITLE" ) );
- mainFrame()->RadioButton1->setIcon( imageOp );
- mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
- mainFrame()->RadioButton2->close();
- mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
- mainFrame()->RadioButton3->close();
-
-
- QGroupBox *GroupBoxExport = new QGroupBox(parent);
-
- QGridLayout *gridLayoutExport = new QGridLayout(GroupBoxExport);
+ setWindowTitle(tr("GEOM_EXPORTXAO_TITLE"));
+
+ /***************************************************************/
+ mainFrame()->GroupConstructors->setTitle(tr("GEOM_EXPORTXAO_TITLE"));
+ mainFrame()->RadioButton1->setIcon(imageOp);
+ mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
+ mainFrame()->RadioButton2->close();
+ mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+ mainFrame()->RadioButton3->close();
+
+ QGroupBox* gbxExport = new QGroupBox(parent);
+
+ QGridLayout *gridLayoutExport = new QGridLayout(gbxExport);
#ifndef Q_OS_MAC
- gridLayoutExport->setSpacing(6);
+ gridLayoutExport->setSpacing(6);
#endif
#ifndef Q_OS_MAC
- gridLayoutExport->setContentsMargins(9, 9, 9, 9);
+ gridLayoutExport->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayoutExport->setObjectName(QString::fromUtf8("gridLayoutExport"));
+ gridLayoutExport->setObjectName(QString::fromUtf8("gridLayoutExport"));
- //****************************
- QLabel *TextLabel1 = new QLabel(tr( "GEOM_EXPORTXAO_EXPORTINGSHAPE" ),GroupBoxExport);
- gridLayoutExport->addWidget(TextLabel1, 0, 0, 1, 1);
+ //****************************
+ QLabel* txtLabel1 = new QLabel(tr("GEOM_EXPORTXAO_EXPORTINGSHAPE"), gbxExport);
+ gridLayoutExport->addWidget(txtLabel1, 0, 0, 1, 1);
- mySelBtn = new QPushButton(GroupBoxExport);
- mySelBtn->setIcon(iconSelect);
- gridLayoutExport->addWidget(mySelBtn, 0, 1, 1, 1);
+ btnSelect = new QPushButton(gbxExport);
+ btnSelect->setIcon(iconSelect);
+ gridLayoutExport->addWidget(btnSelect, 0, 1, 1, 1);
- myMainShape = new QLineEdit(GroupBoxExport);
- myMainShape->setMinimumSize(QSize(100, 0));
- gridLayoutExport->addWidget(myMainShape, 0, 2, 1, 1);
+ ledShape = new QLineEdit(gbxExport);
+ ledShape->setMinimumSize(QSize(100, 0));
+ gridLayoutExport->addWidget(ledShape, 0, 2, 1, 1);
- //****************************
- QLabel *TextLabel2 = new QLabel(tr( "GEOM_EXPORTXAO_FILENAME" ),GroupBoxExport);
- gridLayoutExport->addWidget(TextLabel2, 1, 0, 1, 1);
+ //****************************
+ QLabel* txtLabel2 = new QLabel(tr("GEOM_EXPORTXAO_FILENAME"), gbxExport);
+ gridLayoutExport->addWidget(txtLabel2, 1, 0, 1, 1);
- myMainFile = new QLineEdit(GroupBoxExport);
- gridLayoutExport->addWidget(myMainFile, 1, 1, 1, 2);
+ ledFileName = new QLineEdit(gbxExport);
+ gridLayoutExport->addWidget(ledFileName, 1, 1, 1, 2);
- //****************************
- QLabel *TextLabel3 = new QLabel(tr( "GEOM_EXPORTXAO_LGROUPS" ),GroupBoxExport);
- gridLayoutExport->addWidget(TextLabel3, 2, 0, 1, 2);
-
- myListGroups = new QListWidget(GroupBoxExport);
- gridLayoutExport->addWidget(myListGroups, 3, 0, 1, 2);
+ //****************************
+ QLabel* txtLabel3 = new QLabel(tr("GEOM_EXPORTXAO_LGROUPS"), gbxExport);
+ gridLayoutExport->addWidget(txtLabel3, 2, 0, 1, 2);
- QLabel *TextLabel4 = new QLabel(tr( "GEOM_EXPORTXAO_LFIELDS" ),GroupBoxExport);
- gridLayoutExport->addWidget(TextLabel4, 2, 2, 1, 1);
+ lstGroups = new QListWidget(gbxExport);
+ gridLayoutExport->addWidget(lstGroups, 3, 0, 1, 2);
- myListFields = new QListWidget(GroupBoxExport);
- gridLayoutExport->addWidget(myListFields, 3, 2, 1, 1);
+ QLabel* txtLabel4 = new QLabel(tr("GEOM_EXPORTXAO_LFIELDS"), gbxExport);
+ gridLayoutExport->addWidget(txtLabel4, 2, 2, 1, 1);
+ lstFields = new QListWidget(gbxExport);
+ gridLayoutExport->addWidget(lstFields, 3, 2, 1, 1);
- QVBoxLayout* layout = new QVBoxLayout(centralWidget());
- layout->setMargin(0); layout->setSpacing(6);
- layout->addWidget(GroupBoxExport);
+ QVBoxLayout* layout = new QVBoxLayout(centralWidget());
+ layout->setMargin(0);
+ layout->setSpacing(6);
+ layout->addWidget(gbxExport);
- //QWidget::setTabOrder(PushButton1, LineEdit1);
- //QWidget::setTabOrder(LineEdit1, LineEdit2);
-
- setHelpFileName("create_exportxao_page.html");
+ //QWidget::setTabOrder(PushButton1, LineEdit1);
+ //QWidget::setTabOrder(LineEdit1, LineEdit2);
- Init();
+ setHelpFileName("create_exportxao_page.html");
+
+ Init();
}
//=================================================================================
@@ -132,7 +128,7 @@ ImportExportGUI_ExportXAODlg::ImportExportGUI_ExportXAODlg (GeometryGUI* theGeom
//=================================================================================
ImportExportGUI_ExportXAODlg::~ImportExportGUI_ExportXAODlg()
{
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
@@ -141,20 +137,20 @@ ImportExportGUI_ExportXAODlg::~ImportExportGUI_ExportXAODlg()
//=================================================================================
void ImportExportGUI_ExportXAODlg::Init()
{
- // Get setting of step value from file configuration
- myGroups.clear();
- myFields.clear();
+ // Get setting of step value from file configuration
+ m_groups.clear();
+ m_fields.clear();
- // Signal/slot connections
- connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ // Signal/slot connections
+ connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect( mySelBtn, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
- connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ connect(btnSelect, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(((SalomeApp_Application*) (SUIT_Session::session()->activeApplication()))->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- initName(tr("GEOM_EXPORTXAO"));
- SelectionIntoArgument();
+ initName(tr("GEOM_EXPORTXAO"));
+ SelectionIntoArgument();
}
//=================================================================================
@@ -163,20 +159,22 @@ void ImportExportGUI_ExportXAODlg::Init()
//=================================================================================
void ImportExportGUI_ExportXAODlg::processObject()
{
- if ( myMainObj->_is_nil() ) {
- myMainShape->setText( "" );
- myMainFile->setText( "" );
- }
- else {
- myMainShape->setText( GEOMBase::GetName( myMainObj ) );
- GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations(getStudyId());
- GEOM::ListOfGO_var Groups = aShOp->GetExistingSubObjects(myMainObj, true);
- // Affichage des noms des groupes
- for ( int i = 0, n = Groups->length(); i < n; i++ )
+ if (m_mainObj->_is_nil())
{
- myListGroups->addItem( GEOMBase::GetName( Groups[i] ) );
+ ledShape->setText("");
+ ledFileName->setText("");
+ }
+ else
+ {
+ ledShape->setText(GEOMBase::GetName(m_mainObj));
+ GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::ListOfGO_var Groups = aShOp->GetExistingSubObjects(m_mainObj, true);
+ // Affichage des noms des groupes
+ for (int i = 0, n = Groups->length(); i < n; i++)
+ {
+ lstGroups->addItem(GEOMBase::GetName(Groups[i]));
+ }
}
- }
}
//=================================================================================
@@ -185,8 +183,8 @@ void ImportExportGUI_ExportXAODlg::processObject()
//=================================================================================
void ImportExportGUI_ExportXAODlg::ClickOnOk()
{
- if (ClickOnApply())
- ClickOnCancel();
+ if (ClickOnApply())
+ ClickOnCancel();
}
//=================================================================================
@@ -195,12 +193,12 @@ void ImportExportGUI_ExportXAODlg::ClickOnOk()
//=================================================================================
bool ImportExportGUI_ExportXAODlg::ClickOnApply()
{
- if (!onAccept())
- return false;
+ if (!onAccept())
+ return false;
- initName();
+ initName();
- return true;
+ return true;
}
//=================================================================================
@@ -209,27 +207,27 @@ bool ImportExportGUI_ExportXAODlg::ClickOnApply()
//=================================================================================
void ImportExportGUI_ExportXAODlg::SelectionIntoArgument()
{
- myMainObj = GEOM::GEOM_Object::_nil();
+ m_mainObj = GEOM::GEOM_Object::_nil();
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
- SALOME_ListIO aSelList;
- aSelMgr->selectedObjects(aSelList);
+ LightApp_SelectionMgr* selMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO selList;
+ selMgr->selectedObjects(selList);
- if (aSelList.Extent() != 1) {
+ if (selList.Extent() != 1)
+ {
+ processObject();
+ return;
+ }
+
+ /*GEOM::GEOM_Object_var aSelectedObject*/m_mainObj = GEOMBase::ConvertIOinGEOMObject(selList.First());
+
+ /*if ( aSelectedObject->_is_nil() ) {
+ processObject();
+ return;
+ }*/
+
+ //myMainObj = aSelectedObject;
processObject();
- return;
- }
-
- /*GEOM::GEOM_Object_var aSelectedObject*/myMainObj = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
-
- /*if ( aSelectedObject->_is_nil() ) {
- processObject();
- return;
- }*/
-
- //myMainObj = aSelectedObject;
-
- processObject();
}
//=================================================================================
@@ -238,9 +236,9 @@ void ImportExportGUI_ExportXAODlg::SelectionIntoArgument()
//=================================================================================
void ImportExportGUI_ExportXAODlg::SetEditCurrentArgument()
{
- myMainShape->setFocus();
- myEditCurrentArgument = myMainShape;
- SelectionIntoArgument();
+ ledShape->setFocus();
+ myEditCurrentArgument = ledShape;
+ SelectionIntoArgument();
}
//=================================================================================
// function : ActivateThisDialog()
@@ -248,17 +246,17 @@ void ImportExportGUI_ExportXAODlg::SetEditCurrentArgument()
//=================================================================================
void ImportExportGUI_ExportXAODlg::ActivateThisDialog()
{
- GEOMBase_Skeleton::ActivateThisDialog();
+ GEOMBase_Skeleton::ActivateThisDialog();
}
//=================================================================================
// function : enterEvent [REDEFINED]
// purpose :
//=================================================================================
-void ImportExportGUI_ExportXAODlg::enterEvent (QEvent*)
+void ImportExportGUI_ExportXAODlg::enterEvent(QEvent*)
{
- if (!mainFrame()->GroupConstructors->isEnabled())
- ActivateThisDialog();
+ if (!mainFrame()->GroupConstructors->isEnabled())
+ ActivateThisDialog();
}
//=================================================================================
@@ -267,47 +265,51 @@ void ImportExportGUI_ExportXAODlg::enterEvent (QEvent*)
//=================================================================================
GEOM::GEOM_IOperations_ptr ImportExportGUI_ExportXAODlg::createOperation()
{
- return getGeomEngine()->GetIImportExportOperations(getStudyId());
+ return getGeomEngine()->GetIImportExportOperations(getStudyId());
}
//=================================================================================
// function : isValid
// purpose :
//=================================================================================
-bool ImportExportGUI_ExportXAODlg::isValid (QString& msg)
+bool ImportExportGUI_ExportXAODlg::isValid(QString& msg)
{
- bool ok = true;
+ bool ok = true;
- //@@ add custom validation actions here @@//
+ //@@ add custom validation actions here @@//
- return ok;
+ return ok;
}
//=================================================================================
// function : execute
// purpose :
//=================================================================================
-bool ImportExportGUI_ExportXAODlg::execute (ObjectList& objects)
+bool ImportExportGUI_ExportXAODlg::execute(ObjectList& objects)
{
- bool res = false;
+ bool res = false;
- GEOM::GEOM_Object_var anObj;
+ GEOM::GEOM_Object_var obj;
- GEOM::GEOM_IImportExportOperations_var anOper = GEOM::GEOM_IImportExportOperations::_narrow(getOperation());
- GEOM::GEOM_IShapesOperations_var anShapesOper = getGeomEngine()->GetIShapesOperations(getStudyId());
- GEOM::ListOfGO_var mylGroups = anShapesOper->GetExistingSubObjects(myMainObj, true);
- GEOM::ListOfGO_var mylFields = new GEOM::ListOfGO();
+ GEOM::GEOM_IImportExportOperations_var ieOp = GEOM::GEOM_IImportExportOperations::_narrow(getOperation());
+ GEOM::GEOM_IShapesOperations_var shapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::ListOfGO_var groups = shapesOp->GetExistingSubObjects(m_mainObj, true);
+ GEOM::ListOfGO_var fields = new GEOM::ListOfGO();
- mylGroups->length( myGroups.count() );
- for ( int i = 0; i < myGroups.count(); i++ )
- mylGroups[i] = myGroups[i].copy();
-
- mylFields->length( myFields.count() );
- for ( int i = 0; i < myFields.count(); i++ )
- mylFields[i] = myFields[i].copy();
+ std::cout << " == Groups" << std::endl;
+ groups->length(m_groups.count());
+ for (int i = 0; i < m_groups.count(); i++)
+ groups[i] = m_groups[i].copy();
- // call engine function
- res = anOper->ExportXAO(myMainObj, myMainFile->text().toStdString().c_str(), mylGroups, mylFields);
+ std::cout << " == Fields" << std::endl;
+ fields->length(m_fields.count());
+ for (int i = 0; i < m_fields.count(); i++)
+ fields[i] = m_fields[i].copy();
- return res;
+ // call engine function
+ std::cout << " >> ExportXAO" << std::endl;
+ res = ieOp->ExportXAO(m_mainObj, ledFileName->text().toStdString().c_str(), groups, fields);
+ std::cout << " << ExportXAO" << std::endl;
+
+ return res;
}
diff --git a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h
index f89324ae7..825071e31 100644
--- a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h
+++ b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h
@@ -1,7 +1,4 @@
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@ -23,7 +20,7 @@
#define IMPORTEXPORTGUI_EXPORTXAODLG_H
#include
-#include "GEOM_GenericObjPtr.h"
+#include
class QLineEdit;
class QButtonGroup;
@@ -35,45 +32,45 @@ class QListWidget;
// class : ImportExportGUI_ExportXAODlg
// purpose :
//=================================================================================
-class ImportExportGUI_ExportXAODlg : public GEOMBase_Skeleton
+class ImportExportGUI_ExportXAODlg: public GEOMBase_Skeleton
{
- Q_OBJECT
+ Q_OBJECT
public:
- ImportExportGUI_ExportXAODlg( GeometryGUI*, QWidget* = 0 );
- ~ImportExportGUI_ExportXAODlg();
+ ImportExportGUI_ExportXAODlg(GeometryGUI*, QWidget* = 0);
+ ~ImportExportGUI_ExportXAODlg();
protected:
- // redefined from GEOMBase_Helper
- virtual GEOM::GEOM_IOperations_ptr createOperation();
- virtual bool isValid( QString& );
- virtual bool execute( ObjectList& );
+ // redefined from GEOMBase_Helper
+ virtual GEOM::GEOM_IOperations_ptr createOperation();
+ virtual bool isValid(QString&);
+ virtual bool execute(ObjectList&);
private:
- void Init();
- void enterEvent( QEvent* );
- void processObject();
+ void Init();
+ void enterEvent(QEvent*);
+ void processObject();
private:
- GEOM::GEOM_Object_var myMainObj;
- QList myGroups;
- QList myFields;
- //ImportExportGUI_1Sel1LineEdit2ListWidget* myGrp;
- QLineEdit *myMainShape;
- QLineEdit *myMainFile;
- QListWidget *myListGroups;
- QListWidget *myListFields;
- QPushButton *mySelBtn;
+ GEOM::GEOM_Object_var m_mainObj;
+ QList m_groups;
+ QList m_fields;
+ //ImportExportGUI_1Sel1LineEdit2ListWidget* myGrp;
+ QLineEdit* ledShape;
+ QLineEdit* ledFileName;
+ QListWidget* lstGroups;
+ QListWidget* lstFields;
+ QPushButton* btnSelect;
private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ActivateThisDialog();
- void LineEditReturnPressed();
- void SelectionIntoArgument();
- void SetEditCurrentArgument();
- //void ValueChangedInSpinBox();
- //void SetDoubleSpinBoxStep( double );
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ActivateThisDialog();
+ void LineEditReturnPressed();
+ void SelectionIntoArgument();
+ void SetEditCurrentArgument();
+ //void ValueChangedInSpinBox();
+ //void SetDoubleSpinBoxStep( double );
};
#endif // IMPORTEXPORTGUI_EXPORTXAODLG_H
diff --git a/src/XAO/Field.cxx b/src/XAO/Field.cxx
index 173bb2db4..812ecf0d2 100644
--- a/src/XAO/Field.cxx
+++ b/src/XAO/Field.cxx
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2013 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
diff --git a/src/XAO/Field.hxx b/src/XAO/Field.hxx
index c7352f465..5617f3e11 100644
--- a/src/XAO/Field.hxx
+++ b/src/XAO/Field.hxx
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2013 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
@@ -32,7 +32,7 @@ namespace XAO
FACE = 2,
SOLID = 3
} FieldDimension;
-
+
typedef enum
{
BOOLEAN = 0,
@@ -40,7 +40,7 @@ namespace XAO
DOUBLE = 2,
STRING = 3
} FieldType;
-
+
class Field
{
public:
diff --git a/src/XAO/GeometricElement.cxx b/src/XAO/GeometricElement.cxx
new file mode 100644
index 000000000..4979b184b
--- /dev/null
+++ b/src/XAO/GeometricElement.cxx
@@ -0,0 +1,105 @@
+// Copyright (C) 2013 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Frederic Pons (OpenCascade)
+
+#include
+
+#include "GeometricElement.hxx"
+
+using namespace XAO;
+
+
+GeometricElement::GeometricElement()
+{
+ m_name = "";
+ m_reference = "";
+}
+
+GeometricElement::GeometricElement(const char* name, const char* reference)
+{
+ m_name = name;
+ m_reference = reference;
+}
+
+GeometricElement::~GeometricElement()
+{
+
+}
+
+GeometricElementList::GeometricElementList()
+{
+ setSize(0);
+}
+
+GeometricElementList::GeometricElementList(const int count)
+{
+ setSize(m_count);
+}
+
+void GeometricElementList::setSize(const int nb)
+{
+ m_count = nb;
+ m_elements.clear();
+ for (int i = 0; i < nb; ++i)
+ {
+ m_elements[i] = GeometricElement();
+ }
+}
+
+void GeometricElementList::setElement(const int index, const char* name, const char* reference)
+{
+ if (m_count == 0 || index > m_count)
+ throw SALOME_Exception("Problem with number of elements");
+
+ m_elements[index].setName(name);
+ m_elements[index].setReference(reference);
+}
+
+
+const char* GeometricElementList::getName(const int index)
+{
+ if (m_count == 0 || index > m_count)
+ throw SALOME_Exception("Problem with number of elements");
+
+ return m_elements[index].getName();
+}
+
+void GeometricElementList::setName(const int index, const char* name)
+{
+ if (m_count == 0 || index > m_count)
+ throw SALOME_Exception("Problem with number of elements");
+
+ m_elements[index].setName(name);
+}
+
+const char* GeometricElementList::getReference(const int index)
+{
+ if (m_count == 0 || index > m_count)
+ throw SALOME_Exception("Problem with number of elements");
+
+ return m_elements[index].getReference();
+}
+
+void GeometricElementList::setReference(const int index, const char* name)
+{
+ if (m_count == 0 || index > m_count)
+ throw SALOME_Exception("Problem with number of elements");
+
+ m_elements[index].setReference(name);
+}
diff --git a/src/XAO/GeometricElement.hxx b/src/XAO/GeometricElement.hxx
new file mode 100644
index 000000000..3863b5849
--- /dev/null
+++ b/src/XAO/GeometricElement.hxx
@@ -0,0 +1,85 @@
+// Copyright (C) 2013 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Frederic Pons (OpenCascade)
+
+#ifndef __XAO_GEOMETRICELEMENT_HXX__
+#define __XAO_GEOMETRICELEMENT_HXX__
+
+#include
+#include