#if !defined(__HEXABLOCK_VERSION_H__)
#define __HEXABLOCK_VERSION_H__
-/*!
- Specify version of SALOME HEXABLOCK module, as follows
-
- HEXABLOCK_VERSION_MAJOR : (integer) number identifying major version
- HEXABLOCK_VERSION_MINOR : (integer) number identifying minor version
- HEXABLOCK_VERSION_MAINTENANCE : (integer) number identifying maintenance version
- HEXABLOCK_VERSION_STR : (string) complete version number "major.minor.maintenance"
- HEXABLOCK_VERSION : (hex) complete version number (major << 16) + (minor << 8) + maintenance
- HEXABLOCK_DEVELOPMENT : (integer) indicates development version when set to 1
+/*
+ HEXABLOCK_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define HEXABLOCK_VERSION_MAJOR @SALOMEHEXABLOCK_MAJOR_VERSION@
-#define HEXABLOCK_VERSION_MINOR @SALOMEHEXABLOCK_MINOR_VERSION@
-#define HEXABLOCK_VERSION_MAINTENANCE @SALOMEHEXABLOCK_PATCH_VERSION@
-#define HEXABLOCK_VERSION_STR "@SALOMEHEXABLOCK_VERSION@"
-#define HEXABLOCK_VERSION @SALOMEHEXABLOCK_XVERSION@
-#define HEXABLOCK_DEVELOPMENT @SALOMEHEXABLOCK_VERSION_DEV@
+#define HEXABLOCK_VERSION_STR "@VERSION@"
+#define HEXABLOCK_VERSION @XVERSION@
+#define HEXABLOCK_DEVELOPMENT @VERSION_DEV@
#endif // __HEXABLOCK_VERSION_H__
#ifndef __HEX_H
#define __HEX_H
-#include "Hex_defines.hxx"
-
#include "hexa_base.hxx"
#if defined WIN32
BEGIN_NAMESPACE_HEXA
-class Hex;
-HEXABLOCKENGINE_EXPORT Hex* hex_instance ();
+HexaExport Hex* hex_instance ();
-class HEXABLOCKENGINE_EXPORT Hex
+class HexaExport Hex
{
public:
static Hex* getInstance ();
#endif // not SWIG
};
-HEXABLOCKENGINE_EXPORT void what ();
+HexaExport void what ();
END_NAMESPACE_HEXA
#endif
#ifndef __ANA_QUADS_H
#define __ANA_QUADS_H
-#include "Hex_defines.hxx"
#include "HexQuad.hxx"
// #include "HexEdge.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT AnaQuads
+class HexaExport AnaQuads
{
public:
AnaQuads (Quad* q1, Quad* q2, Quad* q3=NULL, Quad* q4=NULL, Quad* q5=NULL);
#ifndef __ASSO_EDGE_H_
#define __ASSO_EDGE_H_
-#include "Hex_defines.hxx"
#include "HexEdgeShape.hxx"
#include <TopTools_IndexedMapOfShape.hxx>
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT AssoEdge
+class HexaExport AssoEdge
{
public :
AssoEdge (EdgeShape* shape, double deb, double fin);
#ifndef __BI_CYLINDER_H_
#define __BI_CYLINDER_H_
-#include "Hex_defines.hxx"
-
#include "HexElements.hxx"
#include <map>
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT BiCylinder : public Elements
+class HexaExport BiCylinder : public Elements
{
public:
BiCylinder (Document* doc);
#ifndef __BI_CYLINDER_SHAPE_HXX_
#define __BI_CYLINDER_SHAPE_HXX_
-#include "Hex_defines.hxx"
#include "HexGlobale.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT BiCylinderShape
+class HexaExport BiCylinderShape
{
public :
BiCylinderShape (Document* doc);
#ifndef __CLONER_H
#define __CLONER_H
-#include "Hex_defines.hxx"
#include "hexa_base.hxx"
#include <map>
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Cloner
+class HexaExport Cloner
{
public:
Cloner (Matrix* mat);
#ifndef __CRAMER_H_
#define __CRAMER_H_
-#include "Hex_defines.hxx"
#include "hexa_base.hxx"
// #include <cmath>
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Cramer
+class HexaExport Cramer
{
public:
Cramer (int size);
+++ /dev/null
-
-// C++ : Gestion des cylindres croises
-
-// Copyright (C) 2009-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
-
-#include "HexCrossElements.hxx"
-
-#include "HexDocument.hxx"
-#include "HexVector.hxx"
-#include "HexVertex.hxx"
-#include "HexHexa.hxx"
-#include "HexEdge.hxx"
-
-#include "HexGlobale.hxx"
-#include "HexCylinder.hxx"
-#include "HexNewShape.hxx"
-
-#include <stdlib.h>
-
-static bool db = false;
-
-static const double UnSur2pi = DEMI/M_PI;
-
-BEGIN_NAMESPACE_HEXA
-
-// ====================================================== Constructeur
-CrossElements::CrossElements (Document* doc, EnumGrid type)
- : Elements (doc)
-{
- cross_cyl1 = NULL;
- cross_cyl1 = NULL;
- cross_cyl2 = NULL;
- cross_center = NULL;
- grid_type = type;
- angle_intermed = angle_inter [CylSmall] = angle_inter [CylBig] = 0;
- at_right = at_left = true;
- is_filled = false;
- grid_geom = NULL;
-}
-// ====================================================== resize
-void CrossElements::resize ()
-{
- size_hx = 2;
- size_hy = S_MAXI;
- size_hz [CylSmall] = size_h1z;
- size_hz [CylBig] = size_h2z;
-
- size_vx = size_hx + 1;
- size_vy = size_hy;
- size_vz[CylSmall] = size_v1z;
- size_vz[CylBig] = size_v2z;
-
- nbr_vertex1 = size_vx*size_vy* size_v1z;
- nbr_quads1 = nbr_vertex1*DIM3;
- nbr_edges1 = nbr_quads1;
- nbr_hexas1 = size_hx * size_hy * size_h1z;
-
- nbr_vertex = nbr_vertex1 + size_vx * size_vy * size_v1z;
- nbr_quads = nbr_vertex*DIM3;
- nbr_edges = nbr_quads;
- nbr_hexas = nbr_hexas1 + size_hx * size_hy * size_h2z;
-
- tab_hexa .resize (nbr_hexas*2);
- tab_quad .resize (nbr_quads*2);
- tab_edge .resize (nbr_edges*2);
- tab_vertex.resize (nbr_vertex*2);
-
- for (int nc=0 ; nc< nbr_hexas ; nc++) tab_hexa [nc] = NULL;
- for (int nc=0 ; nc< nbr_quads ; nc++) tab_quad [nc] = NULL;
- for (int nc=0 ; nc< nbr_edges ; nc++) tab_edge [nc] = NULL;
- for (int nc=0 ; nc< nbr_vertex ; nc++) tab_vertex [nc] = NULL;
-}
-// ====================================================== indHexa
-int CrossElements::indHexa (int cyl, int nx, int ny, int nz)
-{
- if (cyl<0 || cyl>1)
- return NOTHING;
- if ( nx < 0 || nx >= size_hx || ny < 0 || ny >= size_hy
- || nz < 0 || nz >= size_hz[cyl]) return NOTHING;
-
- int nro = cyl*nbr_hexas1 + nx + size_hx*ny + size_hx*size_hy*nz;
- return nro;
-}
-// ====================================================== indQuad
-int CrossElements::indQuad (int cyl, int dd, int nx, int ny, int nz)
-{
- if (cyl<0 || cyl>1 || dd <0 || dd >= DIM3)
- return NOTHING;
- if ( nx < 0 || nx >= size_vx || ny < 0 || ny >= size_vy
- || nz < 0 || nz >= size_vz[cyl]) return NOTHING;
-
- int nro = cyl*nbr_quads1 + nx + size_vx*ny + size_vx*size_vy*nz
- + size_vx*size_vy*size_vz[cyl]*dd;
- return nro;
-}
-// ====================================================== indEdge
-int CrossElements::indEdge (int cyl, int dd, int nx, int ny, int nz)
-{
- return indQuad (cyl, dd, nx, ny, nz);
-}
-// ====================================================== indVertex
-int CrossElements::indVertex (int cyl, int nx, int ny, int nz)
-{
- if (cyl<0 || cyl>1)
- return NOTHING;
- if ( nx < 0 || nx >= size_vx || ny < 0 || ny >= size_vy
- || nz < 0 || nz >= size_vz[cyl])
- return NOTHING;
-
- int nro = cyl*nbr_vertex1 + nx + size_vx*ny + size_vx*size_vy*nz;
- return nro;
-}
-// ------------------------------------------------------------------------
-// ====================================================== getHexaIJK
-Hexa* CrossElements::getHexaIJK (int cyl, int nx, int ny, int nz)
-{
- int nro = indHexa (cyl, nx, ny, nz);
-
- if (nro >= 0 && tab_hexa[nro]!= NULL && tab_hexa[nro]->isHere ())
- return tab_hexa [nro];
- else
- return NULL;
-}
-// ====================================================== getQuadIJ
-Quad* CrossElements::getQuadIJ (int cyl, int nx, int ny, int nz)
-{
- int nro = indQuad (cyl, dir_z, nx, ny, nz);
- if (nro<0)
- return NULL;
-
- return tab_quad [nro];
-}
-// ====================================================== getQuadJK
-Quad* CrossElements::getQuadJK (int cyl, int nx, int ny, int nz)
-{
- int nro = indQuad (cyl, dir_x, nx, ny, nz);
- if (nro<0)
- return NULL;
- return tab_quad [nro];
-}
-// ====================================================== getQuadIK
-Quad* CrossElements::getQuadIK (int cyl, int nx, int ny, int nz)
-{
- int nro = indQuad (cyl, dir_y, nx, ny, nz);
- if (nro<0)
- return NULL;
- return tab_quad [nro];
-}
-// ====================================================== getEdgeI
-Edge* CrossElements::getEdgeI (int cyl, int nx, int ny, int nz)
-{
- int nro = indEdge (cyl, dir_x, nx, ny, nz);
- if (nro<0)
- return NULL;
- return tab_edge [nro];
-}
-// ====================================================== getEdgeJ
-Edge* CrossElements::getEdgeJ (int cyl, int nx, int ny, int nz)
-{
- int nro = indEdge (cyl, dir_y, nx, ny, nz);
- if (nro<0)
- return NULL;
- return tab_edge [nro];
-}
-// ====================================================== getEdgeK
-Edge* CrossElements::getEdgeK (int cyl, int nx, int ny, int nz)
-{
- int nro = indEdge (cyl, dir_z, nx, ny, nz);
- if (nro<0)
- return NULL;
- return tab_edge [nro];
-}
-// ====================================================== getVertexIJK
-Vertex* CrossElements::getVertexIJK (int cyl, int nx, int ny, int nz)
-{
- int nro = indVertex (cyl, nx, ny, nz);
- if (nro<0)
- return NULL;
- return tab_vertex [nro];
-}
-// ------------------------------------------------------------------------
-// ====================================================== setHexa
-void CrossElements::setHexa (Hexa* elt, int cyl, int nx, int ny, int nz)
-{
- if (db)
- {
- printf ("tab_hexa [%d, %d,%d,%d] = ", cyl, nx, ny, nz);
- PrintName (elt);
- printf ("\n");
- }
-
- int nro = indHexa (cyl, nx, ny, nz);
- if (nro<0)
- return;
- tab_hexa [nro] = elt;
-}
-// ====================================================== setQuad
-void CrossElements::setQuad (Quad* elt, int cyl, int dd, int nx, int ny, int nz)
-{
- if (db)
- {
- printf ("tab_quad [%d,%d, %d,%d,%d] = ", cyl, dd, nx, ny, nz);
- PrintName (elt);
- printf ("\n");
- }
-
- int nro = indQuad (cyl, dd, nx, ny, nz);
- if (nro<0)
- return;
- tab_quad [nro] = elt;
-}
-// ====================================================== setEdge
-void CrossElements::setEdge (Edge* elt, int cyl, int dd, int nx, int ny, int nz)
-{
- if (db)
- {
- printf ("tab_edge [%d,%d, %d,%d,%d] = ", cyl, dd, nx, ny, nz);
- PrintName (elt);
- printf ("\n");
- }
-
- int nro = indEdge (cyl, dd, nx, ny, nz);
- if (nro<0)
- return;
- tab_edge [nro] = elt;
-}
-// ====================================================== setVertex
-void CrossElements::setVertex (Vertex* elt, int cyl, int nx, int ny, int nz)
-{
- if (db)
- {
- printf ("tab_vertex [%d, %d,%d,%d] = ", cyl, nx, ny, nz);
- PrintName (elt);
- printf ("\n");
- }
-
- int nro = indVertex (cyl, nx, ny, nz);
- if (nro<0)
- return;
- tab_vertex [nro] = elt;
-}
-// ====================================================== setVertex (2)
-inline bool isequals (double v1, double v2)
-{
- const double eps = 0.01;
- bool equals = v1 <= v2 + eps && v1 >= v2 - eps;
- return equals;
-}
-// ====================================================== setVertex (2)
-void CrossElements::setVertex (int cyl, int nx, int ny, int nz, double px,
- double py, double pz)
-{
- if (isequals (px, 0) && isequals (py, -1.5) && isequals (pz, 5))
- printf (" Vertex trouve : Cyl%d [%d,%d,%d] = (%g,%g,%g)\n",
- cyl, nx,ny,nz, px,py,pz);
-
- int nro = indVertex (cyl, nx, ny, nz);
- if (nro<0)
- return;
- else if (tab_vertex[nro] != NULL)
- {
- Vertex* node = tab_vertex[nro];
- if (node->definedBy (px, py, pz))
- return;
-
- printf (" ************ ATTENTION ****************\n");
- printf (" Creation d'un vertex : Cyl%d [%d,%d,%d] = (%g,%g,%g)\n",
- cyl, nx,ny,nz, px,py,pz);
- printf (" Indice %d deja occupe par le vertex (%g,%g,%g)\n", nro,
- node->getX(), node->getY(), node->getZ());
-
- return;
- }
-
- int trouve = findVertex (px, py, pz);
- if (trouve>=0)
- {
- printf (" Creation d'un vertex : Cyl%d [%d,%d,%d] = (%g,%g,%g)\n",
- cyl, nx,ny,nz, px,py,pz);
- printf (" Vertex %d present a l'indice %d\n", nro, trouve);
- tab_vertex [nro] = tab_vertex [trouve];
- return;
- }
- Vertex* node = el_root->addVertex (px, py, pz);
- setVertex (node, cyl, nx, ny, nz);
-}
-// ====================================================== copyEdge
-void CrossElements::copyEdge (int d1, int i1, int j1, int k1, int d2, int i2,
- int j2, int k2)
-{
- Edge* edge = NULL;
- switch (d1)
- {
- case dir_x : edge = getEdgeI (CylSmall, i1, j1, k1);
- break;
- case dir_y : edge = getEdgeJ (CylSmall, i1, j1, k1);
- break;
- case dir_z : edge = getEdgeK (CylSmall, i1, j1, k1);
- break;
- }
-
- setEdge (edge, CylBig, d2, i2, j2, k2);
-}
-// ====================================================== copyQuad
-void CrossElements::copyQuad (int d1, int i1, int j1, int k1, int d2, int i2,
- int j2, int k2)
-{
- Quad* quad = NULL;
- switch (d1)
- {
- case dir_x : quad = getQuadJK (CylSmall, i1, j1, k1);
- break;
- case dir_y : quad = getQuadIK (CylSmall, i1, j1, k1);
- break;
- case dir_z : quad = getQuadIJ (CylSmall, i1, j1, k1);
- break;
- }
-
- setQuad (quad, CylBig, d2, i2, j2, k2);
-}
-// ====================================================== addEdge
-Edge* CrossElements::addEdge (Vertex* v1, Vertex* v2, int cyl, int dir,
- int nx, int ny, int nz)
-{
- Edge* edge = NULL;
- if (v1==NULL || v2==NULL)
- return NULL;
-
- else if (cyl==CylBig)
- {
- edge = findEdge1 (v1, v2);
- /* ************************************************
- if (edge != NULL)
- {
- printf (" Edge (%d, %d,%d,%d) trouve = ", dir, nx, ny, nz);
- edge->printName ("\n");
- }
- ************************************************ */
- }
-
- if (edge == NULL)
- edge = newEdge (v1, v2);
-
- setEdge (edge, cyl, dir, nx, ny, nz);
- return edge;
-}
-// ====================================================== addHexa
-Hexa* CrossElements::addHexa (Quad* q1, Quad* q2, Quad* q3, Quad* q4, Quad* q5,
- Quad* q6, int cyl, int nx, int ny, int nz)
-{
-/* **************************
- if (cyl==CylSmall)
- {
- if (nx == 0) return NULL;
- if (nz != 1) return NULL;
- if (ny != 4) return NULL;
- return NULL;
- }
-
- if (cyl==CylBig)
- {
- if (nz > 2) return NULL;
- if (nz < 1) return NULL;
- // if (nx == 0) return NULL;
- // if (ny != 4) return NULL;
- }
- ************************** */
-
- Hexa* hexa = NULL;
- if (cyl==CylBig)
- hexa = findHexa1 (q1, q2);
-
- if (hexa == NULL)
- hexa = newHexa (q1, q2, q3, q4, q5, q6);
- else if (db)
- {
- printf (" Hexa (%d,%d,%d) trouve = ", nx, ny, nz);
- hexa->printName ("\n");
- }
-
- setHexa (hexa, cyl, nx, ny, nz);
- return hexa;
-}
-// ====================================================== addQuad
-Quad* CrossElements::addQuad (Edge* e1, Edge* e2, Edge* e3, Edge* e4, int cyl,
- int dir, int nx, int ny, int nz)
-{
- Quad* quad = NULL;
- if (cyl==CylBig)
- quad = findQuad1 (e1, e3);
-
- if (quad == NULL)
- quad = newQuad (e1, e2, e3, e4);
- else if (db)
- {
- printf (" Quad (%d, %d,%d,%d) trouve = ", dir, nx, ny, nz);
- quad->printName ("\n");
- }
-
- setQuad (quad, cyl, dir, nx, ny, nz);
- return quad;
-}
-// ====================================================== findEdge1
-Edge* CrossElements::findEdge1 (Vertex* v1, Vertex* v2)
-{
- for (int nc=0; nc < nbr_edges1 ; nc++)
- if (tab_edge[nc] != NULL && tab_edge[nc]->definedBy (v1, v2))
- return tab_edge[nc];
-
- return NULL;
-}
-// ====================================================== findHexa1
-Hexa* CrossElements::findHexa1 (Quad* e1, Quad* e2)
-{
- for (int nc=0; nc < nbr_hexas1 ; nc++)
- if (tab_hexa[nc] != NULL && tab_hexa[nc]->definedBy (e1, e2))
- return tab_hexa[nc];
-
- return NULL;
-}
-// ====================================================== findQuad1
-Quad* CrossElements::findQuad1 (Edge* e1, Edge* e2)
-{
- for (int nc=0; nc < nbr_quads1 ; nc++)
- if (tab_quad[nc] != NULL && tab_quad[nc]->definedBy (e1, e2))
- return tab_quad[nc];
-
- return NULL;
-}
-// ====================================================== fillGrid
-void CrossElements::fillGrid (int cyl, int deb, int fin)
-{
- int nz0 = deb >= 0 ? deb : 0;
- int nzn = fin > 0 ? fin : size_vz [cyl];
-
- fillCenter (cyl, nz0, nzn);
-
- for (int nz=nz0 ; nz<nzn ; nz++)
- {
- for (int nx=1 ; nx<size_hx ; nx++)
- {
- // Edges horizontaux radiaux
- // Edges horizontaux // cloisons ext
- for (int ny=0 ; ny<size_vy ; ny++)
- {
- int ny1 = (ny + 1) MODULO size_vy;
- Vertex* vc = getVertexIJK (cyl, nx, ny, nz);
- Vertex* v1 = getVertexIJK (cyl, nx+1, ny, nz);
- Vertex* v2 = getVertexIJK (cyl, nx+1, ny1,nz);
-
- addEdge (vc, v1, cyl, dir_x, nx, ny, nz);
- addEdge (v1, v2, cyl, dir_y, nx+1, ny, nz);
- }
- // Quads horizontaux
- for (int ny=0 ; ny<size_vy ; ny++)
- {
- int ny1 = (ny + 1) MODULO size_vy;
- Edge* e1 = getEdgeI (cyl, nx, ny, nz);
- Edge* e2 = getEdgeJ (cyl, nx+1, ny, nz);
- Edge* e3 = getEdgeI (cyl, nx, ny1, nz);
- Edge* e4 = getEdgeJ (cyl, nx, ny, nz);
-
- addQuad (e1, e2, e3, e4, cyl, dir_z, nx, ny, nz);
- }
-
- if (nz>0)
- {
- // Edges verticaux + cloisons interieures
- for (int ny=0 ; ny<size_vy ; ny++)
- {
- Vertex* vp = getVertexIJK (cyl, nx+1, ny, nz-1);
- Vertex* vv = getVertexIJK (cyl, nx+1, ny, nz);
-
- Edge* edge = addEdge (vp, vv, cyl, dir_z, nx+1, ny, nz-1);
-
- Edge* e0 = getEdgeI (cyl, nx, ny, nz-1);
- Edge* e2 = getEdgeI (cyl, nx, ny, nz);
- Edge* e3 = getEdgeK (cyl, nx, ny, nz-1);
-
- addQuad (e0, edge, e2, e3, cyl, dir_y, nx, ny, nz-1);
- }
- // Cloisons exterieures ***
- for (int ny=0 ; ny<size_vy ; ny++)
- {
- int ny1 = (ny + 1) MODULO size_vy;
- Edge* e0 = getEdgeJ (cyl, nx+1, ny, nz-1);
- Edge* e2 = getEdgeJ (cyl, nx+1, ny, nz);
-
- Edge* e1 = getEdgeK (cyl, nx+1, ny, nz-1);
- Edge* e3 = getEdgeK (cyl, nx+1, ny1, nz-1);
- addQuad (e0, e1, e2, e3, cyl, dir_x, nx+1, ny, nz-1);
- }
- // Hexas (8)
- if (is_filled || cyl==CylBig || (nz!=3 && nz != 4))
- {
- for (int ny=0 ; ny<size_hy ; ny++)
- {
- int ny1 = (ny + 1) MODULO size_vy;
- // printf (" ---------- Hexa : nz=%d, ny=%d\n", ny, nz);
- Quad* qa = getQuadIJ (cyl, nx, ny, nz-1);
- Quad* qb = getQuadIJ (cyl, nx, ny, nz);
-
- Quad* qc = getQuadJK (cyl, nx+1, ny, nz-1);
- Quad* qd = getQuadJK (cyl, nx, ny, nz-1);
-
- Quad* qe = getQuadIK (cyl, nx, ny1, nz-1);
- Quad* qf = getQuadIK (cyl, nx, ny, nz-1);
-
- // Hexa* cell = newHexa (qa, qb, qc, qd, qe, qf);
- // setHexa (cell, cyl, nx, ny, nz-1);
- addHexa (qa, qb, qc, qd, qe, qf, cyl, nx, ny, nz-1);
- }
- }
- }
- }
- }
-}
-// ====================================================== fillCenter
-void CrossElements::fillCenter (int cyl, int nz0, int nzn)
-{
- int nx = 0;
-
- for (int nz=nz0 ; nz<nzn ; nz++)
- {
- Vertex* center = getVertexIJK (cyl, 0, 0, nz);
- // Edges horizontaux // cloisons ext
- for (int ny=0 ; ny<size_vy ; ny++)
- {
- Vertex* v1 = getVertexIJK (cyl, 1, ny, nz);
- Vertex* v2 = getVertexIJK (cyl, 1, (ny+1) MODULO size_vy, nz);
- addEdge (v1, v2, cyl, dir_y, nx+1, ny, nz);
- }
- if (is_filled)
- {
- // Edges horizontaux radiaux
- for (int nc=0 ; nc<NbrIntCotes ; nc++)
- {
- Vertex* vv = getVertexIJK (cyl, 1, 2*nc, nz);
- addEdge (center, vv, cyl, dir_x, nx, nc, nz);
- }
- // Quads horizontaux
- for (int nc=0; nc<NbrIntCotes ; nc++)
- {
- int nc1 = (nc + 1) MODULO NbrIntCotes;
- Edge* e1 = getEdgeI (cyl, nx, nc, nz);
- Edge* e2 = getEdgeJ (cyl, nx+1, 2*nc, nz);
- Edge* e3 = getEdgeJ (cyl, nx+1, 2*nc+1, nz);
- Edge* e4 = getEdgeI (cyl, nx, nc1, nz);
-
- addQuad (e1, e2, e3, e4, cyl, dir_z, nx, nc, nz);
- }
- }
-
- if (nz>0)
- {
- // Edges verticaux + cloisons interieures
- Vertex* vhaut = getVertexIJK (cyl,nx,0, nz-1);
- Edge* pilier = addEdge (center, vhaut, cyl, dir_z, nx, 0, nz-1);
-
- for (int ny=0 ; ny<size_vy ; ny++)
- {
- Vertex* vp = getVertexIJK (cyl, 1, ny, nz-1);
- Vertex* vv = getVertexIJK (cyl, 1, ny, nz);
- Edge* edge = addEdge (vp, vv, cyl, dir_z, 1, ny, nz-1);
- if (is_filled && (ny MODULO 2) == 0)
- {
- Edge* e0 = getEdgeI (cyl, nx, ny/2, nz-1);
- Edge* e2 = getEdgeI (cyl, nx, ny/2, nz);
- addQuad (e0,edge, e2,pilier, cyl, dir_y, nx, ny/2, nz-1);
- }
- }
- // Cloisons exterieures
- for (int ny=0 ; ny<size_vy ; ny++)
- {
- int ny1 = (ny + 1) MODULO size_vy;
- Edge* e0 = getEdgeJ (cyl, 1, ny, nz-1);
- Edge* e2 = getEdgeJ (cyl, 1, ny, nz);
- Edge* e1 = getEdgeK (cyl, 1, ny, nz-1);
- Edge* e3 = getEdgeK (cyl, 1, ny1, nz-1);
-
- addQuad (e0, e1, e2, e3, cyl, dir_x, 1, ny, nz-1);
- }
- // Hexas (4)
- if (is_filled)
- {
- for (int nc=0 ; nc < NbrIntCotes ; nc++)
- {
- // printf (" --------------- Hexa : nz=%d, nc=%d\n", nc, nz);
- int nc1 = (nc + 1) MODULO NbrIntCotes;
- Quad* qa = getQuadIJ (cyl, 0, nc, nz-1);
- Quad* qb = getQuadIJ (cyl, 0, nc, nz);
-
- Quad* qc = getQuadJK (cyl, 1, 2*nc, nz-1);
- Quad* qe = getQuadJK (cyl, 1, 2*nc+1, nz-1);
-
- Quad* qd = getQuadIK (cyl, 0, nc1, nz-1);
- Quad* qf = getQuadIK (cyl, 0, nc, nz-1);
-
- // Hexa* cell = newHexa (qa, qb, qc, qd, qe, qf);
- // setHexa (cell, cyl, 0, nc, nz-1);
- addHexa (qa, qb, qc, qd, qe, qf, cyl, nx, nc, nz-1);
- }
- }
- }
- }
-}
-// ====================================================== dump
-void CrossElements::dump ()
-{
- int sizey [2] = { 4, S_MAXI };
- for (int cyl=CylSmall ; cyl<=CylBig ; cyl++)
- {
- printf (" +++++++++ \n");
- printf (" +++++++++ Hexas du Cylindre nro %d\n", cyl);
- printf (" +++++++++ \n");
- for (int nz=0; nz<size_hz[cyl]; nz++)
- {
- for (int nx=0; nx<size_hx; nx++)
- {
- printf ("\n");
- for (int ny=0; ny<sizey[nx]; ny++)
- {
- Hexa* cell = getHexaIJK (cyl,nx,ny,nz);
- int nro = indHexa (cyl, nx, ny, nz);
- printf ("tab_hexa[%03d] (%d, %d,%d,%d) = ",
- nro, cyl,nx,ny,nz);
- if (cell!=NULL) cell->printName("\n");
- else printf ("NULL\n");
- }
- }
- }
- }
-}
-// ====================================================== dumpVertex
-void CrossElements::dumpVertex ()
-{
- int sizey [3] = { 1, S_MAXI, S_MAXI };
-
- for (int cyl=CylSmall ; cyl<=CylBig ; cyl++)
- {
- printf (" +++++++++ \n");
- printf (" +++++++++ Vertex du Cylindre nro %d\n", cyl);
- printf (" +++++++++ \n");
- for (int nz=0; nz<size_vz[cyl]; nz++)
- {
- for (int nx=0; nx<size_vx; nx++)
- {
- printf ("\n");
- for (int ny=0; ny<sizey[nx]; ny++)
- {
- Vertex* node = getVertexIJK (cyl,nx,ny,nz);
- int nro = indVertex (cyl, nx, ny, nz);
- printf ("tab_vertex[%03d] (%d, %d,%d,%d) = ",
- nro, cyl,nx,ny,nz);
- if (node!=NULL) node->printName("\n");
- else printf ("NULL\n");
- }
- }
- }
- }
-}
-// ====================================================== dumpHexas
-void CrossElements::dumpHexas ()
-{
- int sizey [3] = { 1, 4, S_MAXI };
-
- for (int cyl=CylSmall ; cyl<=CylBig ; cyl++)
- {
- printf (" +++++++++ \n");
- printf (" +++++++++ Hexaedres du Cylindre nro %d\n", cyl);
- printf (" +++++++++ \n");
- for (int nz=0; nz<size_hz[cyl]; nz++)
- {
- for (int nx=0; nx<size_hx; nx++)
- {
- printf ("\n");
- for (int ny=0; ny<sizey[nx]; ny++)
- {
- Hexa* elt = getHexaIJK (cyl,nx,ny,nz);
- if (elt!=NULL)
- {
- int nro = indHexa (cyl, nx, ny, nz);
- printf ("tab_hexa[%03d] (%d, %d,%d,%d) = ",
- nro, cyl,nx,ny,nz);
- elt->printName("\n");
- }
- }
- }
- }
- }
-}
-// ====================================================== calcul_centre
-double calcul_centre (Vertex* orig, Vertex* inter)
-{
- double dx = inter->getX () - orig->getX ();
- double dy = inter->getY () - orig->getY ();
- double dz = inter->getZ () - orig->getZ ();
- double dd = sqrt (dx*dx + dy*dy + dz*dz);
- return dd;
-}
-// ===================================================== assoSlice
-void CrossElements::assoSlice (int cyl, double* base, double* normal, int nx,
- int nzs)
-{
- Real3 center, pnt1, pnt2;
- // string brep;
-
- Vertex* v_n = getVertexIJK (cyl, nx, S_N , nzs);
- Vertex* v_s = getVertexIJK (cyl, nx, S_S , nzs);
-
- v_s->getPoint (pnt1);
- v_n->getPoint (pnt2);
-
- double rayon = calc_distance (pnt1, pnt2)/2;
- for (int nro=0 ; nro<DIM3 ; nro++)
- center[nro] = (pnt1[nro] + pnt2[nro])/2;
-
- int subid = grid_geom->addCircle (center, rayon, normal, base);
-
- for (int ny=0 ; ny<S_MAXI ; ny++)
- {
- assoArc (cyl, nx, ny, nzs, subid);
- }
-}
-// ===================================================== assoArc
-void CrossElements::assoArc (int cyl, int nx, int ny, int nz, int subid)
-{
- double angle1 = getAngle (cyl, ny, nz);
- double angle2 = getAngle (cyl, ny+1, nz);
- Edge* edge = getEdgeJ (cyl, nx, ny, nz);
- if (edge==NULL)
- return;
-
- grid_geom->addAssociation (edge, subid, angle1*UnSur2pi, angle2*UnSur2pi);
-
- // Assurer avec les vertex
- int ny2 = ny>=S_MAXI-1 ? 0 : ny+1;
- Vertex* node1 = getVertexIJK (cyl, nx, ny, nz);
- Vertex* node2 = getVertexIJK (cyl, nx, ny2, nz);
-
- grid_geom->addAssociation (node1, subid, angle1*UnSur2pi);
- grid_geom->addAssociation (node2, subid, angle2*UnSur2pi);
-}
-// ====================================================== getAngleInter
-// ==== Angle intersection intermediaire
-double CrossElements::getAngleInter (int cyl, int nz)
-{
- if (cyl==CylBig && (nz==1 || nz==3))
- return angle_intermed;
- else
- return angle_inter[cyl];
-}
-// ====================================================== getAngle
-double CrossElements::getAngle (int cyl, int nj, int nz)
-{
- switch (nj)
- {
- case S_E : return 0;
- case S_NE : return angle_inter[cyl];
- case S_N : return M_PI/2;
- case S_NW : return M_PI - angle_inter[cyl];
- case S_W : return M_PI;
- case S_SW : return M_PI + angle_inter[cyl];
- case S_S : return 3*M_PI/2;
- case S_SE : return 2*M_PI - angle_inter[cyl];
- case S_MAXI : return 2*M_PI;
- default : break;
- }
- return 0;
-}
-// ====================================================== addVertex
-void CrossElements::addVertex (int cyl, int ni, int nj, int nk, double px,
- double rayon)
-{
- if (rayon<0.0)
- rayon = cross_rayon [cyl][ni];
- double theta = getAngle (cyl, nj);
-
- if (cyl==CylSmall)
- setVertex (cyl, ni, nj, nk, px, rayon*cos(theta), rayon*sin(theta));
- else
- setVertex (cyl, ni, nj, nk, rayon*cos(theta), rayon*sin(theta), px);
-}
-// ====================================================== addSlice
-void CrossElements::addSlice (int cyl, int ni, int nk, double px, double rayon)
-{
- for (int nj=0 ; nj < S_MAXI ; nj++)
- addVertex (cyl, ni, nj, nk, px, rayon);
-}
-END_NAMESPACE_HEXA
+++ /dev/null
-
-// C++ : Gestion des cylindres croises : construction
-
-// Copyright (C) 2009-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
-//
-
-#include "HexCrossElements.hxx"
-
-#include "HexDocument.hxx"
-#include "HexVector.hxx"
-#include "HexVertex.hxx"
-#include "HexHexa.hxx"
-#include "HexEdge.hxx"
-
-#include "HexGlobale.hxx"
-#include "HexCylinder.hxx"
-#include "HexNewShape.hxx"
-#include "HexBiCylinderShape.hxx"
-#include "HexAssoEdge.hxx"
-#include "HexEdgeShape.hxx"
-
-static bool db = false;
-
-BEGIN_NAMESPACE_HEXA
-
-static const int MaxLevel = 7;
-static const double epaiss2 = 0.5;
-static const double UnSur2pi = DEMI/M_PI;
-
-double calcul_centre (Vertex* orig, Vertex* inter);
-
-// ====================================================== createBigCyl
-void CrossElements::createBigCyl ()
-{
- const int iv0 = 0;
- const int kv_mil = cyl_left != NO_PIPE ? 2 : 3 ;
-
- enum { k0, k1, k2, k3, k4 };
- double z0, z2, z4;
-
- z0 = big_hauteur[0] = - calcul_centre (cross_cyl2->getBase(), cross_center);
- z4 = big_hauteur[4] = z0 + cross_cyl2->getHeight ();
-
- big_hauteur[1] = getVertexIJK (CylSmall, NxExt, S_SE, kv_mil)->getZ();
- z2 = big_hauteur[2] = getVertexIJK (CylSmall, NxExt, S_E, kv_mil)->getZ();
- big_hauteur[3] = getVertexIJK (CylSmall, NxExt, S_NE, kv_mil)->getZ();
-
- setVertex (CylBig, iv0, 0, k0, 0, 0, z0);
- addSlice (CylBig, NxInt, k0, z0);
- addSlice (CylBig, NxExt, k0, z0);
-
- setVertex (CylBig, iv0, 0, k4, 0, 0, z4);
- addSlice (CylBig, NxInt, k4, z4);
- addSlice (CylBig, NxExt, k4, z4);
-
- //------------------------------- Points intermediaires :
-
- double xe1 = getVertexIJK (CylBig, NxExt, S_N, k0)->getX();
- double ye1 = getVertexIJK (CylBig, NxExt, S_N, k0)->getY();
-
- double xe2 = getVertexIJK (CylBig, NxExt, S_S, k0)->getX();
- double ye2 = getVertexIJK (CylBig, NxExt, S_S, k0)->getY();
-
- double xi1 = getVertexIJK (CylBig, NxInt, S_N, k0)->getX();
- double yi1 = getVertexIJK (CylBig, NxInt, S_N, k0)->getY();
-
- double xi2 = getVertexIJK (CylBig, NxInt, S_S, k0)->getX();
- double yi2 = getVertexIJK (CylBig, NxInt, S_S, k0)->getY();
-
- //------------------------------- Reprise des vertex du cylindre 1
-
- //------------------------------- Centre
- if (grid_type != GR_BIPIPE)
- copyVertex (NxExt, S_S, 3, iv0, 0, k1);
-
- //------------------------------- Creation Vertex Nord-Sud
- for (int nk=k1 ; nk<k4 ; nk++)
- {
- setVertex (CylBig, NxExt, S_N, nk, xe1, ye1, big_hauteur[nk]);
- setVertex (CylBig, NxExt, S_S, nk, xe2, ye2, big_hauteur[nk]);
- setVertex (CylBig, NxInt, S_N, nk, xi1, yi1, big_hauteur[nk]);
- setVertex (CylBig, NxInt, S_S, nk, xi2, yi2, big_hauteur[nk]);
- }
-
- //------------------------------- Face k1 externe :
-
- copyVertex (NxExt, S_S, 5, NxExt, S_E, k1);
- copyVertex (NxExt, S_SE, 5, NxExt, S_NE, k1);
- copyVertex (NxExt, S_SW, 5, NxExt, S_SE, k1);
-
- copyVertex (NxExt, S_S, 1, NxExt, S_W, k1);
- copyVertex (NxExt, S_SE, 1, NxExt, S_NW, k1);
- copyVertex (NxExt, S_SW, 1, NxExt, S_SW, k1);
-
- //------------------------------- Face k1 interne :
-
- copyVertex (NxExt, S_S, 2, NxInt, S_W, k1);
- copyVertex (NxExt, S_SE, 2, NxInt, S_NW, k1);
- copyVertex (NxExt, S_SW, 2, NxInt, S_SW, k1);
-
- copyVertex (NxExt, S_SE, 3, NxInt, S_N, k1); // 16/02/2012
- copyVertex (NxExt, S_SW, 3, NxInt, S_S, k1); // 16/02/2012
-
- copyVertex (NxExt, S_S, 4, NxInt, S_E, k1);
- copyVertex (NxExt, S_SE, 4, NxInt, S_NE, k1);
- copyVertex (NxExt, S_SW, 4, NxInt, S_SE, k1);
-
- // ------------------------------------------------------------ K2
- //------------------------------- Centre
- // copyVertex (iv0, 0, 3, iv0, 0, k2);
- // ------------------------------ Face k2 externe :
-
-
- copyVertex (NxExt, S_E, 5, NxExt, S_NE, k2);
- copyVertex (NxExt, S_W, 5, NxExt, S_SE, k2);
-
- copyVertex (NxExt, S_E, 1, NxExt, S_NW, k2);
- copyVertex (NxExt, S_W, 1, NxExt, S_SW, k2);
-
- //------------------------------- Face k2 interne :
-
- copyVertex (NxExt, S_E, 2, NxInt, S_NW, k2);
- copyVertex (NxExt, S_W, 2, NxInt, S_SW, k2);
-
- copyVertex (NxExt, S_E, 4, NxInt, S_NE, k2);
- copyVertex (NxExt, S_W, 4, NxInt, S_SE, k2);
-
- if (cyl_left == NO_PIPE)
- {
- addVertex (CylBig, NxExt, S_W, k2, z2, cross_rayon [CylBig][NxExt]);
- addVertex (CylBig, NxInt, S_W, k2, z2, cross_rayon [CylBig][NxInt]);
- }
-
- if (cyl_right == NO_PIPE)
- {
- addVertex (CylBig, NxExt, S_E, k2, z2, cross_rayon [CylBig][NxExt]);
- addVertex (CylBig, NxInt, S_E, k2, z2, cross_rayon [CylBig][NxInt]);
- }
-
- // ------------------------------------------------------------
-
- //------------------------------- Centre
- if (grid_type != GR_BIPIPE)
- copyVertex (NxExt, S_N, 3, iv0, 0, k3);
-
- //------------------------------- Face k3 externe :
- copyVertex (NxExt, S_N, 5, NxExt, S_E, k3);
- copyVertex (NxExt, S_NE, 5, NxExt, S_NE, k3);
- copyVertex (NxExt, S_NW, 5, NxExt, S_SE, k3);
-
- copyVertex (NxExt, S_N, 1, NxExt, S_W, k3);
- copyVertex (NxExt, S_NE, 1, NxExt, S_NW, k3);
- copyVertex (NxExt, S_NW, 1, NxExt, S_SW, k3);
-
- //------------------------------- Face k3 interne :
-
- copyVertex (NxExt, S_N, 2, NxInt, S_W, k3);
- copyVertex (NxExt, S_NE, 2, NxInt, S_NW, k3);
- copyVertex (NxExt, S_NW, 2, NxInt, S_SW, k3);
-
- copyVertex (NxExt, S_NE, 3, NxInt, S_N, k3); // 16/02/2012
- copyVertex (NxExt, S_NW, 3, NxInt, S_S, k3); // 16/02/2012
-
- copyVertex (NxExt, S_N, 4, NxInt, S_E, k3);
- copyVertex (NxExt, S_NE, 4, NxInt, S_NE, k3);
- copyVertex (NxExt, S_NW, 4, NxInt, S_SE, k3);
-
- //------------------------------- Remplissage
-
- if (grid_type == GR_BIPIPE)
- {
- for (int nj=0; nj<S_MAXI ; nj++)
- {
- Vertex* node = getVertexIJK (CylBig, NxInt, nj, 0);
- double px = node->getX();
- double py = node->getY();
- for (int nk=1; nk<4 ; nk++)
- {
- node = getVertexIJK (CylBig, NxInt, nj, nk);
- if (node != NULL)
- {
- node -> setX (px);
- node -> setY (py);
- }
- }
- }
- }
- fillGrid (CylBig);
-}
-// ====================================================== createLittleCyl
-void CrossElements::createLittleCyl ()
-{
- double c1 = calcul_centre (cross_cyl1->getBase(), cross_center);
- // double cosalpha = cos (angle_inter[CylBig]);
- double prayext = cross_rayon [CylBig][NxExt]; // * cosalpha;
- double prayint = cross_rayon [CylBig][NxInt]; // * cosalpha;
-
- double t_haut [MaxLevel] = { -c1, -prayext, -prayint,
- 0, prayint, prayext,
- cross_cyl1->getHeight () -c1 };
-
- double rm = ( cross_rayon [CylSmall][NxExt]
- + cross_rayon [CylSmall][NxInt]) / 2;
- double rc = cross_rayon [CylBig] [NxInt];
-
- double t_rayext [MaxLevel] = { -1, -1, rm, rc, rm, -1, -1 };
-
-/* *******************************************************************
- int nkdeb = at_left ? 0 : size_v1z/2;
- int nkfin = at_right ? size_v1z : size_v1z/2;
- ******************************************************************* */
-
- int nkdeb, nkfin;
- switch (cyl_left)
- {
- case IS_HERE : nkdeb = 0;
- break;
- case NO_PIPE : nkdeb = size_v1z/2;
- break;
- case NO_CYL : nkdeb = 1;
- break;
- }
- switch (cyl_right)
- {
- case IS_HERE : nkfin = size_v1z;
- break;
- case NO_PIPE : nkfin = size_v1z/2;
- break;
- case NO_CYL : nkfin = size_v1z-1;
- break;
- }
-
- for (int nk = nkdeb ; nk<nkfin ; nk++)
- {
- double px = t_haut [nk];
- if (grid_type != GR_BIPIPE)
- addVertex (CylSmall, 0, 0, nk, px, 0);
-
- addSlice (CylSmall, NxInt, nk, px);
- addSlice (CylSmall, NxExt, nk, px, t_rayext[nk]);
- }
-
-
- fillGrid (CylSmall);
-}
-// ====================================================== crossCylinders
-int CrossElements::crossCylinders (Cylinder* lun, Cylinder* lautre, bool fill)
-{
- is_filled = fill;
- resize ();
-
- if (lun->getRadius() < lautre->getRadius())
- {
- cross_cyl1 = lun;
- cross_cyl2 = lautre;
- }
- else
- {
- cross_cyl1 = lautre;
- cross_cyl2 = lun;
- }
-
- double pr = cross_cyl1->getRadius ();
- double gr = cross_cyl2->getRadius ();
- if (pr>=gr*0.95)
- {
- cout << " **** crossCylinders : les deux rayons sont trop proches"
- << endl;
- setError (HERR);
- return HERR;
- }
-
- cross_center = cross_cyl2->interCylinder(cross_cyl1, at_left, at_right);
- if (cross_center==NULL)
- {
- setError (HERR);
- return HERR;
- }
-
- if (at_left) cyl_left = IS_HERE;
- else if (grid_type == GR_BIPIPE) cyl_left = NO_PIPE;
- else cyl_left = NO_CYL;
-
- if (at_right) cyl_right = IS_HERE;
- else if (grid_type == GR_BIPIPE) cyl_right = NO_PIPE;
- else cyl_right = NO_CYL;
-
- double cross_gray1 = cross_cyl1->getRadius ();
- double cross_gray2 = cross_cyl2->getRadius ();
- double cross_igray1 = cross_gray1 * epaiss2;
- double cross_igray2 = cross_gray2 * epaiss2;
-
- if (db)
- {
- HexDisplay (cross_gray1);
- HexDisplay (cross_gray2);
- HexDisplay (cross_igray2);
- HexDisplay (cross_igray1);
- }
-
- angle_inter [CylSmall] = M_PI/6;
- angle_inter [CylBig] = asin (cross_gray1/cross_gray2);
- angle_intermed = angle_inter [CylBig];
-
- cross_rayon [CylSmall] [0] = cross_rayon [CylBig] [0] = 0;
-
- cross_rayon [CylSmall] [NxInt] = cross_igray1;
- cross_rayon [CylSmall] [NxExt] = cross_gray1;
- cross_rayon [CylBig] [NxInt] = cross_igray2;
- cross_rayon [CylBig] [NxExt] = cross_gray2;
-
- createLittleCyl ();
- createBigCyl ();
-
- double h1=0, h3=0, dx=1 , dy=1;
- if (cyl_left!=NO_PIPE)
- {
- adjustLittleSlice (NxExt, 1, NxExt);
- adjustLittleSlice (NxInt, 1, NxExt);
- if (grid_type == GR_BIPIPE)
- adjustLittleSlice (NxInt, 2, NxInt);
- dx = getVertexIJK (CylBig, NxExt, S_NW, 1)->getX();
- dy = getVertexIJK (CylBig, NxExt, S_NW, 1)->getY();
- h1 = getVertexIJK (CylBig, NxExt, S_NW, 1)->getZ();
- h3 = getVertexIJK (CylBig, NxExt, S_NW, 3)->getZ();
- }
-
- if (cyl_right!=NO_PIPE)
- {
- adjustLittleSlice (NxExt, 5, NxExt);
- adjustLittleSlice (NxInt, 5, NxExt);
- if (grid_type == GR_BIPIPE)
- adjustLittleSlice (NxInt, 4, NxInt);
- dx = -getVertexIJK (CylBig, NxExt, S_NE, 1)->getX();
- dy = getVertexIJK (CylBig, NxExt, S_NE, 1)->getY();
- h1 = getVertexIJK (CylBig, NxExt, S_NE, 1)->getZ();
- h3 = getVertexIJK (CylBig, NxExt, S_NE, 3)->getZ();
- }
-
- for (int ny=0 ; ny<S_MAXI ; ny++)
- {
- if (ny != S_E && ny != S_W)
- {
- getVertexIJK (CylBig, NxExt, ny, 1)->setZ(h1);
- getVertexIJK (CylBig, NxExt, ny, 3)->setZ(h3);
- }
- }
-
- angle_intermed = atan (dy/dx);
- Vector* iprim = new Vector (cross_cyl1->getDirection());
- Vector* kprim = new Vector (cross_cyl2->getDirection());
- Vector* jprim = new Vector (kprim);
-
- iprim->renormer ();
- kprim->renormer ();
- jprim->vectoriel (kprim, iprim);
-
- transfoVertices (cross_center, iprim, jprim, kprim);
-
- Real3 snorm, bnorm;
- iprim->getCoord (snorm);
- kprim->getCoord (bnorm);
-
- char name [12];
- sprintf (name, "grid_%02d", el_id);
- grid_geom = el_root->addShape (name, SH_INTER);
- grid_geom -> openShape();
- assoCylinder (CylSmall, snorm);
- assoCylinder (CylBig, bnorm);
- grid_geom -> closeShape();
-
- if (cyl_left == IS_HERE)
- {
- assoIntersection (NxExt, 1, snorm, bnorm);
- if (grid_type == GR_BIPIPE)
- {
- assoIntersection (NxInt, 2, snorm, bnorm);
- }
- }
-
- if (cyl_right == IS_HERE)
- {
- assoIntersection (NxExt, NbrSlices1-1, snorm, bnorm);
- if (grid_type == GR_BIPIPE)
- {
- assoIntersection (NxInt, NbrSlices1-2, snorm, bnorm);
- }
- }
-
- if (cyl_left == IS_HERE)
- {
- adjustAsso (NxExt, S_N, 1, V_AVAL);
- adjustAsso (NxExt, S_SW, 1, V_AMONT);
-
- adjustAsso (NxExt, S_N, 3, V_AVAL);
- adjustAsso (NxExt, S_SW, 3, V_AMONT);
- }
-
- if (cyl_right == IS_HERE)
- {
- adjustAsso (NxExt, S_NE, 1, V_AMONT);
- adjustAsso (NxExt, S_S, 1, V_AVAL);
-
- adjustAsso (NxExt, S_NE, 3, V_AMONT);
- adjustAsso (NxExt, S_S, 3, V_AVAL);
- }
-
- // assoResiduelle ();
- return HOK;
-}
-// ====================================================== copyVertex
-void CrossElements::copyVertex (int i1, int j1, int k1, int i2, int j2, int k2)
-{
- Vertex* node = getVertexIJK (CylSmall, i1, j1, k1);
- if (node!=NULL)
- {
- setVertex (node, CylBig, i2, j2, k2);
- return;
- }
-
- double rayon = cross_rayon [CylBig][i2];
- double hauteur = big_hauteur [k2];
-
- addVertex (CylBig, i2, j2, k2, hauteur, rayon);
-}
-// ===================================================== assoCylinder
-void CrossElements::assoCylinder (int cyl, double* normal)
-{
- Real3 base, vec1, center, east, west, nordest;
- int nk = 0;
- if (cyl==CylSmall && cyl_left != IS_HERE)
- nk = size_hz[cyl];
-
- Vertex* v_e = getVertexIJK (cyl, NxExt, S_E , nk);
- Vertex* v_ne = getVertexIJK (cyl, NxExt, S_NE, nk);
- Vertex* v_w = getVertexIJK (cyl, NxExt, S_W , nk);
-
- v_e->getPoint (east);
- v_w->getPoint (west);
- calc_vecteur (west, east, base);
-
- for (int nro=0 ; nro<DIM3 ; nro++)
- center[nro] = (east[nro] + west[nro])/2;
-
- v_ne->getPoint (nordest);
- calc_vecteur (center, nordest, vec1);
-
- double ps = prod_scalaire (base, vec1);
- double pnorm = calc_norme(base) * calc_norme(vec1);
-
- angle_inter [cyl] = acos (ps/pnorm);
-
- if (cyl==CylBig || at_left)
- {
- assoSlice (cyl, base, normal, NxExt, 0);
- if (grid_type == GR_BIPIPE)
- {
- assoSlice (cyl, base, normal, NxInt, 0);
- assoSlice (cyl, base, normal, NxInt, 1);
- }
- }
-
- if (cyl==CylBig || cyl_right == IS_HERE)
- {
- assoSlice (cyl, base, normal, NxExt, size_hz[cyl]);
- if (grid_type == GR_BIPIPE)
- {
- assoSlice (cyl, base, normal, NxInt, size_hz[cyl]);
- assoSlice (cyl, base, normal, NxInt, size_hz[cyl]-1);
- }
- }
-
- if (cyl==CylBig)
- for (int nz=1 ; nz<=3 ; nz++)
- assoBigMiddle (base, normal, nz);
-}
-// ===================================================== assoBigMiddle
-void CrossElements::assoBigMiddle (double* base, double* normal, int nzs)
-{
- Real3 center, pnt1, pnt2;
- int nx = NxExt;
-
- Vertex* v_n = getVertexIJK (CylBig, nx, S_N , nzs);
- Vertex* v_s = getVertexIJK (CylBig, nx, S_S , nzs);
-
- v_s->getPoint (pnt1);
- v_n->getPoint (pnt2);
-
- double rayon = calc_distance (pnt1, pnt2)/2;
- // double alpha = angle_inter [CylBig];
- // if (nzs != 2)
- // {
- // double h1 = cross_rayon[CylSmall][NxExt] * cos (angle_inter[CylSmall]);
- // alpha = asin (h1/cross_rayon[CylBig][NxExt]);
- // }
-
- for (int nro=0 ; nro<DIM3 ; nro++)
- center[nro] = (pnt1[nro] + pnt2[nro])/2;
-
- int subid = grid_geom->addCircle (center, rayon, normal, base);
-
- if (cyl_right != IS_HERE)
- {
- assoArc (CylBig, NxExt, S_SE, nzs, subid);
- assoArc (CylBig, NxExt, S_E, nzs, subid);
- }
-
- assoArc (CylBig, NxExt, S_NE, nzs, subid);
- assoArc (CylBig, NxExt, S_N , nzs, subid);
-
- if (cyl_left != IS_HERE)
- {
- assoArc (CylBig, NxExt, S_NW, nzs, subid);
- assoArc (CylBig, NxExt, S_W , nzs, subid);
- }
-
- assoArc (CylBig, NxExt, S_SW, nzs, subid);
- assoArc (CylBig, NxExt, S_S , nzs, subid);
-}
-// ====================================================== adjustLittleSlice
-void CrossElements::adjustLittleSlice (int ni, int nk, int nibig)
-{
- Vertex* node = getVertexIJK (CylSmall, ni, S_N, nk);
- if (node==NULL)
- return;
-
- double grayon2 = cross_rayon[CylBig][nibig] * cross_rayon[CylBig][nibig];
- double prayon = cross_rayon[CylSmall][ni];
-
- for (int nj=0; nj<S_MAXI ; nj++)
- {
- node = getVertexIJK (CylSmall, ni, nj, nk);
- double angle = getAngle (CylSmall, nj);
- double py = prayon * cos (angle);
- double pz = prayon * sin (angle);
- double px = sqrt (grayon2-py*py);
-
- double qx = node->getX();
- if (qx>=0) node->setX ( px);
- else node->setX (-px);
- node->setY (py);
- node->setZ (pz);
- }
-}
-// ===================================================== assoIntersection
-int CrossElements::assoIntersection (int nxs, int nzs, double* snorm,
- double* bnorm)
-{
- Real3 center;
- Real3 pse, psw, sorig, sbase;
- Real3 pbe, pbw, borig, bbase;
-
- cross_center->getPoint (center);
- int nz = nzs < MiddleSlice1 ? 0 : NbrSlices1;
-
- getVertexIJK (CylSmall, nxs, S_E , nz)->getPoint (pse);
- getVertexIJK (CylSmall, nxs, S_W , nz)->getPoint (psw);
- getVertexIJK (CylBig, nxs, S_E , 0) ->getPoint (pbe);
- getVertexIJK (CylBig, nxs, S_W , 0) ->getPoint (pbw);
-
- double srayon = calc_distance (pse, psw)/2;
- double brayon = calc_distance (pbe, pbw)/2;
-
- calc_milieu (psw, pse, sorig);
- calc_milieu (pbw, pbe, borig);
- calc_vecteur (psw, pse, sbase);
- calc_vecteur (pbw, pbe, bbase);
-
- double shaut = calc_distance (center, sorig);
- double bhaut = calc_distance (center, borig)*2;
- double* orig = nzs < MiddleSlice1 ? sorig : center; // Pb orientation
-
- BiCylinderShape bicyl_shape (el_root);
- int ier = bicyl_shape.defineCyls (borig, bnorm, bbase, brayon, bhaut,
- orig, snorm, sbase, srayon, shaut);
- if (ier != HOK)
- return ier;
-
- for (int ny=S_E ; ny<=S_SE ; ny++)
- {
- Vertex* node = getVertexIJK (CylSmall, nxs, ny, nzs);
- if (node!=NULL)
- node->clearAssociation ();
- }
-
- for (int ny=S_E ; ny<=S_SE ; ny++)
- {
- Edge* edge = getEdgeJ (CylSmall, nxs, ny, nzs);
- bicyl_shape.associate (edge);
- }
-
- return HOK;
-}
-// ===================================================== adjustAsso
-void CrossElements::adjustAsso (int nx, int ny, int nz, int sens)
-{
- Edge* edge = getEdgeJ (CylBig, nx, ny, nz);
- if (edge==NULL)
- return;
-
- Real3 point;
- Vertex* vertex = edge->getVertex (sens);
- AssoEdge* asso = edge->getAssociation (0);
- if (asso==NULL)
- return;
-
- vertex->getPoint (point);
-
- EdgeShape* line = asso->getEdgeShape ();
- double param = line->getParam (point);
-
- if (param<0)
- return;
- if (sens==V_AMONT)
- asso->setStart (param);
- else
- asso->setEnd (param);
-}
-END_NAMESPACE_HEXA
+++ /dev/null
-
-// C++ : Gestion des cylindres
-
-// Copyright (C) 2009-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
-//
-#include "HexCylinder.hxx"
-#include "HexVertex.hxx"
-#include "HexVector.hxx"
-#include "HexXmlWriter.hxx"
-#include "HexDocument.hxx"
-
-#include <cmath>
-
-BEGIN_NAMESPACE_HEXA
-
-bool is_out (double val, double orig, double lg);
-
-// ======================================================== Constructeur
-Cylinder::Cylinder(Vertex* b, Vector* v, double r, double h)
- : EltBase (b->dad(), EL_CYLINDER)
-{
- c_base = b;
- c_dir = v;
- c_radius = r;
- c_height = h;
-
- if (el_root->debug ())
- {
- Echo ("---------------------------------- AddCylinder");
- HexDisplay (c_radius);
- HexDisplay (c_height);
- HexDump (c_base);
- HexDump (c_dir);
- cout << endl;
- }
-
- if (c_base==NULL || c_dir==NULL || el_root==NULL)
- setError ();
- else
- {
- double tol = el_root->getTolerance ();
- double norme = c_dir ->getNorm ();
- if (c_radius <= tol || c_height <= tol || norme <= tol)
- setError ();
- }
-}
-// ======================================================== rdiffers
-bool rdiffers (double v1, double v2)
-{
- double dd = v1-v2;
- return dd*dd > 1e-12;
-}
-// ======================================================== norme
-double norme (double px, double py, double pz)
-{
- double res = sqrt (px*px + py*py + pz*pz);
- return res;
-}
-// ======================================================== interCylinder
-/// Intersection de 2 droites (c1,v1) et (c2,v2)
-/// Le point M(x,yz) est solutions de 2 equations :
-/// (c1,m) = k * v1
-/// (c2,m) vectoriel v2 = 0
-///
-/// x = xc1 + k * xv1 (1)
-/// y = yc1 + k * yv1 (2)
-/// z = zc1 + k * zv1 (3)
-/// (x-xc2) * yv2 - (y-yc2) * xv2 = 0 (4)
-/// (z-zc2) * yv2 - (y-yc2) * zv2 = 0 (5)
-/// (x-xc2) * zv2 - (z-zc2) * xv2 = 0 (6)
-///
-/// En substituant les (x,y,z)
-///
-/// (k*xv1+xc1-xc2) * yv2 - (k*yv1+yc1-yc2) * xv2 = 0 (4)
-/// (k*zv1+zc1-zc2) * yv2 - (k*yv1+yc1-yc2) * zv2 = 0 (5)
-/// (k*xv1+xc1-xc2) * zv2 - (k*zv1+zc1-zc2) * xv2 = 0 (6)
-///
-/// k * (xv1*yv2 - yv1*xv2) + (xc1-xc2) * yv2 - (yc1-yc2) * xv2 = 0 (4)
-/// k * dxy - nxy = 0 (4)
-/// k * dzy - nzy = 0 (5)
-/// k * dxz - nxz = 0 (6)
-///
-/// nxy = (xc2-xc1) * yv2 - (yc2-yc1) * xv2
-/// dxy = xv1*yv2 - yv1*xv2
-///
-// ======================================================== interCylinder
-Vertex* Cylinder::interCylinder(Cylinder* small, bool& left, bool& right)
-{
- Real3 orig;
- int ier = interCylinder (small, left, right, orig);
- if (ier!=HOK)
- return NULL;
-
- Vertex* sol = new Vertex (c_base->dad(), orig[0], orig[1], orig[2]);
- return sol;
-}
-///
-// ======================================================== interCylinder
-int Cylinder::interCylinder (Cylinder* small, bool& left, bool& right,
- double* orig)
-{
- left = right = true;
- if (el_root->debug ())
- {
- Echo ("---------------------------------- interCylinders");
- PutData (this->c_radius);
- PutData (small->c_radius);
- PutData (this->c_height);
- PutData (small->c_height);
- HexDump (this->c_base);
- HexDump (small->c_base);
- HexDump (this->c_dir);
- HexDump (small->c_dir);
- }
-
- double norm1 = c_dir->getNorm();
- double norm2 = small->c_dir->getNorm();
-
- double xc1 = c_base->getX();
- double yc1 = c_base->getY();
- double zc1 = c_base->getZ();
-
- double xc2 = small->c_base->getX();
- double yc2 = small->c_base->getY();
- double zc2 = small->c_base->getZ();
-
- double xv1 = c_dir->getDx()/norm1;
- double yv1 = c_dir->getDy()/norm1;
- double zv1 = c_dir->getDz()/norm1;
-
- double xv2 = small->c_dir->getDx()/norm2;
- double yv2 = small->c_dir->getDy()/norm2;
- double zv2 = small->c_dir->getDz()/norm2;
-
- double nxyz [DIM3] = { (xc2-xc1) * yv2 - (yc2-yc1) * xv2,
- (zc2-zc1) * yv2 - (yc2-yc1) * zv2,
- (xc2-xc1) * zv2 - (zc2-zc1) * xv2 };
-
- double dxyz [DIM3] = { xv1*yv2 - yv1*xv2,
- zv1*yv2 - yv1*zv2,
- xv1*zv2 - zv1*xv2 };
- double lambda = 0;
- bool prems = true;
- for (int dd=0 ; dd<DIM3 ; dd++)
- {
- // dxyz!=0 : calcul de lambda
- if (rdiffers (dxyz [dd], ZEROR))
- {
- double kk = nxyz [dd] / dxyz[dd];
- // 1er lambda trouve
- if (prems)
- {
- prems = false;
- lambda = kk;
- }
- // Solutions incompatibles
- else if (rdiffers (kk, lambda))
- {
- cout << "*** InterCylinders : Solutions incompatibles " << endl;
- return HERR;
- }
- // equation O*lamda = 0 : ignoree
- // else ....
- }
- // dxyz=0 et nxyz!=0 : Pas de solution
- else if (rdiffers (nxyz [dd], ZEROR))
- {
- cout << "*** InterCylinders : intersection vide " << endl;
- return HERR;
- }
- }
-
- // Aucune solution trouvee
- if (prems)
- {
- HexDisplay (prems);
- cout << "*** InterCylinders : intersection non trouvee " << endl;
- return HERR;
- }
- // Intersection des droites
- orig [dir_x] = xc1 + lambda*xv1;
- orig [dir_y] = yc1 + lambda*yv1;
- orig [dir_z] = zc1 + lambda*zv1;
-
- Real3 base1, dir1, extr1;
- Real3 base2, dir2, extr2;
-
- this ->c_base->getPoint (base1);
- small->c_base->getPoint (base2);
-
- this ->c_dir->getCoord (dir1);
- small->c_dir->getCoord (dir2);
-
- for (int dd=dir_x ; dd<=dir_z ; dd++)
- {
- extr1 [dd] = base1[dd] + dir1[dd]*this ->c_height/norm1;
- extr2 [dd] = base2[dd] + dir2[dd]*small->c_height/norm2;
- }
-
- double dbase1 = calc_distance (orig, base1);
- double dbase2 = calc_distance (orig, base2);
- double dextr1 = calc_distance (orig, extr1);
- double dextr2 = calc_distance (orig, extr2);
-
- double dmin2 = std::min (dbase2, dextr2);
- double dmax2 = std::max (dbase2, dextr2);
- double dmax1 = std::max (dbase1, dextr1);
- double coeff = 1.1;
- // Appartenance axe petit cylindre
- if (dmax2 > small->c_height + c_radius)
- {
- cout << "*** InterCylinders : Petit cylindre trop court" << endl;
- cout << "*** Intersection = (" << orig[0] << ", " << orig[1]
- << ", " << orig[2] << " )" << endl;
- cout << "*** distance = " << dmin2
- << " > gros rayon + longueur "
- << small->c_height + c_radius << endl;
- cout << endl;
- PutCoord (base2);
- PutCoord (extr2);
- PutData(dbase2);
- PutData(dextr2);
- PutData(dextr2);
- return HERR;
- }
-
- left = dbase2 > c_radius*coeff;
- right = dextr2 > c_radius*coeff;
- // Le gros cylindre doit depasser le petit
- if (dmax1 > c_height-coeff*small->c_radius)
- {
- cout << "*** InterCylinders : Gros cylindre trop court" << endl;
- cout << "*** Intersection = (" << orig[0] << ", " << orig[1]
- << ", " << orig[2] << " )" << endl;
- cout << "*** distance maximale = " << dmax1 << endl;
- cout << endl;
- return HERR;
- }
-
- if (el_root->debug ())
- {
- PutCoord (orig);
- HexDisplay (left);
- HexDisplay (right);
- }
- return HOK;
-}
-// ======================================================== is_out
-bool is_out (double val, double v1, double v2)
-{
- if (v1 < v2)
- return (val < v1-Epsil || val > v2+Epsil) ;
-
- else if (v1 > v2)
- return (val < v2-Epsil || val > v1+Epsil) ;
-
- else
- return fabs (val - v1)>Epsil;
-}
-// ========================================================= saveXml
-void Cylinder::saveXml (XmlWriter* xml)
-{
- char buffer[12];
-
- xml->openMark ("Cylinder");
- xml->addAttribute ("c_base", c_base->getName (buffer));
- xml->addAttribute ("c_dir", c_dir->getName (buffer));
- xml->addAttribute ("c_radius", c_radius);
- xml->addAttribute ("c_height", c_height);
- xml->closeMark ();
-}
-END_NAMESPACE_HEXA
-
#ifndef __DOCUMENT_H_
#define __DOCUMENT_H_
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
-#ifdef WIN32
- #ifdef max
- #undef max
-#endif
-#endif
-
BEGIN_NAMESPACE_HEXA
-class NewShape;
+class HexaExport NewShape;
-class HEXABLOCKENGINE_EXPORT Document : public EltBase
+class Document : public EltBase
{
// Fonctions utilisateur
public :
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "HexDocument.hxx"
-#include <Basics_DirUtils.hxx>
+// #include <Basics_DirUtils.hxx>
#include <cstdlib> // Pour atoi et atof
#include "Hex.hxx"
{
XmlTree xml("");
string filename = ficname;
- el_name = Kernel_Utils::GetBaseName ((pchar)ficname);
+ //el_name = Kernel_Utils::GetBaseName ((pchar)ficname);
+ make_basename (ficname, el_name);
static const int NbExt = 3;
static cpchar t_ext [NbExt] = { ".xml", ".XML", ".Xml" };
+++ /dev/null
-
-// C++ : Fonctions perimees de HexDocument
-
-// Copyright (C) 2009-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
-
-#include "HexDocument.hxx"
-
-#include "HexEltBase.hxx"
-#include "HexVertex.hxx"
-#include "HexEdge.hxx"
-#include "HexQuad.hxx"
-#include "HexHexa.hxx"
-
-#include "HexElements.hxx"
-#include "HexCrossElements.hxx"
-
-#include "HexVector.hxx"
-#include "HexCylinder.hxx"
-#include "HexPipe.hxx"
-#include "HexMatrix.hxx"
-#include "HexCloner.hxx"
-#include "HexPropagation.hxx"
-#include "HexLaw.hxx"
-
-#include "HexXmlWriter.hxx"
-#include "HexXmlTree.hxx"
-#include "HexGlobale.hxx"
-#include "HexGroup.hxx"
-#include "Hex.hxx"
-#include "HexNewShape.hxx"
-
-BEGIN_NAMESPACE_HEXA
-
-
-// ======================================================== makeCartesian
-Elements* Document::makeCartesian (Vertex* v, Vector* dir,
- int px, int py, int pz, int mx, int my, int mz)
-{
- DumpStart ("makeCartesianDiag", v << dir << px << py << pz << mx << my << mz);
-
- Vector* v1 = new Vector (this, dir->getDx(), 0, 0);
- Vector* v2 = new Vector (this, 0, dir->getDy(), 0);
- Vector* v3 = new Vector (this, 0,0, dir->getDz());
- Elements* grille = new Elements (this);
- grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz, mx, my, mz);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makeCartesian
-Elements* Document::makeCartesian (Vertex* v, Vector* v1, Vector* v2,
- Vector* v3, int px, int py, int pz)
-{
- DumpStart ("makeCartesian", v << v1 << v2 << v3 << px << py << pz);
-
- Elements* grille = new Elements (this);
- grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makeCartesian1
-Elements* Document::makeCartesian1 (Vertex* v, Vector* v1, Vector* v2,
- Vector* v3, int px, int py, int pz, int mx, int my, int mz)
-{
- DumpStart ("makeCartesian1", v << v1 << v2 << v3 << px << py << pz
- << mx << my << mz);
-
- Elements* grille = new Elements (this);
- grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz, mx, my, mz);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makeSpherical
-Elements* Document::makeSpherical (Vertex* c, double rayon, int nb, double k)
-{
- DumpStart ("makeSpherical", c << rayon << nb << k );
-
- Elements* grille = new Elements (this);
- grille->makeSphericalGrid (c, rayon, nb, k);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makeCylindrical
-Elements* Document::makeCylindrical (Vertex* c, Vector* b, Vector* h,
- double dr, double da, double dl, int nr, int na, int nl, bool fill)
-{
- DumpStart ("makeCylindrical", c << b << h << dr << da << dl << nr << na
- << nl << fill);
-
- Elements* grille = new Elements (this);
- grille->makeCylindricalGrid (c, b, h, dr, da, dl, nr, na, nl, fill);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makeSphere
-Elements* Document::makeSphere (Vertex* center, Vector* vx, Vector* vz,
- double radius, double radhole, Vertex* plorig,
- int nrad, int nang, int nhaut)
-{
- DumpStart ("makeSphere", center << vx << vz << radius << radhole << plorig
- << nrad << nang << nhaut);
-
- Elements* grille = new Elements (this);
- double radint = (radhole + radius)*DEMI;
- grille->makeRind (GR_HEMISPHERIC, center, vx, vz, radius, radint, radhole,
- plorig, 360.0, nrad, nang, nhaut);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makePartSphere
-Elements* Document::makePartSphere (Vertex* center, Vector* vx, Vector* vz,
- double radius, double radhole,
- Vertex* plorig, double angle,
- int nrad, int nang, int nhaut)
-{
- DumpStart ("makePartSphere", center << vx << vz
- << radius << radhole
- << plorig << angle
- << nrad << nang << nhaut);
-
- Elements* grille = new Elements (this);
- double radint = (radhole + radius)*DEMI;
- grille->makeRind (GR_PART_SPHERIC, center, vx, vz, radius, radint, radhole,
- plorig, angle, nrad, nang, nhaut);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makeRind
-Elements* Document::makeRind (Vertex* center, Vector* vx, Vector* vz,
- double radext, double radint, double radhole,
- Vertex* plorig, int nrad, int nang, int nhaut)
-{
- DumpStart ("makeRind", center << vx << vz
- << radext << radint << radhole
- << plorig << nrad << nang << nhaut);
-
- Elements* grille = new Elements (this);
- grille->makeRind (GR_RIND, center, vx, vz, radext, radint, radhole,
- plorig, 360.0, nrad, nang, nhaut);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makePartRind
-Elements* Document::makePartRind (Vertex* center, Vector* vx, Vector* vz,
- double radext, double radint, double radhole,
- Vertex* plorig, double angle,
- int nrad, int nang, int nhaut)
-{
- DumpStart ("makePartRind", center << vx << vz
- << radext << radint << radhole
- << plorig << angle << nrad << nang << nhaut);
-
- Elements* grille = new Elements (this);
- grille->makeRind (GR_PART_RIND, center, vx, vz, radext, radint, radhole,
- plorig, angle, nrad, nang, nhaut);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== prismQuad
-Elements* Document::prismQuad (Quad* qstart, Vector* dir, int nb)
-{
- DumpStart ("prismQuad", qstart << dir << nb);
-
- Quads tstart;
- tstart.push_back (qstart);
-
- update ();
- Elements* prisme = prismQuads (tstart, dir, nb);
-
- DumpReturn (prisme);
- return prisme;
-}
-// ======================================================== prismQuads
-Elements* Document::prismQuads (Quads tstart, Vector* dir, int nb)
-{
- DumpStart ("prismQuads", tstart << dir << nb);
-
- Elements* prisme = new Elements (this);
-
- prisme->prismQuads (tstart, dir, nb);
-
- DumpReturn (prisme);
- return prisme;
-}
-// ======================================================== prismQuadsVec
-Elements* Document::prismQuadsVec (Quads tstart, Vector* dir, RealVector tlen,
- int crit)
-{
- DumpStart ("prismQuadVec", tstart << dir << tlen << crit);
- Elements* prisme = new Elements (this);
- if (tlen.size()<=0) return prisme;
-
- prisme->prismQuadsVec (tstart, dir, tlen, crit);
-
- DumpReturn (prisme);
- return prisme;
-}
-// ======================================================== joinQuads
-Elements* Document::joinQuads (Quads tstart, Quad* dest, Vertex* v1,
- Vertex* v2, Vertex* v3, Vertex* v4, int nb)
-{
- DumpStart ("joinQuads", tstart << dest << v1 << v2 << v3 << v4 << nb);
- update ();
- Elements* joint = new Elements (this);
- if (nb<=0) return joint;
-
- int ier = joint->joinQuads (tstart, nb, v1, v2, v3, v4, dest);
- if (ier !=HOK)
- printf ("\n ****\n **** Error in joinQuad(s)\n ****\n");
-
- DumpReturn (joint);
- return joint;
-}
-// ======================================================== joinQuad
-Elements* Document::joinQuad (Quad* qstart, Quad* dest, Vertex* v1,
- Vertex* v2, Vertex* v3, Vertex* v4, int nb)
-{
- DumpStart ("joinQuad", qstart << dest << v1 << v2 << v3 << v4 << nb);
-
- Quads tstart;
- tstart.push_back (qstart);
-
- Elements* joint = joinQuads (tstart, dest, v1, v2, v3, v4, nb);
-
- DumpReturn (joint);
- return joint;
-}
-// ======================================================== cut
-Elements* Document::cut (Edge* edge, int nbcuts)
-{
- Elements* t_hexas = new Elements (this);
-
- if (edge==NULL || nbcuts<=0)
- return t_hexas;
-
- Propagation* prop = findPropagation (edge);
- const Edges& t_edges = prop->getEdges ();
-
- t_hexas->cutHexas (t_edges, nbcuts);
-
- majPropagation ();
- return t_hexas;
-}
-// ======================================================== makeCylinder
-Elements* Document::makeCylinder (Cylinder* cyl, Vector* base, int nr, int na,
- int nl)
-{
- DumpStart ("makeCylinder", cyl << base << nr << na << nl);
-
- Elements* grille = new Elements (this);
- grille->makeCylinder (cyl, base, nr, na, nl);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makeCylinders
-CrossElements* Document::makeCylinders (Cylinder* cyl1, Cylinder* cyl2)
-{
- DumpStart ("makeCylinders", cyl1 << cyl2 );
-
- CrossElements* grille = new CrossElements (this, GR_BICYL);
- grille->crossCylinders (cyl1, cyl2, true);
-
- DumpReturn (grille);
- return grille;
-}
-
-// ======================================================== makePipe
-Elements* Document::makePipe (Pipe* pipe, Vector* bx, int nr, int na, int nl)
-{
- DumpStart ("makePipe",
- pipe << bx << nr << na << nl);
-
- Elements* grille = new Elements (this);
- grille->makePipe (pipe, bx, nr, na, nr);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== makePipes
-CrossElements* Document::makePipes (Pipe* pipe1, Pipe* pipe2)
-{
- DumpStart ("makePipes",
- pipe1 << pipe2);
-
- CrossElements* grille = new CrossElements (this, GR_BIPIPE);
- grille->crossCylinders (pipe1, pipe2, false);
-
- DumpReturn (grille);
- return grille;
-}
-// ======================================================== getCylinder
-Cylinder* Document::getCylinder (int nro)
-{
- int size = doc_cylinder.size();
- if (nro>=0 && nro<size)
- return doc_cylinder [nro];
- else
- return NULL;
-}
-// ======================================================== getPipe
-Pipe* Document::getPipe (int nro)
-{
- int size = doc_pipe.size();
- if (nro>=0 && nro<size)
- return doc_pipe [nro];
- else
- return NULL;
-}
-// ======================================================== addCylinder
-Cylinder* Document::addCylinder (Vertex* b, Vector* d, double r, double h)
-{
- DumpStart ("addCylinder", b << d << r << h);
-
- Cylinder* cyl = new Cylinder (b, d, r, h);
- doc_cylinder.push_back (cyl);
-
- DumpReturn (cyl);
- return cyl;
-}
-// ======================================================== addPipe
-Pipe* Document::addPipe (Vertex* b, Vector* d, double ri, double re, double h)
-{
- DumpStart ("addPipe", b << d << ri << re << h);
-
- Pipe* tuyau = new Pipe (b, d, ri, re, h);
- doc_pipe.push_back (tuyau);
-
- DumpReturn (tuyau);
- return tuyau;
-}
-// ======================================================== revolutionQuads
-Elements* Document::revolutionQuadsVec (Quads start, Vertex* orig, Vector* axis,
- RealVector angles)
-{
- if (orig==NULL) return NULL;
- if (axis==NULL) return NULL;
- if (angles.size()==0) return NULL;
- if (start .size()==0) return NULL;
-
- Elements* prisme = new Elements (this);
- prisme->revolutionQuads (start, orig, axis, angles);
- return prisme;
-}
-// ======================================================== makeCylindricals
-Elements* Document::makeCylindricals (Vertex* c, Vector* b, Vector* h,
- RealVector tdr, RealVector tda, RealVector tdl, bool fill)
-{
- Elements* grille = new Elements (this);
- grille->makeCylindricalGrid (c, b, h, tdr, tda, tdl, fill);
- return grille;
-}
-END_NAMESPACE_HEXA
// =================================================== operator << (int)
DumpStudy& DumpStudy::operator << (int val)
{
- if (! is_open)
+ if (NOT is_open)
return *this;
char valeur [20];
// =================================================== operator << (double)
DumpStudy& DumpStudy::operator << (double val)
{
- if (! is_open)
+ if (NOT is_open)
return *this;
char valeur [20];
// =================================================== operator << (cpchar)
DumpStudy& DumpStudy::operator << (cpchar val)
{
- if (! is_open)
+ if (NOT is_open)
return *this;
string valeur ("'");
// =================================================== operator << (elt)
DumpStudy& DumpStudy::operator << (EltBase* elt)
{
- if (! is_open)
+ if (NOT is_open)
return *this;
cpchar name = findName (elt);
// =================================================== operator << (Quads)
DumpStudy& DumpStudy::operator << (Quads& tab)
{
- if (! is_open)
+ if (NOT is_open)
return *this;
TabElts& tabelt = (TabElts&) tab;
// =================================================== operator << (Edges)
DumpStudy& DumpStudy::operator << (Edges& tab)
{
- if (! is_open)
+ if (NOT is_open)
return *this;
TabElts& tabelt = (TabElts&) tab;
// =================================================== operator << (Hexas)
DumpStudy& DumpStudy::operator << (Hexas& tab)
{
- if (!is_open)
+ if (NOT is_open)
return *this;
TabElts& tabelt = (TabElts&) tab;
// =================================================== operator << (Reals)
DumpStudy& DumpStudy::operator << (RealVector& tab)
{
- if (! is_open)
+ if (NOT is_open)
return *this;
char name [20], valeur [30];
#ifndef __DUMP_STUDY_H_
#define __DUMP_STUDY_H_
-#include "Hex_defines.hxx"
#include "hexa_base.hxx"
#include <map>
#pragma warning ( disable: 4251 )
#endif
-
BEGIN_NAMESPACE_HEXA
-
#define DumpStart0(p) bool actif=el_root->glob->dump.start(this, p)
#define DumpStart(p,args) bool actif=el_root->glob->dump.start(this, p); if (actif) el_root->glob->dump << args
#define DumpEnd el_root->glob->dump.close (actif)
#define DumpRestore el_root->glob->dump.restore (actif)
class Witness;
-class HEXABLOCKENGINE_EXPORT DumpStudy
+class HexaExport DumpStudy
{
public :
DumpStudy ();
#ifndef __EDGE_H
#define __EDGE_H
-#include "Hex_defines.hxx"
#include "HexVertex.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Edge : public EltBase
+class HexaExport Edge : public EltBase
{
public:
virtual Vertex* getVertex (int nro);
#ifndef __LIBE_SHAPE_H_
#define __LIBE_SHAPE_H_
-#include "Hex_defines.hxx"
#include "HexSubShape.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT EdgeShape : public SubShape
+class HexaExport EdgeShape : public SubShape
{
public :
EdgeShape (NewShape* dad, int id);
#ifndef __ELEMENTS_H
#define __ELEMENTS_H
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
#include "HexMatrix.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Elements : public EltBase
+class HexaExport Elements : public EltBase
{
public:
virtual Hexa* getHexa (int nro);
+++ /dev/null
-
-// C++ : Grilles
-
-// Copyright (C) 2009-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
-//
-
-#include "HexElements.hxx"
-#include "HexDocument.hxx"
-#include "HexVector.hxx"
-#include "HexVertex.hxx"
-#include "HexHexa.hxx"
-#include "HexEdge.hxx"
-#include "HexGlobale.hxx"
-#include "HexCylinder.hxx"
-
-#include <cmath>
-
-BEGIN_NAMESPACE_HEXA
-
-// ====================================================== makeCartesianGrid
-int Elements::makeCartesianGrid (Vertex* orig, Vector* v1, Vector* v2,
- Vector* v3, int px, int py, int pz, int mx, int my, int mz)
-{
- return HERR;
-}
-// ====================================================== makeCartesianNodes
-int Elements::makeCartesianNodes (Vertex* orig, Vector* v1, Vector* v2,
- Vector* v3, int px, int py, int pz, int mx, int my, int mz)
-{
- return HERR;
-}
-// ====================================================== makeBasicCylinder
-int Elements::makeBasicCylinder (double dr, double da, double dl, int nr,
- int na, int nl, bool fill)
-{
- return HERR;
-}
-// ====================================================== transfoVertices
-void Elements::transfoVertices (Vertex* orig, Vector* base, Vector* haut)
-{
-}
-// ====================================================== transfoVertices
-void Elements::transfoVertices (Vertex* orig, Vector* iprim, Vector* jprim,
- Vector* kprim)
-{
-}
-// ====================================================== makeSphericalGrid
-int Elements::makeSphericalGrid (Vertex* c, double rayon, int nb, double k)
-{
- return HERR;
-}
-// ====================================================== makeSphericalGrid
-// ==== Deja perimee en Hexa5
-int Elements::makeSphericalGrid (Vertex* c, Vector* dv, int nb, double k)
-{
- return HERR;
-}
-// ====================================================== addStrate
-int Elements::addStrate (Quad* i_quad[], Edge* i_edge[], Vertex* i_node[],
- Vertex* center, double lambda)
-{
- return HERR;
-}
-// ====================================================== makeCylinder
-int Elements::makeCylinder (Cylinder* cyl, Vector* vx, int nr, int na, int nl)
-{
- return HERR;
-}
-// ====================================================== makePipe
-int Elements::makePipe (Cylinder* cyl, Vector* vx, int nr, int na, int nl)
-{
- return HERR;
-}
-//
-// ---------------------------------------- prism Quads
-//
-// ====================================================== prismQuads
-int Elements::prismQuads (Quads& tstart, Vector* dir, int nbiter)
-{
- return HERR;
-}
-// ====================================================== prismQuadsVec
-int Elements::prismQuadsVec (Quads& tstart, Vector* dir, RealVector& tlen,
- int mode)
-{
- return HERR;
-}
-// ======================================================== revolutionQuads
-int Elements::revolutionQuads (Quads& start, Vertex* center, Vector* axis,
- RealVector &angles)
-{
- return HERR;
-}
-// ====================================================== joinQuads
-int Elements::joinQuads (Quads& orig, int nb, Vertex* v1, Vertex* v2,
- Vertex* v3, Vertex* v4, Quad* cible)
-{
- return HERR;
-}
-// ====================================================== makeCylindricalGrid
-// ==== Version avec vecteurs --> TODO DELETE ????
-int Elements::makeCylindricalGrid (Vertex* orig, Vector* base, Vector* haut,
- RealVector& tdr, RealVector& tda, RealVector& tdh,
- bool fill)
-{
- return HOK;
-}
-// ====================================================== makeCylindricalGrid
-int Elements::makeCylindricalGrid (Vertex* c, Vector* b, Vector* h,
- double dr, double da, double dl, int nr, int na, int nl, bool fill)
-{
- return HOK;
-}
-
-END_NAMESPACE_HEXA
#ifndef __ELT_BASE_H
#define __ELT_BASE_H
-#include "Hex_defines.hxx"
#include "hexa_base.hxx"
#include <vector>
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT EltBase
+class HexaExport EltBase
{
public :
virtual int countHexa () { return 0; }
#ifndef __FACE_SHAPE_H_
#define __FACE_SHAPE_H_
-#include "Hex_defines.hxx"
#include "HexSubShape.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT FaceShape : public SubShape
+class HexaExport FaceShape : public SubShape
{
public :
FaceShape (NewShape* dad, int id);
#ifndef _HEX_GLOBALE_H
#define _HEX_GLOBALE_H
-#include "Hex_defines.hxx"
#include "hexa_base.hxx"
#include "HexDumpStudy.hxx"
#include "HexWitness.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Globale
+class HexaExport Globale
{
public :
static Globale* getInstance ();
#ifndef __GROUP_H
#define __GROUP_H
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Group : public EltBase
+class HexaExport Group : public EltBase
{
public :
int addElement (EltBase* elt);
#ifndef __HEX_HEXA_H_
#define __HEX_HEXA_H_
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
#include "HexQuad.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Hexa : public EltBase
+class HexaExport Hexa : public EltBase
{
public:
virtual Quad* getQuad (int nro);
class gp_Pnt;
-#include "Hex_defines.hxx"
#include "HexGlobale.hxx"
BEGIN_NAMESPACE_HEXA
-int HEXABLOCKENGINE_EXPORT geom_create_cylcyl (double* borig, double* bnorm, double* bbase,
- double bray, double bhaut,
- double* sorig, double* snorm, double* sbase,
- double sray, double shaut);
-int HEXABLOCKENGINE_EXPORT geom_asso_cylcyl (Edge* edge);
+int HexaExport geom_create_cylcyl (double* borig, double* bnorm, double* bbase,
+ double bray, double bhaut,
+ double* sorig, double* snorm, double* sbase,
+ double sray, double shaut);
+int HexaExport geom_asso_cylcyl (Edge* edge);
-bool HEXABLOCKENGINE_EXPORT same_coords (gp_Pnt& pa, gp_Pnt& pb, double epsil2=1e-6);
-void HEXABLOCKENGINE_EXPORT save_brep (cpchar nom, string brep, int& nro);
-void HEXABLOCKENGINE_EXPORT clean_brep (string& brep);
+bool HexaExport same_coords (gp_Pnt& pa, gp_Pnt& pb, double epsil2=1e-6);
+void HexaExport save_brep (cpchar nom, string brep, int& nro);
+void HexaExport clean_brep (string& brep);
-void HEXABLOCKENGINE_EXPORT geom_make_brep (TopoDS_Shape& shape, string& brep);
-int HEXABLOCKENGINE_EXPORT geom_brep2point (rcstring brep, double& px, double& py, double& pz);
-int HEXABLOCKENGINE_EXPORT geom_brep2shape (rcstring brep, TopoDS_Shape& shape);
+void HexaExport geom_make_brep (TopoDS_Shape& shape, string& brep);
+int HexaExport geom_brep2point (rcstring brep, double& px, double& py, double& pz);
+int HexaExport geom_brep2shape (rcstring brep, TopoDS_Shape& shape);
-TopoDS_Shape HEXABLOCKENGINE_EXPORT geom_brep2shape (rcstring brep);
+TopoDS_Shape HexaExport geom_brep2shape (rcstring brep);
END_NAMESPACE_HEXA
#endif
#ifndef __LAW_H_
#define __LAW_H_
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
#include "HexXmlWriter.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Law : public EltBase
+class HexaExport Law : public EltBase
{
public:
const char* getName () { return law_name.c_str() ; }
#ifndef __MATRIX_H
#define __MATRIX_H
-#include "Hex_defines.hxx"
#include "HexVertex.hxx"
#include "HexVector.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Matrix
+class HexaExport Matrix
{
public:
Matrix ();
#ifndef __NEW_SHAPE_H_
#define __NEW_SHAPE_H_
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
#ifndef SWIG
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT NewShape : public EltBase
+class HexaExport NewShape : public EltBase
{
public : // for TUI
virtual int countVertex () { return tab_vertex.size (); }
+++ /dev/null
-
-// C++ : Gestion des tuyaux
-
-// Copyright (C) 2009-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
-//
-#include "HexPipe.hxx"
-
-#include "HexDocument.hxx"
-#include "HexVertex.hxx"
-#include "HexVector.hxx"
-#include "HexXmlWriter.hxx"
-
-BEGIN_NAMESPACE_HEXA
-
-// ======================================================== Constructeur
-Pipe::Pipe (Vertex* b, Vector* v, double ri, double re, double h)
- : Cylinder (b, v, re, h)
-{
- c_int_radius = ri;
- if (isBad () || c_int_radius <= el_root->getTolerance ()
- || c_int_radius >= c_radius)
- setError ();
-}
-// ========================================================= saveXml
-void Pipe::saveXml (XmlWriter* xml)
-{
- char buffer[12];
-
- xml->openMark ("Pipe");
- xml->addAttribute ("c_base", c_base->getName (buffer));
- xml->addAttribute ("c_dir", c_dir->getName (buffer));
- xml->addAttribute ("c_radius", c_radius);
- xml->addAttribute ("c_int_radius", c_int_radius);
- xml->addAttribute ("c_height", c_height);
- xml->closeMark ();
-}
-END_NAMESPACE_HEXA
#ifndef __PROPAGATION_H
#define __PROPAGATION_H
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
#include "HexDocument.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Propagation : public EltBase
+class HexaExport Propagation : public EltBase
{
public:
const Edges& getEdges () { return prop_edges; }
#ifndef __QUAD_H
#define __QUAD_H
-#include "Hex_defines.hxx"
#include "HexEdge.hxx"
BEGIN_NAMESPACE_HEXA
#ifndef SWIG
-struct HEXABLOCKENGINE_EXPORT StrOrient
+struct StrOrient
{
Vertex* v11; // 1er sommet 1er quad
Vertex* v12; // 2eme
};
#endif
-class HEXABLOCKENGINE_EXPORT Quad : public EltBase
+class HexaExport Quad : public EltBase
{
public:
virtual Edge* getEdge (int nro);
#ifndef __SHAPE_H_
#define __SHAPE_H_
-#include "Hex_defines.hxx"
#include "hexa_base.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Shape
+class HexaExport Shape
{
public :
Shape (string brep);
sub_ident = id;
sub_dim = dim;
maj_brep = maj_shape = true;
- kind_of = KS_None;
}
// ====================================================== getShape
const TopoDS_Shape& SubShape::getShape ()
#ifndef __SUB_SHAPE_H_
#define __SUB_SHAPE_H_
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
#include <TopoDS_Shape.hxx>
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT SubShape : public EltBase
+class HexaExport SubShape : public EltBase
{
public :
SubShape (NewShape* dad, int id, int dim);
- NewShape* getParentShape() const { return ss_parent; }
- cpchar getParentName () const;
- int getIdent () { return sub_ident ; }
- int getDim () { return sub_dim ; }
+ NewShape* getParentShape() const { return ss_parent; }
+ cpchar getParentName () const;
+ int getIdent () { return sub_ident ; }
+ int getDim () { return sub_dim ; }
EnumKindOfShape kindOf () { return kind_of ; }
const string& getBrep ();
#ifndef __VECTOR_H
#define __VECTOR_H
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
#include <cmath>
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Vector : public EltBase
+class HexaExport Vector : public EltBase
{
public:
double getDx () { return v_dx ; }
#ifndef __VERTEX_H_
#define __VERTEX_H_
-#include "Hex_defines.hxx"
#include "HexEltBase.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT Vertex : public EltBase
+class HexaExport Vertex : public EltBase
{
public :
double getX() { return v_x; }
#ifndef __NODE_SHAPE_H_
#define __NODE_SHAPE_H_
-#include "Hex_defines.hxx"
#include "HexSubShape.hxx"
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT VertexShape : public SubShape
+class HexaExport VertexShape : public SubShape
{
public :
VertexShape (NewShape* dad, int id);
#ifndef __WITNESS_H_
#define __WITNESS_H_
-#include "Hex_defines.hxx"
-
#define Mess el_root->glob->mess << Begin
#define Follow el_root->glob->mess
const std::string Begin (" **** ");
class DumpStudy;
-class HEXABLOCKENGINE_EXPORT Witness
+class HexaExport Witness
{
public :
Witness ();
#ifndef __XML_TREE_H_
#define __XML_TREE_H_
-#include "Hex_defines.hxx"
#include "hexa_base.hxx"
#include <vector>
M_IDENT, M_EQUALS, M_STRING,
M_COMMENT, M_END_COMMENT, M_PROLOG, M_END_PROLOG,
M_ERROR};
-class HEXABLOCKENGINE_EXPORT XmlTree
+class HexaExport XmlTree
{
public :
XmlTree (const string& name, XmlTree* dad=NULL);
#ifndef __XML_WRITER_H
#define __XML_WRITER_H
-#include "Hex_defines.hxx"
#include "hexa_base.hxx"
#include <stack>
#include <vector>
BEGIN_NAMESPACE_HEXA
-class HEXABLOCKENGINE_EXPORT XmlWriter
+class HexaExport XmlWriter
{
public :
XmlWriter ();
#else
#define HEXABLOCKENGINE_EXPORT
#endif
+#define HexaExport HEXABLOCKENGINE_EXPORT
-#endif //_HEX_DEFINES_HXX_
\ No newline at end of file
+#endif //_HEX_DEFINES_HXX_
typedef double Real;
typedef double Real3 [DIM3];
+ // a cause de Swig
+#ifndef HEXABLOCKENGINE_EXPORT
+#define HEXABLOCKENGINE_EXPORT
+#endif
+
+#ifndef HexaExport
+#define HexaExport
+#endif
+
// Quelques fonctions :
-HEXABLOCKENGINE_EXPORT pchar get_temp_name (cpchar format, pchar nomfic);
-HEXABLOCKENGINE_EXPORT void fatal_error (cpchar format, cpchar info1=NULL, cpchar info2=NULL);
+HexaExport pchar get_temp_name (cpchar format, pchar nomfic);
+HexaExport void fatal_error (cpchar format, cpchar info1=NULL, cpchar info2=NULL);
-HEXABLOCKENGINE_EXPORT double prod_scalaire (double v1[], double v2[]);
-HEXABLOCKENGINE_EXPORT double* prod_vectoriel (double v1[], double v2[], double v3[]);
-HEXABLOCKENGINE_EXPORT double prod_mixte (double vi[], double vj[], double vk[]);
+HexaExport double prod_scalaire (double v1[], double v2[]);
+HexaExport double* prod_vectoriel (double v1[], double v2[], double v3[]);
+HexaExport double prod_mixte (double vi[], double vj[], double vk[]);
-HEXABLOCKENGINE_EXPORT inline double deg2radians (double angle) { return (angle*M_PI/180.0); }
-HEXABLOCKENGINE_EXPORT inline double rad2degres (double angle) { return (angle*180.0/M_PI); }
+HexaExport inline double deg2radians (double angle) { return (angle*M_PI/180.0); }
+HexaExport inline double rad2degres (double angle) { return (angle*180.0/M_PI); }
-HEXABLOCKENGINE_EXPORT double calc_norme (double v1[]);
-HEXABLOCKENGINE_EXPORT double calc_distance (double v1[], double v2[]);
-HEXABLOCKENGINE_EXPORT void calc_vecteur (double pta[], double ptb[], double vab[]);
-HEXABLOCKENGINE_EXPORT void copy_vecteur (double va [], double vb []);
-HEXABLOCKENGINE_EXPORT void calc_milieu (double pta[], double ptb[], double milieu[]);
-HEXABLOCKENGINE_EXPORT int normer_vecteur (double v1[]);
+HexaExport double calc_norme (double v1[]);
+HexaExport double calc_distance (double v1[], double v2[]);
+HexaExport void calc_vecteur (double pta[], double ptb[], double vab[]);
+HexaExport void copy_vecteur (double va [], double vb []);
+HexaExport void calc_milieu (double pta[], double ptb[], double milieu[]);
+HexaExport int normer_vecteur (double v1[]);
-HEXABLOCKENGINE_EXPORT double carre (double val);
-HEXABLOCKENGINE_EXPORT bool same_coords (double* pa, double* pb, double epsilon=1e-6);
+HexaExport double carre (double val);
+HexaExport bool same_coords (double* pa, double* pb, double epsilon=1e-6);
-HEXABLOCKENGINE_EXPORT bool requals (const double v1, const double v2);
-HEXABLOCKENGINE_EXPORT bool requals (const double* v1, const double* v2);
+HexaExport bool requals (const double v1, const double v2);
+HexaExport bool requals (const double* v1, const double* v2);
-HEXABLOCKENGINE_EXPORT bool on_debug(); // == getenv ("HEXA_DB") > 0
-HEXABLOCKENGINE_EXPORT bool in_test (); // == getenv ("HEXA_TEST") > 0
-HEXABLOCKENGINE_EXPORT int niv_debug(); // Implemente prochainement
+HexaExport bool on_debug(); // == getenv ("HEXA_DB") > 0
+HexaExport bool in_test (); // == getenv ("HEXA_TEST") > 0
+HexaExport int niv_debug(); // Implemente prochainement
-HEXABLOCKENGINE_EXPORT void set_minus (string& chaine);
+HexaExport void set_minus (string& chaine);
-HEXABLOCKENGINE_EXPORT bool special_option ();
-HEXABLOCKENGINE_EXPORT void set_special_option (bool opt);
+HexaExport bool special_option ();
+HexaExport void set_special_option (bool opt);
-HEXABLOCKENGINE_EXPORT int sizeof_file (cpchar filename);
-HEXABLOCKENGINE_EXPORT char* read_file (cpchar filename, int& size);
-HEXABLOCKENGINE_EXPORT cpchar get_time (string& buffer);
+HexaExport int sizeof_file (cpchar filename);
+HexaExport char* read_file (cpchar filename, int& size);
+HexaExport cpchar get_time (string& buffer);
+HexaExport int make_basename (cpchar filename, string& base);
const double Epsil = 1e-6;
const double UnEpsil = 0.999999;
const double Epsil2 = 1e-12;
-
END_NAMESPACE_HEXA
#endif
return lun!=NULL && lautre!=NULL && requals (lun [0], lautre [0])
&& requals (lun [1], lautre [1]) && requals (lun [2], lautre [2]) ;
}
+// ======================================================== make_basename
+int make_basename (cpchar filename, string& base)
+{
+ const char slash = '/';
+ const char antis = '\\';
+ int lg = strlen (filename);
+ int ifin = -1;
+ int ideb = 0;
+ bool more = true;
+
+ for (int nc = lg-1 ; more && nc>=0 ; --nc)
+ {
+ char car = filename[nc];
+ if (car==slash || car==antis)
+ {
+ if (ifin >0)
+ {
+ ideb = nc + 1;
+ more = false;
+ }
+ }
+ else if (ifin<0)
+ ifin = nc;
+ }
+
+ if (ifin <0)
+ {
+ base = "undefined";
+ return HERR;
+ }
+
+ base = "";
+ for (int nc=ideb ; nc <= ifin ; ++nc)
+ base += filename[nc];
+ return HOK;
+}
END_NAMESPACE_HEXA
<x>0</x>
<y>0</y>
<width>242</width>
- <height>72</height>
+ <height>129</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Dialog</string>
</property>
</widget>
</item>
<item row="1" column="1">
- <widget class="QLineEdit" name="shape_le"/>
+ <widget class="QLineEdit" name="shape_le">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
</item>
</layout>
</widget>
<rect>
<x>0</x>
<y>0</y>
- <width>289</width>
+ <width>270</width>
<height>326</height>
</rect>
</property>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Cut Edge Operation</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="cutUni_rb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Uniform</string>
</property>
</item>
<item>
<widget class="QRadioButton" name="cut_rb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Custom</string>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="e_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QSpinBox" name="nb_cut_spb">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<rect>
<x>0</x>
<y>0</y>
- <width>338</width>
- <height>598</height>
+ <width>320</width>
+ <height>632</height>
</rect>
</property>
<property name="sizePolicy">
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Disconnect Operation</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QScrollArea" name="scrollArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<rect>
<x>0</x>
<y>0</y>
- <width>318</width>
- <height>578</height>
+ <width>300</width>
+ <height>612</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<bool>true</bool>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="maximumSize">
<size>
<width>16777215</width>
- <height>50</height>
+ <height>16777215</height>
</size>
</property>
<property name="title">
<item>
<widget class="QRadioButton" name="rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QRadioButton" name="rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QRadioButton" name="rb3">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item>
<widget class="QRadioButton" name="rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Quad</string>
</property>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="v_le_rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="h_le_rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QWidget" name="widget_2" native="true">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="e_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="h_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QWidget" name="widget_3" native="true">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="q_le_rb2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="h_le_rb2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</layout>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
</widget>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>260</width>
+ <width>5</width>
<height>0</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QRadioButton" name="single_rb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>One edge</string>
</property>
</item>
<item>
<widget class="QRadioButton" name="multiple_rb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Line</string>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</widget>
</item>
<item row="0" column="1">
- <widget class="QLineEdit" name="first_vex_le"/>
+ <widget class="QLineEdit" name="first_vex_le">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</item>
</layout>
</widget>
<item row="0" column="0" colspan="2">
<widget class="QLineEdit" name="single_edge_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="single_line_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="pstart_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="pend_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
<rect>
<x>0</x>
<y>0</y>
- <width>244</width>
- <height>323</height>
+ <width>226</width>
+ <height>369</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Edge Construction</string>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="maximumSize">
<size>
<width>16777215</width>
- <height>50</height>
+ <height>16777215</height>
</size>
</property>
<property name="title">
<item>
<widget class="QRadioButton" name="rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QRadioButton" name="rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
<property name="title">
<string/>
</property>
<item>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QFormLayout" name="formLayout_4">
- <item row="0" column="0">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string> Name </string>
- </property>
- </widget>
- </item>
<item row="0" column="1">
<widget class="QLineEdit" name="name_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string> Name </string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>Point</string>
- </property>
- </widget>
- </item>
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
<item row="0" column="1">
<widget class="QLineEdit" name="vex_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>Vector</string>
- </property>
- </widget>
- </item>
<item row="1" column="1">
<widget class="QLineEdit" name="vec_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Vector</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Point</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QFormLayout" name="formLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Point 1</string>
- </property>
- </widget>
- </item>
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
<item row="0" column="1">
<widget class="QLineEdit" name="v0_le_rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Point 2</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QLineEdit" name="v1_le_rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Point 2</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Point 1</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
</tabstops>
<resources/>
<connections>
- <connection>
- <sender>rb0</sender>
- <signal>clicked()</signal>
- <receiver>widget_2</receiver>
- <slot>show()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>77</x>
- <y>47</y>
- </hint>
- <hint type="destinationlabel">
- <x>73</x>
- <y>218</y>
- </hint>
- </hints>
- </connection>
<connection>
<sender>rb0</sender>
<signal>clicked()</signal>
</hint>
</hints>
</connection>
+ <connection>
+ <sender>rb0</sender>
+ <signal>clicked()</signal>
+ <receiver>widget_2</receiver>
+ <slot>show()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>77</x>
+ <y>47</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>73</x>
+ <y>218</y>
+ </hint>
+ </hints>
+ </connection>
<connection>
<sender>rb1</sender>
<signal>clicked()</signal>
<x>0</x>
<y>0</y>
<width>194</width>
- <height>206</height>
+ <height>222</height>
</rect>
</property>
<property name="sizePolicy">
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QWidget" name="" native="true">
+ <widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<item row="0" column="1">
<widget class="QLineEdit" name="name_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
#include "HEXABLOCKGUI_DocumentModel.hxx"
#include "HEXABLOCKGUI_DocumentSelectionModel.hxx"
-#include "HEXABLOCKGUI_DocumentDelegate.hxx"
+//#include "HEXABLOCKGUI_DocumentDelegate.hxx"
#include "HEXABLOCKGUI_DocumentPanel.hxx"
#include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
#include "HEXABLOCKGUI_OccGraphicView.hxx"
#include <Visual3d_ViewManager.hxx>
+#include <Graphic3d_Structure.hxx>
+#include <Graphic3d_Group.hxx>
#include <V3d_PerspectiveView.hxx>
#include <V3d_AmbientLight.hxx>
+#include <Graphic3d_GraphicDevice.hxx>
+#include <Graphic3d_Array1OfVertex.hxx>
#include <V3d_DirectionalLight.hxx>
#include <Xw_Window.hxx>
#include <V3d_TypeOfShadingModel.hxx>
HEXABLOCKGUI::HEXABLOCKGUI() :
SalomeApp_Module( "HEXABLOCK" ),
+// LightApp_Module( "HEXABLOCK" ),
_menuId(190),
_dwPattern(0),
_dwAssociation(0),
_dwObjectBrowser(0),
_dwInputPanel(0),
_patternDataTreeView(0),
- _patternBuilderTreeView(0),
+// _patternBuilderTreeView(0),
_patternGeomTreeView(0),
_groupsTreeView(0),
_meshTreeView(0),
- _treeViewDelegate(0),
+// _treeViewDelegate(0),
_isSaved( false ),
moduleActivatedOnce(false),
_vertexDiag(0),
_makeHemiSphereDiag(0),
_modelInfoDiag(NULL),
_addShapeDiag(NULL),
+ _vertexInfoDialog(NULL),
+ _edgeInfoDialog(NULL),
+ _quadInfoDialog(NULL),
+ _hexaInfoDialog(NULL),
+ _vectorInfoDialog(NULL),
+ _groupInfoDialog(NULL),
+ _lawInfoDialog(NULL),
+ _propagationInfoDialog(NULL),
currentDialog(NULL),
lastOccPrs(NULL),
lastVtkDocGView(NULL)
{ //HexaBlock Vtk Window has been closed
if (currentDialog != NULL) currentDialog->close();
- if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
+// if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
if (currentDocGView != NULL)
currentDocGView->setViewWindow(NULL);
if (_edgeAssocDiag != NULL) _edgeAssocDiag->clear();
if (_quadAssocDiag != NULL) _quadAssocDiag->clear();
if (currentDialog != NULL) currentDialog->close();
- if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
+// if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
currentOccGView->getViewWindow()->removeEventFilter(this);
{
//close opened dialog
if (currentDialog != NULL) currentDialog->close();
- if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
+// if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
initialMenus();
}
QTreeView* theTree = NULL;
if ( sender() == currentGraphicView->getPatternDataSelectionModel() ){
theTree = _patternDataTreeView;
- } else if ( sender() == currentGraphicView->getPatternBuilderSelectionModel() ){
+ }
+ /*else if ( sender() == currentGraphicView->getPatternBuilderSelectionModel() ){
theTree = _patternBuilderTreeView;
- } else if ( sender() == currentGraphicView->getPatternGeomSelectionModel() ) {
+ }*/
+ else if ( sender() == currentGraphicView->getPatternGeomSelectionModel() ) {
theTree = _patternGeomTreeView;
}
else if ( sender() == currentGraphicView->getGroupsSelectionModel() ){
_dwInputPanel = new QDockWidget(aParent);
_dwInputPanel->setVisible(false);
_dwInputPanel->setWindowTitle("Input Panel");
- _dwInputPanel->setMinimumWidth(DWINPUT_MINIMUM_WIDTH); // --- force a minimum until display
+// _dwInputPanel->setMinimumWidth(DWINPUT_MINIMUM_WIDTH); // --- force a minimum until display
- _treeViewDelegate = new DocumentDelegate(_dwInputPanel);
+// _treeViewDelegate = new DocumentDelegate(_dwInputPanel);
//2) ************* document data ( Pattern, Association, Mesh ) in treeview representation
// Pattern
patternLayout->setSizeConstraint(QLayout::SetMaximumSize);
QSplitter *splitter = new QSplitter(Qt::Vertical,patternFrame);
_patternDataTreeView = new QTreeView(patternFrame);//_dwPattern);
- _patternBuilderTreeView = new QTreeView(patternFrame);
+// _patternBuilderTreeView = new QTreeView(patternFrame); // ---> TO REMOVE
_patternGeomTreeView = new QTreeView(patternFrame);
splitter->addWidget(_patternDataTreeView);
- splitter->addWidget(_patternBuilderTreeView);
+// splitter->addWidget(_patternBuilderTreeView); // ---> TO REMOVE
splitter->addWidget(_patternGeomTreeView);
patternLayout->addWidget(splitter);
- _patternDataTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers/*QAbstractItemView::DoubleClicked*/);
+ _patternDataTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers/*QAbstractItemView::DoubleClicked*/);
_patternDataTreeView->setSelectionMode(QAbstractItemView::SingleSelection/*QAbstractItemView::MultiSelection*/);
- _patternDataTreeView->setItemDelegate(_treeViewDelegate);
+// _patternDataTreeView->setItemDelegate(_treeViewDelegate);
- _patternBuilderTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
- _patternBuilderTreeView->setItemDelegate(_treeViewDelegate);
+// _patternBuilderTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
+// _patternBuilderTreeView->setItemDelegate(_treeViewDelegate);
_patternGeomTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
_patternGeomTreeView->setSelectionMode(QAbstractItemView::SingleSelection/*QAbstractItemView::MultiSelection*/);
_dwGroups->setWindowTitle("Groups");
_dwGroups->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display
_groupsTreeView = new QTreeView(_dwGroups);
- _groupsTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
- _groupsTreeView->setItemDelegate(_treeViewDelegate);
+ _groupsTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
+// _groupsTreeView->setItemDelegate(_treeViewDelegate);
_dwGroups->setWidget(_groupsTreeView);
_groupsTreeView->show();
_dwMesh->setWindowTitle("Mesh");
_dwMesh->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display
_meshTreeView = new QTreeView(_dwMesh);
- _meshTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
+ _meshTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
_meshTreeView->setSelectionMode(QAbstractItemView::SingleSelection);
- _meshTreeView->setItemDelegate(_treeViewDelegate);
+// _meshTreeView->setItemDelegate(_treeViewDelegate);
_dwMesh->setWidget(_meshTreeView);
_meshTreeView->show();
// dock widget position
aParent->addDockWidget( Qt::LeftDockWidgetArea, _dwObjectBrowser );
- aParent->addDockWidget( Qt::LeftDockWidgetArea, _dwInputPanel );
+// aParent->addDockWidget( Qt::LeftDockWidgetArea, _dwInputPanel );
+ aParent->addDockWidget( Qt::RightDockWidgetArea, _dwInputPanel );
aParent->tabifyDockWidget( _dwObjectBrowser, _dwPattern );
aParent->tabifyDockWidget( _dwPattern, _dwGroups );
dgview->getPatternDataSelectionModel(), SLOT( salomeSelectionChanged() ), Qt::UniqueConnection );
connect( dgview->getPatternDataSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection );
- connect( dgview->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
- this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection );
+// connect( dgview->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
+// this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection );
connect( dgview->getPatternGeomSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection );
connect( dgview->getGroupsSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
dgview->getPatternDataSelectionModel(), SLOT( salomeSelectionChanged() ) );
disconnect( dgview->getPatternDataSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
- disconnect( dgview->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
- this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+// disconnect( dgview->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
+// this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
disconnect( dgview->getPatternGeomSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
disconnect( dgview->getGroupsSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
//close opened dialog
if (currentDialog != NULL) currentDialog->close();
- if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
+// if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
initialMenus();
if (currentDocGView != dgview) clearDialogs();
_patternDataTreeView->setModel(dgview->getPatternDataModel());
- _patternBuilderTreeView->setModel(dgview->getPatternBuilderModel());
+// _patternBuilderTreeView->setModel(dgview->getPatternBuilderModel());
_patternGeomTreeView->setModel(dgview->getPatternGeomModel());
_groupsTreeView->setModel(dgview->getGroupsModel());
_meshTreeView->setModel(dgview->getMeshModel());
_patternDataTreeView->setSelectionModel(dgview->getPatternDataSelectionModel());
- _patternDataTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
+ _patternDataTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
- _patternBuilderTreeView->setSelectionModel(dgview->getPatternBuilderSelectionModel());
- _patternBuilderTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
+// _patternBuilderTreeView->setSelectionModel(dgview->getPatternBuilderSelectionModel());
+// _patternBuilderTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
_patternGeomTreeView->setSelectionModel(dgview->getPatternGeomSelectionModel());
_patternGeomTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
_groupsTreeView->setSelectionModel(dgview->getGroupsSelectionModel());
- _groupsTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
+ _groupsTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
_meshTreeView->setSelectionModel(dgview->getMeshSelectionModel());
- _meshTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
+ _meshTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
// = * init occ view * =
currentModelDialogs.insert(diag);
//close the current dialog box info
- if (_treeViewDelegate != NULL)
- _treeViewDelegate->closeDialog();
+// if (_treeViewDelegate != NULL)
+// _treeViewDelegate->closeDialog();
- if (_dwInputPanel->widget())
- _dwInputPanel->widget()->close();
+// if (_dwInputPanel->widget())
+// _dwInputPanel->widget()->close();
//Temporary for debugging EdgeAssoc Faked InfoDialog
if (diag == _edgeAssocDiag)
currentDialog = diag;
diag->setFocus();
+
+ if (currentDocGView != NULL)
+ currentDocGView->getPatternDataSelectionModel()->setInfoMode(false);
+}
+
+void HEXABLOCKGUI::showVertexInfoDialog(HEXA_NS::Vertex* vertex)
+{
+ if (vertex == NULL || _dwInputPanel == NULL)
+ return;
+
+ if (_vertexInfoDialog == NULL)
+ _vertexInfoDialog = new VertexDialog(_dwInputPanel, HexaBaseDialog::INFO_MODE);
+
+ _vertexInfoDialog->setValue(vertex);
+ _vertexInfoDialog->resetSizeAndShow(_dwInputPanel);
+ currentDialog = _vertexInfoDialog;
+}
+
+void HEXABLOCKGUI::showEdgeInfoDialog(HEXA_NS::Edge* edge)
+{
+ if (edge == NULL || _dwInputPanel == NULL)
+ return;
+
+ if (_edgeInfoDialog == NULL)
+ _edgeInfoDialog = new EdgeDialog(_dwInputPanel, HexaBaseDialog::INFO_MODE);
+
+ _edgeInfoDialog->setValue(edge);
+ _edgeInfoDialog->resetSizeAndShow(_dwInputPanel);
+ currentDialog = _edgeInfoDialog;
+}
+
+void HEXABLOCKGUI::showQuadInfoDialog(HEXA_NS::Quad* quad)
+{
+ if (quad == NULL || _dwInputPanel == NULL)
+ return;
+
+ if (_quadInfoDialog == NULL)
+ _quadInfoDialog = new QuadDialog(_dwInputPanel, HexaBaseDialog::INFO_MODE);
+
+ _quadInfoDialog->setValue(quad);
+ _quadInfoDialog->resetSizeAndShow(_dwInputPanel);
+ currentDialog = _quadInfoDialog;
+}
+
+void HEXABLOCKGUI::showHexaInfoDialog(HEXA_NS::Hexa* hexa)
+{
+ if (hexa == NULL || _dwInputPanel == NULL)
+ return;
+
+ if (_hexaInfoDialog == NULL)
+ _hexaInfoDialog = new HexaDialog(_dwInputPanel, HexaBaseDialog::INFO_MODE);
+
+ _hexaInfoDialog->setValue(hexa);
+ _hexaInfoDialog->resetSizeAndShow(_dwInputPanel);
+ currentDialog = _hexaInfoDialog;
+}
+
+void HEXABLOCKGUI::showVectorInfoDialog(HEXA_NS::Vector* vector)
+{
+ if (vector == NULL || _dwInputPanel == NULL)
+ return;
+
+ if (_vectorInfoDialog == NULL)
+ _vectorInfoDialog = new VectorDialog(_dwInputPanel, HexaBaseDialog::INFO_MODE);
+
+ _vectorInfoDialog->setValue(vector);
+ _vectorInfoDialog->resetSizeAndShow(_dwInputPanel);
+ currentDialog = _vectorInfoDialog;
+}
+
+void HEXABLOCKGUI::showGroupInfoDialog(HEXA_NS::Group* group)
+{
+ if (group == NULL || _dwInputPanel == NULL)
+ return;
+
+ if (_groupInfoDialog == NULL)
+ _groupInfoDialog = new GroupDialog(_dwInputPanel, HexaBaseDialog::INFO_MODE);
+
+ _groupInfoDialog->setValue(group);
+ _groupInfoDialog->resetSizeAndShow(_dwInputPanel);
+ currentDialog = _groupInfoDialog;
+}
+
+void HEXABLOCKGUI::showLawInfoDialog(HEXA_NS::Law* law)
+{
+ if (law == NULL || _dwInputPanel == NULL)
+ return;
+
+ if (_lawInfoDialog == NULL)
+ _lawInfoDialog = new LawDialog(_dwInputPanel, HexaBaseDialog::INFO_MODE);
+
+ _lawInfoDialog->setValue(law);
+ _lawInfoDialog->resetSizeAndShow(_dwInputPanel);
+ currentDialog = _lawInfoDialog;
+}
+
+void HEXABLOCKGUI::showPropagationInfoDialog(HEXA_NS::Propagation* propagation)
+{
+ if (propagation == NULL || _dwInputPanel == NULL)
+ return;
+
+ if (_propagationInfoDialog == NULL)
+ _propagationInfoDialog = new PropagationDialog(_dwInputPanel, HexaBaseDialog::INFO_MODE);
+
+ _propagationInfoDialog->setValue(propagation);
+ _propagationInfoDialog->resetSizeAndShow(_dwInputPanel);
+ currentDialog = _propagationInfoDialog;
}
void HEXABLOCKGUI::addVertex()
_vectorDiag->name_le->setText(doc->getNextName(HEXA_NS::EL_VECTOR).c_str());
}
-void HEXABLOCKGUI::addCylinder()
-{
- if ( !_cylinderDiag ){
- _cylinderDiag = new CylinderDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE);
- }
- _showDialogBox( _cylinderDiag );
-
- //set default name
- HEXA_NS::Document* doc = getCurrentModel() ? getCurrentModel()->getHexaDocument() : NULL;
- if (_cylinderDiag != NULL && doc != NULL)
- _cylinderDiag->name_le->setText(doc->getNextName(HEXA_NS::EL_CYLINDER).c_str());
-}
-
+//void HEXABLOCKGUI::addCylinder()
+//{
+// if ( !_cylinderDiag ){
+// _cylinderDiag = new CylinderDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE);
+// }
+// _showDialogBox( _cylinderDiag );
+//
+// //set default name
+// HEXA_NS::Document* doc = getCurrentModel() ? getCurrentModel()->getHexaDocument() : NULL;
+// if (_cylinderDiag != NULL && doc != NULL)
+// _cylinderDiag->name_le->setText(doc->getNextName(HEXA_NS::EL_CYLINDER).c_str());
+//}
-void HEXABLOCKGUI::addPipe()
-{
- if ( !_pipeDiag){
- _pipeDiag = new PipeDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE);
- }
- _showDialogBox( _pipeDiag );
- //set default name
- HEXA_NS::Document* doc = getCurrentModel() ? getCurrentModel()->getHexaDocument() : NULL;
- if (_pipeDiag != NULL && doc != NULL)
- _pipeDiag->name_le->setText(doc->getNextName(HEXA_NS::EL_CYLINDER).c_str());
-}
+//void HEXABLOCKGUI::addPipe()
+//{
+// if ( !_pipeDiag){
+// _pipeDiag = new PipeDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE);
+// }
+// _showDialogBox( _pipeDiag );
+//
+// //set default name
+// HEXA_NS::Document* doc = getCurrentModel() ? getCurrentModel()->getHexaDocument() : NULL;
+// if (_pipeDiag != NULL && doc != NULL)
+// _pipeDiag->name_le->setText(doc->getNextName(HEXA_NS::EL_CYLINDER).c_str());
+//}
void HEXABLOCKGUI::makeGrid()
void HEXABLOCKGUI::setPropagation()
{
- if ( !_propagationDiag ){
+ if ( !_propagationDiag )
_propagationDiag = new PropagationDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE);
- }
+
_showDialogBox( _propagationDiag );
}
// --------------------------------------------
void HEXABLOCKGUI::computeMesh()
{
- if ( !_computeMeshDiag ){
+ if ( !_computeMeshDiag )
_computeMeshDiag = new ComputeMeshDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE);
- }
- _computeMeshDiag->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+
_showDialogBox( _computeMeshDiag );
}
extern "C"
{
- HEXABLOCK_EXPORT CAM_Module* createModule()
+ HexaExport CAM_Module* createModule()
{
return new HEXABLOCKGUI();
}
- HEXABLOCK_EXPORT char* getModuleVersion()
+ HexaExport char* getModuleVersion()
{
return (char*)HEXABLOCK_VERSION_STR;
}
#ifndef _HEXABLOCKGUI_HXX_
#define _HEXABLOCKGUI_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
#include <iostream>
#include <map>
#include <set>
class VtkDocumentGraphicView;
class OccGraphicView;
class GraphicViewsHandler;
- class DocumentDelegate;
+// class DocumentDelegate;
class DocumentModel;
class PatternDataModel;
- class PatternBuilderModel;
+// class PatternBuilderModel;
class AssociationsModel;
class GroupsModel;
class MeshModel;
class PatternDataSelectionModel;
- class PatternBuilderSelectionModel;
+// class PatternBuilderSelectionModel;
class GroupsSelectionModel;
class MeshSelectionModel;
class LightApp_VTKSelector;
-class HEXABLOCK_EXPORT HEXABLOCKGUI : public SalomeApp_Module
+class HexaExport HEXABLOCKGUI : public SalomeApp_Module
{
Q_OBJECT
QTreeView* getPatternDataTreeView() const { return _patternDataTreeView; }
QTreeView* getPatternGeomTreeView() const { return _patternGeomTreeView; }
+ void showVertexInfoDialog(HEXA_NS::Vertex* vertex);
+ void showEdgeInfoDialog(HEXA_NS::Edge* edge);
+ void showQuadInfoDialog(HEXA_NS::Quad* quad);
+ void showHexaInfoDialog(HEXA_NS::Hexa* hexa);
+ void showVectorInfoDialog(HEXA_NS::Vector* vector);
+ void showGroupInfoDialog(HEXA_NS::Group* group);
+ void showLawInfoDialog(HEXA_NS::Law* law);
+ void showPropagationInfoDialog(HEXA_NS::Propagation* propagation);
+
public slots:
bool deactivateModule( SUIT_Study* theStudy);
bool activateModule( SUIT_Study* theStudy);
void addHexa();
void addVector();
- void addCylinder();
- void addPipe();
+// void addCylinder();
+// void addPipe();
void makeGrid();
void makeCylinder();
void makePipe();
QDockWidget *_dwInputPanel; // user Input
+ // ** Elements creation and modification Dialogs **
+
// Dialog Box ( to keep persistent values )
HEXABLOCK::GUI::VertexDialog* _vertexDiag;
HEXABLOCK::GUI::EdgeDialog* _edgeDiag;
HEXABLOCK::GUI::ModelInfoDialog* _modelInfoDiag;
HEXABLOCK::GUI::AddShapeDialog* _addShapeDiag;
+ // ** Elements information dialogs **
+ HEXABLOCK::GUI::VertexDialog* _vertexInfoDialog;
+ HEXABLOCK::GUI::EdgeDialog* _edgeInfoDialog;
+ HEXABLOCK::GUI::QuadDialog* _quadInfoDialog;
+ HEXABLOCK::GUI::HexaDialog* _hexaInfoDialog;
+ HEXABLOCK::GUI::VectorDialog* _vectorInfoDialog;
+ HEXABLOCK::GUI::GroupDialog* _groupInfoDialog;
+ HEXABLOCK::GUI::LawDialog* _lawInfoDialog;
+ HEXABLOCK::GUI::PropagationDialog* _propagationInfoDialog;
+
std::set<HEXABLOCK::GUI::HexaBaseDialog*> currentModelDialogs;
// Actions
// Pattern Builder
QAction *_addVector;
- QAction *_addCylinder;
- QAction *_addPipe;
+// QAction *_addCylinder;
+// QAction *_addPipe;
QAction *_makeGrid; //Cartesian, Cylindrical, Spherical
QAction *_makeCylinder;
QAction *_makePipe;
// Meshing
QAction *_computeMesh;
-
QAction* _showModelInfoAct;
-
QAction* _addShapeAct;
// VIEW VIEW VIEW VIEW VIEW VIEW VIEW VIEW VIEW VIEW
QTreeView* _patternDataTreeView; // document's pattern : 1 ( only one view )
- QTreeView* _patternBuilderTreeView; // document's pattern : 1 ( only one view )
+// QTreeView* _patternBuilderTreeView; // document's pattern : 1 ( only one view )
QTreeView* _patternGeomTreeView; // the geometries' tree view
QTreeView* _associationTreeView; // document's association : 1 ( only one view )
QTreeView* _groupsTreeView; // document's groups
QTreeView* _meshTreeView; // document's mesh property: 1 ( only one view )
// DELEGATE DELEGATE DELEGATE DELEGATE DELEGATE DELEGATE DELEGATE
- HEXABLOCK::GUI::DocumentDelegate *_treeViewDelegate; // specific editor for each item of the tree
+// HEXABLOCK::GUI::DocumentDelegate *_treeViewDelegate; // specific editor for each item of the tree
HEXABLOCK::GUI::GraphicViewsHandler* graphicViewsHandler; //vtk views hanlder (create, close, ...)
if (_dw->widget()) _dw->widget()->close();
if ( !_dw->isVisible() ) _dw->setVisible(true);
- switch ( index.data(HEXA_TREE_ROLE).toInt() ){
+ switch ( index.data(HEXA_TREE_ROLE).toInt() )
+ {
case VERTEX_TREE : editor = new VertexDialog(_dw, HexaBaseDialog::INFO_MODE); break;
case EDGE_TREE : editor = new EdgeDialog(_dw, HexaBaseDialog::INFO_MODE); break;
case QUAD_TREE : editor = new QuadDialog(_dw, HexaBaseDialog::INFO_MODE); break;
case LAW_TREE : editor = new LawDialog(_dw, HexaBaseDialog::INFO_MODE); break;
case PROPAGATION_TREE : editor = new PropagationDialog(_dw, HexaBaseDialog::INFO_MODE); break;
}
- if ( editor != NULL ){
+
+ if ( editor != NULL )
+ {
HEXABLOCKGUI::assocInProgress = false;
//show the editor in the dockwidget
_dw->close();
_currentEditor = editor;
+
return editor;
}
if (_currentEditor!=NULL)
{
_currentEditor->close();
- emit closeEditor(_currentEditor, NoHint);
+ emit closeEditor(_currentEditor, NoHint); //Problem
delete _currentEditor;
_currentEditor = NULL;
}
}
break;
}
-
}
#ifndef __HEXABLOCKGUI_DOCUMENTDELEGATE_HXX_
#define __HEXABLOCKGUI_DOCUMENTDELEGATE_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
+
// QEvent * event, QAbstractItemModel
#include <QEvent>
#include "HEXABLOCKGUI_DocumentItem.hxx"
#include "HEXABLOCKGUI_DocumentPanel.hxx"
+#include "hexa_base.hxx"
+
namespace HEXABLOCK
{
namespace GUI
{
- class HEXABLOCK_EXPORT DocumentDelegate : public QItemDelegate
+ class HexaExport DocumentDelegate : public QItemDelegate
{
Q_OBJECT
QDockWidget* _dw; // creator's container
private slots:
- //void commitEditor();
+ void commitEditor();
};
}
// case CYLINDERITEM: return QVariant::fromValue( (HEXA_NS::Cylinder*)m_DocElt );
// case PIPEITEM: return QVariant::fromValue( (HEXA_NS::Pipe*)m_DocElt );
case ELEMENTSITEM: return QVariant::fromValue( (HEXA_NS::Elements*)m_DocElt );
- case CROSSELEMENTSITEM: return QVariant::fromValue( (HEXA_NS::CrossElements*)m_DocElt );
+// case CROSSELEMENTSITEM: return QVariant::fromValue( (HEXA_NS::CrossElements*)m_DocElt );
case GEOMSHAPEITEM: return QVariant::fromValue( (HEXA_NS::NewShape*) m_DocElt );
case GEOMPOINTITEM: return QVariant::fromValue( (HEXA_NS::VertexShape*) m_DocElt );
case GEOMEDGEITEM: return QVariant::fromValue( (HEXA_NS::EdgeShape*) m_DocElt );
#ifndef _HEXABLOCKGUI_DOCUMENTITEM_HXX_
#define _HEXABLOCKGUI_DOCUMENTITEM_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
#include <QStandardItem>
-#include <HexVertex.hxx>
-#include <HexEdge.hxx>
-#include <HexQuad.hxx>
-#include <HexHexa.hxx>
+#include "HexVertex.hxx"
+#include "HexEdge.hxx"
+#include "HexQuad.hxx"
+#include "HexHexa.hxx"
-#include <HexVector.hxx>
-#include <HexCylinder.hxx>
-#include <HexPipe.hxx>
-#include <HexElements.hxx>
-#include <HexCrossElements.hxx>
-#include <HexNewShape.hxx>
-#include <HexVertexShape.hxx>
-#include <HexEdgeShape.hxx>
-#include <HexFaceShape.hxx>
+#include "HexVector.hxx"
+#include "HexElements.hxx"
+#include "HexNewShape.hxx"
+#include "HexVertexShape.hxx"
+#include "HexEdgeShape.hxx"
+#include "HexFaceShape.hxx"
-
-
-#include <HexGroup.hxx>
-#include <HexLaw.hxx>
-#include <HexPropagation.hxx>
+#include "HexGroup.hxx"
+#include "HexLaw.hxx"
+#include "HexPropagation.hxx"
#include "vtkActor.h"
Q_DECLARE_METATYPE( HEXA_NS::Hexa* );
Q_DECLARE_METATYPE( HEXA_NS::Vector* );
-Q_DECLARE_METATYPE( HEXA_NS::Cylinder* );
-Q_DECLARE_METATYPE( HEXA_NS::Pipe* );
+// Q_DECLARE_METATYPE( HEXA_NS::Cylinder* );
+// Q_DECLARE_METATYPE( HEXA_NS::Pipe* );
Q_DECLARE_METATYPE( HEXA_NS::Elements* );
-Q_DECLARE_METATYPE( HEXA_NS::CrossElements* );
+// Q_DECLARE_METATYPE( HEXA_NS::CrossElements* );
Q_DECLARE_METATYPE( HEXA_NS::NewShape* );
Q_DECLARE_METATYPE( HEXA_NS::SubShape* );
Q_DECLARE_METATYPE( HEXA_NS::VertexShape* );
PROPAGATIONITEM,
};
- enum HexaTreeRole {
+ enum HexaTreeRole {
VERTEX_TREE = 10,
EDGE_TREE,
QUAD_TREE,
// QVariant::UserType
//===================================================================================
- class HEXABLOCK_EXPORT ElementItem : public QStandardItem
+ class HexaExport ElementItem : public QStandardItem
{
public:
ElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole);
};
//===================================================================================
- class HEXABLOCK_EXPORT GraphicElementItem : public ElementItem
+ class HexaExport GraphicElementItem : public ElementItem
{
public:
GraphicElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
int IDinActor;
};
- class HEXABLOCK_EXPORT StandardElementItem : public ElementItem
+ class HexaExport StandardElementItem : public ElementItem
{
public:
StandardElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
}
};
- class HEXABLOCK_EXPORT VertexItem : public GraphicElementItem
+ class HexaExport VertexItem : public GraphicElementItem
{
public:
VertexItem( HEXA_NS::Vertex* hexaVertex, QString entry = "");
};
- class HEXABLOCK_EXPORT EdgeItem : public GraphicElementItem
+ class HexaExport EdgeItem : public GraphicElementItem
{
public:
EdgeItem( HEXA_NS::Edge* hexaEdge, QString entry = "");
};
//-----------------------------------------
- class HEXABLOCK_EXPORT QuadItem : public GraphicElementItem
+ class HexaExport QuadItem : public GraphicElementItem
{
public:
QuadItem( HEXA_NS::Quad* hexaQuad, QString entry = "");
};
//-----------------------------------------
- class HEXABLOCK_EXPORT HexaItem : public GraphicElementItem
+ class HexaExport HexaItem : public GraphicElementItem
{
public:
HexaItem( HEXA_NS::Hexa* hexaHexa, QString entry = "");
};
//-----------------------------------------
- class HEXABLOCK_EXPORT VectorItem : public StandardElementItem
+ class HexaExport VectorItem : public StandardElementItem
{
public:
VectorItem( HEXA_NS::Vector* hexaVector, QString entry = "");
};
//-----------------------------------------
-// class HEXABLOCK_EXPORT CylinderItem : public StandardElementItem
+// class HexaExport CylinderItem : public StandardElementItem
// {
// public:
// CylinderItem( HEXA_NS::Cylinder* hexaCyl, QString entry = "");
// };
//-----------------------------------------
- class HEXABLOCK_EXPORT ElementsItem : public StandardElementItem
+ class HexaExport ElementsItem : public StandardElementItem
{
public:
ElementsItem( HEXA_NS::Elements* hexaElements, QString entry = "" );
// };
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomItem: public StandardElementItem
+ class HexaExport GeomItem: public StandardElementItem
{
public:
GeomItem( HEXA_NS::EltBase* geomShape, QString entry, HexaType ttype, HexaTreeRole treeRole, HEXA_NS::EltBase* assoc = NULL );
};
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomShapeItem: public GeomItem
+ class HexaExport GeomShapeItem: public GeomItem
{
public:
GeomShapeItem( HEXA_NS::NewShape* shape, HEXA_NS::EltBase* assoc = NULL);
};
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomPointItem: public GeomItem
+ class HexaExport GeomPointItem: public GeomItem
{
public:
GeomPointItem( HEXA_NS::VertexShape* geomPoint, HEXA_NS::Vertex* associatedVertex = NULL);
};
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomEdgeItem: public GeomItem
+ class HexaExport GeomEdgeItem: public GeomItem
{
public:
GeomEdgeItem( HEXA_NS::EdgeShape* geomEdge, HEXA_NS::Edge* associatedEdge = NULL);
};
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomFaceItem: public GeomItem
+ class HexaExport GeomFaceItem: public GeomItem
{
public:
GeomFaceItem( HEXA_NS::FaceShape* geomFace, HEXA_NS::Quad* associatedQuad = NULL);
};
//-----------------------------------------
- class HEXABLOCK_EXPORT GroupItem : public QStandardItem
+ class HexaExport GroupItem : public QStandardItem
{
public:
GroupItem( HEXA_NS::Group* hexaGroup );
};
- class HEXABLOCK_EXPORT LawItem : public QStandardItem
+ class HexaExport LawItem : public QStandardItem
{
public:
LawItem( HEXA_NS::Law* hexaLaw );
};
- class HEXABLOCK_EXPORT PropagationItem : public QStandardItem
+ class HexaExport PropagationItem : public QStandardItem
{
public:
PropagationItem( HEXA_NS::Propagation* hexaPropagation );
case HEXA_TREE : elt = getHexaPtr<HEXA_NS::Hexa*>(iElt); break;
case VECTOR_TREE : elt = getHexaPtr<HEXA_NS::Vector*>(iElt); break;
case ELEMENTS_TREE : elt = getHexaPtr<HEXA_NS::Elements*>(iElt); break;
- case CROSSELEMENTS_TREE : elt = getHexaPtr<HEXA_NS::CrossElements*>(iElt); break;
+// case CROSSELEMENTS_TREE : elt = getHexaPtr<HEXA_NS::CrossElements*>(iElt); break;
case GEOMSHAPE_TREE: elt = getHexaPtr<HEXA_NS::NewShape*>(iElt); break;
case GEOMPOINT_TREE: elt = getHexaPtr<HEXA_NS::VertexShape*>(iElt); break;
case GEOMEDGE_TREE: elt = getHexaPtr<HEXA_NS::EdgeShape*>(iElt); break;
clearAll();
fillData();
- fillBuilder();
+// fillBuilder();
fillGeometry();
fillAssociation();
fillGroups();
clearAll();
fillData();
- fillBuilder();
+// fillBuilder();
fillGeometry();
fillAssociation();
fillGroups();
void DocumentModel::clearAll()
{
clearData();
- clearBuilder();
+// clearBuilder();
clearGeometry();
clearAssociation();
clearGroups();
_edgeDirItem->removeRows(0, _edgeDirItem->rowCount() );
_quadDirItem->removeRows(0, _quadDirItem->rowCount() );
_hexaDirItem->removeRows(0, _hexaDirItem->rowCount() );
-}
-
-void DocumentModel::clearBuilder()
-{
_vectorDirItem->removeRows(0, _vectorDirItem->rowCount() );
_elementsDirItem->removeRows(0, _elementsDirItem->rowCount() );
_crossElementsDirItem->removeRows(0, _crossElementsDirItem->rowCount() );
}
+
+//void DocumentModel::clearBuilder()
+//{
+// _vectorDirItem->removeRows(0, _vectorDirItem->rowCount() );
+// _elementsDirItem->removeRows(0, _elementsDirItem->rowCount() );
+// _crossElementsDirItem->removeRows(0, _crossElementsDirItem->rowCount() );
+//}
+
void DocumentModel::clearGeometry()
{
_explicitShapesDirItem->removeRows(0, _explicitShapesDirItem->rowCount() );
hItem = new HexaItem(h, _entry);
_hexaDirItem->appendRow(hItem);
}
-}
+ // +++++ Builder ++++++++++++++++++++++++++++++
-void DocumentModel::fillBuilder()
-{
- HEXA_NS::Vector *v = NULL;
- VectorItem *vItem = NULL;
+ HEXA_NS::Vector *vec = NULL;
+ VectorItem *vecItem = NULL;
int nbVector = _hexaDocument->countVector();
for ( int i=0; i<nbVector; ++i ){
- v = _hexaDocument->getVector(i);
- vItem = new VectorItem(v);
- _vectorDirItem->appendRow(vItem);
+ vec = _hexaDocument->getVector(i);
+ vecItem = new VectorItem(vec);
+ _vectorDirItem->appendRow(vecItem);
}
//******* A VOIR AVEC ALAIN POUR LE REMPLISSAGE DE L'ARBRE ELEMENTS ET CROSSELEMENTS (ByCylinder) *******/
//******* OU SONT STOCKES LES ELEMENTS ET LES CROSSELEMENTS DANS LE DOCUMENT? ******/
// _cylinderDirItem
-// HEXA_NS::Cylinder *c = NULL;
-// HEXA_NS::Elements* c = NULL;
-// CylinderItem *cItem = NULL;
-// ElementsItem* cItem = NULL;
-// int nbCylinder = _hexaDocument->countCylinder();
-// for ( int i=0; i<nbCylinder; ++i ){
-// c = _hexaDocument->getCylinder(i);
-// cItem = new CylinderItem(c, _entry);
-// cItem = new ElementsItem(c, _entry);
-// _cylinderDirItem->appendRow(cItem);
-// _elementsDirItem->appendRow(cItem);
-// }
+ // HEXA_NS::Cylinder *c = NULL;
+ // HEXA_NS::Elements* c = NULL;
+ // CylinderItem *cItem = NULL;
+ // ElementsItem* cItem = NULL;
+ // int nbCylinder = _hexaDocument->countCylinder();
+ // for ( int i=0; i<nbCylinder; ++i ){
+ // c = _hexaDocument->getCylinder(i);
+ // cItem = new CylinderItem(c, _entry);
+ // cItem = new ElementsItem(c, _entry);
+ // _cylinderDirItem->appendRow(cItem);
+ // _elementsDirItem->appendRow(cItem);
+ // }
// _pipeDirItem
-// HEXA_NS::Pipe *p = NULL;
-// HEXA_NS::Elements* p = NULL;
-// PipeItem *pItem = NULL;
-// ElementsItem* pItem = NULL;
-// int nbPipe = _hexaDocument->countPipe();
-// for ( int i=0; i<nbPipe; ++i ){
-// p = _hexaDocument->getPipe(i);
-// pItem = new PipeItem(p);
-// pItem = new ElementsItem(p, _entry);
-// _pipeDirItem->appendRow(pItem);
-// _elementsDirItem->appendRow(pItem);
-// }
+ // HEXA_NS::Pipe *p = NULL;
+ // HEXA_NS::Elements* p = NULL;
+ // PipeItem *pItem = NULL;
+ // ElementsItem* pItem = NULL;
+ // int nbPipe = _hexaDocument->countPipe();
+ // for ( int i=0; i<nbPipe; ++i ){
+ // p = _hexaDocument->getPipe(i);
+ // pItem = new PipeItem(p);
+ // pItem = new ElementsItem(p, _entry);
+ // _pipeDirItem->appendRow(pItem);
+ // _elementsDirItem->appendRow(pItem);
+ // }
//********************************************************************************************************
}
+
+//void DocumentModel::fillBuilder()
+//{
+// HEXA_NS::Vector *v = NULL;
+// VectorItem *vItem = NULL;
+// int nbVector = _hexaDocument->countVector();
+// for ( int i=0; i<nbVector; ++i ){
+// v = _hexaDocument->getVector(i);
+// vItem = new VectorItem(v);
+// _vectorDirItem->appendRow(vItem);
+// }
+//
+// //******* A VOIR AVEC ALAIN POUR LE REMPLISSAGE DE L'ARBRE ELEMENTS ET CROSSELEMENTS (ByCylinder) *******/
+// //******* OU SONT STOCKES LES ELEMENTS ET LES CROSSELEMENTS DANS LE DOCUMENT? ******/
+//
+// // _cylinderDirItem
+//// HEXA_NS::Cylinder *c = NULL;
+//// HEXA_NS::Elements* c = NULL;
+//// CylinderItem *cItem = NULL;
+//// ElementsItem* cItem = NULL;
+//// int nbCylinder = _hexaDocument->countCylinder();
+//// for ( int i=0; i<nbCylinder; ++i ){
+//// c = _hexaDocument->getCylinder(i);
+//// cItem = new CylinderItem(c, _entry);
+//// cItem = new ElementsItem(c, _entry);
+//// _cylinderDirItem->appendRow(cItem);
+//// _elementsDirItem->appendRow(cItem);
+//// }
+//
+// // _pipeDirItem
+//// HEXA_NS::Pipe *p = NULL;
+//// HEXA_NS::Elements* p = NULL;
+//// PipeItem *pItem = NULL;
+//// ElementsItem* pItem = NULL;
+//// int nbPipe = _hexaDocument->countPipe();
+//// for ( int i=0; i<nbPipe; ++i ){
+//// p = _hexaDocument->getPipe(i);
+//// pItem = new PipeItem(p);
+//// pItem = new ElementsItem(p, _entry);
+//// _pipeDirItem->appendRow(pItem);
+//// _elementsDirItem->appendRow(pItem);
+//// }
+// //********************************************************************************************************
+//}
+
void DocumentModel::fillGeometry()
{
PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
_propagationItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
}
+/**********************************************************
void DocumentModel::allowCrossElementsSelectionOnly()
{
_vertexItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
_lawItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
_propagationItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
}
+ ********************************************************** */
void DocumentModel::allowLawSelectionOnly()
{
return edgeIndex;
}
-QModelIndex DocumentModel::addEdgeVector ( const QModelIndex &i_v, const QModelIndex &i_vec )
+QModelIndex DocumentModel::addEdgeVector( const QModelIndex &i_v, const QModelIndex &i_vec )
{
QModelIndex edgeIndex;
- HEXA_NS::Vertex* hv0 = getHexaPtr<HEXA_NS::Vertex*>(i_v);
+ HEXA_NS::Vertex* hv = getHexaPtr<HEXA_NS::Vertex*>(i_v);
HEXA_NS::Vector* hvec = getHexaPtr<HEXA_NS::Vector*>(i_vec);
- HEXA_NS::Edge* he = _hexaDocument->addEdgeVector( hv0, hvec );
+ if (hv == NULL || hvec == NULL) return edgeIndex;
+
+ HEXA_NS::Edge* he = _hexaDocument->addEdgeVector( hv, hvec );
if ( BadElement(he) ) return edgeIndex;
+ HEXA_NS::Vertex* hv2 = he->getAval(); //the new vertex resulting from the creation of the edge
+ if (hv2 == NULL) return edgeIndex;
+
+ //ADD the edge in the treeview
EdgeItem* e = new EdgeItem(he, _entry);
- _vectorDirItem->appendRow(e);
+ _edgeDirItem->appendRow(e);
edgeIndex = e->index();
+
+ //The resulting Vertex
+ VertexItem* v = new VertexItem(hv2, _entry);
+ _vertexDirItem->appendRow(v);
+
emit patternDataChanged();
return edgeIndex;
HEXA_NS::Vertex* hv2 = getHexaPtr<HEXA_NS::Vertex*>(i_v2);
HEXA_NS::Vertex* hv3 = getHexaPtr<HEXA_NS::Vertex*>(i_v3);
- if ( hv0 && hv1 && hv2 && hv3 ){
+ if ( hv0 and hv1 and hv2 and hv3 ){
HEXA_NS::Quad* hq = _hexaDocument->addQuadVertices( hv0, hv1, hv2, hv3 );
if ( BadElement(hq) ) return quadIndex;
HEXA_NS::Edge* he2 = getHexaPtr<HEXA_NS::Edge*>(e2);
HEXA_NS::Edge* he3 = getHexaPtr<HEXA_NS::Edge*>(e3);
- if ( he0 && he1 && he2 && he3 ){
+ if ( he0 and he1 and he2 and he3 ){
HEXA_NS::Quad* hq = _hexaDocument->addQuad( he0, he1, he2, he3 );
if ( BadElement(hq) ) return quadIndex;
PatternDataModel::PatternDataModel( QObject * parent ) :
QSortFilterProxyModel( parent )
{
- QString dataRegExp = QString("(%1|%2|%3|%4|%5|%6|%7|%8)").
- arg(VERTEX_TREE).arg(EDGE_TREE).arg(QUAD_TREE).arg(HEXA_TREE).
- arg(VERTEX_DIR_TREE).arg(EDGE_DIR_TREE).arg(QUAD_DIR_TREE).arg(HEXA_DIR_TREE);
+ QString dataRegExp = QString("(%1|%2|%3|%4|%5|%6|%7|%8|%9|%10|%11|%12)").
+ arg(VERTEX_TREE).arg(EDGE_TREE).arg(QUAD_TREE).arg(HEXA_TREE).arg(VECTOR_TREE).arg(ELEMENTS_TREE).
+ arg(VERTEX_DIR_TREE).arg(EDGE_DIR_TREE).arg(QUAD_DIR_TREE).arg(HEXA_DIR_TREE).arg(VECTOR_DIR_TREE).
+ arg(ELEMENTS_DIR_TREE);
setFilterRole(HEXA_TREE_ROLE);
setFilterRegExp ( QRegExp(dataRegExp) );
QVariant PatternDataModel::headerData ( int section, Qt::Orientation orientation, int role ) const
{
- if ( section == 0 && orientation == Qt::Horizontal && role == Qt::DisplayRole ){
+ if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){
return QVariant( "Data" );
} else {
return QSortFilterProxyModel::headerData ( section, orientation, role );
return item;
}
-PatternBuilderModel::PatternBuilderModel( QObject * parent ) :
- QSortFilterProxyModel( parent )
-{
- QString builderRegExp =QString("(%1|%2|%3|%4|%5|%6)").
- arg(VECTOR_TREE).arg(ELEMENTS_TREE).
- arg(CROSSELEMENTS_TREE).arg(VECTOR_DIR_TREE).arg(ELEMENTS_DIR_TREE).arg(CROSSELEMENTS_DIR_TREE);
-
- setFilterRole( HEXA_TREE_ROLE );
- setFilterRegExp ( QRegExp( builderRegExp ) );
-}
-
-PatternBuilderModel::~PatternBuilderModel()
-{
-}
+//PatternBuilderModel::PatternBuilderModel( QObject * parent ) :
+// QSortFilterProxyModel( parent )
+//{
+// QString builderRegExp =QString("(%1|%2|%3|%4|%5|%6)").
+// arg(VECTOR_TREE).arg(ELEMENTS_TREE).
+// arg(CROSSELEMENTS_TREE).arg(VECTOR_DIR_TREE).arg(ELEMENTS_DIR_TREE).arg(CROSSELEMENTS_DIR_TREE);
+//
+// setFilterRole( HEXA_TREE_ROLE );
+// setFilterRegExp ( QRegExp( builderRegExp ) );
+//}
-Qt::ItemFlags PatternBuilderModel::flags(const QModelIndex &index) const
-{
- Qt::ItemFlags flags;
+//PatternBuilderModel::~PatternBuilderModel()
+//{
+//}
- DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
- if ( m != NULL ){
- flags = m->flags( mapToSource(index) );
- }
- return flags;
-}
+//Qt::ItemFlags PatternBuilderModel::flags(const QModelIndex &index) const
+//{
+// Qt::ItemFlags flags;
+//
+// DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
+// if ( m != NULL ){
+// flags = m->flags( mapToSource(index) );
+// }
+// return flags;
+//}
-QVariant PatternBuilderModel::headerData ( int section, Qt::Orientation orientation, int role ) const
-{
- if ( section == 0 && orientation == Qt::Horizontal && role == Qt::DisplayRole ){
- return QVariant( "Builder" );
- } else {
- return QSortFilterProxyModel::headerData ( section, orientation, role );
- }
-}
+//QVariant PatternBuilderModel::headerData ( int section, Qt::Orientation orientation, int role ) const
+//{
+// if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){
+// return QVariant( "Builder" );
+// } else {
+// return QSortFilterProxyModel::headerData ( section, orientation, role );
+// }
+//}
-QStandardItem* PatternBuilderModel::itemFromIndex ( const QModelIndex & index ) const
-{
- QStandardItem *item = NULL;
- DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
- if ( m != NULL ){
- item = m->itemFromIndex( mapToSource(index) );
- }
- return item;
-}
+//QStandardItem* PatternBuilderModel::itemFromIndex ( const QModelIndex & index ) const
+//{
+// QStandardItem *item = NULL;
+// DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
+// if ( m != NULL ){
+// item = m->itemFromIndex( mapToSource(index) );
+// }
+// return item;
+//}
//====================================================================
// PatternGeomModel
QVariant PatternGeomModel::headerData ( int section, Qt::Orientation orientation, int role ) const
{
- if ( section == 0 && orientation == Qt::Horizontal && role == Qt::DisplayRole ){
+ if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){
return QVariant( "Geometry" );
} else {
return QSortFilterProxyModel::headerData ( section, orientation, role );
QVariant AssociationsModel::headerData ( int section, Qt::Orientation orientation, int role ) const
{
- if ( section == 0 && orientation == Qt::Horizontal && role == Qt::DisplayRole ){
+ if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){
return QVariant( "Associations" );
} else {
return QSortFilterProxyModel::headerData ( section, orientation, role );
QVariant GroupsModel::headerData ( int section, Qt::Orientation orientation, int role ) const
{
- if ( section == 0 && orientation == Qt::Horizontal && role == Qt::DisplayRole ){
+ if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){
return QVariant( "Groups" );
} else {
return QSortFilterProxyModel::headerData ( section, orientation, role );
QVariant MeshModel::headerData ( int section, Qt::Orientation orientation, int role ) const
{
- if ( section == 0 && orientation == Qt::Horizontal && role == Qt::DisplayRole ){
+ if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){
return QVariant( "Mesh" );
} else {
return QSortFilterProxyModel::headerData ( section, orientation, role );
#define _HEXABLOCKGUI_DOCUMENTMODEL_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
#include <QTemporaryFile>
#include <QStandardItemModel>
#include <QSortFilterProxyModel>
{
namespace GUI
{
- class HEXABLOCK_EXPORT DocumentModel : public QStandardItemModel
+ class HexaExport DocumentModel : public QStandardItemModel
{
Q_OBJECT
public:
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();
};
- class HEXABLOCK_EXPORT PatternDataModel : public QSortFilterProxyModel
+ class PatternDataModel : public QSortFilterProxyModel
{
public:
PatternDataModel( QObject * parent = 0 );
};
- 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
{
return iItems;
}
-// ============================================================= lockSizeToSizeHint
-void HexaBaseDialog::lockSizeToSizeHint()
-{
- setMaximumHeight(sizeHint().height());
- // setMaximumWidth(sizeHint().width());
- // setMinimumHeight(sizeHint().height());
- // setMinimumWidth(sizeHint().width());
-}
-
-// ============================================================= unlockSizeModification
-void HexaBaseDialog::unlockSizeModification()
-{
- setMaximumHeight(MAX_HEIGHT);
- // setMaximumWidth(MAX_WIDTH);
- // setMinimumHeight(MIN_HEIGHT);
- // setMinimumWidth(MIN_WIDTH);
-}
-
// ============================================================= resetSizeAndShow
void HexaBaseDialog::resetSizeAndShow(QDockWidget* parent)
{
+ if (parent == NULL)
+ return;
+
//force the dialog to fit its contain
- lockSizeToSizeHint();
+// setMinimumWidth(sizeHint().width());
//set the dialog in the dockwidget
+ if (parent->widget())
+ parent->widget()->close();
parent->setWidget(this);
parent->setWindowTitle(windowTitle());
- parent->setVisible(true);
- show();
+ parent->show();
- unlockSizeModification();
+// setMinimumWidth(MIN_WIDTH);
}
QString HexaBaseDialog::getErrorMsg()
//Connect the graphic view and its model to the dialog box
connect( docGView->getPatternDataSelectionModel(), SIGNAL( selectionChanged ( const QItemSelection &, const QItemSelection &) ),
this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection );
- connect( docGView->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
- this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection );
+// connect( docGView->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
+// this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection );
connect( docGView->getPatternGeomSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection );
connect( docGView->getGroupsSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
disconnect(docGView->getPatternDataSelectionModel(), SIGNAL( selectionChanged ( const QItemSelection &, const QItemSelection &) ),
this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
- disconnect(docGView->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
- this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+// disconnect(docGView->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
+// this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
disconnect(docGView->getPatternGeomSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
{
//reset the data selection pattern (forget all selections of the current context)
getPatternDataSelectionModel()->reset();
- getPatternBuilderSelectionModel()->reset();
+// getPatternBuilderSelectionModel()->reset();
getPatternGeomSelectionModel()->reset();
//Clear vtk selection
//Close the dialog box
if (parentWidget())
parentWidget()->close();
+
+ getPatternDataSelectionModel()->setInfoMode(true);
}
// ============================================================== onHelpRequested
case VERTEX_TREE:
case EDGE_TREE:
case QUAD_TREE:
- case HEXA_TREE: selector = getPatternDataSelectionModel(); break;
- case VECTOR_TREE:
+ case HEXA_TREE:
+ case VECTOR_TREE: selector = getPatternDataSelectionModel(); break;
// case CYLINDER_TREE:
// case PIPE_TREE:
- case ELEMENTS_TREE:
- case CROSSELEMENTS_TREE: selector = getPatternBuilderSelectionModel(); break;
+// case ELEMENTS_TREE:
+// case CROSSELEMENTS_TREE: selector = getPatternBuilderSelectionModel(); break;
case GEOMPOINT_TREE:
case GEOMEDGE_TREE:
case GEOMFACE_TREE: selector = getPatternGeomSelectionModel(); break;
if ( !getDocumentModel() ) return false;
const PatternDataModel* patternDataModel = getPatternDataModel();
- const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
- if ( !patternDataModel || !patternBuilderModel ) return false;
+// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+ if ( !patternDataModel /*|| !patternBuilderModel*/ ) return false;
QModelIndex iEdge;
}
} else if ( rb1->isChecked() ){
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] );
+ QModelIndex ivec = patternDataModel->mapToSource( _index[vec_le_rb1] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] );
if ( ivex.isValid() && ivec.isValid() ){
iEdge = getDocumentModel()->addEdgeVector( ivex, ivec );
}
if ( editmode == INFO_MODE ){
setWindowTitle( tr("Hexahedron Information") );
+ quads_lw->viewport()->setAttribute( Qt::WA_TransparentForMouseEvents );
+ vertices_lw->viewport()->setAttribute( Qt::WA_TransparentForMouseEvents );
}
}
vertices_lw->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) );
vertices_lw->installEventFilter(this);
-
if ( editmode != INFO_MODE ) {
// delete item from listwidget
QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw );
}
nbItems = iElts.count();
- if ( quads_rb->isChecked() && (nbItems>=2 && nbItems<=6) ){ // build from quads iElts.count() should be between [2,6]
+ if ( quads_rb->isChecked() and (nbItems>=2 and nbItems<=6) ){ // build from quads iElts.count() should be between [2,6]
iHexa = getDocumentModel()->addHexaQuads( iElts );
- } else if ( vertices_rb->isChecked() && nbItems== 8 ){ // build from vertices
+ } else if ( vertices_rb->isChecked() and nbItems== 8 ){ // build from vertices
iHexa = getDocumentModel()->addHexaVertices( iElts[0], iElts[1], iElts[2], iElts[3],
iElts[4], iElts[5], iElts[6], iElts[7] );
}
if ( !getDocumentModel() ) return false;
const PatternDataModel* patternDataModel = getPatternDataModel();
- const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
- if ( !patternDataModel || !patternBuilderModel) return false;
+// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+ if ( !patternDataModel /*|| !patternBuilderModel*/) return false;
QModelIndex iVector;
updateDefaultName(name_le, _value->getType());
// to select/highlight result
- result = patternBuilderModel->mapFromSource(iVector);
+ result = patternDataModel->mapFromSource(iVector);
+// result = patternBuilderModel->mapFromSource(iVector);
return true;
}
DocumentModel* docModel = getDocumentModel();
PatternDataModel* patternDataModel = getPatternDataModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QModelIndex iNewElts;
if ( rb0->isChecked() )
else if ( rb1->isChecked() )
{
QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] );
- QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
- QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] );
+ QModelIndex iaxis = patternDataModel->mapToSource( _index[axis_le] );
+ QModelIndex ibase = patternDataModel->mapToSource( _index[base_le] );
+ QModelIndex ivec = patternDataModel->mapToSource( _index[vec_le] );
+// QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
+// QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] );
if ( icenter.isValid() && iaxis.isValid() && ibase.isValid() && ivec.isValid() )
{
} else if ( rb2->isChecked() )
{
QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] );
- QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
- QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] );
+ QModelIndex iaxis = patternDataModel->mapToSource( _index[axis_le] );
+ QModelIndex ibase = patternDataModel->mapToSource( _index[base_le] );
+ QModelIndex ivec = patternDataModel->mapToSource( _index[vec_le] );
+// QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
+// QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] );
if ( icenter.isValid() && iaxis.isValid() && ibase.isValid() && ivec.isValid() )
{
return false;
}
- result = patternBuilderModel->mapFromSource( iNewElts );
+ result = patternDataModel->mapFromSource(iNewElts);
+// result = patternBuilderModel->mapFromSource( iNewElts );
return true;
}
DocumentModel* docModel = getDocumentModel();
PatternDataModel* patternDataModel = getPatternDataModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QModelIndex iorigin = patternDataModel->mapToSource( _index[origin_le] );
- QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
- QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] );
+ QModelIndex iaxis = patternDataModel->mapToSource( _index[axis_le] );
+ QModelIndex ibase = patternDataModel->mapToSource( _index[base_le] );
+// QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
+// QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] );
double rext = ext_radius_spb->value();
double rint = int_radius_spb->value();
double angle = angle_spb->value();
return false;
}
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
return true;
}
DocumentModel* docModel = getDocumentModel();
PatternDataModel* patternDataModel = getPatternDataModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QModelIndex iorigin = patternDataModel->mapToSource( _index[origin_le] );
- QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
- QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] );
+ QModelIndex iaxis = patternDataModel->mapToSource( _index[axis_le] );
+ QModelIndex ibase = patternDataModel->mapToSource( _index[base_le] );
+// QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
+// QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] );
double rext = ext_radius_spb->value();
double rint = int_radius_spb->value();
double angle = angle_spb->value();
}
// to select/highlight result
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
return true;
}
DocumentModel* docModel = getDocumentModel();
PatternDataModel* patternDataModel = getPatternDataModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QModelIndex iElts;
QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] );
QModelIndex icenter2 = patternDataModel->mapToSource( _index[center2_le] );
- QModelIndex idir = patternBuilderModel->mapToSource( _index[direction_le] );
- QModelIndex idir2 = patternBuilderModel->mapToSource( _index[direction2_le] );
+ QModelIndex idir = patternDataModel->mapToSource( _index[direction_le] );
+ QModelIndex idir2 = patternDataModel->mapToSource( _index[direction2_le] );
+// QModelIndex idir = patternBuilderModel->mapToSource( _index[direction_le] );
+// QModelIndex idir2 = patternBuilderModel->mapToSource( _index[direction2_le] );
if ( icenter.isValid() && icenter2.isValid() && idir.isValid() && idir2.isValid()){
double r1 = radius_spb->value();
return false;
}
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
return true;
}
DocumentModel* docModel = getDocumentModel();
PatternDataModel* patternDataModel = getPatternDataModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QModelIndex iorigin1 = patternDataModel->mapToSource( _index[origin_le] );
QModelIndex iorigin2 = patternDataModel->mapToSource( _index[origin2_le] );
- QModelIndex idir1 = patternBuilderModel->mapToSource( _index[dir_le] );
- QModelIndex idir2 = patternBuilderModel->mapToSource( _index[dir2_le] );
+ QModelIndex idir1 = patternDataModel->mapToSource( _index[dir_le] );
+ QModelIndex idir2 = patternDataModel->mapToSource( _index[dir2_le] );
+// QModelIndex idir1 = patternBuilderModel->mapToSource( _index[dir_le] );
+// QModelIndex idir2 = patternBuilderModel->mapToSource( _index[dir2_le] );
double rint1 = int_radius_spb->value();
double rext1 = ext_radius_spb->value();
double height1 = height_spb->value();
return false;
}
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
return true;
}
_currentObj = NULL;
DocumentModel* docModel = getDocumentModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+ PatternDataModel* patternDataModel = getPatternDataModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QModelIndexList iquads = getIndexList(quads_lw);
- QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
+ QModelIndex iaxis = patternDataModel->mapToSource( _index[axis_le] );
+// QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
double length = length_spb->value();
int nb = nb_spb->value();
return false;
}
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
return true;
}
DocumentModel* docModel = getDocumentModel();
PatternDataModel* patternDataModel = getPatternDataModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QModelIndexList iquads;
QModelIndex iquad;
SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT JOIN QUAD(S)" ) + "\n" + getErrorMsg() );
return false;
}
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
return true;
}
_currentObj = NULL;
if (getDocumentModel() == NULL) return false;
const PatternDataModel* patternDataModel = getPatternDataModel();
- const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
- if ( !patternDataModel || !patternBuilderModel) return false;
+// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+ if ( !patternDataModel /*|| !patternBuilderModel*/) return false;
QModelIndex iElts;
return false;
}
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
return true;
}
DocumentModel* docModel = getDocumentModel();
PatternDataModel* patternDataModel = getPatternDataModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QModelIndex iElts;
QModelIndex iedge = patternDataModel->mapToSource( _index[e_le] );
return false;
}
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
//Update the line edit
QVariant invalid;
if (getDocumentModel() == NULL) return false;
const PatternDataModel* patternDataModel = getPatternDataModel();
- const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
- if ( !patternDataModel || !patternBuilderModel) return false;
+// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+ if ( !patternDataModel /*|| !patternBuilderModel*/) return false;
QModelIndex iNewElts;
if ( rb0->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb0] );
+ QModelIndex ielts = patternDataModel->mapToSource( _index[elts_le_rb0] );
+ QModelIndex ivec = patternDataModel->mapToSource( _index[vec_le_rb0] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb0] );
if ( ielts.isValid()
&& ivec.isValid() )
iNewElts = getDocumentModel()->makeTranslation( ielts, ivec );
} else if ( rb1->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] );
+ QModelIndex ielts = patternDataModel->mapToSource( _index[elts_le_rb1] );
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] );
double k = k_spb->value();
iNewElts = getDocumentModel()->makeScale( ielts, ivex, k );
} else if ( rb2->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] );
+ QModelIndex ielts = patternDataModel->mapToSource( _index[elts_le_rb2] );
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] );
+ QModelIndex ivec = patternDataModel->mapToSource( _index[vec_le_rb2] );
double angle = angle_spb->value();
if ( ielts.isValid()
return false;
}
- result = patternBuilderModel->mapFromSource(iNewElts);
+ result = patternDataModel->mapFromSource(iNewElts);
+// result = patternBuilderModel->mapFromSource(iNewElts);
return true;
}
_currentObj = NULL;
if (getDocumentModel() == NULL) return false;
const PatternDataModel* patternDataModel = getPatternDataModel();
- const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
- if ( !patternDataModel || !patternBuilderModel) return false;
+// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+ if ( !patternDataModel /*|| !patternBuilderModel*/) return false;
QModelIndex iNewElts;
if ( rb0->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] );
+ QModelIndex ielts = patternDataModel->mapToSource( _index[elts_le_rb0] );
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb0] );
if ( ielts.isValid()
} else if ( rb1->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] );
+ QModelIndex ielts = patternDataModel->mapToSource( _index[elts_le_rb1] );
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] );
+ QModelIndex ivec = patternDataModel->mapToSource( _index[vec_le_rb1] );
if ( ielts.isValid()
&& ivex.isValid()
iNewElts = getDocumentModel()->makeSymmetryLine( ielts, ivex, ivec );
} else if ( rb2->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] );
+ QModelIndex ielts = patternDataModel->mapToSource(_index[elts_le_rb2]);
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] );
+ QModelIndex ivec = patternDataModel->mapToSource(_index[vec_le_rb2]);
if ( ielts.isValid()
&& ivex.isValid()
return false;
}
- result = patternBuilderModel->mapFromSource(iNewElts);
+// result = patternBuilderModel->mapFromSource(iNewElts);
+ result = patternDataModel->mapFromSource(iNewElts);
return true;
}
if (getDocumentModel() == NULL) return false;
const PatternDataModel* patternDataModel = getPatternDataModel();
- const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
- if ( !patternDataModel || !patternBuilderModel) return false;
+// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+ if ( !patternDataModel /*|| !patternBuilderModel*/) return false;
bool performed = false;
if ( rb0->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb0] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] );
+ QModelIndex ielts = patternDataModel->mapToSource(_index[elts_le_rb0]);
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb0] );
+ QModelIndex ivec = patternDataModel->mapToSource(_index[vec_le_rb0]);
if ( ielts.isValid()
&& ivec.isValid() )
performed = getDocumentModel()->performTranslation( ielts, ivec );
} else if ( rb1->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] );
+ QModelIndex ielts = patternDataModel->mapToSource(_index[elts_le_rb1]);
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] );
double k = k_spb->value();
performed = getDocumentModel()->performScale( ielts, ivex, k );
} else if ( rb2->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] );
+ QModelIndex ielts = patternDataModel->mapToSource(_index[elts_le_rb2]);
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] );
+ QModelIndex ivec = patternDataModel->mapToSource(_index[vec_le_rb2]);
double angle = angle_spb->value();
if ( ielts.isValid()
if (getDocumentModel() == NULL) return false;
const PatternDataModel* patternDataModel = getPatternDataModel();
- const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
- if ( !patternDataModel || !patternBuilderModel) return false;
+// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+ if ( !patternDataModel /*|| !patternBuilderModel*/) return false;
bool performed = false;
if ( rb0->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] );
+ QModelIndex ielts = patternDataModel->mapToSource(_index[elts_le_rb0]);
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb0] );
if ( ielts.isValid()
performed = getDocumentModel()->performSymmetryPoint( ielts, ivex );
} else if ( rb1->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] );
+ QModelIndex ielts = patternDataModel->mapToSource(_index[elts_le_rb1]);
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] );
+ QModelIndex ivec = patternDataModel->mapToSource(_index[vec_le_rb1]);
if ( ielts.isValid()
&& ivex.isValid()
performed = getDocumentModel()->performSymmetryLine( ielts, ivex, ivec );
} else if ( rb2->isChecked() ){
- QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] );
+// QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] );
+ QModelIndex ielts = patternDataModel->mapToSource(_index[elts_le_rb2]);
QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] );
- QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] );
+// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] );
+ QModelIndex ivec = patternDataModel->mapToSource(_index[vec_le_rb2]);
if ( ielts.isValid()
&& ivex.isValid()
{
name_le->setReadOnly(true);
kind_cb->setEnabled(false);
+ eltBase_lw->viewport()->setAttribute( Qt::WA_TransparentForMouseEvents );
}
connect(eltBase_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection);
{
_helpFileName = "gui_mesh.html";
setWindowTitle( tr("Compute mesh") );
- QVBoxLayout* layout = new QVBoxLayout;
- setLayout(layout);
-
- QHBoxLayout* up = new QHBoxLayout;
- QHBoxLayout* down = new QHBoxLayout;
-
- layout->addLayout(up);
- layout->addLayout(down);
-
- QVBoxLayout* vlg = new QVBoxLayout;
- QVBoxLayout* vld = new QVBoxLayout;
-
- up->addLayout(vlg);
- up->addLayout(vld);
-
- vlg->addWidget(new QLabel("Name"));
- vlg->addWidget(new QLabel("Dimension"));
- vlg->addWidget(new QLabel("Container"));
-
- _name = new QLineEdit("Mesh");
- _dim = new QSpinBox();
- _fact = new QLineEdit("FactoryServer");
-
- vld->addWidget(_name);
- vld->addWidget(_dim);
- vld->addWidget(_fact);
-
- _dim->setRange(1, 3);
- _dim->setValue(3);
-
+ setupUi( this );
_initWidget(editmode);
}
if ( !getDocumentModel() ) return false;
const PatternDataModel* patternDataModel = getPatternDataModel();
- const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
- if ( !patternDataModel || !patternBuilderModel) return false;
+// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+ if ( !patternDataModel /*|| !patternBuilderModel*/) return false;
QModelIndex ielts; //result
return false;
}
_value = ielts.model()->data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements*>();
- result = patternBuilderModel->mapFromSource(ielts);
+// result = patternBuilderModel->mapFromSource(ielts);
+ result = patternDataModel->mapFromSource(ielts);
//update the list (indexes)
for ( int r = 0; r < nbQuads; ++r ){
DocumentModel* docModel = getDocumentModel();
PatternDataModel* patternDataModel = getPatternDataModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QListWidgetItem* item = NULL;
}
QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] );
- QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
+ QModelIndex iaxis = patternDataModel->mapToSource(_index[axis_le]);
+// QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] );
int angle = angle_spb->value();
int nbre = nbre_spb->value();
return false;
}
_value = iElts.model()->data(iElts, HEXA_DATA_ROLE).value<HEXA_NS::Elements*>();
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
return true;
}
DocumentModel* docModel = getDocumentModel();
PatternDataModel* patternDataModel = getPatternDataModel();
- PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
+// PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
QModelIndex iElts;
QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] );
QModelIndex ivplan = patternDataModel->mapToSource( _index[vplan_le] );
- QModelIndex ivecx = patternBuilderModel->mapToSource( _index[base_le] );
- QModelIndex ivecz = patternBuilderModel->mapToSource( _index[hole_axis_le] );
+ QModelIndex ivecx = patternDataModel->mapToSource(_index[base_le]);
+ QModelIndex ivecz = patternDataModel->mapToSource(_index[hole_axis_le]);
+// QModelIndex ivecx = patternBuilderModel->mapToSource( _index[base_le] );
+// QModelIndex ivecz = patternBuilderModel->mapToSource( _index[hole_axis_le] );
double radhole = hole_rad_spb->value();
double radext = sphere_radext_spb->value();
return false;
}
_value = iElts.model()->data(iElts, HEXA_DATA_ROLE).value<HEXA_NS::Elements*>();
- result = patternBuilderModel->mapFromSource(iElts);
+ result = patternDataModel->mapFromSource(iElts);
+// result = patternBuilderModel->mapFromSource(iElts);
return true;
}
return true;
}
-
-
-
-
-
-
-//***************************** OBSOLETE: A SUPPRIMER !!!! ************************************//
-
-// ============================================================== Constructeur
-CylinderDialog::CylinderDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f )
-: HexaBaseDialog(parent, editmode, f),
- _value(0)
-{
- _helpFileName = "gui_cyl.html";
- setupUi( this );
- _initWidget(editmode);
-
- if ( editmode == INFO_MODE ){
- setWindowTitle( tr("Cylinder Information") );
- }
-}
-
-// ============================================================== Destructeur
-CylinderDialog::~CylinderDialog()
-{
-}
-
-// ============================================================== _initInputWidget
-void CylinderDialog::_initInputWidget( Mode editmode )
-{
- QRegExp rx("");
- QValidator *validator = new QRegExpValidator(rx, this);
-
- installEventFilter(this);
- name_le->installEventFilter(this);
-
- vex_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) );
- vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) );
-
- vex_le->setValidator( validator );
- vec_le->setValidator( validator );
-
- vex_le->installEventFilter(this);
- vec_le->installEventFilter(this);
-
- vex_le->setReadOnly(true);
- vec_le->setReadOnly(true);
-
- if (editmode == INFO_MODE)
- {
- name_le->setReadOnly(true);
- r_spb->setReadOnly(true);
- h_spb->setReadOnly(true);
- }
-
-}
-
-// ============================================================== clear
-void CylinderDialog::clear()
-{
- name_le->clear();
-
- vex_le->clear();
- modelUnregister(vex_le);
-
- vec_le->clear();
- modelUnregister(vec_le);
-
- r_spb->clear();
- h_spb->clear();
-
- modelUnregister(this);
-
-}
-
-// ============================================================== setValue
-void CylinderDialog::setValue(HEXA_NS::Cylinder* c)
-{
- HEXA_NS::Vertex* base = c->getBase();
- HEXA_NS::Vector* direction = c->getDirection();
- double r = c->getRadius();
- double h = c->getHeight();
-
- name_le->setText( c->getName() );
- vex_le->setText( base->getName() );
- vec_le->setText( direction->getName() );
- r_spb->setValue(r);
- h_spb->setValue(h);
-
- if ( getPatternDataSelectionModel() ){
- QModelIndex iCyl = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(c) );
- QModelIndex iBase = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(base) );
- QModelIndex iDirection = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(direction) );
-
- name_le->setProperty( "QModelIndex", QVariant::fromValue(iCyl) );
- vex_le->setProperty( "QModelIndex", QVariant::fromValue(iBase) );
- vec_le->setProperty( "QModelIndex", QVariant::fromValue(iDirection) );
- }
- _value = c;
-}
-
-// ============================================================== getValue
-HEXA_NS::Cylinder* CylinderDialog::getValue()
-{
- return _value;
-}
-
-// ============================================================== apply
-bool CylinderDialog::apply(QModelIndex& result)
-{
-// if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
-// _currentObj = NULL;
-//
-// if ( !getDocumentModel() ) return false;
-// const PatternDataModel* patternDataModel = getPatternDataModel();
-// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
-// if ( !patternDataModel || !patternBuilderModel) return false;
-//
-// QModelIndex iCyl;
-// QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le] );
-// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] );
-// double r = r_spb->value();
-// double h = h_spb->value();
-//
-// if ( ivex.isValid()
-// && ivec.isValid() ){
-// iCyl = getDocumentModel()->addCylinder( ivex, ivec, r, h );
-// }
-//
-// if ( !iCyl.isValid() ){
-// SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD CYLINDER" ) );
-// return false;
-// }
-//
-// _value = iCyl.model()->data(iCyl, HEXA_DATA_ROLE).value<HEXA_NS::Cylinder *>();
-//
-// QString newName = name_le->text();
-// if (!newName.isEmpty()) /*{*/
-// getDocumentModel()->setName( iCyl, newName );
-//
-// //update the default name in the dialog box
-// if (_value != NULL)
-// updateDefaultName(name_le, _value->getType());
-//
-// // to select/highlight result
-// result = patternBuilderModel->mapFromSource(iCyl);
-
- return true;
-}
-
-//------------------------------- PipeDialog -----------------------------------
-
-// ============================================================== Constructeur
-
-PipeDialog::PipeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f )
-: HexaBaseDialog(parent, editmode, f),
- _value(0)
-{
- _helpFileName = "gui_pipe.html";
- setupUi( this );
- _initWidget(editmode);
- // setFocusProxy( vex_le );
-
- if ( editmode == INFO_MODE ){
- setWindowTitle( tr("Pipe Information") );
- }
-
-}
-
-// ============================================================== Destructeur
-PipeDialog::~PipeDialog()
-{
-}
-
-// ============================================================== _initInputWidget
-void PipeDialog::_initInputWidget( Mode editmode )
-{
- QRegExp rx("");
- QValidator *validator = new QRegExpValidator(rx, this);
-
- installEventFilter(this);
- name_le->installEventFilter(this);
-
- //Vertex Field config
- vex_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) );
- vex_le->installEventFilter(this);
- vex_le->setValidator( validator );
-
- //Vector Field config
- vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) );
- vec_le->installEventFilter(this);
- vec_le->setValidator( validator );
-
-
- if ( editmode == INFO_MODE ){
- name_le->setReadOnly(true);
- ir_spb->setReadOnly(true);
- er_spb->setReadOnly(true);
- h_spb->setReadOnly(true);
- }
-
- vex_le->setReadOnly(true);
- vec_le->setReadOnly(true);
-
- //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()));
-}
-
-// ============================================================== clear
-void PipeDialog::clear()
-{
- name_le->clear();
-
- vex_le->clear();
- modelUnregister(vex_le);
-
- vec_le->clear();
- modelUnregister(vec_le);
-
- modelUnregister(this);
-}
-
-// ============================================================== setValue
-void PipeDialog::setValue(HEXA_NS::Pipe* p)
-{
- HEXA_NS::Vertex* base = p->getBase();
- HEXA_NS::Vector* direction = p->getDirection();
- double ir = p->getInternalRadius();
- double er = p->getRadius();
- double h = p->getHeight();
-
- name_le->setText( p->getName() );
- vex_le->setText( base->getName() );
- vec_le->setText( direction->getName() );
- ir_spb->setValue(ir);
- er_spb->setValue(er);
- h_spb->setValue(h);
-
- if ( getPatternDataSelectionModel() ){
- QModelIndex iPipe = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(p) );
- QModelIndex iBase = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(base) );
- QModelIndex iDirection = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(direction) );
-
- name_le->setProperty( "QModelIndex", QVariant::fromValue(iPipe) );
- vex_le->setProperty( "QModelIndex", QVariant::fromValue(iBase) );
- vec_le->setProperty( "QModelIndex", QVariant::fromValue(iDirection) );
- }
- _value = p;
-}
-
-// ============================================================== getValue
-HEXA_NS::Pipe* PipeDialog::getValue()
-{
- return _value;
-}
-
-// ============================================================== apply
-bool PipeDialog::apply(QModelIndex& result)
-{
-// if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
-// _currentObj = NULL;
-//
-// if ( !getDocumentModel() ) return false;
-// const PatternDataModel* patternDataModel = getPatternDataModel();
-// const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel();
-// if ( !patternDataModel || !patternBuilderModel) return false;
-//
-// QModelIndex iPipe;
-// QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le] );
-// QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] );
-// double ir = ir_spb->value();
-// double er = er_spb->value();
-// double h = h_spb->value();
-//
-// if (ir >= er) {
-// SUIT_MessageBox::information( this, tr( "CANNOT ADD PIPE" ), tr( "External radius must be greather than Internal radius!" ) );
-// return false;
-// }
-//
-//
-// if ( ivex.isValid()
-// && ivec.isValid() ){
-// iPipe = getDocumentModel()->addPipe( ivex, ivec, ir, er, h );
-// }
-//
-// if ( !iPipe.isValid() ){
-// SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD PIPE" ) );
-// return false;
-// }
-// _value = iPipe.model()->data(iPipe, HEXA_DATA_ROLE).value<HEXA_NS::Pipe *>();
-//
-// QString newName = name_le->text();
-// if ( !newName.isEmpty() )/*{*/
-// getDocumentModel()->setName( iPipe, newName );
-//
-// //update the default name in the dialog box
-// if (_value != NULL)
-// updateDefaultName(name_le, _value->getType());
-//
-// // to select/highlight result
-// result = patternBuilderModel->mapFromSource(iPipe);
-
- return true;
-}
-// ************************************** FIN A SUPPRIMER ******************************************//
-
#ifndef __HEXABLOCKGUI_DOCUMENTPANEL_HXX_
#define __HEXABLOCKGUI_DOCUMENTPANEL_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
#define MAX_WIDTH 16777215
#define MAX_HEIGHT 16777215
-#define MIN_WIDTH 0
+#define MIN_WIDTH 5
#define MIN_HEIGHT 0
#include <QShortcut>
#include "ui_MakeHemiSphere_QTD.h"
#include "ui_ModelInfo_QTD.h"
#include "ui_AddShapeDialog_QTD.h"
+#include "ui_ComputeMesh_QTD.h"
#include "HexVertex.hxx"
#include "HexEdge.hxx"
{
namespace GUI
{
- class HEXABLOCK_EXPORT HexaBaseDialog : public QDialog
+ class HexaExport HexaBaseDialog : public QDialog
{
Q_OBJECT
return HEXABLOCKGUI::currentDocGView->getPatternGeomModel();
}
- PatternBuilderModel* getPatternBuilderModel() const {
- return HEXABLOCKGUI::currentDocGView->getPatternBuilderModel();
- }
+// PatternBuilderModel* getPatternBuilderModel() const {
+// return HEXABLOCKGUI::currentDocGView->getPatternBuilderModel();
+// }
GroupsModel* getGroupsModel() const {
return HEXABLOCKGUI::currentDocGView->getGroupsModel();
return HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel();
}
- PatternBuilderSelectionModel* getPatternBuilderSelectionModel() const {
- return HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel();
- }
+// PatternBuilderSelectionModel* getPatternBuilderSelectionModel() const {
+// return HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel();
+// }
PatternGeomSelectionModel* getPatternGeomSelectionModel() const {
return HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
HEXABLOCKGUI::ViewType getObjectViewType(QObject* obj);
void modelUnregister(QWidget* widget); //unlink the widget from the model
void resetSizeAndShow(QDockWidget* parent);
- void lockSizeToSizeHint();
- void unlockSizeModification();
virtual QModelIndexList getAssocsVTK()
{
QModelIndexList assocs;
- class HEXABLOCK_EXPORT VertexDialog : public HexaBaseDialog,
+ class HexaExport VertexDialog : public HexaBaseDialog,
public Ui::VertexDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT EdgeDialog : public HexaBaseDialog,
+ class HexaExport EdgeDialog : public HexaBaseDialog,
public Ui::EdgeDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT QuadDialog : public HexaBaseDialog,
+ class HexaExport QuadDialog : public HexaBaseDialog,
public Ui::QuadDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT HexaDialog : public HexaBaseDialog,
+ class HexaExport HexaDialog : public HexaBaseDialog,
public Ui::HexaDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT VectorDialog : public HexaBaseDialog,
+ class HexaExport VectorDialog : public HexaBaseDialog,
public Ui::VectorDialog
{
Q_OBJECT
QModelIndex _ivalue;
};
- class HEXABLOCK_EXPORT MakeGridDialog : public HexaBaseDialog,
+ class HexaExport MakeGridDialog : public HexaBaseDialog,
public Ui::MakeGridDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakeCylinderDialog : public HexaBaseDialog,
+ class HexaExport MakeCylinderDialog : public HexaBaseDialog,
public Ui::MakeCylinderDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakePipeDialog : public HexaBaseDialog,
+ class HexaExport MakePipeDialog : public HexaBaseDialog,
public Ui::MakePipeDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakeCylindersDialog : public HexaBaseDialog,
+ class HexaExport MakeCylindersDialog : public HexaBaseDialog,
public Ui::MakeCylindersDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakePipesDialog : public HexaBaseDialog,
+ class HexaExport MakePipesDialog : public HexaBaseDialog,
public Ui::MakePipesDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT RemoveHexaDialog : public HexaBaseDialog,
+ class HexaExport RemoveHexaDialog : public HexaBaseDialog,
public Ui::RemoveHexaDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT PrismQuadDialog : public HexaBaseDialog,
+ class HexaExport PrismQuadDialog : public HexaBaseDialog,
public Ui::PrismQuadDialog
{
Q_OBJECT
void updateHelpFileName();
private slots:
- //void addQuad();
+ void addQuad();
void removeQuad();
- //void clearQuads();
+ void clearQuads();
};
- class HEXABLOCK_EXPORT JoinQuadDialog : public HexaBaseDialog,
+ class HexaExport JoinQuadDialog : public HexaBaseDialog,
public Ui::JoinQuadDialog
{
Q_OBJECT
void updateHelpFileName();
private slots:
- //void addQuad();
+ void addQuad();
void removeQuad();
- //void clearQuads();
+ void clearQuads();
};
- class HEXABLOCK_EXPORT MergeDialog : public HexaBaseDialog,
+ class HexaExport MergeDialog : public HexaBaseDialog,
public Ui::MergeDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT DisconnectDialog : public HexaBaseDialog,
+ class HexaExport DisconnectDialog : public HexaBaseDialog,
public Ui::DisconnectDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT CutEdgeDialog : public HexaBaseDialog,
+ class HexaExport CutEdgeDialog : public HexaBaseDialog,
public Ui::CutEdgeDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakeTransformationDialog : public HexaBaseDialog,
+ class HexaExport MakeTransformationDialog : public HexaBaseDialog,
public Ui::TransformationDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakeSymmetryDialog : public HexaBaseDialog,
+ class HexaExport MakeSymmetryDialog : public HexaBaseDialog,
public Ui::SymmetryDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT PerformTransformationDialog : public HexaBaseDialog,
+ class HexaExport PerformTransformationDialog : public HexaBaseDialog,
public Ui::TransformationDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT PerformSymmetryDialog : public HexaBaseDialog,
+ class HexaExport PerformSymmetryDialog : public HexaBaseDialog,
public Ui::SymmetryDialog
{
Q_OBJECT
void updateHelpFileName();
};
-class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog,
+class HexaExport EdgeAssocDialog : public HexaBaseDialog,
public Ui::EdgeAssocDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT QuadAssocDialog : public HexaBaseDialog,
+ class HexaExport QuadAssocDialog : public HexaBaseDialog,
public Ui::QuadAssocDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT GroupDialog : public HexaBaseDialog,
+ class HexaExport GroupDialog : public HexaBaseDialog,
public Ui::GroupDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT LawDialog : public HexaBaseDialog,
+ class HexaExport LawDialog : public HexaBaseDialog,
public Ui::LawDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT PropagationDialog : public HexaBaseDialog,
+ class HexaExport PropagationDialog : public HexaBaseDialog,
public Ui::PropagationDialog
{
Q_OBJECT
void _initInputWidget( Mode editmode );
protected slots:
- //void updateHelpFileName();
+ void updateHelpFileName();
void deletePropagationItem();
virtual void selectElementOfModel();
// Define the compute mesh dialog box
// ----------------------------------
- class HEXABLOCK_EXPORT ComputeMeshDialog : public HexaBaseDialog
+ class HexaExport ComputeMeshDialog : public HexaBaseDialog,
+ public Ui::ComputeMeshDialog
{
Q_OBJECT
protected:
void _initInputWidget( Mode editmode );
-
- private:
- QLineEdit* _name;
- QSpinBox* _dim;
- QLineEdit* _fact;
};
- class HEXABLOCK_EXPORT ReplaceHexaDialog : public HexaBaseDialog,
+ class HexaExport ReplaceHexaDialog : public HexaBaseDialog,
public Ui::ReplaceHexaDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT QuadRevolutionDialog : public HexaBaseDialog,
+ class HexaExport QuadRevolutionDialog : public HexaBaseDialog,
public Ui::QuadRevolutionDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT MakeHemiSphereDialog : public HexaBaseDialog,
+ class HexaExport MakeHemiSphereDialog : public HexaBaseDialog,
public Ui::MakeHemiSphereDialog
{
Q_OBJECT
HEXA_NS::Elements *_value;
};
- class HEXABLOCK_EXPORT ModelInfoDialog : public HexaBaseDialog,
+ class HexaExport ModelInfoDialog : public HexaBaseDialog,
public Ui::ModelInfoDialog
{
Q_OBJECT
virtual void _initInputWidget( Mode editmode ){}
};
- class HEXABLOCK_EXPORT AddShapeDialog : public HexaBaseDialog,
+ class HexaExport AddShapeDialog : public HexaBaseDialog,
public Ui::AddShapeDialog
{
Q_OBJECT
virtual void onCurrentSelectionChanged();
};
-
- //***************************** OBSOLETE: A SUPPRIMER !!!! ************************************//
-
- class HEXABLOCK_EXPORT CylinderDialog : public HexaBaseDialog,
- public Ui::CylinderDialog
- {
- Q_OBJECT
-
- public:
- CylinderDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
- virtual ~CylinderDialog();
-
- void clear();
-
- void setValue( HEXA_NS::Cylinder* v );
- HEXA_NS::Cylinder* getValue();
-
- public slots:
- virtual bool apply(QModelIndex& result);
-
- protected:
- void _initInputWidget( Mode editmode );
-
- private:
- HEXA_NS::Cylinder *_value;
- QModelIndex _ivalue;
- };
-
- class HEXABLOCK_EXPORT PipeDialog : public HexaBaseDialog,
- public Ui::PipeDialog
- {
- Q_OBJECT
-
- public:
- PipeDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
- virtual ~PipeDialog();
-
- void clear();
-
- void setValue( HEXA_NS::Pipe* p );
- HEXA_NS::Pipe* getValue();
-
- public slots:
- virtual bool apply(QModelIndex& result);
-
- protected:
- void _initInputWidget( Mode editmode );
-
- private:
- HEXA_NS::Pipe *_value;
- QModelIndex _ivalue;
-
- };
- // ************************************** FIN A SUPPRIMER ******************************************//
-
-
}
}
-
-
#endif
#include "HEXABLOCKGUI_OccGraphicView.hxx"
#include "HEXABLOCKGUI_SalomeTools.hxx"
#include "HEXABLOCKGUI_DocumentSelectionModel.hxx"
-#include "HEXABLOCKGUI_DocumentModel.hxx"
#include "HEXABLOCKGUI_DocumentItem.hxx"
#include "HEXABLOCKGUI.hxx"
// SelectionModel
// //===========================================================================
+bool SelectionModel::infoMode = true;
+
SelectionModel::SelectionModel( QAbstractItemModel * model ):
QItemSelectionModel( model )
{
return theIndexes;
}
+DocumentModel* SelectionModel::getDocModel() const
+{
+ DocumentModel* docModel = NULL;
+ const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
+ if ( pModel != NULL)
+ docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
+
+ return docModel;
+}
+
+void SelectionModel::showEltInfo(QModelIndex& elt)
+{
+ DocumentModel* docModel = getDocModel();
+ if (!elt.isValid() || docModel == NULL)
+ return;
+
+ HEXA_NS::Vertex* vertex = docModel->getHexaPtr<HEXA_NS::Vertex*>(elt);
+ HEXA_NS::Edge* edge = docModel->getHexaPtr<HEXA_NS::Edge*>(elt);
+ HEXA_NS::Quad* quad = docModel->getHexaPtr<HEXA_NS::Quad*>(elt);
+ HEXA_NS::Hexa* hexa = docModel->getHexaPtr<HEXA_NS::Hexa*>(elt);
+ HEXA_NS::Vector* vector = docModel->getHexaPtr<HEXA_NS::Vector*>(elt);
+ HEXA_NS::Group* group = docModel->getHexaPtr<HEXA_NS::Group*>(elt);
+ HEXA_NS::Law* law = docModel->getHexaPtr<HEXA_NS::Law*>(elt);
+ HEXA_NS::Propagation* propagation = docModel->getHexaPtr<HEXA_NS::Propagation*>(elt);
+
+ HEXABLOCKGUI* hexagui = HEXABLOCKGUI::getInstance();
+ if (vertex != NULL)
+ hexagui->showVertexInfoDialog(vertex);
+ else if (edge != NULL)
+ hexagui->showEdgeInfoDialog(edge);
+ else if (quad != NULL)
+ hexagui->showQuadInfoDialog(quad);
+ else if (hexa != NULL)
+ hexagui->showHexaInfoDialog(hexa);
+ else if (vector != NULL)
+ hexagui->showVectorInfoDialog(vector);
+ else if (group != NULL)
+ hexagui->showGroupInfoDialog(group);
+ else if (law != NULL)
+ hexagui->showLawInfoDialog(law);
+ else if (propagation != NULL)
+ hexagui->showPropagationInfoDialog(propagation);
+}
+
void SelectionModel::salomeSelectionChanged()
{
// clear highlights and selections in the trees
PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel();
- PatternBuilderSelectionModel* pbsm = HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel();
+// PatternBuilderSelectionModel* pbsm = HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel();
PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
pdsm->clearSelection();
- pbsm->clearSelection();
+// pbsm->clearSelection();
pgsm->clearSelection();
pdsm->unhighlightTreeItems();
pgsm->unhighlightTreeItems();
// * highlight item
QAbstractItemModel* theModel = (QAbstractItemModel*) model();
- QMap<int, QVariant> roles;
- roles[Qt::BackgroundRole] = bgColor;
- roles[Qt::ForegroundRole] = fgColor;
foreach( const QModelIndex& anItemIndex, indexes )
{
if (anItemIndex.isValid())
{
- theModel->setItemData(anItemIndex, roles);
+ theModel->setData(anItemIndex, fgColor, Qt::ForegroundRole);
+ theModel->setData(anItemIndex, bgColor, Qt::BackgroundRole);
currentHighlightedItems << anItemIndex;
}
}
return;
QAbstractItemModel* theModel = (QAbstractItemModel*) model();
- QMap<int, QVariant> roles;
- roles[Qt::BackgroundRole] = Qt::white;
- roles[Qt::ForegroundRole] = Qt::darkGreen;
foreach( const QModelIndex& anItemIndex, currentHighlightedItems)
{
if (anItemIndex.isValid())
- theModel->setItemData(anItemIndex, roles);
+ {
+ theModel->setData(anItemIndex, Qt::darkGreen, Qt::ForegroundRole);
+ theModel->setData(anItemIndex, Qt::white, Qt::BackgroundRole);
+ }
}
currentHighlightedItems.clear();
}
QModelIndexList PatternDataSelectionModel::getGeomAssociations(const QModelIndex& dataIndex)
{
QModelIndexList geomIndexList;
- DocumentModel *docModel = NULL;
- const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
- PatternGeomSelectionModel* pGSModel = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
-
- if ( pModel != NULL)
- docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
-
+ DocumentModel* docModel = getDocModel();
+ PatternGeomSelectionModel* pGSModel = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
if (docModel == NULL || pGSModel == NULL)
return geomIndexList;
+ const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
HEXA_NS::Vertex* vertex = docModel->getHexaPtr<HEXA_NS::Vertex*>(dataIndex);
HEXA_NS::Edge* edge = docModel->getHexaPtr<HEXA_NS::Edge*>(dataIndex);
HEXA_NS::Quad* quad = docModel->getHexaPtr<HEXA_NS::Quad*>(dataIndex);
void PatternDataSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
{
QModelIndexList indexes = selected.indexes();
- if (indexes.count() == 0)
+ int nbSelected = indexes.count();
+ if (nbSelected == 0)
return;
// ** unhighlight current highlighted items in the trees
// ** highlight association in the occ view
HEXABLOCKGUI::currentOccGView->highlight(indexes);
+ if (!infoMode || nbSelected > 1)
+ return;
+
+ // ** Show informations of the selected element
+ QModelIndex elt = indexes[0];
+ showEltInfo(elt);
}
void PatternDataSelectionModel::geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject )
//Temporary Debug for hexa selection ------------------------------
if (HEXABLOCKGUI::currentDocGView->getSelectionMode() == HEXA_TREE)
{
- DocumentModel *docModel = NULL;
- const QSortFilterProxyModel *pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
+ DocumentModel* docModel = getDocModel();
+ if ( docModel != NULL && anIOIndex.isValid())
+ {
+ //get the selected quad
+ HEXA_NS::Quad* quad = docModel->getHexaPtr<HEXA_NS::Quad*>(anIOIndex);
- if ( pModel != NULL){
- docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
- if ( docModel != NULL && anIOIndex.isValid())
+ if (quad != NULL)
{
- //get the selected quad
- HEXA_NS::Quad* quad = docModel->getHexaPtr<HEXA_NS::Quad*>(anIOIndex);
-
- if (quad != NULL)
+ //get the hexa the quad belongs to
+ HEXA_NS::Hexa* hexa = docModel->getQuadHexa(quad);
+ if (hexa != NULL) //convert the hexa to a QModelIndex so we can select it in the model
+ anIOIndex = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(hexa));
+ else
{
- //get the hexa the quad belongs to
- HEXA_NS::Hexa* hexa = docModel->getQuadHexa(quad);
- if (hexa != NULL) //convert the hexa to a QModelIndex so we can select it in the model
- anIOIndex = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(hexa));
- else
- {
- SUIT_MessageBox::critical( 0,
- tr("HexaBlock"),
- tr("The Hexahedron this quad belongs to has been deleted!"));
- return;
- }
+ SUIT_MessageBox::critical( 0,
+ tr("HexaBlock"),
+ tr("The Hexahedron this quad belongs to has been deleted!"));
+ return;
}
}
}
// * highlight items
QAbstractItemModel* theModel = (QAbstractItemModel*) model();
- QMap<int, QVariant> roles;
- roles[Qt::BackgroundRole] = bgColor;
- roles[Qt::ForegroundRole] = fgColor;
foreach( const QModelIndex& anItemIndex, indexes )
{
if (anItemIndex.isValid())
{
- theModel->setItemData(anItemIndex, roles);
+ theModel->setData(anItemIndex, fgColor, Qt::ForegroundRole);
+ theModel->setData(anItemIndex, bgColor, Qt::BackgroundRole);
currentHighlightedItems << anItemIndex;
}
}
if (currentHighlightedItems.count() == 0)
return;
QAbstractItemModel* theModel = (QAbstractItemModel*) model();
- QMap<int, QVariant> roles;
- roles[Qt::BackgroundRole] = Qt::white;
- roles[Qt::ForegroundRole] = Qt::darkGreen;
foreach( const QModelIndex& anItemIndex, currentHighlightedItems)
{
if (anItemIndex.isValid())
- theModel->setItemData(anItemIndex, roles);
+ {
+ theModel->setData(anItemIndex, Qt::darkGreen, Qt::ForegroundRole);
+ theModel->setData(anItemIndex, Qt::white, Qt::BackgroundRole);
+ }
}
currentHighlightedItems.clear();
}
this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
}
-
void GroupsSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
{
- try {
QModelIndexList indexes = selected.indexes();
- for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
- HEXABLOCKGUI::currentDocGView->highlightGroups( *i_index );
+ int nbSelected = indexes.count();
+ if (nbSelected == 0)
+ return;
+
+ // ** Highlight the group in the vtk view **/
+ try {
+ for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
+ HEXABLOCKGUI::currentDocGView->highlightGroups( *i_index );
+ }
+ } catch ( ... ) {
+ MESSAGE("Unknown exception was cought !!!");
}
- } catch ( ... ) {
- MESSAGE("Unknown exception was cought !!!");
- }
+
+ if (!infoMode || nbSelected > 1)
+ return;
+
+ // ** Show informations of the selected element **/
+ QModelIndex elt = indexes[0];
+ showEltInfo(elt);
}
// //===========================================================================
// MeshSelectionModel
// //===========================================================================
MeshSelectionModel::MeshSelectionModel( QAbstractItemModel * model ):
-SelectionModel( model )
+ SelectionModel( model )
{
- connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
- this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ), Qt::UniqueConnection );
- connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
- this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
+ connect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
+ this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ), Qt::UniqueConnection );
+ connect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
+ this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ), Qt::UniqueConnection );
}
-
MeshSelectionModel::~MeshSelectionModel()
{
- disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
- this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
- disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
- this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
+ disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
+ this, SLOT( onCurrentChanged( const QModelIndex & , const QModelIndex & ) ) );
+ disconnect( this, SIGNAL( selectionChanged( const QItemSelection & , const QItemSelection & ) ),
+ this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
}
void MeshSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
{
- try {
-
QModelIndexList indexes = selected.indexes();
- for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
- HEXABLOCKGUI::currentDocGView->highlightPropagation( *i_index );
+ int nbSelected = indexes.count();
+ if (nbSelected == 0)
+ return;
+
+ try {
+ for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
+ HEXABLOCKGUI::currentDocGView->highlightPropagation( *i_index );
+ }
+ } catch ( ... ) {
+ MESSAGE("Unknown exception was cought !!!");
}
- } catch ( ... ) {
- MESSAGE("Unknown exception was cought !!!");
- }
+
+ if (!infoMode || nbSelected > 1)
+ return;
+
+ // ** Show informations of the selected element **/
+ QModelIndex elt = indexes[0];
+ showEltInfo(elt);
}
#ifndef _HEXABLOCKGUI_DOCUMENTSELECTIONMODEL_HXX_
#define _HEXABLOCKGUI_DOCUMENTSELECTIONMODEL_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <QItemSelectionModel>
#include <LightApp_SelectionMgr.h>
#include "klinkitemselectionmodel.hxx"
+#include "HEXABLOCKGUI_DocumentModel.hxx"
+
class OCCViewer_ViewWindow;
namespace GUI
{
- class HEXABLOCK_EXPORT SelectionModel: public QItemSelectionModel
+ class HexaExport SelectionModel: public QItemSelectionModel
{
Q_OBJECT
QModelIndex indexBy( int role, const QVariant& var );
QModelIndex indexOf( const QString& anIOEntry, int role );
QModelIndexList indexListOf( const QString& anEntry, int role );
+ DocumentModel* getDocModel() const;
+ void showEltInfo(QModelIndex& elt);
virtual void geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) {}
virtual void vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) {}
void clearHighlightedItems() { currentHighlightedItems.clear(); }
+ void setInfoMode(bool isOn) { infoMode = isOn; }
+
protected slots:
virtual void onCurrentChanged( const QModelIndex & current,
protected:
QModelIndexList getSelectionFromModel(const Handle(SALOME_InteractiveObject)& anIObject);
-
QModelIndexList currentHighlightedItems;
+ static bool infoMode;
};
- class PatternBuilderSelectionModel: public KLinkItemSelectionModel
- {
- public:
- PatternBuilderSelectionModel( QAbstractItemModel *model,
- QItemSelectionModel *proxySelector, QObject *parent = 0 ):
- KLinkItemSelectionModel( model, proxySelector, parent )
- {
- }
- };
-
- class PatternDataSelectionModel : public SelectionModel
+// class PatternBuilderSelectionModel: public KLinkItemSelectionModel
+// {
+// public:
+// PatternBuilderSelectionModel( QAbstractItemModel *model,
+// QItemSelectionModel *proxySelector, QObject *parent = 0 ):
+// KLinkItemSelectionModel( model, proxySelector, parent )
+// {
+// }
+// };
+
+ class HexaExport PatternDataSelectionModel : public SelectionModel
{
Q_OBJECT
};
- class PatternGeomSelectionModel : public SelectionModel
+ class HexaExport PatternGeomSelectionModel : public SelectionModel
{
Q_OBJECT
};
- class GroupsSelectionModel : public SelectionModel
+ class HexaExport GroupsSelectionModel : public SelectionModel
{
Q_OBJECT
};
- class MeshSelectionModel : public SelectionModel
+ class HexaExport MeshSelectionModel : public SelectionModel
{
Q_OBJECT
#ifndef __HEXABLOCKGUI_EXCEPTION_HXX__
#define __HEXABLOCKGUI_EXCEPTION_HXX__
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <string>
#include <exception>
{
namespace GUI
{
- class HEXABLOCK_EXPORT Exception : public std::exception
+ class HexaExport Exception : public std::exception
{
protected:
std::string _what;
#ifndef _HEXABLOCKGUI_VTKGRAPHICVIEWSHANDLER_HXX_
#define _HEXABLOCKGUI_VTKGRAPHICVIEWSHANDLER_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
//Salome Includes
#include <SVTK_ViewWindow.h>
#include <OCCViewer_ViewWindow.h>
#include <QMap>
//HEXABLOCK Includes
+#include "hexa_base.hxx"
#include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
namespace HEXABLOCK
namespace GUI
{
- class HEXABLOCK_EXPORT GraphicViewsHandler
+ class HexaExport GraphicViewsHandler
{
public:
#ifndef _HEXABLOCKGUI_MODEL_HXX_
#define _HEXABLOCKGUI_MODEL_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
#include <SalomeApp_DataModel.h>
+#include "hexa_base.hxx"
-class HEXABLOCK_EXPORT CHEXABLOCKGUI_Model : public SalomeApp_DataModel
+class HexaExport HEXABLOCKGUI_Model : public SalomeApp_DataModel
{
public:
HEXABLOCKGUI_Model(CAM_Module* theModule);
#ifndef HEXABLOCKGUI_OCCSELECTOR_H
#define HEXABLOCKGUI_OCCSELECTOR_H
-#include "HEXABLOCKGUI_Export.hxx"
#include <LightApp_OCCSelector.h>
+#include "hexa_base.hxx"
-class HEXABLOCK_EXPORT HEXABLOCKGUI_OCCSelector : public LightApp_OCCSelector
+class HexaExport HEXABLOCKGUI_OCCSelector : public LightApp_OCCSelector
{
public:
HEXABLOCKGUI_OCCSelector( OCCViewer_Viewer*, SUIT_SelectionMgr* );
#include "HEXABLOCKGUI_OccGraphicView.hxx"
-#include "utilities.h"
#include "HEXABLOCKGUI.hxx"
-#include "HEXABLOCKGUI_DocumentModel.hxx"
#include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
-#include "HexNewShape.hxx"
-#include "HexVertexShape.hxx"
-#include "HexEdgeShape.hxx"
-#include "HexFaceShape.hxx"
-
-#include <SelectMgr_Selection.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <SelectBasics_SensitiveEntity.hxx>
-#include <StdSelect_BRepOwner.hxx>
-#include <TopExp.hxx>
#include <SOCC_ViewModel.h>
#include <SUIT_ViewManager.h>
}
highlight( assocEntrySubIDs, only );
}
-#include <SUIT_Session.h>
+
void OccGraphicView::highlightSubShapes(const Handle(AIS_Shape)& anObj,
const TColStd_IndexedMapOfInteger& aIndexMap, bool only)
{
#ifndef _HEXABLOCKGUI_OCCGRAPHICVIEW_HXX_
#define _HEXABLOCKGUI_OCCGRAPHICVIEW_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
#include <OCCViewer_ViewWindow.h>
#include "HEXABLOCKGUI_SalomeTools.hxx"
#include <QModelIndex>
#include <QModelIndexList>
-
-
+#include "hexa_base.hxx"
namespace HEXABLOCK
{
* OccGraphicView
********************************************************************************/
- class HEXABLOCK_EXPORT OccGraphicView
+ class HexaExport OccGraphicView
{
public:
#ifndef _HEXABLOCKGUI_RESOURCE_HXX_
#define _HEXABLOCKGUI_RESOURCE_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <QtGui>
-class HEXABLOCK_EXPORT HEXABLOCKGUI_Resource
+class HexaExport HEXABLOCKGUI_Resource
{
public:
HEXABLOCKGUI_Resource(SUIT_ResourceMgr* r);
#ifndef _HEXABLOCKGUI_SALOMETOOLS_HXX_
#define _HEXABLOCKGUI_SALOMETOOLS_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <SalomeApp_Application.h>
#include <SALOME_Actor.h>
namespace GUI
{
- HEXABLOCK_EXPORT SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry );
- HEXABLOCK_EXPORT _PTR(Study) GetActiveStudyDocument();
+HexaExport SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry );
+ _PTR(Study) GetActiveStudyDocument();
- HEXABLOCK_EXPORT int GetNameOfSelectedElements( SVTK_ViewWindow *theWindow,/* SVTK_Selector* theSelector,*/
- const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName );
+HexaExport int GetNameOfSelectedElements( SVTK_ViewWindow *theWindow,/* SVTK_Selector* theSelector,*/
+ const Handle(SALOME_InteractiveObject)& theIO,
+ QString& theName );
- HEXABLOCK_EXPORT std::string shape2string( const TopoDS_Shape& aShape );
+HexaExport std::string shape2string( const TopoDS_Shape& aShape );
- HEXABLOCK_EXPORT void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
- const Handle(AIS_InteractiveContext)& theIC,
- SelectMgr_IndexedMapOfOwner& theMap );
+HexaExport void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
+ const Handle(AIS_InteractiveContext)& theIC,
+ SelectMgr_IndexedMapOfOwner& theMap );
- HEXABLOCK_EXPORT void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap,
- const TopoDS_Shape& aMainShape,
- const SelectMgr_IndexedMapOfOwner& anAllMap,
- SelectMgr_IndexedMapOfOwner& aToHiliteMap );
+HexaExport void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap,
+ const TopoDS_Shape& aMainShape,
+ const SelectMgr_IndexedMapOfOwner& anAllMap,
+ SelectMgr_IndexedMapOfOwner& aToHiliteMap );
- HEXABLOCK_EXPORT TopoDS_Shape getSubShape(const TopoDS_Shape& theShape, const int theIndex);
- HEXABLOCK_EXPORT int getSubId(const TopoDS_Shape& theShape, const TopoDS_Shape& theSubShape);
+HexaExport TopoDS_Shape getSubShape(const TopoDS_Shape& theShape, const int theIndex);
+HexaExport int getSubId(const TopoDS_Shape& theShape, const TopoDS_Shape& theSubShape);
- HEXABLOCK_EXPORT Standard_Boolean getExtremaSolution(const gp_Pnt& theInitPnt,
+HexaExport Standard_Boolean getExtremaSolution(const gp_Pnt& theInitPnt,
const TopoDS_Shape& theRefShape,
gp_Pnt& thePnt);
- HEXABLOCK_EXPORT TopoDS_Vertex makePoint(const double x, const double y, const double z);
+HexaExport TopoDS_Vertex makePoint(const double x, const double y, const double z);
- HEXABLOCK_EXPORT TopoDS_Vertex makePointWithReference(const TopoDS_Shape& point, const double dx,
+HexaExport TopoDS_Vertex makePointWithReference(const TopoDS_Shape& point, const double dx,
const double dy,
const double dz);
- HEXABLOCK_EXPORT TopoDS_Vertex makePointOnCurve(const TopoDS_Shape& edge, const double param);
+HexaExport TopoDS_Vertex makePointOnCurve(const TopoDS_Shape& edge, const double param);
- HEXABLOCK_EXPORT TopoDS_Vertex makePointOnCurveByLength(const TopoDS_Shape& edge, const TopoDS_Shape& point, const double length);
+HexaExport TopoDS_Vertex makePointOnCurveByLength(const TopoDS_Shape& edge, const TopoDS_Shape& point, const double length);
- HEXABLOCK_EXPORT TopoDS_Vertex makePointOnCurveByCoord(const TopoDS_Shape& edge, const double x, const double y, const double z);
+HexaExport TopoDS_Vertex makePointOnCurveByCoord(const TopoDS_Shape& edge, const double x, const double y, const double z);
- HEXABLOCK_EXPORT TopoDS_Vertex makePointOnLinesIntersection(const TopoDS_Shape& line1, const TopoDS_Shape& line2);
+ TopoDS_Vertex makePointOnLinesIntersection(const TopoDS_Shape& line1, const TopoDS_Shape& line2);
- HEXABLOCK_EXPORT TopoDS_Vertex makePointOnSurface(const TopoDS_Shape& face, const double param_u, const double param_v);
+HexaExport TopoDS_Vertex makePointOnSurface(const TopoDS_Shape& face, const double param_u, const double param_v);
- HEXABLOCK_EXPORT TopoDS_Vertex makePointOnSurfaceByCoord(const TopoDS_Shape& face, const double x, const double y, const double z);
+HexaExport TopoDS_Vertex makePointOnSurfaceByCoord(const TopoDS_Shape& face, const double x, const double y, const double z);
}
}
#ifndef __HEXABLOCKGUI_TRACE_HXX__
#define __HEXABLOCKGUI_TRACE_HXX__
-
-
#include <iostream>
#include <sstream>
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include "HEXABLOCKGUI_Exception.hxx"
#ifdef _DEVDEBUG_
namespace HEXABLOCK {
namespace GUI {
- extern HEXABLOCK_EXPORT int traceLevel;
+ extern HexaExport int traceLevel;
}
}
//#define _DEVDEBUG_
-#include <sstream>
-
-#include <iostream>
-
-#include <math.h>
-
-#include "utilities.h"
-
-#include <QtGui>
-
-
-#include <LightApp_Application.h>
-
-#include <SUIT_ViewManager.h>
-#include <SUIT_ViewWindow.h>
-#include <SVTK_ViewManager.h>
-#include <SVTK_ViewModel.h>
-#include <SVTK_ViewWindow.h>
-#include <SVTK_Prs.h>
-#include <SALOME_Actor.h>
-#include <VTKViewer_Algorithm.h>
-#include <SalomeApp_Study.h>
-
// VTK includes
#include <vtkRenderer.h>
-#include <vtkActorCollection.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkRenderWindowInteractor.h>
-#include <vtkSmartPointer.h>
-#include <SVTK_View.h>
-// test tutorial (sphere)
-#include <vtkPolyDataMapper.h>
-#include <vtkSphereSource.h>
-
-// test point (cf. SMESHGUI)
-#include <vtkIdList.h>
-#include <vtkCellArray.h>
-#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
-#include <vtkProperty.h>
-#include <vtkLineSource.h>
-
-#include <vtkLine.h>
-#include <vtkQuad.h>
-#include <vtkHexahedron.h>
-
-#include "vtkLookupTable.h"
-#include "vtkPoints.h"
#include "vtkCellArray.h"
-#include "vtkFloatArray.h"
#include "vtkPolyData.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkActor.h"
-#include "vtkPointData.h"
-#include "vtkProperty.h"
-
-
-// #include "vtkStructuredGridReader.h"
-#include "vtkUnstructuredGridReader.h"
#include <VTKViewer_CellLocationsArray.h>
-
-
-
-
-
-#ifndef M_PI
-#define M_PI 3.1415927
-#endif
+#include <SVTK_ViewModel.h>
#include "HEXABLOCKGUI_Trace.hxx"
-#include "HEXABLOCKGUI_DocumentModel.hxx"
#include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
#include "HEXABLOCKGUI.hxx"
-
+#ifndef M_PI
+#define M_PI 3.1415927
+#endif
using namespace std;
using namespace HEXABLOCK::GUI;
using namespace HEXA_NS;
-// !!! ceci est ni pipe ni un actor mais un mélange des deux
+
Document_Actor::Document_Actor( Document* doc, const QString& entry ):
SALOME_Actor(),
_doc( doc )
setIO(anIO);
vtkUnstructuredGrid* aGrid = getUnstructuredGrid();
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
- aMapper->SetInputData(aGrid);
+ aMapper->SetInputData(aGrid); // saclay
+// aMapper->SetInput(aGrid);
aGrid->Delete();
SetVisibility( true );//VisibilityOff();
vtkUnstructuredGrid* aGrid = getUnstructuredGrid();
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
- aMapper->SetInputData(aGrid);
+ aMapper->SetInputData(aGrid); // saclay
+// aMapper->SetInput (aGrid);
aGrid->Delete();
SetVisibility( true );//VisibilityOff();
//Model
setModel(documentModel);
patternDataModel = new PatternDataModel(parent);
- patternBuilderModel = new PatternBuilderModel(parent);
patternGeomModel = new PatternGeomModel(parent);
groupsModel = new GroupsModel(parent);
meshModel = new MeshModel(parent);
patternDataModel->setSourceModel(documentModel);
- patternBuilderModel->setSourceModel(documentModel);
patternGeomModel->setSourceModel(documentModel);
groupsModel->setSourceModel(documentModel);
meshModel->setSourceModel(documentModel);
//Selection Model
patternDataSelectionModel = new PatternDataSelectionModel(patternDataModel);
- patternBuilderSelectionModel = new PatternBuilderSelectionModel(patternBuilderModel, patternDataSelectionModel);
patternGeomSelectionModel = new PatternGeomSelectionModel(patternGeomModel);
groupsSelectionModel = new GroupsSelectionModel(groupsModel);
meshSelectionModel = new MeshSelectionModel(meshModel );
//Delete Model
delete patternDataModel;
- delete patternBuilderModel;
delete groupsModel;
delete meshModel;
//Delete Selection Model/ Disconnect signals on delete (Qt)
// delete patternDataSelectionModel;
-// delete patternBuilderSelectionModel;
// delete groupsSelectionModel;
// delete meshSelectionModel;
}
void VtkDocumentGraphicView::setVertexSelection()
{
setSelectionMode(NodeSelection);
-// // NodeSelection,
-// // CellSelection,
-// // EdgeOfCellSelection,
-// // EdgeSelection,
-// // FaceSelection,
-// // VolumeSelection,
-// // ActorSelection };
}
void VtkDocumentGraphicView::setEdgeSelection()
case PROPAGATION_TREE :
case PROPAGATION_DIR_TREE : setEdgeSelection(); break;
default: setAllSelection();
-// CellSelection,
-// EdgeOfCellSelection,
-// VolumeSelection,
-// ActorSelection
}
}
/********************************************************************************
* ABSTRACT METHOD ( MUST BE IMPLEMENTED )
********************************************************************************/
-
/*
Returns the item that covers the coordinate given in the view.
*/
-
QModelIndex VtkDocumentGraphicView::indexAt(const QPoint &point) const
{
return QModelIndex();
{
}
-
/*
Returns the position of the item in viewport coordinates.
*/
// connect( dm, SIGNAL( nameChanged(const QString&) ), this, SLOT ( setWindowTitle(const QString&) ) );
}
}
-
-// void DocumentGraphicView::loadVTK( const QString& path ) //CS_TEST
-// {
-// std::cout << "DocumentGraphicView::loadVTK=>"<<std::endl;
-// QFile file(path);
-// if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
-// return;
-// // QByteArray vtkData = file.readAll ();
-// QString vtkData = file.readAll ();
-// vtkData.replace(",",".");
-//
-//
-// SVTK_ViewWindow* myVTKViewWindow = dynamic_cast<SVTK_ViewWindow*>(_suitView);
-//
-// // vtkStructuredGridReader
-// vtkUnstructuredGridReader* r = vtkUnstructuredGridReader::New();
-// // r->SetFileName( path.toLocal8Bit().constData() );
-// r->SetInputString( vtkData.toLocal8Bit().constData() );
-// r->SetReadFromInputString( true );
-// r->Update();
-//
-// vtkUnstructuredGrid* myGrid = r->GetOutput();//vtkUnstructuredGrid::New();
-// std::cout << "GetNumberOfCells =>"<< myGrid->GetNumberOfCells();
-// // Create and display actor
-//
-// vtkDataSetMapper* myMapper = vtkDataSetMapper::New();
-// myMapper->SetInputData(myGrid);
-//
-// // if ( myPreviewActor ){
-// // myVTKViewWindow->RemoveActor(myPreviewActor);
-// // myPreviewActor->Delete();
-// // }
-//
-// SALOME_Actor* myPreviewActor = SALOME_Actor::New();
-// myPreviewActor = SALOME_Actor::New();
-// Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(QString::number( reinterpret_cast<intptr_t>(_hexaDocument) ),"HEXABLOCK");//,theName);
-// myPreviewActor->setIO(anIO);
-//
-// // myPreviewActor->PickableOff();
-// myPreviewActor->SetVisibility( true );//VisibilityOff();
-// myPreviewActor->SetPickable( true );
-// myPreviewActor->SetMapper(myMapper);
-//
-// vtkProperty* aProp = vtkProperty::New();
-// // aProp->SetRepresentationToWireframe();
-// aProp->SetRepresentationToSurface();
-// aProp->EdgeVisibilityOn ();
-//
-// // aProp->SetColor(10, 10, 250);
-// aProp->SetPointSize(5);
-// myPreviewActor->SetProperty(aProp);
-// aProp->Delete();
-//
-// /*vtkProperty* myBackProp = vtkProperty::New();
-// GetColor( "SMESH", "backface_color", aBackRGB[0], aBackRGB[1], aBackRGB[2], QColor( 0, 0, 255 ) );
-// myBackProp->SetColor( aBackRGB[0], aBackRGB[1], aBackRGB[2] );
-// myPreviewActor->SetBackfaceProperty( myBackProp );
-// myBackProp->Delete()*/;
-// myVTKViewWindow->AddActor(myPreviewActor);
-// myVTKViewWindow->getRenderer()->Render();
-// myVTKViewWindow->Repaint();
-// myVTKViewWindow->onFitAll();
-//
-// myVTKViewWindow->SetSelectionMode( ActorSelection );
-// // myVTKViewWindow->SetSelectionMode( NodeSelection );
-// // myVTKViewWindow->SetSelectionMode( EdgeSelection );
-// // myVTKViewWindow->SetSelectionMode( FaceSelection );
-// }
#ifndef _HEXABLOCKGUI_VTKDOCUMENTGRAPHICVIEW_HXX_
#define _HEXABLOCKGUI_VTKDOCUMENTGRAPHICVIEW_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
// SALOME GUI includes
#include <LightApp_Displayer.h>
#include <SUIT_ViewWindow.h>
namespace GUI
{
- class HEXABLOCK_EXPORT Document_Actor : public SALOME_Actor
+ class HexaExport Document_Actor : public SALOME_Actor
{
public:
Document_Actor(HEXA_NS::Document* doc, const QString& entry);
};
// Abu
- class Associate_Actor : public SALOME_Actor
+ class HexaExport Associate_Actor : public SALOME_Actor
{
public:
Associate_Actor(HEXA_NS::Document* doc, const QString& entry);
HEXA_NS::Document* _doc;
};
-
/********************************************************************************
* VtkDocumentGraphicView
********************************************************************************/
- class HEXABLOCK_EXPORT VtkDocumentGraphicView : public QAbstractItemView
+ class HexaExport VtkDocumentGraphicView : public QAbstractItemView
{
Q_OBJECT
PatternDataSelectionModel* getPatternDataSelectionModel() const
{ return patternDataSelectionModel; }
- PatternBuilderSelectionModel* getPatternBuilderSelectionModel() const
- { return patternBuilderSelectionModel; }
-
PatternGeomSelectionModel* getPatternGeomSelectionModel() const
{ return patternGeomSelectionModel;}
{ return meshSelectionModel; }
PatternDataModel* getPatternDataModel() const {return patternDataModel;}
- PatternBuilderModel* getPatternBuilderModel() const {return patternBuilderModel;}
PatternGeomModel* getPatternGeomModel() const { return patternGeomModel;}
GroupsModel* getGroupsModel() const {return groupsModel;}
MeshModel* getMeshModel() const {return meshModel;}
Associate_Actor* associateActor;
PatternDataSelectionModel* patternDataSelectionModel;
- PatternBuilderSelectionModel* patternBuilderSelectionModel;
PatternGeomSelectionModel* patternGeomSelectionModel;
GroupsSelectionModel* groupsSelectionModel;
MeshSelectionModel* meshSelectionModel;
PatternDataModel* patternDataModel;
- PatternBuilderModel* patternBuilderModel;
PatternGeomModel* patternGeomModel;
GroupsModel* groupsModel;
MeshModel* meshModel;
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Hexahedron Construction</string>
</property>
<x>0</x>
<y>0</y>
<width>282</width>
- <height>180</height>
+ <height>248</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
- <width>5</width>
+ <width>0</width>
<height>0</height>
</size>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="name_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="nb_nodes_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimum">
<number>0</number>
</property>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="coeff_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
<item row="3" column="1">
<widget class="QComboBox" name="kind_cb">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
</widget>
</item>
+ <item row="4" column="1">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
<rect>
<x>0</x>
<y>0</y>
- <width>275</width>
- <height>407</height>
+ <width>226</width>
+ <height>422</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Cylinders Construction</string>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="center_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="direction_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="radius_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="height_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="center2_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="direction2_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="radius2_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="height2_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
- <height>0</height>
+ <height>16777215</height>
</size>
</property>
</spacer>
</property>
<property name="minimumSize">
<size>
- <width>0</width>
+ <width>5</width>
<height>324</height>
</size>
</property>
<rect>
<x>0</x>
<y>0</y>
- <width>305</width>
- <height>464</height>
+ <width>253</width>
+ <height>480</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Pipes Construction</string>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="origin_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="dir_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="ext_radius_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>hole radius</string>
</property>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="int_radius_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="height_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="origin2_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="dir2_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="ext_radius2_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_9">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>hole radius</string>
</property>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="int_radius2_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="height2_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</layout>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<resources/>
<height>198</height>
</rect>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Merge Operation</string>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="e0_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="e1_le">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="v0_le">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="v1_le">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="minimumSize">
<size>
<width>127</width>
<rect>
<x>0</x>
<y>0</y>
- <width>254</width>
- <height>736</height>
+ <width>304</width>
+ <height>836</height>
</rect>
</property>
<property name="sizePolicy">
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string> Merge Operation</string>
</property>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<rect>
<x>0</x>
<y>0</y>
- <width>216</width>
- <height>784</height>
+ <width>284</width>
+ <height>816</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QRadioButton" name="rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QRadioButton" name="rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item>
<widget class="QRadioButton" name="rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Quad</string>
</property>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="v1_le_rb0">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="e0_le_rb1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="v0_le_rb1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="e1_le_rb1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="v1_le_rb1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="q0_le_rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="v0_le_rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="v2_le_rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="q1_le_rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="v1_le_rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="v3_le_rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</layout>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
</widget>
QPixmap image7 (aResMgr->loadPixmap("GEOM", tr("ICO_WIRE")));
setWindowTitle( tr("Vertex Association") );
- setMinimumWidth(260);
- setMinimumHeight(400);
+// setMinimumWidth(260);
+// setMinimumHeight(400);
mainFrame()->GroupConstructors->setTitle(tr("GEOM_POINTS"));
mainFrame()->RadioButton1->setIcon(image0);
#ifndef MYBASICGUI_POINTDLG_H
#define MYBASICGUI_POINTDLG_H
-#include "HEXABLOCKGUI_Export.hxx"
+
#include "MyGEOMBase_Skeleton.hxx"
// class : MyBasicGUI_PointDlg
// purpose :
//=================================================================================
-typedef class HEXABLOCK_EXPORT MyBasicGUI_PointDlg : public MyGEOMBase_Skeleton
+#include "hexa_base.hxx"
+typedef class HexaExport MyBasicGUI_PointDlg : public MyGEOMBase_Skeleton
{
Q_OBJECT
void ClickParamCoord( int );
void onBtnPopup( QAction* );
void updateSize();
-//void onRefPointChanged(const QString& pointName);
-//void onStartPointSelected(const QString& pointName);
+ void onRefPointChanged(const QString& pointName);
+ void onStartPointSelected(const QString& pointName);
void onParamValueChanged(double newValue);
void onXCoordChanged(double newValue);
void onYCoordChanged(double newValue);
<x>0</x>
<y>0</y>
<width>345</width>
- <height>538</height>
+ <height>401</height>
</rect>
</property>
<property name="sizePolicy">
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QScrollArea" name="scrollArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<x>0</x>
<y>0</y>
<width>325</width>
- <height>518</height>
+ <height>381</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox_2">
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="title">
<string>Vertex of the model</string>
</property>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="title">
<string>Point of the geometry</string>
</property>
</widget>
</item>
<item>
- <spacer name="verticalSpacer_2">
+ <spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
- <height>10</height>
+ <height>16777215</height>
</size>
</property>
</spacer>
#ifndef MYGEOMBASE_SKELETON_H
#define MYGEOMBASE_SKELETON_H
-#include "HEXABLOCKGUI_Export.hxx"
+
#include "HEXABLOCKGUI_OccGraphicView.hxx"
#include "HEXABLOCKGUI.hxx"
# define DBL_DIGITS_DISPLAY 13
#endif // COORD_MIN
+#include "hexa_base.hxx"
+
namespace HEXABLOCK
{
namespace GUI
{
-class HEXABLOCK_EXPORT MyGEOMBase_Skeleton : public HexaBaseDialog
+class HexaExport MyGEOMBase_Skeleton : public HexaBaseDialog
{
Q_OBJECT
</property>
<property name="minimumSize">
<size>
- <width>0</width>
+ <width>5</width>
<height>300</height>
</size>
</property>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="currentIndex">
<number>0</number>
</property>
<rect>
<x>0</x>
<y>0</y>
- <width>196</width>
- <height>297</height>
+ <width>251</width>
+ <height>341</height>
</rect>
</property>
<property name="sizePolicy">
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Propagation</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<property name="title">
<string>Propagation(s)</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListWidget" name="propagations_lw">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>130</height>
+ </size>
+ </property>
</widget>
</item>
</layout>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="title">
<string>Law</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_4">
+ <layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLineEdit" name="law_le">
<property name="sizePolicy">
</item>
<item>
<widget class="QCheckBox" name="way_cb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>way</string>
</property>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<x>0</x>
<y>0</y>
<width>232</width>
- <height>271</height>
+ <height>378</height>
</rect>
</property>
<property name="sizePolicy">
</property>
<property name="minimumSize">
<size>
- <width>0</width>
+ <width>5</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
- <height>378</height>
+ <height>16777215</height>
</size>
</property>
<property name="windowTitle">
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QLineEdit" name="quad_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</layout>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
<x>0</x>
<y>0</y>
<width>389</width>
- <height>584</height>
+ <height>712</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>5</width>
- <height>300</height>
+ <height>0</height>
</size>
</property>
<property name="windowTitle">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QRadioButton" name="revolutionUni_rb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Uniform</string>
</property>
</item>
<item>
<widget class="QRadioButton" name="revolution_rb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Custom</string>
</property>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<x>0</x>
<y>0</y>
<width>369</width>
- <height>518</height>
+ <height>646</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item row="0" column="1">
<widget class="QLineEdit" name="center_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="axis_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="angle_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="nbre_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximum">
<number>1000000</number>
</property>
</widget>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</widget>
<rect>
<x>0</x>
<y>0</y>
- <width>216</width>
- <height>463</height>
+ <width>232</width>
+ <height>495</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>0</width>
+ <width>5</width>
<height>0</height>
</size>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>5</width>
+ <width>1</width>
<height>0</height>
</size>
</property>
<item>
<widget class="QRadioButton" name="rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QRadioButton" name="rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>5</width>
+ <width>1</width>
<height>0</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget_3" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<item>
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="v0_le_rb0">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
</property>
</widget>
</item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="v0_le_rb0">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="e0_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="e1_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="1">
<widget class="QLineEdit" name="e2_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="3" column="1">
<widget class="QLineEdit" name="e3_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</layout>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
<connection>
<sender>rb1</sender>
<signal>clicked()</signal>
- <receiver>widget_2</receiver>
- <slot>show()</slot>
+ <receiver>widget</receiver>
+ <slot>hide()</slot>
<hints>
<hint type="sourcelabel">
- <x>297</x>
- <y>46</y>
+ <x>353</x>
+ <y>49</y>
</hint>
<hint type="destinationlabel">
- <x>310</x>
- <y>264</y>
+ <x>351</x>
+ <y>110</y>
</hint>
</hints>
</connection>
<connection>
<sender>rb1</sender>
<signal>clicked()</signal>
- <receiver>widget</receiver>
- <slot>hide()</slot>
+ <receiver>widget_2</receiver>
+ <slot>show()</slot>
<hints>
<hint type="sourcelabel">
- <x>353</x>
- <y>49</y>
+ <x>297</x>
+ <y>46</y>
</hint>
<hint type="destinationlabel">
- <x>351</x>
- <y>110</y>
+ <x>310</x>
+ <y>264</y>
</hint>
</hints>
</connection>
<rect>
<x>0</x>
<y>0</y>
- <width>225</width>
- <height>109</height>
+ <width>257</width>
+ <height>156</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="title">
<string/>
</property>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Hexa</string>
- </property>
- </widget>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Hexa</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="hexa_le">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="hexa_le">
+ <item>
+ <widget class="QCheckBox" name="connected_cb">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0" colspan="2">
- <widget class="QCheckBox" name="connected_cb">
<property name="text">
<string>including connected hexa</string>
</property>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
<rect>
<x>0</x>
<y>0</y>
- <width>369</width>
- <height>457</height>
+ <width>287</width>
+ <height>500</height>
</rect>
</property>
<property name="minimumSize">
<size>
- <width>0</width>
+ <width>5</width>
<height>0</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<rect>
<x>0</x>
<y>0</y>
- <width>349</width>
- <height>437</height>
+ <width>267</width>
+ <height>480</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QWidget" name="widget" native="true">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="p1_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="p2_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="1">
<widget class="QLineEdit" name="p3_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="c1_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="c2_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="1">
<widget class="QLineEdit" name="c3_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
#ifndef _RESOURCE_HXX_
#define _RESOURCE_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <QColor>
#include <QFont>
namespace HEXABLOCK {
namespace GUI {
- class HEXABLOCK_EXPORT Resource {
+ class HexaExport Resource {
public:
Resource();
<rect>
<x>0</x>
<y>0</y>
- <width>234</width>
+ <width>280</width>
<height>422</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>5</width>
- <height>50</height>
+ <width>1</width>
+ <height>0</height>
</size>
</property>
<property name="maximumSize">
<item row="0" column="0">
<widget class="QRadioButton" name="rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QRadioButton" name="rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Plane</string>
</property>
<widget class="QGroupBox" name="groupBox_2">
<property name="minimumSize">
<size>
- <width>5</width>
+ <width>1</width>
<height>0</height>
</size>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="elts_le_rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</widget>
</item>
<item row="1" column="1">
- <widget class="QLineEdit" name="vex_le_rb0"/>
+ <widget class="QLineEdit" name="vex_le_rb0">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
</item>
</layout>
</widget>
<item row="0" column="1">
<widget class="QLineEdit" name="elts_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="vex_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="1">
<widget class="QLineEdit" name="vec_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="elts_le_rb2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="vex_le_rb2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="1">
<widget class="QLineEdit" name="vec_le_rb2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<rect>
<x>0</x>
<y>0</y>
- <width>287</width>
+ <width>266</width>
<height>475</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Transform Operation</string>
</property>
<height>0</height>
</size>
</property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>50</height>
+ </size>
+ </property>
<property name="title">
<string/>
</property>
<item>
<widget class="QRadioButton" name="rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QRadioButton" name="rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QRadioButton" name="rb2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="elts_le_rb0">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QFormLayout" name="formLayout_2">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>elements</string>
+ </property>
+ </widget>
+ </item>
<item row="1" column="1">
<widget class="QLineEdit" name="elts_le_rb1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="vex_le_rb1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="k_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="decimals">
<number>6</number>
</property>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_8">
- <property name="text">
- <string>elements</string>
- </property>
- </widget>
- </item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QFormLayout" name="formLayout_3">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>elements</string>
+ </property>
+ </widget>
+ </item>
<item row="1" column="1">
<widget class="QLineEdit" name="elts_le_rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="vex_le_rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="vec_le_rb2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maximumSize">
<size>
<width>16777215</width>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="angle_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="wrapping">
<bool>false</bool>
</property>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>elements</string>
- </property>
- </widget>
- </item>
</layout>
</widget>
</item>
<rect>
<x>0</x>
<y>0</y>
- <width>255</width>
- <height>364</height>
+ <width>231</width>
+ <height>395</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>5</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="windowTitle">
<string>Vector Construction</string>
</property>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QRadioButton" name="rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<widget class="QRadioButton" name="rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<bool>true</bool>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="dx_spb_rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<bool>true</bool>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="dz_spb_rb0">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<widget class="QLineEdit" name="v0_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="1" column="1">
<widget class="QLineEdit" name="v1_le_rb1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</layout>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
<rect>
<x>0</x>
<y>0</y>
- <width>246</width>
- <height>216</height>
+ <width>228</width>
+ <height>248</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>0</width>
+ <width>5</width>
<height>0</height>
</size>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="name_le">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="x_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>0</string>
</property>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="y_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>0</string>
</property>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="z_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>0</string>
</property>
</layout>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
</item>
#ifndef KLINKITEMSELECTIONMODEL_H
#define KLINKITEMSELECTIONMODEL_H
-#include "HEXABLOCKGUI_Export.hxx"
-
#include <QtCore/QObject>
#include <QtGui/QItemSelectionModel>
#include <QtGui/QAbstractProxyModel>
// #include "kdeui_export.h"
// #include "klinkitemselectionmodel_p.hxx"
+#include "hexa_base.hxx"
#include "kmodelindexproxymapper.hxx"
class KLinkItemSelectionModelPrivate;
-class HEXABLOCK_EXPORT KLinkItemSelectionModel : public QItemSelectionModel
+class HexaExport KLinkItemSelectionModel : public QItemSelectionModel
{
Q_OBJECT
public:
#endif
-class HEXABLOCK_EXPORT KLinkItemSelectionModelPrivate
+class KLinkItemSelectionModelPrivate
{
public:
KLinkItemSelectionModelPrivate(KLinkItemSelectionModel *proxySelectionModel, QAbstractItemModel *model,
#ifndef KMODELINDEXPROXYMAPPER_H
#define KMODELINDEXPROXYMAPPER_H
-#include "HEXABLOCKGUI_Export.hxx"
-
#include <QObject>
+#include "hexa_base.hxx"
+
// #include "kdeui_export.h"
class QAbstractItemModel;
class QItemSelection;
class KModelIndexProxyMapperPrivate;
-class HEXABLOCK_EXPORT KModelIndexProxyMapper : public QObject
+class HexaExport KModelIndexProxyMapper : public QObject
{
Q_OBJECT
public:
<component-username>HEXABLOCK TUI</component-username>
<component-type>Data</component-type>
<component-author>CS</component-author>
- <component-version>@SALOMEHEXABLOCK_VERSION@</component-version>
+ <component-version>@VERSION@</component-version>
<component-comment>CEA - RD</component-comment>
<component-multistudy>1</component-multistudy>
<component-icone>ModuleHexablock.png</component-icone>
<!-- Major module parameters -->
<parameter name="name" value="HexaBlock"/>
<parameter name="icon" value="ModuleHexablock.png"/>
- <parameter name="version" value="@SALOMEHEXABLOCK_VERSION@"/>
+ <parameter name="version" value="@VERSION@"/>
<parameter name="documentation" value="hexablock_help"/>
</section>
<section name="hexablock_help" >
Q_INVERSE = _hexablock_swig.Q_INVERSE
Q_UNDEFINED = _hexablock_swig.Q_UNDEFINED
Q_WAITING = _hexablock_swig.Q_WAITING
+KS_None = _hexablock_swig.KS_None
+KS_Line = _hexablock_swig.KS_Line
+KS_Circle = _hexablock_swig.KS_Circle
+KS_Ellipse = _hexablock_swig.KS_Ellipse
+KS_Hyperbola = _hexablock_swig.KS_Hyperbola
+KS_Parabola = _hexablock_swig.KS_Parabola
+KS_BezierCurve = _hexablock_swig.KS_BezierCurve
+KS_BSplineCurve = _hexablock_swig.KS_BSplineCurve
+KS_OtherCurve = _hexablock_swig.KS_OtherCurve
CylSmall = _hexablock_swig.CylSmall
CylBig = _hexablock_swig.CylBig
NxInt = _hexablock_swig.NxInt
SWIG_Python_SetConstant(d, "Q_INVERSE",SWIG_From_int(static_cast< int >(Hex::Q_INVERSE)));
SWIG_Python_SetConstant(d, "Q_UNDEFINED",SWIG_From_int(static_cast< int >(Hex::Q_UNDEFINED)));
SWIG_Python_SetConstant(d, "Q_WAITING",SWIG_From_int(static_cast< int >(Hex::Q_WAITING)));
+ SWIG_Python_SetConstant(d, "KS_None",SWIG_From_int(static_cast< int >(Hex::KS_None)));
+ SWIG_Python_SetConstant(d, "KS_Line",SWIG_From_int(static_cast< int >(Hex::KS_Line)));
+ SWIG_Python_SetConstant(d, "KS_Circle",SWIG_From_int(static_cast< int >(Hex::KS_Circle)));
+ SWIG_Python_SetConstant(d, "KS_Ellipse",SWIG_From_int(static_cast< int >(Hex::KS_Ellipse)));
+ SWIG_Python_SetConstant(d, "KS_Hyperbola",SWIG_From_int(static_cast< int >(Hex::KS_Hyperbola)));
+ SWIG_Python_SetConstant(d, "KS_Parabola",SWIG_From_int(static_cast< int >(Hex::KS_Parabola)));
+ SWIG_Python_SetConstant(d, "KS_BezierCurve",SWIG_From_int(static_cast< int >(Hex::KS_BezierCurve)));
+ SWIG_Python_SetConstant(d, "KS_BSplineCurve",SWIG_From_int(static_cast< int >(Hex::KS_BSplineCurve)));
+ SWIG_Python_SetConstant(d, "KS_OtherCurve",SWIG_From_int(static_cast< int >(Hex::KS_OtherCurve)));
SWIG_Python_SetConstant(d, "CylSmall",SWIG_From_int(static_cast< int >(Hex::CylSmall)));
SWIG_Python_SetConstant(d, "CylBig",SWIG_From_int(static_cast< int >(Hex::CylBig)));
SWIG_Python_SetConstant(d, "NxInt",SWIG_From_int(static_cast< int >(Hex::NxInt)));
// C++ : Tests unitaires
-// Copyright (C) 2009-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2011 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 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.
+// 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
+// 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
#include "test_unit.hxx"
#include "Hex.hxx"
#include "HexDocument.hxx"
#include "HexElements.hxx"
-#include "HexCrossElements.hxx"
#include "HexHexa.hxx"
#include "HexQuad.hxx"
{
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
int ncouches = 2;
double k = 1;
- double rayon = 1;
- Hex::Elements* sphere = doc->makeSpherical (orig, rayon, ncouches, k);
+ Hex::Elements* sphere = doc->makeSphericalTop (ncouches, k);
if (ncouches>0)
{
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid = doc->makeCartesian (orig, dir, size_x,size_y,size_z);
+ Hex::Elements* grid = doc->makeCartesianTop (size_x,size_y,size_z);
// print_propagations (doc);
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid = doc->makeCartesian (orig, dir, size_x,size_y,size_z);
+ Hex::Elements* grid = doc->makeCartesianTop (size_x,size_y,size_z);
grid->saveVtk ("mini1.vtk");
doc->dump ();
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig1 = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
-
- Hex::Elements* grid1 = doc->makeCartesian (orig1, dir, dimx,dimy,dimz);
+ Hex::Elements* grid1 = doc->makeCartesianTop (dimx,dimy,dimz);
Hex::Vertex* orig2 = doc->addVertex (dimx/2.0,0,8);
Hex::Vector* vectj = doc->addVector (0,1,0);
Hex::Vector* vecti = doc->addVector (1,0,0);
- Hex::Elements* grid2 = doc->makeCylindrical (orig2, vecti, vectj,
+ Hex::Elements* grid2 = doc->makeCylinderUni (orig2, vecti, vectj,
1, 180, 1, dimz,dimy,dimx, true);
int mx = dimx/2;
doc->saveVtk ("joint1.vtk");
const int hauteur = 5;
- Hex::Elements* joint = doc->joinQuads(liste, cible, v1,v2,v3,v4, hauteur);
+ Hex::Elements* joint = doc->joinQuadsUni(liste,cible, v1,v2,v3,v4, hauteur);
// for (int nh=0 ; nh<hauteur ; nh++) joint->getHexa(nh)->setScalar (5);
int nbr_joint_vertex = joint->countVertex ();
doc->saveVtk ("joint2.vtk");
return HOK;
}
-// ======================================================== test_prism
-int test_prism (int nbargs, cpchar tabargs[])
-{
- const int dimx = 11;
- const int dimy = 11;
- const int dimz = 2;
-
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* orig1 = doc->addVertex ( 0,0,0);
- Hex::Vector* dir1 = doc->addVector ( 1,1,1);
- Hex::Vector* dir2 = doc->addVector ( 1,1,-1);
-
- Hex::Elements* grid1 = doc->makeCartesian (orig1, dir1, dimx,dimy,dimz);
-
- int mx = dimx/2;
- int my = dimy/2;
- Hex::Quads liste1, liste2;
-
- liste1.push_back (grid1->getQuadIJ (mx, my, dimz));
- liste2.push_back (grid1->getQuadIJ (mx, my, 0));
- for (int nx=0; nx<dimx; nx++)
- if (nx!=mx)
- {
- liste1.push_back (grid1->getQuadIJ (nx, my, dimz));
- liste2.push_back (grid1->getQuadIJ (nx, my, 0));
- }
-
- for (int ny=0; ny<dimy; ny++)
- if (ny!=my)
- {
- liste1.push_back (grid1->getQuadIJ (mx, ny, dimz));
- liste2.push_back (grid1->getQuadIJ (mx, ny, 0));
- }
-
- Hex::RealVector tlen;
- double dh = 2;
- for (int nro=0; nro<5; nro++)
- {
- dh = 2*dh + 1;
- tlen.push_back (dh);
- }
-
- const int nbiter = 5;
- doc->saveVtk ("prisme1.vtk");
- Hex::Elements* prisme2 = doc->prismQuads (liste2, dir2, nbiter);
- doc->saveVtk ("prisme2.vtk");
-
- Hex::Elements* prisme1 = doc->prismQuadsVec (liste1, dir1, tlen, 0);
-
- PutData (liste1.size());
- PutData (tlen.size());
- PutData (prisme1->countHexa());
- PutData (prisme1->countQuad());
- PutData (prisme1->countEdge());
- PutData (prisme1->countVertex());
-
- for (int nro=0 ; nro <nbiter ; nro++)
- {
- Hex::Hexa* cell = prisme2-> getHexa (nbiter+nro);
- cell->setScalar (5);
- }
-
- doc->saveVtk ("prisme3.vtk");
- return HOK;
-}
-// ======================================================== test_revolution9
-int test_revolution9 (int nbargs, cpchar tabargs[])
-{
- const int dimx = 11;
- const int dimy = 11;
- const int dimz = 2;
-
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* orig1 = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
-
- Hex::Elements* grid1 = doc->makeCartesian (orig1, dir, dimx,dimy,dimz);
-
- int mx = dimx/2;
- int my = dimy/2;
- Hex::Quad* prems = grid1->getQuadIJ (mx, my, dimz);
- Hex::Quads liste;
-
- liste.push_back (prems);
- prems -> setScalar (5);
- for (int nx=0; nx<dimx; nx++)
- if (nx!=mx)
- {
- Hex::Quad* cell = grid1->getQuadIJ (nx, my, dimz);
- liste.push_back (cell);
- cell -> setScalar (5);
- }
-
- for (int ny=0; ny<dimy; ny++)
- if (ny!=my)
- {
- Hex::Quad* cell = grid1->getQuadIJ (mx, ny, dimz);
- liste.push_back (cell);
- cell -> setScalar (5);
- }
-
- Hex::Vertex* center = doc->addVertex (0, -10, 0);
- Hex::Vector* axis = doc->addVector (1, 0, 0);
- Hex::RealVector angles;
-
- Hex::Vector* dir1 = doc->addVector (10,0.3,0.3);
- Hex::Elements* grid2 = doc->makeCartesian (center, dir1, 1,1,1);
- Hex::Hexa* cell = grid2->getHexaIJK (0,0,0);
- cell->setScalar (5);
-
- doc->saveVtk ("revolution1.vtk");
-
- double alpha = 5;
- int niter = 5;
- double coeff = 1.5;
- for (int na=0 ; na<niter ; na++)
- {
- angles.push_back (alpha);
- alpha *= coeff;
- }
- for (int na=1 ; na<niter ; na++)
- {
- alpha /= coeff;
- angles.push_back (alpha);
- }
-
- Hex::Elements* bloc = doc->revolutionQuads (liste, center, axis, angles);
- if (bloc != NULL)
- doc->saveVtk ("revolution2.vtk");
-
- return HOK;
-}
-// ======================================================== test_revolution
-int test_revolution (int nbargs, cpchar tabargs[])
-{
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* ori = doc->addVertex (0,0,0);
- Hex::Vector* vx = doc->addVector (1,0,0);
- Hex::Vector* vz = doc->addVector (0,0,1);
-
- int dr = 1;
- int da = 360;
- int dl = 1;
-
- int nr = 1;
- int na = 6;
- int nl = 1;
-
- Hex::Elements* grid = doc->makeCylindrical (ori, vx,vz, dr,da,dl,
- nr,na,nl, false);
-
- Hex::Quads liste;
- for (int nx=0; nx<nr; nx++)
- for (int ny=0; ny<na; ny++)
- {
- Hex::Quad* cell = grid->getQuadIJ (nx, ny, nl);
- liste.push_back (cell);
- cell -> setScalar (5);
- }
-
- Hex::Vertex* center = doc->addVertex (0, -10, 0);
- Hex::Vector* axis = doc->addVector (1, 0, 0);
- Hex::RealVector angles;
-
- Hex::Vector* dir1 = doc->addVector (10,0.3,0.3);
- Hex::Elements* grid2 = doc->makeCartesian (center, dir1, 1,1,1);
- Hex::Hexa* cell = grid2->getHexaIJK (0,0,0);
- cell->setScalar (5);
-
- doc->saveVtk ("revolution1.vtk");
-
- double alpha = 5;
- int niter = 5;
- double coeff = 1.5;
- for (int na=0 ; na<niter ; na++)
- {
- angles.push_back (alpha);
- alpha *= coeff;
- }
- for (int na=1 ; na<niter ; na++)
- {
- alpha /= coeff;
- angles.push_back (alpha);
- }
-
- Hex::Elements* bloc = doc->revolutionQuads (liste, center, axis, angles);
- if (bloc != NULL)
- doc->saveVtk ("revolution2.vtk");
-
- return HOK;
-}
-// ======================================================== test_coude
-int test_coude (int nbargs, cpchar tabargs[])
-{
-#if 0
- const int dimx = 11;
- const int dimy = 11;
- const int dimz = 2;
-
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* vx = doc->addVector (1,0,0);
- Hex::Vector* vz = doc->addVector (0,0,1);
-
- // grid1 = doc->makeCartesian (orig1, dir, dimx,dimy,dimz);
- double dr = 1;
- int dl = 5;
- int nr = 4;
- int na = 8;
-
- Hex::Elements* grid1 = doc->makeCylindrical (orig1, vx,vz,dr,360, dl,
- nr, 10, nl, false);
- int mx = dimx/2;
- int my = dimy/2;
- Hex::Quad* prems = grid1->getQuadIJ (mx, my, dimz);
- Hex::Quads liste;
-
- liste.push_back (prems);
- prems -> setScalar (5);
- for (int nx=0; nx<dimx; nx++)
- if (nx!=mx)
- {
- Hex::Quad* cell = grid1->getQuadIJ (nx, my, dimz);
- liste.push_back (cell);
- cell -> setScalar (5);
- }
-
- for (int ny=0; ny<dimy; ny++)
- if (ny!=my)
- {
- Hex::Quad* cell = grid1->getQuadIJ (mx, ny, dimz);
- liste.push_back (cell);
- cell -> setScalar (5);
- }
-
-
- Hex::Vertex* center = doc->addVertex (0, -10, 0);
- Hex::Vector* axis = doc->addVector (1, 0, 0);
- Hex::RealVector angles;
-
- Hex::Vector* dir1 = doc->addVector (10,0.3,0.3);
- Hex::Elements* grid2 = doc->makeCartesian (center, dir1, 1,1,1);
- Hex::Hexa* cell = grid2->getHexaIJK (0,0,0);
- cell->setScalar (5);
-
- doc->saveVtk ("revolution1.vtk");
-
- double alpha = 5;
- int niter = 5;
- double coeff = 1.5;
- for (int na=0 ; na<niter ; na++)
- {
- angles.push_back (alpha);
- alpha *= coeff;
- }
- for (int na=1 ; na<niter ; na++)
- {
- alpha /= coeff;
- angles.push_back (alpha);
- }
-
- Hex::Elements* bloc = doc->revolutionQuads (liste, center, axis, angles);
- if (bloc != NULL)
- doc->saveVtk ("revolution2.vtk");
-#endif
- return HOK;
-}
// ======================================================== test_count
int test_count (int nbargs, cpchar tabargs[])
{
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig1 = doc->addVertex ( 0, 0,0);
- Hex::Vector* vx = doc->addVector (1,0,0);
- Hex::Vector* vz = doc->addVector (0,0,1);
-
- double dr = 1;
- double dl = 1;
int nr = 2;
int nl = 3;
// Hex::Elements* c1 =
- doc->makeCylindrical (orig1, vx,vz,dr, 360, dl,nr, 10, nl, false);
+ doc->makeCylinderTop (nr, 10, nl);
HexDisplay (doc->countVertex ());
HexDisplay (doc->countUsedVertex ());
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
-
- Hex::Elements* grid = doc->makeCartesian (orig, dir, size_x,size_y,size_z);
+ Hex::Elements* grid = doc->makeCartesianTop (size_x,size_y,size_z);
Hex::Edge* arete = grid->getEdgeK (0, 0, 0);
// doc ->dump ();
int nvtk=0;
doc ->saveVtk ("decoupe", nvtk);
-/* Hex::Elements* grid2 = */ doc->cut (arete, 1);
+/* Hex::Elements* grid2 = */ doc->cutUni (arete, 1);
/// doc ->dump ();
doc ->saveVtk ("decoupe", nvtk);
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
// Hex::Elements* grid =
- doc->makeCartesian (orig, dir, size_x,size_y,size_z);
+ doc->makeCartesianTop (size_x,size_y,size_z);
// Hex::Hexa* cell = grid->getHexa (0);
// Hex::Quad* face = cell->getQuad (0);
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
// Hex::Elements* grid =
- doc->makeCartesian (orig, dir, size_x,size_y,size_z);
-
- // Hex::Hexa* cell = grid->getHexa (0);
- // Hex::Quad* face = cell->getQuad (0);
- // Hex::Edge* arete = cell->getEdge (0);
- // Hex::Vertex* noeud = cell->getVertex (0);
-
- // Hex::Shape* shape1 = new Hex::Shape("riri");
- // Hex::Shape* shape2 = new Hex::Shape("fifi");
- // Hex::Shape* shape3 = new Hex::Shape("loulou");
-
- // noeud->setAssociation (shape1);
- // arete->setAssociation (shape2);
- // face ->setAssociation (shape3);
+ doc->makeCartesianTop (size_x,size_y,size_z);
Hex::Law* law1 = doc->addLaw("loi1", 1);
Hex::Law* law2 = doc->addLaw("loi2", 2);
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid = doc->makeCartesian (orig, dir, size_x,size_y,size_z);
-
+ Hex::Elements* grid = doc->makeCartesianTop (size_x,size_y,size_z);
Hex::Vector* bond = doc->addVector (0, 0, 7);
Hex::Elements* grid2 = doc->makeTranslation (grid, bond);
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- // Hex::Elements* grid =
- doc->makeCartesian (orig, dir, size_x,size_y,size_z);
+ doc->makeCartesianTop (size_x,size_y,size_z);
doc ->saveVtk ("separ.vtk");
doc ->dump();
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- double rayon = 1;
int nbr = 3;
- Hex::Elements* grid = doc->makeSpherical (orig, rayon, nbr, 1);
+ Hex::Elements* grid = doc->makeSphericalTop (nbr, 1);
int nbhexas = grid->countHexa ();
HexDisplay (nbhexas);
Hex::Vector* vz = doc->addVector (0,0,1);
Hex::Vector* vx = doc->addVector (1,0,0);
- double dr = 1;
+ double rint = 5;
+ double rext = 1;
double dl = 1;
int nr = 2;
int nl = 3;
- doc->makeCylindrical (orig1, vx,vz,dr, 360, dl,nr, 4, nl, true);
+ doc->makeCylinderUni (orig1, vx,vz, rint,rext, 360,dl,nr, 4, nl);
Hex::Elements* c2 =
- doc->makeCylindrical (orig2, vx,vz,dr, 360, dl,nr, 8, nl, true);
- doc->makeCylindrical (orig3, vx,vz,dr, 270, dl,nr, 8, nl, true);
- doc->makeCylindrical (orig4, vx,vz,dr, 270, dl,nr, 7, nl, true);
- doc->makeCylindrical (orig5, vx,vz,dr, 360, dl,nr, 5, nl, true);
- doc->makeCylindrical (orig6, vx,vz,dr, 360, dl,nr, 6, nl, true);
+ doc->makeCylinderUni (orig2, vx,vz, rint,rext, 360,dl,nr, 8, nl);
+ doc->makeCylinderUni (orig3, vx,vz, rint,rext, 270,dl,nr, 8, nl);
+ doc->makeCylinderUni (orig4, vx,vz, rint,rext, 270,dl,nr, 7, nl);
+ doc->makeCylinderUni (orig5, vx,vz, rint,rext, 360,dl,nr, 5, nl);
+ doc->makeCylinderUni (orig6, vx,vz, rint,rext, 360,dl,nr, 6, nl);
int base2 = nr*nl*8;
c2->getHexa(base2 + 0)->setScalar (5);
Hex::Vector* vx = doc->addVector (1, 0, 0);
Hex::Vector* vz = doc->addVector (0, 0, 1);
- double dr = 1;
double da = 360;
double dl = 1;
HexDisplay (da);
}
- // Hex::Cylinder* cyl = doc->addCylinder (orig, vz, nr, nl);
- // Hex::Elements* grid = doc->makeCylinder (cyl, vx, nr, na, nl);
- doc->makeCylindrical (orig,vx, vz, dr,da,dl, nr,na, nl, true);
+ doc->makeCylinderUni (orig,vx, vz, 5.0,1.0,da,dl, nr,na, nl);
doc->saveVtk (fic_vtk, na);
return HOK;
}
-// ===================================================== test_cylinder
-int test_cylinder (int nbargs, cpchar tabargs[])
-{
- int nvtk = 1;
- cpchar fic_vtk = "cylindre";
-
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* orig = doc->addVertex (0, 0, 0);
- Hex::Vector* vx = doc->addVector (1, 0, 0);
- Hex::Vector* vz = doc->addVector (0, 0, 1);
-
- double rayon = 10;
- double hauteur = 6;
-
- int nr = 2;
- int na = 8;
- int nl = 5;
-
- Hex::Cylinder* cyl = doc->addCylinder (orig, vz, rayon, hauteur);
- doc->makeCylinder (cyl, vx, nr, na, nl);
- doc ->saveVtk (fic_vtk, nvtk);
- return HOK;
-}
-// ===================================================== test_xml_cylinder
-int test_xml_cylinder (int nbargs, cpchar tabargs[])
-{
- int nvtk = 0;
- cpchar fic_vtk = "cylindre";
-
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* orig1 = doc->addVertex (0, 0,0);
- Hex::Vertex* orig2 = doc->addVertex (50,0,0);
- Hex::Vector* vz = doc->addVector (0,0,1);
- Hex::Vector* vx = doc->addVector (1,0,0);
-
- vx->setName ("vx");
- vz->setName ("vz");
- orig1->setName ("orig1");
- orig2->setName ("orig2");
-
- int nr = 4;
- int nri = 3;
- int nre = nr;
- int na = 9;
- int nl = 5;
-
- Hex::Cylinder* cyl = doc->addCylinder (orig1, vz, nr, nl);
- Hex::Pipe* pipe = doc->addPipe (orig2, vz, nri, nre, nl);
-
- Hex::Elements* grid = doc->makeCylinder (cyl, vx, nr, na, nl);
- doc ->saveVtk (fic_vtk, nvtk);
-
- Hex::Group* groupe = doc->addGroup ("GroupeAMA", Hex::HexaCell);
- groupe->addElement (grid->getHexaIJK (0,0,0));
- groupe->addElement (grid->getHexaIJK (1,0,0));
- groupe->addElement (grid->getHexaIJK (0,1,0));
- groupe->addElement (grid->getHexaIJK (1,1,0));
- groupe->addElement (grid->getHexaIJK (2,1,0));
-
- grid->getHexaIJK (0,0,0)->setName ("Hexa0");
- grid->getQuadIJ (0,0,0)->setName ("QuadIJ0");
- grid->getEdgeK (0,0,0)->setName ("EdgeK0");
-
- doc->makePipe (pipe, vx, nr, na, nl);
- doc ->saveVtk (fic_vtk, nvtk);
- doc->save ("cylindre");
-
- return HOK;
-}
-// ===================================================== test_pipe
-int test_pipe (int nbargs, cpchar tabargs[])
-{
- int nvtk = 0;
- cpchar fic_vtk = "cylindre";
-
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* orig1 = doc->addVertex (0, 0,0);
- Hex::Vector* vx = doc->addVector (1,0,0);
- Hex::Vector* vy = doc->addVector (0,1,0);
-
- int nr = 1;
- int nri = 1;
- int nre = 2;
- int na = 2;
- int nl = 1;
-
- Hex::Pipe* pipe = doc->addPipe (orig1, vx, nri, nre, nl);
- doc->makePipe (pipe, vy, nr, na, nl);
- doc ->saveVtk (fic_vtk, nvtk);
-
- return HOK;
-}
-// ======================================================== del_hexa
-void del_hexa (Hex::CrossElements* gr, int cyl, int ni, int nj, int nk, int dr)
-{
- Hex::Hexa* hexa = gr->getHexaIJK (cyl, ni, nj, nk);
- if (hexa!=NULL)
- {
- hexa->remove ();
- if (dr>1)
- save_vtk ();
- }
-}
-// ======================================================== del_tranche
-int del_tranche (Hex::CrossElements* grid, int cyl, int ni, int nk, int dr=1)
-{
- for (int nj = 0 ; nj < 8 ; nj++)
- del_hexa (grid, cyl, ni, nj, nk, dr);
-
- if (dr==1)
- save_vtk ();
- printf ("del_tranche (g=%d, i=%d, k=%d) : fic = %d\n",
- cyl, ni, nk, nbr_vtk-1);
- return nbr_vtk;
-}
// ======================================================== test_joint2
int test_joint2 (int nbargs, cpchar tabargs[])
{
Hex::Vertex* hori = docu->addVertex (0, 0, 0);
double da = 360;
- double dr = 2;
double dl = 1;
int nr = 1;
int na = 8;
int nl = 1;
- bool fill = true;
Hex::Elements *bgrid=NULL, *hgrid=NULL;
- hgrid = docu->makeCylindrical (hori, vx,vz, dr,da,dl, nr,na,nl, fill);
+ hgrid = docu->makeCylinderUni (hori, vx,vz, 5.0,1.0,da,dl, nr,na,nl);
docu->dump ();
save_vtk ();
Hex::Vertex* bori = docu->addVertex (0, 0, -5);
- bgrid = docu->makeCylindrical (bori, vx,vz, dr,da,dl, nr,na,nl, fill);
+ bgrid = docu->makeCylinderUni (bori, vx,vz, 5.0,1.0,da,dl, nr,na,nl);
save_vtk ();
Hex::Quads qsource, qdest;
Hex::Vertex* vs1 = hgrid->getVertexIJK (0, 0, 0);
Hex::Vertex* vs2 = hgrid->getVertexIJK (1, 0, 0);
- docu->joinQuads (qsource, cible, vs1, vc1, vs2, vc2, 1);
- save_vtk ();
-
- return HOK;
-}
-// ======================================================== test_croix
-int test_croix (int nbargs, cpchar tabargs[])
-{
- Hex::Hex mon_ex;
- case_name = "croix";
- docu = mon_ex.addDocument (case_name);
-
- Hex::Vertex* ori1 = docu->addVertex ( 0,0,0);
- Hex::Vertex* ori2 = docu->addVertex (-5,0,5);
- Hex::Vector* vz = docu->addVector ( 0,0,1);
- Hex::Vector* vx = docu->addVector ( 1,0,0);
-
- double r1 = 2;
- double r2 = 3;
- double l1 = 10;
- double l2 = 10;
-
- Hex::Cylinder* cyl1 = docu->addCylinder (ori1, vz, r1, l1);
- Hex::Cylinder* cyl2 = docu->addCylinder (ori2, vx, r2, l2);
- Hex::CrossElements* grid = docu->makeCylinders (cyl1, cyl2);
-
- save_vtk ();
- PutData ((BadElement (grid)));
-
-
- Hex::Edge* pipo = docu->addEdge (ori1, ori1);
- PutData (pipo->isValid());
- PutData ((BadElement (pipo)));
- return HOK;
-
- del_tranche (grid, 0, 1, 0);
- del_tranche (grid, 0, 1, 5);
-
- del_tranche (grid, 1, 1, 0);
- del_tranche (grid, 1, 1, 3);
-
- del_tranche (grid, 1, 0, 0);
- del_tranche (grid, 1, 0, 3);
- // Le trognon
- del_tranche (grid, 0, 0, 0);
- del_tranche (grid, 0, 0, 5);
- del_tranche (grid, 0, 0, 1);
- del_tranche (grid, 0, 0, 2);
- del_tranche (grid, 0, 0, 3);
- del_tranche (grid, 0, 0, 4);
- // Partie critique
-
- del_tranche (grid, 1, 1, 1, 2);
-
- del_tranche (grid, 0, 1, 1, 2);
- del_tranche (grid, 0, 1, 4, 2);
- del_tranche (grid, 0, 1, 3, 2);
- del_tranche (grid, 0, 1, 2, 2);
-
- del_tranche (grid, 1, 1, 2, 2);
- return HOK;
-}
-// ======================================================== test_croix2
-int test_croix2 (int nbargs, cpchar tabargs[])
-{
- Hex::Hex mon_ex;
- case_name = "croix";
- docu = mon_ex.addDocument (case_name);
-
- Hex::Vertex* pt1 = docu->addVertex ( 0,0,0);
- Hex::Vertex* pt2 = docu->addVertex (10,0,0);
-
- Hex::Vector* dx = docu->addVector ( 1,0,0);
- Hex::Vector* dy = docu->addVector ( 0,1,0);
- Hex::Vector* dz = docu->addVector ( 0,0,1);
-
- double r1 = 4;
- double r2 = 2;
- double l1 = 20;
- double l2 = 15;
-
- Hex::Cylinder* cyl1 = docu->addCylinder (pt1, dx, r1, l1);
- Hex::Cylinder* cyl2 = docu->addCylinder (pt2, dz, r2, l2);
-
- int nr = 3;
- int na = 8;
- int nl = 2;
- Hex::Elements* grid1 = docu->makeCylinder (cyl1, dy, nr, na, nl);
- grid1->saveVtk ("cyl_big.vtk");
- Hex::Elements* grid2 = docu->makeCylinder (cyl2, dy, nr, na, nl);
- grid2->saveVtk ("cyl_small.vtk");
-
- PutData ((BadElement (grid1)));
- PutData ((BadElement (grid2)));
-
- Hex::CrossElements* grid = docu->makeCylinders (cyl1, cyl2);
-
- grid->saveVtk ("cyl_all.vtk");
- return HOK;
-}
-// ======================================================== test_pipes
-int test_pipes (int nbargs, cpchar tabargs[])
-{
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* ori1 = doc->addVertex ( 0,0,0);
- Hex::Vertex* ori2 = doc->addVertex (-5,0,5);
- Hex::Vector* vz = doc->addVector ( 0,0,1);
- Hex::Vector* vx = doc->addVector ( 1,0,0);
-
-// double h1 = 5, ri1 = 1, re1 = 2;
- double h1 = 10, ri1 = 1, re1 = 2;
- double h2 = 10, ri2 = 2, re2 = 3;
-
- Hex::Pipe* pipe1 = doc->addPipe (ori1, vz, ri1, re1, h1);
- Hex::Pipe* pipe2 = doc->addPipe (ori2, vx, ri2, re2, h2);
- Hex::CrossElements* grid = doc->makePipes (pipe1, pipe2);
-
- case_name = "pipe";
- docu = doc;
+ docu->joinQuadsUni (qsource, cible, vs1, vc1, vs2, vc2, 1);
save_vtk ();
- del_tranche (grid, 0, 1, 0);
- del_tranche (grid, 0, 1, 5);
-
- del_tranche (grid, 1, 1, 0);
- del_tranche (grid, 1, 1, 3);
- // Partie critique
-
- del_tranche (grid, 1, 1, 1, 2);
-
- del_tranche (grid, 0, 1, 1, 2);
- del_tranche (grid, 0, 1, 4, 2);
- del_tranche (grid, 0, 1, 3, 2);
- del_tranche (grid, 0, 1, 2, 2);
-
- del_tranche (grid, 1, 1, 2, 2);
- /* ***************************************************
-
- int nbz [2] = { 8, 4 };
- int ni = 1;
- for (int cyl = 0 ; cyl < 2 ; cyl++)
- for (int nk = 0 ; nk < nbz[cyl] ; nk++)
- for (int nj = 0 ; nj < 4 ; nj++)
- {
- int jj = nj;
- if (cyl==0) jj = (jj+6) MODULO 8 ;
- Hex::Hexa* hexa = grid->getHexaIJK (cyl, ni, jj, nk);
- if (hexa!=NULL)
- {
- hexa->remove ();
- doc->saveVtk (case_name, nbr_vtk);
- }
- }
- *************************************************** */
- return HOK;
-}
-// ======================================================== test_lorraine
-int test_lorraine(int nbargs, cpchar tabargs[])
-{
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* ori1 = doc->addVertex ( 0,0,0);
- Hex::Vertex* ori2 = doc->addVertex (-5,0,5);
- Hex::Vertex* ori3 = doc->addVertex ( 0,0,12);
- Hex::Vertex* ori4 = doc->addVertex (-5,0,17);
-
- Hex::Vector* vz = doc->addVector ( 0,0,1);
- Hex::Vector* vx = doc->addVector ( 1,0,0);
-
- int nl1 = 10;
- int nl2 = 10;
-
- double rsmall = 1;
- double rmoy = 2;
- double rbig = 3;
-
- Hex::Cylinder* cyl1 = doc->addCylinder (ori1, vz, rmoy, nl1);
- Hex::Cylinder* cyl2 = doc->addCylinder (ori2, vx, rsmall, nl2);
-
- Hex::Cylinder* cyl3 = doc->addCylinder (ori3, vz, rmoy, nl1);
- Hex::Cylinder* cyl4 = doc->addCylinder (ori4, vx, rbig, nl2);
-
- Hex::CrossElements* grid1 = doc->makeCylinders (cyl1, cyl2);
- Hex::CrossElements* grid2 = doc->makeCylinders (cyl4, cyl3);
-
-#define Imprimer(x) printf (#x " = ") ; if (x) x->dump() ; else printf ("NULL\n")
- const int nx_int = 0;
- const int nx_ext = 1;
-
- // vc2 = grid1->getVertexIJK (Hex::CylBig, 0,0,0);
- // vc3 = grid2->getVertexIJK (Hex::CylSmall, 0,0,0);
- // Cyl i j k
- Hex::Quad* qb = grid1-> getQuadIJ (Hex::CylBig, nx_ext, Hex::S_E, 4);
- Hex::Quad* qh = grid2-> getQuadIJ (Hex::CylSmall, nx_ext, Hex::S_N, 0);
-
- Hex::Vertex* vb0 = qb->getVertex (3);
- Hex::Vertex* vb1 = qb->getVertex (2);
- Hex::Vertex* vh0 = qh->getVertex (0);
- Hex::Vertex* vh1 = qh->getVertex (1);
-
- vb0 = grid1->getVertexIJK (Hex::CylBig, 2, Hex::S_E, 4); // cible
- vb1 = grid1->getVertexIJK (Hex::CylBig, 2, Hex::S_NE, 4);
- vh0 = grid2->getVertexIJK (Hex::CylSmall, 2, Hex::S_N, 0); // depart
- vh1 = grid2->getVertexIJK (Hex::CylSmall, 2, Hex::S_NW, 0);
-
- Imprimer (vh0);
- Imprimer (vh1);
- Imprimer (vb0);
- Imprimer (vb1);
-
- // qb->remove ();
- // qh->remove ();
- Hex::Quads hliste;
-
- hliste.push_back (qh);
- for (int ny=1; ny<Hex::S_MAXI; ny++)
- {
- int ns = (ny + Hex::S_N) MODULO Hex::S_MAXI;
- hliste.push_back (grid2->getQuadIJ (Hex::CylSmall, nx_ext, ns, 0));
- }
-
- for (int ny=0; ny<4 ; ny++)
- hliste.push_back (grid2->getQuadIJ (Hex::CylSmall, nx_int, ny, 0));
-
- int hauteur = 3;
- doc->joinQuads (hliste, qb, vh0, vb0, vh1, vb1, hauteur);
- doc->saveVtk ("lorraine.vtk");
-
- // doc->dump ();
return HOK;
}
// ======================================================== test_disconnect2
const int size_z = 1;
Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* orig2 = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid2 = doc->makeCartesian (orig2, dir, size_x,size_y,size_z);
-
- doc->dump ();
+ Hex::Document* doc = mon_ex.addDocument ();
+ Hex::Elements* grid2 = doc->makeCartesianTop (size_x,size_y,size_z);
int nvtk = 0;
doc->setLevel (1);
- Hex::Matrix matrice;
- Hex::Vector* ecart = doc->addVector (0.5,0.5,0);
- matrice.defTranslation (ecart);
Hex::Hexa* hexa2 = grid2->getHexaIJK (1,1,0);
Hex::Edge* edge = grid2->getEdgeK (1,2,0);
- hexa2->setScalar (2);
- edge->setScalar (5);
+ hexa2->setColor (2);
+ edge->setColor (5);
doc->saveVtk ("test_disco", nvtk);
HexDisplay (disco_edges->countQuad());
HexDisplay (disco_edges->countHexa());
- // hexa2->transform (&matrice);
- /**********************************
- for (int ns=0; ns<disco_edges->countVertex(); ns++)
- {
- Hex::Vertex* sommet = disco_edges->getVertex(ns);
- sommet->setX (sommet->getX()+0.5);
- sommet->setY (sommet->getY()+0.5);
- }
- ********************************* */
-
doc->saveVtk ("test_disco", nvtk);
doc->save ("test_disco");
- doc->dump ();
- hexa2->dumpFull ();
+ // doc->dump ();
+ // hexa2->dumpFull ();
- doc->setLevel (4);
+ // doc->setLevel (4);
return HOK;
}
// ======================================================== test_disconnect4
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig2 = doc->addVertex (0,0,0);
- Hex::Vector* vx = doc->addVector (1,0,0);
- Hex::Vector* vy = doc->addVector (0,1,0);
- Hex::Vector* vz = doc->addVector (0,0,1);
- Hex::Elements* grid2 = doc->makeCartesian (orig2, vx,vy,vz, size_x,size_y,size_z);
+ Hex::Elements* grid2 = doc->makeCartesianTop (size_x,size_y,size_z);
int nvtk = 0;
doc->setLevel (1);
doc->setLevel (4);
return HOK;
}
-// ======================================================== test_disconnect
+// ======================================================== test_disconnect1
// ==== Disconnect Quad
int test_disconnect1 (int nbargs, cpchar tabargs[])
{
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig1 = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid1 = doc->makeCartesian (orig1, dir, size_x,size_y,size_z);
+ Hex::Elements* grid1 = doc->makeCartesianTop (size_x,size_y,size_z);
int nvtk = 0;
doc->setLevel (1);
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig1 = doc->addVertex (0,0,0);
-
- Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid1 = doc->makeCartesian (orig1, dir, size_x,size_y,size_z);
+ Hex::Elements* grid1 = doc->makeCartesianTop (size_x,size_y,size_z);
int nvtk = 0;
doc->setLevel (1);
Hex::Vertex* orig2 = doc->addVertex (4,0,0);
Hex::Vertex* orig3 = doc->addVertex (8,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid1 = doc->makeCartesian (orig1, dir, size_x,size_y,size_z);
- Hex::Elements* grid2 = doc->makeCartesian (orig2, dir, size_x,size_y,size_z);
- Hex::Elements* grid3 = doc->makeCartesian (orig3, dir, size_x,size_y,size_z);
+ Hex::Vector* vx = doc->addVector (1,0,0);
+ Hex::Vector* vy = doc->addVector (0,1,0);
+ Hex::Vector* vz = doc->addVector (0,0,1);
+ double dx=1, dy=1, dz=1;
+
+ Hex::Elements* grid1 = doc->makeCartesianUni (orig1, vx,vy,vz, dx,dy,dz,
+ size_x,size_y,size_z);
+ Hex::Elements* grid2 = doc->makeCartesianUni (orig2, vx,vy,vz, dx,dy,dz,
+ size_x,size_y,size_z);
+ Hex::Elements* grid3 = doc->makeCartesianUni (orig3, vx,vy,vz, dx,dy,dz,
+ size_x,size_y,size_z);
int nvtk = 0;
doc->setLevel (1);
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- // Hex::Elements* grid =
- doc->makeCartesian (orig, dir, size_x,size_y,size_z);
+ doc->makeCartesianTop (size_x,size_y,size_z);
int nb = doc->countPropagation ();
for (int nro=0 ; nro<nb ; nro++)
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid = doc->makeCartesian (orig, dir, size_x,size_y,size_z);
+ Hex::Elements* grid = doc->makeCartesianTop (size_x,size_y,size_z);
Hex::Vector* enhaut = doc->addVector (0, 0, 5);
Hex::Vector* devant = doc->addVector (5, 0, 0);
Hex::Vertex* orig = doc->addVertex (0,0,0);
Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid = doc->makeCartesian (orig, dir, size_x, size_y,
- size_z);
+ Hex::Elements* grid = doc->makeCartesianTop (size_x, size_y, size_z);
if (grid==NULL)
return HERR;
return HOK;
}
-// ======================================================== test_transfo
-int test_transfo (int nbargs, cpchar tabargs[])
-{
- int nvtk = 0;
- cpchar fic_vtk = "transfo";
-
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
- doc ->setLevel (1);
-
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vector* vx = doc->addVector (1,0,0);
- Hex::Vector* vz = doc->addVector (0,0,1);
- double dr = 1;
- double da = 360;
- double dl = 1;
- int nr = 3;
- int na = 8;
- int nl = 3;
- Hex::Elements* grid = doc->makeCylindrical (orig, vx,vz, dr, da, dl,
- nr, na, nl, false);
- if (grid==NULL)
- return HERR;
-
- doc ->saveVtk (fic_vtk, nvtk);
- Hex::Vector* devant = doc->addVector (10, 0, 0);
-
- Hex::Elements* grid2 = doc->makeTranslation (grid, devant);
- if (grid2==NULL)
- return HERR;
- doc ->saveVtk (fic_vtk, nvtk);
-
- return HOK;
-}
// ======================================================== test_copy_document
int test_copy_document (int nbargs, cpchar tabargs[])
{
Hex::Hex mon_ex;
Hex::Document* doc = mon_ex.addDocument ();
- Hex::Vertex* orig = doc->addVertex (0,0,0);
- Hex::Vertex* orig1 = doc->addVertex (6,0,0);
- Hex::Vector* dir = doc->addVector (1,1,1);
- Hex::Elements* grid = doc->makeCartesian (orig, dir, size_x,size_y,size_z);
- doc->makeCartesian (orig1, dir, 1,1,1);
+ Hex::Elements* grid = doc->makeCartesianTop (size_x,size_y,size_z);
doc->saveVtk ("removeConn1.vtk");
Echo ("--------- Avant destruction");
if (n15>0.0) tab.push_back (n15);
if (n16>0.0) tab.push_back (n16);
}
-// ================================================== test_cylindricals
-int test_cylindricals (int nbargs, cpchar tabargs[])
-{
- Hex::Hex mon_ex;
- Hex::Document* doc = mon_ex.addDocument ();
-
- Hex::Vertex* orig = doc->addVertex (0, 0, 0);
- Hex::Vector* vz = doc->addVector (0, 0, 1);
- Hex::Vector* vx = doc->addVector (1 ,0, 0);
-
- Hex::RealVector tdr, tda, tdl;
-
- /******************
- init_vec (tdr, 2, 1, 0.5);
- init_vec (tda, 40, 35, 30, 25, 20, 15, 10, 5,
- 5, 10, 15, 20, 25, 30, 35, 40);
- init_vec (tdl, 1, 2, 3 );
-
- init_vec (tdr, 1, 1, 1, 1);
- init_vec (tda, 45,45, 45,45, 45,45, 45,45 );
- init_vec (tdl, 1, 1, 1 );
-
- ****************** */
-
-
- init_vec (tdr, 1, 2, 1, 2);
- init_vec (tda, 20, 20, 20 );
- init_vec (tdl, 1 );
-
- Hex::Elements* grid=doc->makeCylindricals (orig, vx,vz, tdr,tda,tdl, false);
-
- doc->saveVtk ("cylindricals.vtk");
- doc->dump();
- grid->clearAssociation();
- doc->clearAssociation();
- return HOK;
-}
// ======================================================== test_edge
int test_edge (int nbargs, cpchar tabargs[])
{
goto_workspace ();
- ier = test_cylindricals (nbargs, tabargs);
- ier = test_transfo (nbargs, tabargs);
free_workspace ();
return ier;