]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
last changes from nge
authorfps <fps@opencascade.com>
Thu, 28 Mar 2013 08:49:23 +0000 (08:49 +0000)
committerfps <fps@opencascade.com>
Thu, 28 Mar 2013 08:49:23 +0000 (08:49 +0000)
26 files changed:
configure.ac
src/GEOMImpl/GEOMImpl_ExportXAODriver.cxx
src/GEOMImpl/GEOMImpl_IImportExportOperations.cxx
src/GEOMImpl/GEOMImpl_IImportExportOperations.hxx
src/GEOMImpl/GEOMImpl_Types.hxx
src/GEOMImpl/Makefile.am
src/GEOM_I_Superv/GEOM_Superv_i.hh
src/ImportExportGUI/ImportExportGUI.cxx
src/ImportExportGUI/ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.ui [deleted file]
src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx
src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h
src/ImportExportGUI/ImportExportGUI_Widgets.cxx [deleted file]
src/ImportExportGUI/ImportExportGUI_Widgets.h [deleted file]
src/ImportExportGUI/Makefile.am
src/Makefile.am
src/XAO/Geometry.cxx
src/XAO/Geometry.hxx
src/XAO/Group.cxx
src/XAO/Group.hxx
src/XAO/Makefile.am
src/XAO/Xao.cxx
src/XAO/Xao.hxx
src/XAOExport/Makefile.am [deleted file]
src/XAOExport/XAOExport.cxx [deleted file]
src/XAOImport/Makefile.am [deleted file]
src/XAOImport/XAOImport.cxx [deleted file]

index 0fdd3c51fb59e6b6128006e24cf61e7d96ce46ef..1605a48f0d982f06df45926bc3174d24f31b33a8 100644 (file)
@@ -372,7 +372,7 @@ else
 fi
 echo
 
-obligatory_vars="cc_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok sphinx_ok Kernel_ok"
+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"
 gui_vars="OpenGL_ok qt_ok gui_ok"
 
