From 3df8bbc667663d7adc189021a2f68225afe5b7ab Mon Sep 17 00:00:00 2001 From: abuhsing Date: Fri, 31 Jan 2014 13:02:56 +0000 Subject: [PATCH] Quelques bugs (ihm + extrudeQuadsTop) : : Modified Files: : Tag: V7_main : HEXABLOCK/HexDocument_v6.cxx HEXABLOCK/HexElements_grid.cxx : HEXABLOCK/test_hexa6.cxx HEXABLOCKGUI/HEXABLOCKGUI.cxx : HEXABLOCKGUI/HEXABLOCKGUI.hxx : HEXABLOCKGUI/HEXABLOCKGUI_Model.cxx : ---------------------------------------------------------------------- --- src/HEXABLOCK/HexDocument_v6.cxx | 43 ++++++++++++++++++++++--- src/HEXABLOCK/HexElements_grid.cxx | 4 +-- src/HEXABLOCK/test_hexa6.cxx | 29 +++++++++++++++-- src/HEXABLOCKGUI/HEXABLOCKGUI.cxx | 2 +- src/HEXABLOCKGUI/HEXABLOCKGUI_Model.cxx | 5 ++- 5 files changed, 70 insertions(+), 13 deletions(-) diff --git a/src/HEXABLOCK/HexDocument_v6.cxx b/src/HEXABLOCK/HexDocument_v6.cxx index a8ba2e6..28bf301 100644 --- a/src/HEXABLOCK/HexDocument_v6.cxx +++ b/src/HEXABLOCK/HexDocument_v6.cxx @@ -26,12 +26,46 @@ #include "HexBiCylinder.hxx" #include "HexVector.hxx" #include "HexQuad.hxx" +#include "HexHexa.hxx" #include "HexGlobale.hxx" BEGIN_NAMESPACE_HEXA +// ======================================================== make_normale +int make_normale (Quads& tquads, double axe[], double& largeur) +{ + double lgmoy = 0; + Real3 cf, cg, vn; + int nbre = tquads.size(); + if (nbre==0) + return HERR; + + double coeff = 0; + for (int nro=0 ; nrogetNbrParents(); + if (nbp!=1) + return HERR; + // Calcul des cotes + for (int nc=0 ; ncgetEdge(nc)->getLength (); + // Calcul de la normale sortante + Hexa* hexa = quad->getParent (0); + hexa->getCenter (cg); + quad->getCenter (cf); + calc_vecteur (cg, cf, vn); + for (int nc=0 ; nccheckQuad (start); - grid->makeNormale (tstart, axe, larg); + make_normale (tstart, axe, larg); for (int nro=0 ; nroisValid()) @@ -823,8 +856,8 @@ Elements* Document::extrudeQuadsTop (Quads tstart, int nbre) double larg = 1; Elements* grid = new Elements (this); - grid->checkQuads (tstart); - grid->makeNormale (tstart, axe, larg); + grid->checkQuads (tstart); + make_normale (tstart, axe, larg); for (int nro=0 ; nroisValid()) diff --git a/src/HEXABLOCK/HexElements_grid.cxx b/src/HEXABLOCK/HexElements_grid.cxx index 4371cb9..df51e94 100755 --- a/src/HEXABLOCK/HexElements_grid.cxx +++ b/src/HEXABLOCK/HexElements_grid.cxx @@ -421,9 +421,7 @@ void Elements::fillCenterOdd () int Elements::makeBasicCylinder (RealVector& tdr, RealVector& tda, RealVector& tdh, bool fill) { - int na = tda.size()-1; - PutData (na); - + int na = tda.size()-1; cyl_dispo = CYL_NOFILL; if (fill && na > 3) { diff --git a/src/HEXABLOCK/test_hexa6.cxx b/src/HEXABLOCK/test_hexa6.cxx index 3538017..d5353ad 100644 --- a/src/HEXABLOCK/test_hexa6.cxx +++ b/src/HEXABLOCK/test_hexa6.cxx @@ -101,13 +101,13 @@ void eplucher (Hex::Document* doc, Hex::Elements* grid, string& radical) int test_cartesian6 (int nbargs, cpchar tabargs[]) { case_name = "cartesian_top"; + Hex::Document* doc = get_document (); + +/*********************** const int size_x = 3; const int size_y = 4; const int size_z = 5; - Hex::Document* doc = get_document (); - -/*********************** Hex::Elements* grid1 = doc->makeCartesianTop (size_x, size_y, size_z); grid1->saveVtk ("makeCartesianTop.vtk"); PutData (grid1->isValid()); @@ -490,6 +490,29 @@ int test_extrude6 (int nbargs, cpchar tabargs[]) doc->saveVtk ("prisme3.vtk"); return HOK; } +// ======================================================== test_extrude7 +int test_extrude7 (int nbargs, cpchar tabargs[]) +{ + const int nr = 2; + const int na = 8; + const int nh = 3; + + Hex::Document* doc = get_document (); + Hex::Elements* grid1 = doc->makeCylinderTop (nr, na, nh); + + Hex::Quads tquads; + for (int k=0 ; kgetQuadJK (nr, 0, k); + quad->setColor (5); + tquads.push_back (quad); + } + + doc->saveVtk ("grid0.vtk"); + Hex::Elements* grid2 = doc->extrudeQuadsTop (tquads, 4); + doc->saveVtk ("grid1.vtk"); + return HOK; +} // ======================================================== test_revolution6 int test_revolution6 (int nbargs, cpchar tabargs[]) { diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx index 2fa79cb..c5180cf 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx @@ -1012,7 +1012,7 @@ void HEXABLOCKGUI::createAndFillDockWidget() _dwMesh->setWidget(_meshTreeView); _meshTreeView->show(); -// QDockWidget *_dwObjectBrowser = 0; + QDockWidget *_dwObjectBrowser = 0; QWidget* wid = getApp()->objectBrowser()->treeView(); QWidget *w = wid->parentWidget(); while ( w && !_dwObjectBrowser ) { diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_Model.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_Model.cxx index a5d5c47..47926d7 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_Model.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_Model.cxx @@ -17,6 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include "hexa_base.hxx" #include "HEXABLOCKGUI_Model.hxx" //#define _DEVDEBUG_ @@ -28,6 +29,7 @@ HEXABLOCKGUI_Model::HEXABLOCKGUI_Model(CAM_Module* theModule) : SalomeApp_DataModel(theModule) { DEBTRACE("HEXABLOCKGUI_Model::HEXABLOCKGUI_Model"); + std::cout << "HEXABLOCKGUI_Model::HEXABLOCKGUI_Model" << std::endl; } HEXABLOCKGUI_Model::~HEXABLOCKGUI_Model() @@ -44,12 +46,13 @@ bool HEXABLOCKGUI_Model::open(const QString& fileName, CAM_Study* study, QString bool HEXABLOCKGUI_Model::save(QStringList& listOfFiles) { DEBTRACE("HEXABLOCKGUI_Model::save"); + std::cout << "HEXABLOCKGUI_Model::save" << std::endl; return SalomeApp_DataModel::save(listOfFiles); } bool HEXABLOCKGUI_Model::saveAs(const QString& fileName, CAM_Study* study, QStringList& listOfFiles) { DEBTRACE("HEXABLOCKGUI_Model::saveAs"); + std::cout << "HEXABLOCKGUI_Model::saveAs" << std::endl; return SalomeApp_DataModel::saveAs(fileName, study, listOfFiles); } - -- 2.39.2