Salome HOME
Copyright update 2022
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI_DocumentModel.hxx
old mode 100755 (executable)
new mode 100644 (file)
index add5d19..4c43f4a
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2022  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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,6 +20,7 @@
 #ifndef _HEXABLOCKGUI_DOCUMENTMODEL_HXX_
 #define _HEXABLOCKGUI_DOCUMENTMODEL_HXX_
 
+#include "HEXABLOCKGUI_Export.hxx"
 
 #include <QTemporaryFile>
 #include <QStandardItemModel>
@@ -35,7 +36,7 @@ namespace HEXABLOCK
 {
   namespace GUI
   {
-    class DocumentModel : public QStandardItemModel
+    class HEXABLOCK_EXPORT DocumentModel : public QStandardItemModel
     {
       Q_OBJECT
     public:
@@ -73,16 +74,20 @@ namespace HEXABLOCK
       void refresh(); //refresh data
       bool isEmpty() const;
 
+      double getLength(const QModelIndex& iEdge);
+      double getRadius(const QModelIndex& iEdge);
+      double getAngle(const QModelIndex& iEdge);
+
       void clearAll();
       void clearData();
-      void clearBuilder();
+//      void clearBuilder();
       void clearGeometry();
       void clearAssociation();
       void clearGroups();
       void clearMesh();
 
       void fillData();
-      void fillBuilder();
+//      void fillBuilder();
       void fillGeometry();
       void fillAssociation();
       void fillGroups();
@@ -202,7 +207,7 @@ namespace HEXABLOCK
       QModelIndex makeCartesianUni(const QModelIndex& icenter, const QModelIndex& ibase, const QModelIndex& ivec,
                                    const QModelIndex& iaxis, double lx, double ly, double lz, int nx, int ny, int nz);
       QModelIndex makeCartesian(const QModelIndex& icenter, const QModelIndex& ibase, const QModelIndex& ivec,
-                                const QModelIndex& iaxis, vector<double>& radius, vector<double>& angles, vector<double>& heights);
+                                const QModelIndex& iaxis, std::vector<double>& radius, std::vector<double>& angles, std::vector<double>& heights);
 
       // ====== SPHERE
 
@@ -216,7 +221,7 @@ namespace HEXABLOCK
 
       QModelIndex makeSphere    (QModelIndex& icenter,
                                  QModelIndex& ivec_x, QModelIndex& ivec_z,
-                                 vector<double>& tray, vector<double>& tang, vector<double>& thaut);
+                                 std::vector<double>& tray, std::vector<double>& tang, std::vector<double>& thaut);
 
       // ====== SPHERICAL
 
@@ -229,7 +234,7 @@ namespace HEXABLOCK
 
       QModelIndex makeSpherical    (QModelIndex& icenter,
                                     QModelIndex& ivec_x, QModelIndex& ivec_z,
-                                    vector<double>& rayon,
+                                    std::vector<double>& rayon,
                                     int crit);
 
       // =========== RIND
@@ -243,7 +248,7 @@ namespace HEXABLOCK
 
       QModelIndex makeRind   (QModelIndex& icenter,
                               QModelIndex& ivec_x, QModelIndex& ivec_z,
-                              vector<double>& tray, vector<double>& tang, vector<double>& thaut);
+                              std::vector<double>& tray, std::vector<double>& tang, std::vector<double>& thaut);
 
       // ======== Cylinder
       QModelIndex makeCylinderTop(int nr, int na, int nh);
@@ -253,7 +258,7 @@ namespace HEXABLOCK
                                    int nr, int na, int nh);
 
       QModelIndex makeCylinder   (QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz,
-                                  vector<double>& tray, vector<double>& tang, vector<double>& thaut);
+                                  std::vector<double>& tray, std::vector<double>& tang, std::vector<double>& thaut);
 
       // ======== Cylinders
       QModelIndex makeCylinders  (QModelIndex& iorig1, QModelIndex& ivecz1,  double r1, double h1,
@@ -267,7 +272,7 @@ namespace HEXABLOCK
                                int nr, int na, int nh);
 
       QModelIndex makePipe    (QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz,
-                               vector<double>& tray, vector<double>& tang, vector<double>& thaut);
+                               std::vector<double>& tray, std::vector<double>& tang, std::vector<double>& thaut);
 
       // ======== Pipes
       QModelIndex makePipes  (QModelIndex& iorig1, QModelIndex& ivecz1, double rint1, double rex1, double h1,
@@ -278,39 +283,39 @@ namespace HEXABLOCK
                               QModelIndex& iv3, QModelIndex& iv4, int nb);
 
       QModelIndex joinQuad   (QModelIndex&  istart, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1,
-                              QModelIndex& iva2, QModelIndex& ivb2, vector<double>& tlen);
+                              QModelIndex& iva2, QModelIndex& ivb2, std::vector<double>& tlen);
 
       QModelIndex joinQuadsUni (QModelIndexList& istarts, QModelIndex& idest, QModelIndex& iv1, QModelIndex& iv2,
                                 QModelIndex& iv3, QModelIndex& iv4, int nb);
 
       QModelIndex joinQuads    (QModelIndexList& istarts, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1,
-                                QModelIndex& iva2, QModelIndex& ivb2, vector<double>& tlen);
+                                QModelIndex& iva2, QModelIndex& ivb2, std::vector<double>& tlen);
 
       // ======== Quad Revolution
       QModelIndex revolutionQuadUni(QModelIndex& istart, QModelIndex& icenter, QModelIndex& iaxis,
                                     double angle, int nbre);
 
       QModelIndex revolutionQuad(QModelIndex& istart, QModelIndex& icenter, QModelIndex& iaxis,
-                                 vector<double>& angles);
+                                 std::vector<double>& angles);
 
       QModelIndex revolutionQuadsUni(QModelIndexList& istarts, QModelIndex& icenter, QModelIndex& iaxis,
                                      double angle, int nbre);
 
       QModelIndex revolutionQuads(QModelIndexList& istarts, QModelIndex& icenter, QModelIndex& iaxis,
-                                  vector<double>& angles);
+                                  std::vector<double>& angles);
 
       // ==== PrismQuad or ExtrudeQuad
       QModelIndex extrudeQuadTop (QModelIndex& istart, int nbre);
       QModelIndex extrudeQuadUni (QModelIndex& istart, QModelIndex& dv, double len, int nbre);