@@ -495,6 +495,7 @@ AC_OUTPUT([ \
   doc/salome/tui/static/header.html \
   src/Makefile \
   src/AdvancedGUI/Makefile \
+  src/XAO/Makefile \
   src/ImportExportGUI/Makefile \
   src/ARCHIMEDE/Makefile \
   src/BREPExport/Makefile \
index 60cc8fcfa411c46a944801248877f53e7840803f..7a4911a6c247a27d3c4a114e721acf7c696e5fe4 100644 (file)
@@ -37,7 +37,7 @@
 //=======================================================================
 const Standard_GUID& GEOMImpl_ExportXAODriver::GetID()
 {
-  static Standard_GUID aGUID("FF1BBB71-5D14-4df2-980B-3A668264EA16");
+  static Standard_GUID aGUID("1C3A0F3F-729D-4E83-8232-78E74FC5637C");
   return aGUID;
 }
 
index bd49205f0d6477768967b630f34668aaee34fc32..ceba312dad4d9c4d0cfb6c0d479d2d562a979529 100644 (file)
 #include "GEOM_Function.hxx"
 #include "GEOM_PythonDump.hxx"
 
+#include "Xao.hxx"
+#include "Geometry.hxx"
+#include "Group.hxx"
+
 #include <GEOMImpl_ExportXAODriver.hxx>
 #include <GEOMImpl_IExportXAO.hxx>
 /*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/
 #include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Vertex.hxx>
+#include <TopAbs.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 
 #include <TCollection_AsciiString.hxx>
 
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <Standard_Transient.hxx>
+
 #include <gp_Pnt.hxx>
 #include <gp_Vec.hxx>
 #include <gp_Ax3.hxx>
@@ -78,14 +86,16 @@ GEOMImpl_IImportExportOperations::GEOMImpl_IImportExportOperations(GEOM_Engine*
   GEOM_IOperations(theEngine, theDocID)
 {
   MESSAGE("GEOMImpl_IImportExportOperations::GEOMImpl_IImportExportOperations");
-  myBasicOperations     = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID());
+  /*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());
+  myHealingOperations   = new GEOMImpl_IHealingOperations(GetEngine(), GetDocID());*/
+  myShapesOperations    = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
+  myGroupOperations     = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
 }
 
 //=============================================================================
@@ -96,14 +106,16 @@ GEOMImpl_IImportExportOperations::GEOMImpl_IImportExportOperations(GEOM_Engine*
 GEOMImpl_IImportExportOperations::~GEOMImpl_IImportExportOperations()
 {
   MESSAGE("GEOMImpl_IImportExportOperations::~GEOMImpl_IImportExportOperations");
-  delete myBasicOperations;
+  /*delete myBasicOperations;
   delete myBooleanOperations;
   delete myShapesOperations;
   delete myTransformOperations;
   delete myBlocksOperations;
   delete my3DPrimOperations;
   delete myLocalOperations;
-  delete myHealingOperations;
+  delete myHealingOperations;*/
+  delete myShapesOperations;
+  delete myGroupOperations;
 }
 
 //=============================================================================
@@ -120,6 +132,8 @@ bool GEOMImpl_IImportExportOperations::ExportXAO (Handle(GEOM_Object) theExporti
 {
   SetErrorCode(KO);
   bool isGood = false;
+  
+  //
 
   //Add a new shape function with parameters
   Handle(GEOM_Function) aRefFunction = theExportingShape->GetLastFunction();
@@ -135,13 +149,13 @@ bool GEOMImpl_IImportExportOperations::ExportXAO (Handle(GEOM_Object) theExporti
  //Check if the function is set correctly
   if (aFunction->GetDriverGUID() != GEOMImpl_ExportXAODriver::GetID()) return false;
 
-  GEOMImpl_IExportXAO aData (aRefFunction);
+  /*GEOMImpl_IExportXAO aData (aRefFunction);
 
   TCollection_AsciiString FileName = theFileName.c_str();
   aData.SetExportingShape(aRefFunction);
   aData.SetFileName(FileName);
-  /* A MODIFIER aData.SetlGroups(thelGroups);
-  aData.SetlFields(thelFields);*/
+  aData.SetlGroups(thelGroups);
+  aData.SetlFields(thelFields);
 
   //Compute the resulting value
   try {
@@ -157,14 +171,81 @@ bool GEOMImpl_IImportExportOperations::ExportXAO (Handle(GEOM_Object) theExporti
     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)
+    {
+      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<Handle(GEOM_Object)>::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);
+      }
+    }
+    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;
+    }  */
+   
+
+  }
+  
 
   //Make a Python command
   GEOM::TPythonDump pd (aFunction);
   std::list<Handle(GEOM_Object)>::iterator itG = thelGroups.begin();
   std::list<Handle(GEOM_Object)>::iterator itF = thelFields.begin();
   pd << /*isGood <<*/ " = geompy.ExportXAO(" << theExportingShape << ", " << FileName.ToCString() << ", [";
-  //itG = thePoints.begin();
+
   pd << (*itG++);
   while (itG != thelGroups.end()) {
     pd << ", " << (*itG++);
index 72328f4fdf2afa5eacb518995684dda960957d48..e4b1ffc0ac545d15b7b03c377b6d09b92d2ce4a3 100644 (file)
 
 #include <list>
 
-class GEOMImpl_IBasicOperations;
+/*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_IHealingOperations;*/
+class GEOMImpl_IShapesOperations;
+class GEOMImpl_IGroupOperations;
 
 class GEOMImpl_IImportExportOperations: public GEOM_IOperations {
 
 private:
-  GEOMImpl_IBasicOperations*     myBasicOperations;
+  /*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_IHealingOperations*   myHealingOperations;*/
+  GEOMImpl_IShapesOperations*    myShapesOperations;
+  GEOMImpl_IGroupOperations*     myGroupOperations;
   
 public:
   Standard_EXPORT GEOMImpl_IImportExportOperations(GEOM_Engine* theEngine, int theDocID);
index d69db705895fbdaddf3fea62eb3cb50f9134a300..130737c812fdbb903f5137c7543477f468104c9b 100755 (executable)
@@ -80,6 +80,8 @@
 
 #define GEOM_GROUP 37
 
+#define GEOM_FIELD 370
+
 #define GEOM_BLOCK 38
 
 #define GEOM_MARKER 39
index 8abb1c9be78da675f133c2c5f6790054dc648b7c..4d0821d970cb6aa968e4892666518f2985b3809a 100644 (file)
@@ -249,6 +249,7 @@ libGEOMimpl_la_CPPFLAGS =           \
        -I$(srcdir)/../GEOMAlgo         \
        -I$(srcdir)/../SKETCHER         \
        -I$(srcdir)/../ARCHIMEDE        \
+       -I$(srcdir)/../XAO              \
        -I$(top_builddir)/idl
 
 libGEOMimpl_la_LDFLAGS  =                      \
@@ -257,6 +258,7 @@ libGEOMimpl_la_LDFLAGS  =                   \
        ../ShHealOper/libShHealOper.la          \
        ../ARCHIMEDE/libGEOMArchimede.la        \
        ../SKETCHER/libGEOMSketcher.la          \
+       ../XAO/libXAO.la                        \
        $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics     \
        $(STDLIB)                               \
        $(CAS_LDPATH) -lTKCAF -lTKFillet -lTKOffset -lTKFeat \
index 4ded8898faaf1316d16c0b4acf21c55639c44cf6..bd6b4cf85351180e6bc60ca7793f7cfec13cc215 100644 (file)
@@ -736,6 +736,7 @@ private:
   GEOM::GEOM_ILocalOperations_var     myLocalOp;
   GEOM::GEOM_IGroupOperations_var     myGroupOp;
   GEOM::GEOM_IAdvancedOperations_var  myAdvancedOp;
+  GEOM::GEOM_IImportExportOperations_var  myImportExportOp;
 };
 
 #endif
index 2d111202e1223adf6fe4dc4da4cc3e0f207629f9..7b9f7adb202c989a6141798dd19ce8ae5cf54013 100644 (file)
 #include "GeometryGUI.h"
 #include "GeometryGUI_Operations.h"
 
+#include <GEOMBase.h>
 #include <SUIT_Desktop.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
 #include <SalomeApp_Application.h>
 
 #include "ImportExportGUI_ExportXAODlg.h"
 //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@//
 
-#include <QDialog>
+#include <QDialog> 
+#include <iostream>
 
 //=======================================================================
 // function : ImportExportGUI()
@@ -62,7 +66,9 @@ bool ImportExportGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
 
   QDialog* aDlg = NULL;
 
-  switch ( theCommandID ) {  case GEOMOp::OpExportXAO:
+  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 @@//
diff --git a/src/ImportExportGUI/ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.ui b/src/ImportExportGUI/ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.ui
deleted file mode 100644 (file)
index 12090f4..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ImportExportGUI_1Sel1LineEdit2ListWidget_QTD</class>
- <widget class="QWidget" name="ImportExportGUI_1Sel1LineEdit2ListWidget_QTD">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>222</width>
-    <height>178</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string/>
-  </property>
-  <layout class="QGridLayout">
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QGroupBox" name="GroupBox1">
-     <property name="title">
-      <string/>
-     </property>
-     <layout class="QGridLayout">
-      <property name="margin">
-       <number>9</number>
-      </property>
-      <property name="spacing">
-       <number>6</number>
-      </property>
-      <item row="1" column="1" colspan="2">
-       <widget class="QLineEdit" name="LineEdit2"/>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="TextLabel2">
-        <property name="text">
-         <string>TL2</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="QPushButton" name="PushButton1">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text">
-         <string/>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="0">
-       <widget class="QLabel" name="TextLabel1">
-        <property name="text">
-         <string>TL1</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="2">
-       <widget class="QLineEdit" name="LineEdit1">
-        <property name="minimumSize">
-         <size>
-          <width>100</width>
-          <height>0</height>
-         </size>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="0" colspan="2">
-       <widget class="QLabel" name="TextLabel3">
-        <property name="text">
-         <string>TL3</string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="2">
-       <widget class="QLabel" name="TextLabel4">
-        <property name="text">
-         <string>TL4</string>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="0" colspan="2">
-       <widget class="QListWidget" name="listWidget1"/>
-      </item>
-      <item row="3" column="2">
-       <widget class="QListWidget" name="listWidget2"/>
-      </item>
-     </layout>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <tabstops>
-  <tabstop>PushButton1</tabstop>
-  <tabstop>LineEdit1</tabstop>
-  <tabstop>LineEdit2</tabstop>
- </tabstops>
- <resources/>
- <connections/>
-</ui>
index f7c2940feaacd42d7d7ee40845c53c1e703f5df6..5216e1f8ba53f9a5556565fdabb02bccf2476806 100644 (file)
@@ -20,7 +20,7 @@
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
 #include "ImportExportGUI_ExportXAODlg.h"
-#include "ImportExportGUI_Widgets.h"
+//#include "ImportExportGUI_Widgets.h"
 
 #include <DlgRef.h>
 #include <GeometryGUI.h>
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
 #include <LightApp_SelectionMgr.h>
 
 #include <QLabel>
 #include <QLineEdit>
+#include <QButtonGroup>
+#include <QListWidget>
 #include <QMap>
 //#include <ui_ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.h>
 
 ImportExportGUI_ExportXAODlg::ImportExportGUI_ExportXAODlg (GeometryGUI* theGeometryGUI, QWidget* parent)
   : GEOMBase_Skeleton(theGeometryGUI, 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 imageSel (resMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+  QPixmap iconSelect (resMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
 
   setWindowTitle(tr("GEOM_EXPORTXAO_TITLE"));
 
@@ -65,13 +70,57 @@ ImportExportGUI_ExportXAODlg::ImportExportGUI_ExportXAODlg (GeometryGUI* theGeom
   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
   mainFrame()->RadioButton3->close();
   
-  myGrp = new ImportExportGUI_1Sel1LineEdit2ListWidget( centralWidget() );
-  myGrp->GroupBox1->setTitle( tr( "GEOM_EXPORTXAO" ) );
-  myGrp->TextLabel1->setText( tr( "GEOM_EXPORTXAO_EXPORTINGSHAPE" ) );
-  myGrp->TextLabel2->setText( tr( "GEOM_EXPORTXAO_FILENAME" ) );
-  myGrp->TextLabel3->setText( tr( "GEOM_EXPORTXAO_LGROUPS" ) );
-  myGrp->TextLabel4->setText( tr( "GEOM_EXPORTXAO_LFIELDS" ) );
-  myGrp->PushButton1->setIcon( imageSel );
+  QGroupBox *GroupBoxExport = new QGroupBox(parent);
+  
+  QGridLayout *gridLayoutExport = new QGridLayout(GroupBoxExport);
+#ifndef Q_OS_MAC
+  gridLayoutExport->setSpacing(6);
+#endif
+#ifndef Q_OS_MAC
+  gridLayoutExport->setContentsMargins(9, 9, 9, 9);
+#endif
+  gridLayoutExport->setObjectName(QString::fromUtf8("gridLayoutExport"));
+
+  //****************************
+  QLabel *TextLabel1 = new QLabel(tr( "GEOM_EXPORTXAO_EXPORTINGSHAPE" ),GroupBoxExport);
+  gridLayoutExport->addWidget(TextLabel1, 0, 0, 1, 1);
+
+  mySelBtn = new QPushButton(GroupBoxExport);
+  mySelBtn->setIcon(iconSelect);
+  gridLayoutExport->addWidget(mySelBtn, 0, 1, 1, 1);
+
+  myMainShape = new QLineEdit(GroupBoxExport);
+  myMainShape->setMinimumSize(QSize(100, 0));
+  gridLayoutExport->addWidget(myMainShape, 0, 2, 1, 1);
+
+  //****************************
+  QLabel *TextLabel2 = new QLabel(tr( "GEOM_EXPORTXAO_FILENAME" ),GroupBoxExport);
+  gridLayoutExport->addWidget(TextLabel2, 1, 0, 1, 1);
+
+  myMainFile = new QLineEdit(GroupBoxExport);
+  gridLayoutExport->addWidget(myMainFile, 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 *TextLabel4 = new QLabel(tr( "GEOM_EXPORTXAO_LFIELDS" ),GroupBoxExport);
+  gridLayoutExport->addWidget(TextLabel4, 2, 2, 1, 1);
+
+  myListFields = new QListWidget(GroupBoxExport);
+  gridLayoutExport->addWidget(myListFields, 3, 2, 1, 1);
+
+
+  QVBoxLayout* layout = new QVBoxLayout(centralWidget());
+  layout->setMargin(0); layout->setSpacing(6);
+  layout->addWidget(GroupBoxExport);
+
+        //QWidget::setTabOrder(PushButton1, LineEdit1);
+        //QWidget::setTabOrder(LineEdit1, LineEdit2);
   
   setHelpFileName("create_exportxao_page.html");
 
@@ -93,12 +142,14 @@ ImportExportGUI_ExportXAODlg::~ImportExportGUI_ExportXAODlg()
 void ImportExportGUI_ExportXAODlg::Init()
 {
   // Get setting of step value from file configuration
+  myGroups.clear();
+  myFields.clear();
 
   // Signal/slot connections
   connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
 
-  connect( myGrp->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
+  connect( mySelBtn, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
   connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
@@ -113,14 +164,18 @@ void ImportExportGUI_ExportXAODlg::Init()
 void ImportExportGUI_ExportXAODlg::processObject()
 {
   if ( myMainObj->_is_nil() ) {
-    myGrp->LineEdit1->setText( "" );
-    myGrp->LineEdit2->setText( "" );
-    erasePreview();
+    myMainShape->setText( "" );
+    myMainFile->setText( "" );
   }
   else {   
-    myGrp->LineEdit1->setText( GEOMBase::GetName( myMainObj ) );
-
-    SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+    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++ )
+    {
+      myListGroups->addItem( GEOMBase::GetName( Groups[i] ) );
+    }
   }
 }
 
@@ -154,7 +209,6 @@ bool ImportExportGUI_ExportXAODlg::ClickOnApply()
 //=================================================================================
 void ImportExportGUI_ExportXAODlg::SelectionIntoArgument()
 {
-  erasePreview();
   myMainObj = GEOM::GEOM_Object::_nil();
 
   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
@@ -166,15 +220,15 @@ void ImportExportGUI_ExportXAODlg::SelectionIntoArgument()
     return;
   }
 
-  GEOM::GEOM_Object_var aSelectedObject =
-    GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
+  /*GEOM::GEOM_Object_var aSelectedObject*/myMainObj = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
 
-  if ( aSelectedObject->_is_nil() ) {
+  /*if ( aSelectedObject->_is_nil() ) {
     processObject();
     return;
-  }
+  }*/
 
-  myMainObj = aSelectedObject;
+  //myMainObj = aSelectedObject;
+  
   processObject();
 }
 
@@ -184,8 +238,8 @@ void ImportExportGUI_ExportXAODlg::SelectionIntoArgument()
 //=================================================================================
 void ImportExportGUI_ExportXAODlg::SetEditCurrentArgument()
 {
-  myGrp->LineEdit1->setFocus();
-  myEditCurrentArgument = myGrp->LineEdit1;
+  myMainShape->setFocus();
+  myEditCurrentArgument = myMainShape;
   SelectionIntoArgument();
 }
 //=================================================================================
@@ -240,29 +294,20 @@ bool ImportExportGUI_ExportXAODlg::execute (ObjectList& objects)
   GEOM::GEOM_Object_var anObj;
 
   GEOM::GEOM_IImportExportOperations_var anOper = GEOM::GEOM_IImportExportOperations::_narrow(getOperation());
-
-  /*//@@ retrieve input values from the widgets here @@//
-  CORBA::Double theExportingShape = @@ init parameter value from dialog box @@;
-  CORBA::String_var theFileName = @@ init parameter value from dialog box @@;
-  CORBA::Boolean thelGroups = @@ init parameter value from dialog box @@;
-  CORBA::Boolean thelFields = @@ init parameter value from dialog box @@;
+  GEOM::GEOM_IShapesOperations_var anShapesOper = getGeomEngine()->GetIShapesOperations(getStudyId());
+  GEOM::ListOfGO_var mylGroups = anShapesOper->GetExistingSubObjects(myMainObj, true);
+  GEOM::ListOfGO_var mylFields = 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();
 
   // call engine function
-  anObj = anOper->ExportXAO(theExportingShape, theFileName, thelGroups, thelFields);
-  res = !anObj->_is_nil();
-  if (res && !IsPreview())
-  {
-    QStringList aParameters;
-    //@@ put stringified input parameters to the string list here to store in the data model for notebook @@//
-    aParameters << @@ stringified parameter value @@; // ExportingShape parameter
-    aParameters << @@ stringified parameter value @@; // FileName parameter
-    aParameters << @@ stringified parameter value @@; // lGroups parameter
-    aParameters << @@ stringified parameter value @@; // lFields parameter
-    if ( aParameters.count() > 0 ) anObj->SetParameters(aParameters.join(":").toLatin1().constData());
-  }
-  
-  if (res)
-    objects.push_back(anObj._retn());*/
+  res = anOper->ExportXAO(myMainObj, myMainFile->text().toStdString().c_str(), mylGroups, mylFields);
 
   return res;
 }
index 3c5fb42434b82ae9134d1be5d9b744f5d3620d1a..f89324ae706a353ae3f8d31c94c492b122e049cd 100644 (file)
 #define IMPORTEXPORTGUI_EXPORTXAODLG_H
 
 #include <GEOMBase_Skeleton.h>
+#include "GEOM_GenericObjPtr.h"
 
-class QGroupBox;
 class QLineEdit;
 class QButtonGroup;
-class ImportExportGUI_1Sel1LineEdit2ListWidget;
+class QListWidget;
+
+//class ImportExportGUI_1Sel1LineEdit2ListWidget;
 
 //=================================================================================
 // class    : ImportExportGUI_ExportXAODlg
@@ -54,12 +56,20 @@ private:
 
 private:
   GEOM::GEOM_Object_var                       myMainObj;
-  ImportExportGUI_1Sel1LineEdit2ListWidget*   myGrp;
+  QList<GEOM::GeomObjPtr>                     myGroups;
+  QList<GEOM::GeomObjPtr>                     myFields;
+  //ImportExportGUI_1Sel1LineEdit2ListWidget*   myGrp;
+  QLineEdit                                  *myMainShape;
+  QLineEdit                                  *myMainFile;
+  QListWidget                                *myListGroups;
+  QListWidget                                *myListFields;
+  QPushButton                                *mySelBtn;
 
 private slots:
   void                               ClickOnOk();
   bool                               ClickOnApply();
   void                               ActivateThisDialog();
+  void                               LineEditReturnPressed();
   void                               SelectionIntoArgument();
   void                               SetEditCurrentArgument();
   //void                               ValueChangedInSpinBox();
diff --git a/src/ImportExportGUI/ImportExportGUI_Widgets.cxx b/src/ImportExportGUI/ImportExportGUI_Widgets.cxx
deleted file mode 100644 (file)
index 0324dfb..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2007-2012  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
-// 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
-//
-
-// File   : ImportExportGUI_Widgets.cxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-#include "ImportExportGUI_Widgets.h"
-
-//////////////////////////////////////////
-// ImportExportGUI_1Sel1LineEdit2ListWidget
-//////////////////////////////////////////
-
-ImportExportGUI_1Sel1LineEdit2ListWidget::ImportExportGUI_1Sel1LineEdit2ListWidget( QWidget* parent, Qt::WindowFlags f )
-: QWidget( parent, f )
-{
-  setupUi( this );
-}
-ImportExportGUI_1Sel1LineEdit2ListWidget::~ImportExportGUI_1Sel1LineEdit2ListWidget()
-{
-}
-
diff --git a/src/ImportExportGUI/ImportExportGUI_Widgets.h b/src/ImportExportGUI/ImportExportGUI_Widgets.h
deleted file mode 100644 (file)
index 8655428..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (C) 2007-2012  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
-// 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
-//
-
-// File   : IMPORTEXPORTGUI_Widgets.h
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-#ifndef IMPORTEXPORTGUI_WIDGETS_H
-#define IMPORTEXPORTGUI_WIDGETS_H
-
-//////////////////////////////////////////
-// ImportExportGUI_1Sel1LineEdit2ListWidget
-//////////////////////////////////////////
-
-#include "ui_ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.h"
-
-class ImportExportGUI_1Sel1LineEdit2ListWidget : public QWidget, 
-                                  public Ui::ImportExportGUI_1Sel1LineEdit2ListWidget_QTD
-{
-  Q_OBJECT
-
-public:
-  ImportExportGUI_1Sel1LineEdit2ListWidget( QWidget* = 0, Qt::WindowFlags = 0 );
-  ~ImportExportGUI_1Sel1LineEdit2ListWidget();
-};
-
-#endif // MEASUREGUI_WIDGETS_H
index 1959304e6b66400bc94488dfcfc1aca7f38b076f..28d9303b5865bce567152a8931727b6a4393f68b 100644 (file)
 #
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
+# Libraries targets
+lib_LTLIBRARIES = libImportExportGUI.la
+
 # header files 
 salomeinclude_HEADERS =                        \
-       ImportExportGUI.h               \
-       ImportExportGUI_Widgets.h
+       ImportExportGUI.h \
+       ImportExportGUI_ExportXAODlg.h
        
-IMPORTEXPORT_INCLUDES = 
-IMPORTEXPORT_INCLUDES += ImportExportGUI_ExportXAODlg.h
+#IMPORTEXPORT_INCLUDES = 
+#IMPORTEXPORT_INCLUDES += ImportExportGUI_ExportXAODlg.h
 ##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@##
 
-salomeinclude_HEADERS += $(IMPORTEXPORT_INCLUDES)
-
-# Libraries targets
-lib_LTLIBRARIES = libImportExportGUI.la
+#salomeinclude_HEADERS += $(IMPORTEXPORT_INCLUDES)
 
 dist_libImportExportGUI_la_SOURCES =   \
-       ImportExportGUI.cxx             \
-       ImportExportGUI_Widgets.cxx
+       ImportExportGUI_ExportXAODlg.h          \
+       ImportExportGUI.h       \
+       ImportExportGUI_ExportXAODlg.cxx                \
+       ImportExportGUI.cxx
        
-IMPORTEXPORT_SOURCES = 
-IMPORTEXPORT_SOURCES += ImportExportGUI_ExportXAODlg.h ImportExportGUI_ExportXAODlg.cxx
+#IMPORTEXPORT_SOURCES = 
+#IMPORTEXPORT_SOURCES += ImportExportGUI_ExportXAODlg.h ImportExportGUI_ExportXAODlg.cxx
 ##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@##
 
-dist_libImportExportGUI_la_SOURCES += $(IMPORTEXPORT_SOURCES)
+#dist_libImportExportGUI_la_SOURCES += $(IMPORTEXPORT_SOURCES)
 
 MOC_FILES =
 
-IMPORTEXPORT_MOC_FILES = 
+IMPORTEXPORT_MOC_FILES = ImportExportGUI_moc.cxx               
 IMPORTEXPORT_MOC_FILES += ImportExportGUI_ExportXAODlg_moc.cxx
 ##@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@##
 
@@ -57,10 +59,6 @@ MOC_FILES += $(IMPORTEXPORT_MOC_FILES)
 nodist_libImportExportGUI_la_SOURCES = \
        $(MOC_FILES)
 
-UIC_FILES =                                            \
-       ui_ImportExportGUI_1Sel1LineEdit2ListWidget_QTD.h
-
-BUILT_SOURCES = $(UIC_FILES)
 # additional information to compile and link file
 
 libImportExportGUI_la_CPPFLAGS =                       \
index 8646ff6508f67aa6d527e807f4096858f4d5dd0e..6e93da55079e0b7779e1f11f99a76eaec40ee4f1 100644 (file)
@@ -23,7 +23,7 @@
 
 SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER OCC2VTK GEOM      \
           BREPExport BREPImport IGESExport IGESImport STEPExport       \
-          STEPImport STLExport VTKExport ShHealOper GEOMImpl GEOM_I    \
+          STEPImport STLExport VTKExport ShHealOper XAO GEOMImpl GEOM_I        \
           GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
 
 if WITH_OPENCV
@@ -40,9 +40,9 @@ endif
 DIST_SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo \
                SKETCHER OCC2VTK GEOM BREPExport \
                BREPImport IGESExport IGESImport STEPExport STEPImport STLExport \
-               VTKExport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv   \
+               VTKExport ShHealOper XAO GEOMImpl GEOM_I GEOMClient GEOM_I_Superv       \
                GEOM_SWIG OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI GEOMBase  \
                GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI     \
                EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI    \
-               RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI             \
+               RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI ImportExportGUI             \
                GEOM_SWIG_WITHIHM GEOM_PY ShapeRecognition
index 848280774076457fd73618142264f1b63e27f8e3..38d27d7bff586f2581d658960e5093756e6f5526 100644 (file)
 #include <sstream>
 #include <iostream>
 #include <ostream>
+#include <list>
+
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_HArray1OfInteger.hxx>
+#include <TColStd_HSequenceOfInteger.hxx>
 using namespace std;
 
 using namespace XAO;
@@ -78,47 +90,161 @@ Geometry::~Geometry()
     delete _myIdsSolids;
 }
 
-Geometry *Geometry::New()
+void Geometry::setShape(TopoDS_Shape Shape)
 {
-  return new Geometry;
+  _myShape = Shape;
+  
+  // intialization of Ids
+  initListIds(TopAbs_VERTEX);
+  initListIds(TopAbs_EDGE);
+  initListIds(TopAbs_FACE);
+  initListIds(TopAbs_SOLID);
 }
 
-void Geometry::initShapeFromBREP(const char * brep )
+void Geometry::setShape(const char * brep )
 {
   istringstream streamBrep(brep);
   BRep_Builder aBuilder;
   BRepTools::Read(_myShape, streamBrep, aBuilder);
+  
+  // intialization of Ids
+  initListIds(TopAbs_VERTEX);
+  initListIds(TopAbs_EDGE);
+  initListIds(TopAbs_FACE);
+  initListIds(TopAbs_SOLID);
 }
 
-const char * Geometry::convertShapeToBREP()
+const char * Geometry::getBREP()
 {
   ostringstream streamShape;
   BRepTools::Write(_myShape, streamShape);
   return streamShape.str().c_str();
 }
 
-void Geometry::setNameVerticesAt(int i, const char *myName)
+void Geometry::setVertexName(int index, const char *myName)
 {
-  if (_myNbVertices == 0 || i > _myNbVertices)
+  if (_myNbVertices == 0 || index > _myNbVertices)
     Standard_TypeMismatch::Raise("Problem with number of vertices");
 
   if (_myNamesVertices == NULL)
     _myNamesVertices = new std::string[_myNbVertices];
     
-  _myNamesVertices[i] = myName;
+  _myNamesVertices[index] = myName;
 }
 
-void Geometry::setNamesVertices(const char **myNames)
+void Geometry::changeVertexName(int id, const char *myName)
 {
+  if (_myNbVertices == 0)
+    Standard_TypeMismatch::Raise("Problem with number of vertices");
+
   if (_myNamesVertices == NULL)
     _myNamesVertices = new std::string[_myNbVertices];
     
-  for (int i = 0;i < _myNbVertices; i++)
-    _myNamesVertices[i] = * myNames[i];
+  int index = findVertex(id);
+  
+  if (index == -1)
+    Standard_TypeMismatch::Raise("Problem with the id of the vertex");
+    
+  _myNamesVertices[index] = myName;
+}
+
+const char * Geometry::findVertexName(int id)
+{
+  if (_myNbVertices == 0) {
+    Standard_TypeMismatch::Raise("Problem with number of vertices");
+    return "";
+  }
+
+  int index = findVertex(id);
+  
+  if (index == -1) {
+    Standard_TypeMismatch::Raise("Problem with the id of the vertex");
+    return "";
+  }
+    
+  return _myNamesVertices[index].c_str();
+}
+
+int Geometry::findVertex(int id)
+{
+  int index = -1;
+  for (int i = 0, n = _myNbVertices; i < n; i++)
+  {
+    if (_myIdsVertices[i] == id)
+      return i;
+  }
+  return index;
 }
 
-void Geometry::initIdsVertices()
+void Geometry::initListIds(const Standard_Integer theShapeType)
 {
-  //TopTools_ListOfShape listShape;
+  std::list<int> aList;
+  
+  TopTools_MapOfShape mapShape;
+  TopTools_ListOfShape listShape;
+  
+  TopExp_Explorer exp (_myShape, TopAbs_ShapeEnum(theShapeType));
+  for (; exp.More(); exp.Next())
+    if (mapShape.Add(exp.Current()))
+      listShape.Append(exp.Current());
+
+  if (listShape.IsEmpty()) {
+    return ;
+  }
+
+  TopTools_IndexedMapOfShape anIndices;
+  TopExp::MapShapes(_myShape, anIndices);
+  Handle(TColStd_HArray1OfInteger) anArray;
+
+  TopTools_ListIteratorOfListOfShape itSub (listShape);
+  for (int index = 1; itSub.More(); itSub.Next(), ++index) {
+    TopoDS_Shape aValue = itSub.Value();
+    aList.push_back(anIndices.FindIndex(aValue));
+  }
+  
+  std::list<int>::iterator it = aList.begin();
+  switch ( theShapeType ) {
+    case TopAbs_VERTEX: /* Fill vertices ids */ 
+    {
+      _myNbVertices = aList.size();
+      if (_myIdsVertices != NULL)
+        delete _myIdsVertices;
+      _myIdsVertices = new int[_myNbVertices];
+      for (int i = 0; it != aList.end(); it++, i++)
+        _myIdsVertices[i] = (*it);
+      break;
+    }
+    case TopAbs_EDGE: /* Fill edges ids */
+    {
+      _myNbEdges = aList.size();
+      if (_myIdsEdges != NULL)
+        delete _myIdsEdges;
+      _myIdsEdges = new int[_myNbEdges];
+      for (int i = 0; it != aList.end(); it++, i++)
+        _myIdsEdges[i] = (*it);
+      break;
+    }
+    case TopAbs_FACE: /* Fill faces ids */
+    {
+      _myNbFaces = aList.size();
+      if (_myIdsFaces != NULL)
+        delete _myIdsFaces;
+      _myIdsFaces = new int[_myNbFaces];
+      for (int i = 0; it != aList.end(); it++, i++)
+        _myIdsFaces[i] = (*it);
+      break;
+    }
+    case TopAbs_SOLID: /* Fill solids ids */
+    {
+      _myNbSolids = aList.size();
+      if (_myIdsSolids != NULL)
+        delete _myIdsSolids;
+      _myIdsSolids = new int[_myNbSolids];
+      for (int i = 0; it != aList.end(); it++, i++)
+        _myIdsSolids[i] = (*it);
+      break;
+    }
+  }
+  
 }
 
index 4923df0fa16b778f7243a7370cd1c249e68478ec..11accc149a11803d09154ebf6f325edab2169e83 100644 (file)
@@ -31,36 +31,35 @@ namespace XAO
   class Geometry
   {
   public:
-    static Geometry *New();
+    Geometry();
+    ~Geometry();
+
     void setName(const char *name) { _myName=name; }
     const char *getName() const { return _myName.c_str(); }
+
     void setFormat(const char *format) { _myFormat=format; }
     const char *getFormat() const { return _myFormat.c_str(); }
     
-    void setShape(TopoDS_Shape &Shape) { _myShape=Shape; }
+    void setShape(TopoDS_Shape Shape);
     TopoDS_Shape getShape() { return _myShape; }
     
-    void initShapeFromBREP(const char * brep );
-    const char * convertShapeToBREP();
+    void setShape(const char * brep );
+    const char * getBREP();
     
-    void setNbVertices(int nb) { _myNbVertices=nb; }
-    int getNbVertices() { return _myNbVertices; }
-    void setNameVerticesAt(int i, const char *myName);
-    void setNamesVertices(const char **myNames);
-    const char *  getNameVerticesAt(int i) { return _myNamesVertices[i].c_str(); } 
-    void initIdsVertices();
-    int * getIdsVertices();
+    int countVertices() { return _myNbVertices; }
+    int findVertex(int id);
+    void setVertexName(int index, const char *myName);
+    const char *  getVertexName(int index) { return _myNamesVertices[index].c_str(); } 
+    void changeVertexName(int id, const char *myName);
+    const char *  findVertexName(int id);
 
-    void setNbEdges(int nb) { _myNbEdges=nb; }
-    int getNbEdges() { return _myNbEdges; }
-    void setNbFaces(int nb) { _myNbFaces=nb; }
-    int getNbFaces() { return _myNbFaces; }
-    void setNbSolids(int nb) { _myNbSolids=nb; }
-    int getNbSolids() { return _myNbSolids; }
+    int countEdges() { return _myNbEdges; }
+    int countFaces() { return _myNbFaces; }
+    int countSolids() { return _myNbSolids; }
+    
 
   private:
-    Geometry();
-    ~Geometry();
+    void initListIds(const Standard_Integer theShapeType);
 
   private:
     TopoDS_Shape        _myShape;
index e5951e3e17c6bb7d1993c84823459f414298b3ec..fbc862ad4675390abab70f67c2ab066dbd1aba44 100644 (file)
@@ -26,17 +26,10 @@ Group::Group()
 {
   _myType = 0;
   _myCount = 0;
-  _myValues = NULL;
 }
 
 Group::~Group()
 {
-  if (_myValues != NULL)
-    delete _myValues;
 }
 
-Group *Group::New()
-{
-  return new Group;
-}
 
index 25d88ba67f4f02182ecd23c6c7d04e4f1f742611..952bd319f4e5193dd99a6c8ba78c4dfa02bbe1ae 100644 (file)
 #define __XAO_GROUP_HXX__
 
 #include <string>
+#include <list>
 
 namespace XAO
 {
   class Group
   {
   public:
-    static Group *New();
+    Group();
+    ~Group();
+
     void setName(const char *name) { _myName=name; }
     const char *getName() const { return _myName.c_str(); }
+
     void setType(int type) { _myType=type; }
     int getType() { return _myType; }
-    void setCount(int nb) { _myCount=nb; }
-    int getCount() { return _myCount; }
+
+    int getCount() { return _myValues.size(); }
+    
+    void addValue(int value) {_myValues.push_back(value);}
+    //int  getValue(int index) { return _myValues[index]; } 
 
   private:
-    Group();
-    ~Group();
+    void sort() {_myValues.sort();}
 
   private:
-    std::string _myName;
-    int         _myType;
-    int         _myCount;
-    int        *_myValues;
+    std::string         _myName;
+    int                 _myType;
+    int                 _myCount;
+    std::list<int>      _myValues;
   };
 }
 
index 0d6e5374b483e34a938a078ffc8ec0c3ac718f4a..eae1a4414ff9716478674214a8442a4d1f407cf2 100644 (file)
@@ -44,15 +44,14 @@ dist_libXAO_la_SOURCES = \
 
 
 libXAO_la_CPPFLAGS = \
-       $(CORBA_CXXFLAGS) \
-       $(CORBA_INCLUDES) \
-       $(KERNEL_CXXFLAGS) \
-       $(GEOM_CXXFLAGS) \
-       $(CAS_CPPFLAGS) \
-       -I$(top_builddir) \
+       $(GEOM_CXXFLAGS)                        \
+       $(CAS_CPPFLAGS)                         \
+       $(LIBXML_INCLUDES)                      \
+       -I$(top_builddir)                       \
        -I$(top_builddir)/idl
 
 libXAO_la_LDFLAGS = \
-       $(CAS_LDPATH) \
+       $(CAS_LDPATH)                           \
+       $(LIBXML_LIBS)                          \
         $(GEOM_LDFLAGS)
 
index dd311aafccbee397988d2206b1601e007a8ab066..179a2b7fdd9d495b41d98379866820232bd59f10 100644 (file)
 #include "Group.hxx"
 #include "Field.hxx"
 
+#include <libxml/xmlmemory.h>
+#include <libxml/parser.h>
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+
+#include <fstream>
+#include <sstream>
+#include <iostream>
+#include <ostream>
+
 using namespace XAO;
 
 Xao::Xao()
 {
   _myAuthor = "Nathalie Gore";
   _myVersion = "1.0";
+  _myGeometry = NULL;
+  _myNbGroups = 0;
 }
 
-Xao::~Xao()
+Xao::Xao(const char *author, const char *version)
 {
+  _myAuthor = author;
+  _myVersion = version;
+  _myGeometry = NULL;
+  _myNbGroups = 0;
 }
 
-Xao *Xao::New()
+
+Xao::~Xao()
 {
-  return new Xao;
+  if (_myGeometry != NULL)
+  {
+    delete _myGeometry;
+    _myGeometry = NULL;
+  }
 }
 
+bool Xao::Export(const char* fileName)
+{
+  if (_myGeometry == NULL)
+    return false;
+    
+  xmlDocPtr master_doc = 0;
+  xmlNodePtr xao_node = 0;
+  
+  //Creating the Xml document
+  master_doc = xmlNewDoc(BAD_CAST "1.0");
+  xao_node = xmlNewNode(0, BAD_CAST "XAO");
+  xmlDocSetRootElement(master_doc,xao_node);
+  
+  xmlNodePtr version_node = xmlNewChild(xao_node,0, BAD_CAST "version", BAD_CAST _myVersion.c_str());
+  xmlNodePtr author_node = xmlNewChild(xao_node,0, BAD_CAST "author", BAD_CAST _myAuthor.c_str());
+  
+  // Geometric part
+  xmlNodePtr geom_node = xmlNewChild(xao_node,0, BAD_CAST "geometry",0);
+  xmlNodePtr name_geom_node = xmlNewChild(geom_node,0, BAD_CAST "name",BAD_CAST _myGeometry->getName());
+  xmlNodePtr format_geom_node = xmlNewChild(geom_node,0, BAD_CAST "name",BAD_CAST _myGeometry->getFormat());
+  xmlNodePtr shape_geom_node = xmlNewChild(geom_node,0, BAD_CAST "shape",BAD_CAST _myGeometry->getBREP());
+  
+  /*xmlNodePtr topo_geom_node = xmlNewChild(geom_node,0, BAD_CAST "topology",0);
+  ostringstream  stream;
+  stream << _myGeometry->countVertices();
+  xmlNodePtr count_topo_geom_node = xmlNewChild(count_topo_geom_node,0, BAD_CAST "topology", BAD_CAST stream.str().c_str());*/
+  
+
+}
 
index 0835e20484ff1c6f9d9483ec04f52aa259bbcb4e..09a695845f9e78b1df72d304021ce0aa20bf1d9c 100644 (file)
 #define __XAO_XAO_HXX__
 
 #include <string>
+#include <list>
 
 namespace XAO
 {
+  enum Kind{
+    VERTEX,
+    EDGE,
+    FACE,
+    SOLID
+  };
+  
   class Geometry;
   class Group;
   class Field;
@@ -32,28 +40,36 @@ namespace XAO
   class Xao
   {
   public:
-    static Xao *New();
+    Xao();
+    Xao(const char *author, const char *version);
+    ~Xao();
+
     void setAuthor(const char *author) { _myAuthor=author; }
     const char *getAuthor() const { return _myAuthor.c_str(); }
+    
     void setVersion(const char *version) { _myVersion=version; }
     const char *getVersion() const { return _myVersion.c_str(); }
-    void setNbGroups(int nb) { _myNbGroups=nb; }
-    int getNbGroups() { return _myNbGroups; }
-    void setNbFields(int nb) { _myNbFields=nb; }
+
+    void setGeometry(Geometry *myGeometry) { _myGeometry=myGeometry; }
+    const Geometry *getGeometry() const { return _myGeometry; }
+
+    int getNbGroups() { return _myGroups.size(); }
+    void addGroup(Group *myGroup) { _myGroups.push_back(myGroup); }
+    void removeGroup(Group *myGroup) { _myGroups.remove(myGroup); }
+
     int getNbFields() { return _myNbFields; }
+    
+    bool Export(const char* fileName);
 
-  private:
-    Xao();
-    ~Xao();
 
   private:
-    Geometry    *_myGeom;
-    int          _myNbGroups;
-    Group       *_myGroups;
-    int          _myNbFields;
-    Field       *_myFields;
-    std::string  _myAuthor;
-    std::string  _myVersion;
+    std::string                  _myAuthor;
+    std::string                  _myVersion;
+    Geometry                    *_myGeometry;
+    int                          _myNbGroups;
+    std::list<Group *>           _myGroups;
+    int                          _myNbFields;
+    //std::list<Field *>           _myFields;
   };
 }
 
diff --git a/src/XAOExport/Makefile.am b/src/XAOExport/Makefile.am
deleted file mode 100644 (file)
index 581a7c8..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright (C) 2007-2012  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
-# 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
-#
-
-#  File   : Makefile.in
-#  Author : Nathalie Gore
-#  Modified by : Nathalie Gore (OCN) - autotools usage
-#  Module : GEOM
-#  $Header: /home/server/cvs/GEOM/GEOM_SRC/src/XAOExport/Makefile.am,v 1.4 2012-08-09 07:43:00 vsr Exp $
-#
-include $(top_srcdir)/adm_local/unix/make_common_starter.am
-
-# Libraries targets
-lib_LTLIBRARIES = libXAOExport.la
-
-# Sources files
-dist_libXAOExport_la_SOURCES = \
-       XAOExport.cxx
-
-# additional information to compile and link file
-
-libXAOExport_la_CPPFLAGS =                     \
-       $(CORBA_CXXFLAGS)                       \
-       $(CORBA_INCLUDES)                       \
-       $(QT_INCLUDES)                          \
-       $(LIBXML_INCLUDES)                      \
-       $(CAS_CPPFLAGS)                         \
-       $(GUI_CXXFLAGS)                         \
-       $(KERNEL_CXXFLAGS)                      \
-       $(BOOST_CPPFLAGS)                       \
-       -I$(srcdir)/../GEOMBase                 \
-       -I$(srcdir)/../GEOMClient               \
-       -I$(srcdir)/../OBJECT                   \
-       -I$(srcdir)/../GEOMImpl                 \
-       -I$(srcdir)/../GEOM                     \
-       -I$(srcdir)/../GEOMGUI                  \
-       -I$(srcdir)/../GEOMAlgo                 \
-       -I$(top_builddir)/idl
-
-libXAOExport_la_LDFLAGS  =                     \
-       $(LIBXML_LIBS)                          \
-       $(KERNEL_LDFLAGS) -lSALOMELocalTrace    \
-       $(GUI_LDFLAGS) -lsuit -lSalomeApp -lSVTK                \
-       ../GEOMBase/libGEOMBase.la              \
-       ../GEOMGUI/libGEOM.la                   \
-       ../GEOMImpl/libGEOMimpl.la                      \
-       ../GEOMAlgo/libGEOMAlgo.la                      \
-       ../../idl/libSalomeIDLGEOM.la           \
-       $(STDLIB)                               \
-       $(CAS_LDPATH) -lTKBRep
diff --git a/src/XAOExport/XAOExport.cxx b/src/XAOExport/XAOExport.cxx
deleted file mode 100644 (file)
index 777cf4c..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-// Copyright (C) 2007-2012  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
-//
-// 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
-//
-
-// File:        XAOExport.cxx
-// Created:     Thu Dec 04 08:00:00 2012
-// Author:      Nathalie Gore
-//              <nathalie.gore@opencascade.com>
-//
-#include "utilities.h"
-
-#include <BRepTools.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopAbs_ShapeEnum.hxx>
-
-#include <fstream>
-#include <sstream>
-#include <iostream>
-#include <ostream>
-using namespace std;
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-
-#include <SUIT_Desktop.h>
-#include <SUIT_Session.h>
-#include <SUIT_MessageBox.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_ViewManager.h>
-#include <SUIT_OverrideCursor.h>
-#include <SalomeApp_Application.h>
-#include <SalomeApp_Study.h>
-#include <LightApp_Application.h>
-#include <LightApp_SelectionMgr.h>
-
-#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
-
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
-#include <GEOMBase_Helper.h>
-#include <GEOMBase_Skeleton.h>
-#include <GEOMImpl_Types.hxx>
-
-#include <GEOM_Engine.hxx>
-
-#include <GEOMImpl_Gen.hxx>
-#include <GEOMImpl_IShapesOperations.hxx>
-
-#ifdef WNT
- #if defined XAOEXPORT_EXPORTS || defined XAOExport_EXPORTS
-  #if defined WIN32
-   #define XAOEXPORT_EXPORT __declspec( dllexport )
-  #else
-   #define XAOEXPORT_EXPORT
-  #endif
- #else
-  #if defined WIN32
-   #define XAOEXPORT_EXPORT __declspec( dllimport )
-  #else
-   #define XAOEXPORT_EXPORT
-  #endif
- #endif
-#else
- #define XAOEXPORT_EXPORT
-#endif
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
-XAOEXPORT_EXPORT
-  int Export(const TopoDS_Shape& theShape, const TCollection_AsciiString& theFileName)
-  {
-    MESSAGE("Export XAO into file " << theFileName.ToCString());
-    SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
-    if (!app) 
-      return 0;
-    
-    //SalomeApp_Study* anActiveStudy = ( SalomeApp_Study* ) app->activeStudy();
-    SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
-    if (!anActiveStudy) 
-      return 0;
-
-    LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
-    if (!aSelMgr) 
-      return 0;
-  
-    // get selection
-    SALOME_ListIO aList;
-    aSelMgr->selectedObjects(aList, "ObjectBrowser", false);
-    SALOME_ListIteratorOfListIO It (aList);
-  
-    SUIT_OverrideCursor();
-
-    QString nameShape;
-    GEOM::ListOfLong_var aSubShapesId;
-    for (; It.More(); It.Next()) 
-    {
-      Handle(SALOME_InteractiveObject) anIObject = It.Value();
-      if (anIObject->hasEntry()) 
-      {
-       _PTR(SObject) SO (anActiveStudy->studyDS()->FindObjectID(anIObject->getEntry()));
-         if (!SO)
-           return 0;
-         GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(SO));
-         if (CORBA::is_nil(anObj)) 
-           return 0;
-         //nameShape = GEOMBase::GetName( anObj.get() );
-         nameShape = anObj->GetName();
-          
-         GEOM::GEOM_IShapesOperations_var aShOp = GeometryGUI::GetGeomGen()->GetIShapesOperations(anObj->GetStudyID());
-          aSubShapesId = aShOp->SubShapeAllIDs(anObj, TopAbs_VERTEX, false);
-      }
-    }
-
-
-    ostringstream  streamShape;
-    BRepTools::Write(theShape, streamShape);
-
-    xmlDocPtr master_doc = 0;
-    xmlNodePtr geometry_node = 0;
-  
-    //Creating the Xml document
-    master_doc = xmlNewDoc(BAD_CAST "1.0");
-    geometry_node = xmlNewNode(0, BAD_CAST "geometry");
-    xmlDocSetRootElement(master_doc,geometry_node);
-  
-    // Creating child nodes
-    xmlNodePtr version_geom_node = xmlNewChild(geometry_node, 0, BAD_CAST "version",BAD_CAST "1.0");
-    xmlNodePtr name_geom_node = xmlNewChild(geometry_node, 0, BAD_CAST "name",BAD_CAST nameShape.toStdString().c_str());
-    xmlNodePtr format_geom_node = xmlNewChild(geometry_node, 0, BAD_CAST "format",BAD_CAST "BREP");
-    xmlNodePtr shape_geom_node = xmlNewChild(geometry_node, 0, BAD_CAST "shape",BAD_CAST streamShape.str().c_str());
-    xmlNodePtr topo_geom_node = xmlNewChild(geometry_node, 0, BAD_CAST "shape",BAD_CAST streamShape.str().c_str());
-    
-    // Topomogy description
-    xmlNodePtr vertices_topo_geom_node = xmlNewChild(topo_geom_node,0, BAD_CAST "vertices",0);
-    xmlNodePtr count_vertices_topo_geom_node = xmlNewChild(vertices_topo_geom_node,0, BAD_CAST "count",BAD_CAST "12");
-    
-    //std::string myfile(theFileName);
-    xmlSaveFormatFileEnc(theFileName.ToCString(), master_doc, "UTF-8", 1);
-    
-    xmlFreeDoc(master_doc);
-    
-    xmlCleanupParser();
-    return 1;
-  }
-}
diff --git a/src/XAOImport/Makefile.am b/src/XAOImport/Makefile.am
deleted file mode 100644 (file)
index 9948b3d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2007-2012  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
-# 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
-#
-
-#  File   : Makefile.in
-#  Author : Nathalie Gore
-#  Modified by : Nathalie Gore (OCN) - autotools usage
-#  Module : GEOM
-#  $Header: /home/server/cvs/GEOM/GEOM_SRC/src/XAOImport/Makefile.am,v 1.4 2012-08-09 07:43:02 vsr Exp $
-#
-include $(top_srcdir)/adm_local/unix/make_common_starter.am
-
-# Libraries targets
-lib_LTLIBRARIES = libXAOImport.la
-
-# Sources files
-dist_libXAOImport_la_SOURCES = \
-       XAOImport.cxx
-
-# additional information to compile and link file
-
-libXAOImport_la_CPPFLAGS =     \
-       $(LIBXML_INCLUDES)      \
-       $(KERNEL_CXXFLAGS)      \
-       $(CAS_CPPFLAGS)
-
-libXAOImport_la_LDFLAGS  =                     \
-       $(LIBXML_LIBS)                          \
-       $(KERNEL_LDFLAGS) -lSALOMELocalTrace    \
-       $(CAS_LDPATH) -lTKBRep                  \
-       $(STDLIB)
diff --git a/src/XAOImport/XAOImport.cxx b/src/XAOImport/XAOImport.cxx
deleted file mode 100644 (file)
index 4ae50c0..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (C) 2007-2012  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
-//
-// 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
-//
-
-// File:        XAOImport.cxx
-// Created:     Thu Dec 04 08:00:00 2012
-// Author:      Nathalie Gore
-//              <nathalie.gore@opencascade.com>
-//
-#include "utilities.h"
-
-#include <BRepTools.hxx>
-#include <BRep_Builder.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TDF_Label.hxx>
-
-#include <fstream>
-#include <sstream>
-#include <iostream>
-#include <string>
-using namespace std;
-
-
-#ifdef WNT
- #if defined XAOIMPORT_EXPORTS || defined XAOImport_EXPORTS
-  #if defined WIN32
-   #define XAOIMPORT_EXPORT __declspec( dllexport )
-  #else
-   #define XAOIMPORT_EXPORT
-  #endif
- #else
-  #if defined WIN32
-   #define XAOIMPORT_EXPORT __declspec( dllimport )
-  #else
-   #define XAOIMPORT_EXPORT
-  #endif
- #endif
-#else
- #define XAOIMPORT_EXPORT
-#endif
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
-XAOIMPORT_EXPORT
-  TopoDS_Shape Import (const TCollection_AsciiString& theFileName,
-                       const TCollection_AsciiString& /*theFormatName*/,
-                       TCollection_AsciiString&       theError,
-                       const TDF_Label&)
-  {
-    MESSAGE("Import XAO from file " << theFileName);
-    
-    // Read file
-    ifstream is;
-    is.open (theFileName.ToCString(), ios::binary );
-
-    // ***** get length of file:
-    is.seekg (0, std::ios::end);
-    long length = is.tellg();
-    is.seekg (0, std::ios::beg);
-
-    // ***** allocate memory:
-    char *buffer = new char [length];
-
-    // ***** read data as a block:
-    is.read (buffer,length);
-
-    // ***** create string stream of memory contents
-    // NOTE: this ends up copying the buffer!!!
-    istringstream streamBrep( buffer );
-
-    // ***** delete temporary buffer
-    delete [] buffer;
-
-    // ***** close filestream
-    is.close();
-    
-    // Import file
-    TopoDS_Shape aShape;
-    BRep_Builder B;
-    BRepTools::Read(aShape, streamBrep, B);
-    if (aShape.IsNull()) {
-      theError = "XAO Import failed";
-    }
-    return aShape;
-  }
-}