-      QModelIndex extrudeQuad    (QModelIndex& istart, QModelIndex& dv, vector<double>& tlen);
+      QModelIndex extrudeQuad    (QModelIndex& istart, QModelIndex& dv, std::vector<double>& tlen);
 
       QModelIndex extrudeQuadsTop (QModelIndexList& istarts, int nbre);
       QModelIndex extrudeQuadsUni (QModelIndexList& istarts, QModelIndex& axis, double len, int nbre);
-      QModelIndex extrudeQuads    (QModelIndexList& istarts, QModelIndex& iaxis, vector<double>& tlen);
+      QModelIndex extrudeQuads    (QModelIndexList& istarts, QModelIndex& iaxis, std::vector<double>& tlen);
 
       // ==== Cut Edge
       QModelIndex cutUni     (QModelIndex& iEdge, int nbre);
-      QModelIndex cut        (QModelIndex& iEdge, vector<double>& tlen);
+      QModelIndex cut        (QModelIndex& iEdge, std::vector<double>& tlen);
 
       // ============================== END NEW ================================
 
@@ -361,10 +366,9 @@ namespace HEXABLOCK
       bool performSymmetryLine( const QModelIndex& elts, const QModelIndex& v, const QModelIndex& vec );
       bool performSymmetryPlane( const QModelIndex& elts, const QModelIndex& v, const QModelIndex& vec );
 
-      QModelIndex replace( const QModelIndexList& quadsPattern,
-          const QModelIndex& p1, const QModelIndex& c1,
-          const QModelIndex& p2, const QModelIndex& c2,
-          const QModelIndex& p3, const QModelIndex& c3 ); //NEW HEXA3
+      QModelIndex replace( const QModelIndexList& iquads_source, const QModelIndexList& iquads_dest,
+                           const QModelIndex& ip1_source, const QModelIndex& ic1_dest,
+                           const QModelIndex& ip2_source, const QModelIndex& ic2_dest);
 
 
       // ************  ASSOCIATION ************
@@ -479,7 +483,6 @@ namespace HEXABLOCK
       QStandardItem     *_lawDirItem;
       QStandardItem     *_propagationDirItem;
 
-
       Qt::ItemFlags     _vertexItemFlags;
       Qt::ItemFlags     _edgeItemFlags;
       Qt::ItemFlags     _quadItemFlags;
@@ -492,7 +495,6 @@ namespace HEXABLOCK
       Qt::ItemFlags     _groupItemFlags;
       Qt::ItemFlags     _lawItemFlags;
       Qt::ItemFlags     _propagationItemFlags;
-
     };
 
 
@@ -512,16 +514,16 @@ namespace HEXABLOCK
     };
 
 
-    class  PatternBuilderModel : public QSortFilterProxyModel
-    {
-    public:
-      PatternBuilderModel( QObject * parent = 0 );
-      virtual ~PatternBuilderModel();
-
-      virtual Qt::ItemFlags flags(const QModelIndex &index) const;
-      virtual QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
-      QStandardItem * itemFromIndex ( const QModelIndex & index ) const;
-    };
+//    class  PatternBuilderModel : public QSortFilterProxyModel
+//    {
+//    public:
+//      PatternBuilderModel( QObject * parent = 0 );
+//      virtual ~PatternBuilderModel();
+//
+//      virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+//      virtual QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
+//      QStandardItem * itemFromIndex ( const QModelIndex & index ) const;
+//    };
 
     class PatternGeomModel : public QSortFilterProxyModel
     {