From 9f38d30a4881892bfae2dd94a5f67c49368205e6 Mon Sep 17 00:00:00 2001 From: abuhsing Date: Thu, 28 Nov 2013 14:54:35 +0000 Subject: [PATCH] Livraison C-S du 28/11/2013 Modified Files: Tag: V7_main salome_adm/unix/SALOMEconfig.h.in src/HEXABLOCK/HexDocument.hxx src/HEXABLOCK/HexDocument_v6.cxx src/HEXABLOCK/HexEdge.cxx src/HEXABLOCK/HexEdge.hxx src/HEXABLOCK/HexEdgeShape.cxx src/HEXABLOCK/HexEdgeShape.hxx src/HEXABLOCK/HexGlobale.hxx src/HEXABLOCK/HexSubShape.cxx src/HEXABLOCK/HexSubShape.hxx src/HEXABLOCK/hexa_base.hxx src/HEXABLOCK/work/hexablock.py src/HEXABLOCKGUI/CMakeLists.txt src/HEXABLOCKGUI/HEXABLOCKGUI.cxx src/HEXABLOCKGUI/HEXABLOCKGUI.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_Exception.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_Resource.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_Trace.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx src/HEXABLOCKGUI/MakeCylinder_QTD.ui src/HEXABLOCKGUI/MakePipe_QTD.ui src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx src/HEXABLOCKGUI/ReplaceHexa_QTD.ui src/HEXABLOCKGUI/Resource.hxx src/HEXABLOCKGUI/klinkitemselectionmodel.hxx src/HEXABLOCKGUI/kmodelindexproxymapper.hxx src/HEXABLOCK_SWIG/hexablock_swig.py src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc Removed Files: Tag: V7_main src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx ---------------------------------------------------------------------- --- src/HEXABLOCK/HexDocument.hxx | 3 + src/HEXABLOCK/HexDocument_v6.cxx | 18 + src/HEXABLOCK/HexEdge.cxx | 9 + src/HEXABLOCK/HexEdge.hxx | 1 + src/HEXABLOCK/HexEdgeShape.cxx | 54 +- src/HEXABLOCK/HexEdgeShape.hxx | 4 + src/HEXABLOCK/HexSubShape.cxx | 1 + src/HEXABLOCK/HexSubShape.hxx | 2 +- src/HEXABLOCK/hexa_base.hxx | 4 +- src/HEXABLOCK/work/hexablock.py | 10 + src/HEXABLOCKGUI/CMakeLists.txt | 3 - src/HEXABLOCKGUI/HEXABLOCKGUI.cxx | 76 ++- src/HEXABLOCKGUI/HEXABLOCKGUI.hxx | 11 +- .../HEXABLOCKGUI_DocumentDelegate.cxx | 216 ------- .../HEXABLOCKGUI_DocumentDelegate.hxx | 87 --- .../HEXABLOCKGUI_DocumentItem.hxx | 37 +- .../HEXABLOCKGUI_DocumentModel.cxx | 92 ++- .../HEXABLOCKGUI_DocumentModel.hxx | 20 +- .../HEXABLOCKGUI_DocumentPanel.cxx | 539 +++++++++++++++--- .../HEXABLOCKGUI_DocumentPanel.hxx | 99 ++-- .../HEXABLOCKGUI_DocumentSelectionModel.hxx | 18 +- src/HEXABLOCKGUI/HEXABLOCKGUI_Exception.hxx | 4 +- .../HEXABLOCKGUI_GraphicViewsHandler.hxx | 4 +- src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h | 4 +- .../HEXABLOCKGUI_OccGraphicView.hxx | 5 +- src/HEXABLOCKGUI/HEXABLOCKGUI_Resource.hxx | 4 +- src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx | 32 +- src/HEXABLOCKGUI/HEXABLOCKGUI_Trace.hxx | 4 +- .../HEXABLOCKGUI_VtkDocumentGraphicView.hxx | 8 +- src/HEXABLOCKGUI/MakeCylinder_QTD.ui | 6 +- src/HEXABLOCKGUI/MakePipe_QTD.ui | 6 +- src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx | 10 +- src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx | 8 +- src/HEXABLOCKGUI/ReplaceHexa_QTD.ui | 251 +++++--- src/HEXABLOCKGUI/Resource.hxx | 4 +- src/HEXABLOCKGUI/klinkitemselectionmodel.hxx | 4 +- src/HEXABLOCKGUI/kmodelindexproxymapper.hxx | 6 +- src/HEXABLOCK_SWIG/hexablock_swig.py | 4 +- src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc | 63 +- 39 files changed, 1068 insertions(+), 663 deletions(-) delete mode 100755 src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx delete mode 100755 src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx diff --git a/src/HEXABLOCK/HexDocument.hxx b/src/HEXABLOCK/HexDocument.hxx index 4d7df44..9a2307d 100755 --- a/src/HEXABLOCK/HexDocument.hxx +++ b/src/HEXABLOCK/HexDocument.hxx @@ -110,6 +110,9 @@ public : Elements* replace (Quads pattern, Vertex* p1, Vertex* c1, Vertex* p2, Vertex* c2, Vertex* p3, Vertex* c3); + Elements* replaceHexas (Quads pattern, Quads cible, Vertex* p1, Vertex* c1, + Vertex* p2, Vertex* c2, Vertex* p3, Vertex* c3); + int mergeVertices (Vertex* v1, Vertex* v2); int mergeEdges (Edge* e1, Edge* e2, Vertex* v1, Vertex* v2); int mergeQuads (Quad* q1, Quad* q2, Vertex* v1, Vertex* v2, diff --git a/src/HEXABLOCK/HexDocument_v6.cxx b/src/HEXABLOCK/HexDocument_v6.cxx index a8ba2e6..29e8be2 100644 --- a/src/HEXABLOCK/HexDocument_v6.cxx +++ b/src/HEXABLOCK/HexDocument_v6.cxx @@ -1144,4 +1144,22 @@ Elements* Document::cut (Edge* edge, RealVector& tlen) DumpReturn (grid); return grid; } +// ========================================================= replaceHexas +Elements* Document::replaceHexas (Quads pattern, Quads cible, Vertex* p1, + Vertex* c1, Vertex* p2, Vertex* c2, + Vertex* p3, Vertex* c3) +{ + DumpStart ("replace", pattern << cible << p1 << c1 << p2 << c2 << p3 << c3); + + Elements* t_hexas = new Elements (this); + + //if (BadElement (edge)) + { + t_hexas->setError (HERR); + Mess << "This function is not yet implemented"; + } + + DumpReturn (t_hexas); + return t_hexas; +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexEdge.cxx b/src/HEXABLOCK/HexEdge.cxx index 7fc3dc5..e0e34a3 100755 --- a/src/HEXABLOCK/HexEdge.cxx +++ b/src/HEXABLOCK/HexEdge.cxx @@ -517,4 +517,13 @@ double Edge::getAssoLen () return longueur; } +// ========================================================= getLength +double Edge::getLength () +{ + Real3 p1, p2; + e_vertex [V_AMONT]-> getAssoCoord (p1); + e_vertex [V_AVAL ]-> getAssoCoord (p2); + double longueur = calc_distance (p1, p2); + return longueur; +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexEdge.hxx b/src/HEXABLOCK/HexEdge.hxx index 0e05e80..e86ea12 100755 --- a/src/HEXABLOCK/HexEdge.hxx +++ b/src/HEXABLOCK/HexEdge.hxx @@ -35,6 +35,7 @@ public: virtual void clearAssociation (); void setColor (double valeur); bool getWay () { return e_way ; } + double getLength (); Edge (Vertex* va, Vertex* vb); diff --git a/src/HEXABLOCK/HexEdgeShape.cxx b/src/HEXABLOCK/HexEdgeShape.cxx index 5aed434..b652529 100755 --- a/src/HEXABLOCK/HexEdgeShape.cxx +++ b/src/HEXABLOCK/HexEdgeShape.cxx @@ -34,6 +34,19 @@ #include #include +#include + +/**************** +#include +#include +#include +#include +#include +#include +#include +#include +#include +*********************************/ BEGIN_NAMESPACE_HEXA @@ -50,6 +63,8 @@ EdgeShape::EdgeShape (NewShape* dad, int id) lin_end [dir_x] = lin_end [dir_y] = lin_end [dir_z] = 0; par_mini = 0; par_maxi = 0; + lin_radius = 0; + lin_angle = 0; } // ====================================================== getCurve BRepAdaptor_Curve* EdgeShape::getCurve () @@ -168,7 +183,6 @@ double EdgeShape::getParam (double* coord) return -1.0; GeomAdaptor_Curve adapt_curve (handle); - kind_of = (EnumKindOfShape) (adapt_curve.GetType() + 1); /****************** enum GeomAbs_CurveType { GeomAbs_Line, GeomAbs_Circle, GeomAbs_Ellipse, @@ -197,6 +211,9 @@ void EdgeShape::addAssociation (Edge* edge) is_associated = true; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + // ------- Cf GEOMImpl_IMeasureOperations.cxx + // ====================================================== updateCurve void EdgeShape::updateCurve () { @@ -224,5 +241,40 @@ void EdgeShape::updateCurve () // Extremites getPoint (0, lin_start); getPoint (1, lin_end); + + lin_radius = lin_angle = 0; + kind_of = (EnumKindOfShape) adapt_curve.GetType(); + if (kind_of==KS_Circle) + { + Handle(Geom_Circle) hgc = Handle(Geom_Circle)::DownCast (handle); + lin_radius = hgc->Radius (); + lin_angle = (par_maxi-par_mini)*180/M_PI; + PutData (lin_radius); + PutData (lin_angle); + } +} +// ====================================================== getAngle +double EdgeShape::getAngle () +{ + if (maj_curve) + updateCurve (); + + return lin_angle; +} +// ====================================================== getRadius +double EdgeShape::getRadius () +{ + if (maj_curve) + updateCurve (); + + return lin_radius; +} +// ====================================================== getRadius +EnumKindOfShape EdgeShape::kindOf () +{ + if (maj_curve) + updateCurve (); + + return kind_of; } END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexEdgeShape.hxx b/src/HEXABLOCK/HexEdgeShape.hxx index 212a728..4c5404c 100644 --- a/src/HEXABLOCK/HexEdgeShape.hxx +++ b/src/HEXABLOCK/HexEdgeShape.hxx @@ -24,10 +24,13 @@ public : int getPoint (double param, double point[]); double getParam (double point[]); double getLength (); + double getRadius (); + double getAngle (); int onExtremity (double point[]); bool isLinear () { return kind_of == KS_Line ; } static bool samePoints (double point1[], double point2[]); + virtual EnumKindOfShape kindOf (); // void saveXml (XmlWriter* xml); private : @@ -38,6 +41,7 @@ private : Real3 lin_start; Real3 lin_end; double lin_length, par_mini, par_maxi; + double lin_radius, lin_angle; bool maj_curve; Edges tab_assoc; diff --git a/src/HEXABLOCK/HexSubShape.cxx b/src/HEXABLOCK/HexSubShape.cxx index 5195eb9..ba29f01 100755 --- a/src/HEXABLOCK/HexSubShape.cxx +++ b/src/HEXABLOCK/HexSubShape.cxx @@ -41,6 +41,7 @@ SubShape::SubShape (NewShape* dad, int id, int dim) sub_ident = id; sub_dim = dim; maj_brep = maj_shape = true; + kind_of = KS_None; } // ====================================================== getShape const TopoDS_Shape& SubShape::getShape () diff --git a/src/HEXABLOCK/HexSubShape.hxx b/src/HEXABLOCK/HexSubShape.hxx index 1feea54..a2d8cc2 100644 --- a/src/HEXABLOCK/HexSubShape.hxx +++ b/src/HEXABLOCK/HexSubShape.hxx @@ -18,7 +18,7 @@ public : cpchar getParentName () const; int getIdent () { return sub_ident ; } int getDim () { return sub_dim ; } - EnumKindOfShape kindOf () { return kind_of ; } + virtual EnumKindOfShape kindOf () { return kind_of ; } const string& getBrep (); virtual const TopoDS_Shape& getShape (); diff --git a/src/HEXABLOCK/hexa_base.hxx b/src/HEXABLOCK/hexa_base.hxx index 684ec49..10b62be 100755 --- a/src/HEXABLOCK/hexa_base.hxx +++ b/src/HEXABLOCK/hexa_base.hxx @@ -173,9 +173,9 @@ enum EnumHVertex {V_ACE, V_ACF, V_ADE, V_ADF, V_BCE, V_BCF, V_BDE, V_BDF, enum EnumQDirection {Q_INSIDE, Q_DIRECT, Q_INVERSE, Q_UNDEFINED, Q_WAITING }; -enum EnumKindOfShape {KS_None, KS_Line, KS_Circle, KS_Ellipse, KS_Hyperbola, +enum EnumKindOfShape {KS_Line, KS_Circle, KS_Ellipse, KS_Hyperbola, KS_Parabola, KS_BezierCurve, KS_BSplineCurve, - KS_OtherCurve }; + KS_OtherCurve, KS_None=-1 }; enum { CylSmall=0, CylBig=1, NxInt=1, NxExt=2 }; diff --git a/src/HEXABLOCK/work/hexablock.py b/src/HEXABLOCK/work/hexablock.py index ff151b1..5b483c0 100644 --- a/src/HEXABLOCK/work/hexablock.py +++ b/src/HEXABLOCK/work/hexablock.py @@ -49,3 +49,13 @@ def mesh (doc, name=None, dim=3, container="FactoryServer"): def dump (doc, mesh=None, full=False) : return [ 36, 15, 36, 17] +# ======================================================= printMessage +def printMessage () : + + nl = hexa.sizeofMessage() + if nl == 0 : + return + for ni in range (nl) : + mess = hexa.getMessageLine (ni) + print mess + diff --git a/src/HEXABLOCKGUI/CMakeLists.txt b/src/HEXABLOCKGUI/CMakeLists.txt index ac53afb..af1c292 100644 --- a/src/HEXABLOCKGUI/CMakeLists.txt +++ b/src/HEXABLOCKGUI/CMakeLists.txt @@ -74,7 +74,6 @@ SET(_moc_HEADERS HEXABLOCKGUI.hxx HEXABLOCKGUI_VtkDocumentGraphicView.hxx HEXABLOCKGUI_DocumentPanel.hxx - HEXABLOCKGUI_DocumentDelegate.hxx HEXABLOCKGUI_DocumentSelectionModel.hxx HEXABLOCKGUI_DocumentModel.hxx kmodelindexproxymapper.hxx @@ -118,8 +117,6 @@ SET(_other_SOURCES HEXABLOCKGUI_DocumentSelectionModel.cxx HEXABLOCKGUI_DocumentItem.hxx HEXABLOCKGUI_DocumentItem.cxx - HEXABLOCKGUI_DocumentDelegate.hxx - HEXABLOCKGUI_DocumentDelegate.cxx HEXABLOCKGUI_DocumentPanel.hxx HEXABLOCKGUI_DocumentPanel.cxx HEXABLOCKGUI_SalomeTools.hxx diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx index d5843db..a57319c 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx @@ -108,8 +108,12 @@ #include +#include +#include #include #include +#include +#include #include #include #include @@ -617,6 +621,7 @@ void HEXABLOCKGUI::onObjectBrowserClick(const QModelIndex& index) { docGView->setViewWindow(graphicViewsHandler->createVtkWindow()); docGView->getViewWindow()->installEventFilter(this); + showAllMenus(); } else docGView->setViewWindow(currentDocGView->getViewWindow()); @@ -649,7 +654,6 @@ void HEXABLOCKGUI::onWindowClosed( SUIT_ViewWindow* svw) SVTK_ViewWindow* window = dynamic_cast(svw); if (window != NULL) { - //VTK clean close if (currentDocGView != NULL && currentDocGView->getViewWindow() == window) { //HexaBlock Vtk Window has been closed @@ -697,7 +701,6 @@ void HEXABLOCKGUI::onWindowClosed( SUIT_ViewWindow* svw) // if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog(); currentOccGView->getViewWindow()->removeEventFilter(this); - currentOccGView->setViewWindow(NULL); } } @@ -1689,35 +1692,13 @@ void HEXABLOCKGUI::showMeshMenus(bool show) setToolShown( _computeMesh, show); } -void HEXABLOCKGUI::showActor() -{ - VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); - if (currentVtkGView == NULL || currentVtkGView->getViewWindow() == NULL || - currentVtkGView->isEmpty() || currentVtkGView->getDocumentActor() == NULL) - return; - - currentVtkGView->getViewWindow()->setFocus(); - currentVtkGView->getViewWindow()->Display(currentVtkGView->getDocumentActor()->getIO()); - currentVtkGView->update(); - currentVtkGView->getViewWindow()->onFitAll(); - - //update the visibility state now - SalomeApp_Study* aStudy = HEXABLOCKGUI::activeStudy(); - SUIT_ViewManager* vman = currentVtkGView->getViewWindow()->getViewManager(); - if (aStudy == NULL || vman == NULL) return; - - Handle(SALOME_InteractiveObject) anIO = currentVtkGView->getDocumentActor()->getIO(); - aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), "Visibility", 1 ); - displayer()->setVisibilityState(anIO->getEntry(), Qtx::ShownState); -} - -//SOCC_Prs* currentPrs = NULL; -void HEXABLOCKGUI::showOnlyActor() +void HEXABLOCKGUI::showVtkActor() { VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); if (currentVtkGView == NULL || currentVtkGView->isEmpty() || currentVtkGView->getDocumentActor() == NULL) return; + SVTK_ViewWindow* vtkView = currentVtkGView->getViewWindow(); if (vtkView == NULL) return; @@ -1727,8 +1708,8 @@ void HEXABLOCKGUI::showOnlyActor() //show only the current actor ----------------- vtkView->setFocus(); -// vtkView->DisplayOnly(currentVtkGView->getDocumentActor()->getIO()); - Document_Actor *lastDocActor, *currentDocActor = currentVtkGView->getDocumentActor(); + // vtkView->DisplayOnly(currentVtkGView->getDocumentActor()->getIO()); + Document_Actor *lastDocActor; if (lastVtkDocGView != NULL) { lastDocActor = lastVtkDocGView->getDocumentActor(); @@ -1749,11 +1730,12 @@ void HEXABLOCKGUI::showOnlyActor() displayer()->setVisibilityState(anIO->getEntry(), Qtx::ShownState); } vtkView->onFitAll(); +} -// //showOnly in occ viewer ------------- - +void HEXABLOCKGUI::showOccActor() +{ if (currentOccGView == NULL) - return; + return; OCCViewer_ViewWindow* occView = currentOccGView->getViewWindow(); if (occView == NULL) return; @@ -1761,7 +1743,6 @@ void HEXABLOCKGUI::showOnlyActor() if (vf == NULL) return; -// vf->EraseAll(); if (lastOccPrs != NULL) vf->Erase(lastOccPrs); currentOccGView->globalSelection(); @@ -1772,13 +1753,12 @@ void HEXABLOCKGUI::showOnlyActor() occView->onFitAll(); } -void HEXABLOCKGUI::hideActor() +void HEXABLOCKGUI::hideVtkActor() { - // * vtk -- VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); if (currentVtkGView == NULL || currentVtkGView->isEmpty() || - currentVtkGView->getViewWindow() == NULL || - currentVtkGView->getDocumentActor() == NULL) return; + currentVtkGView->getViewWindow() == NULL || + currentVtkGView->getDocumentActor() == NULL) return; currentVtkGView->getViewWindow()->Erase(currentVtkGView->getDocumentActor()->getIO()); currentVtkGView->getViewWindow()->onResetView(); @@ -1791,17 +1771,19 @@ void HEXABLOCKGUI::hideActor() Handle(SALOME_InteractiveObject) anIO = currentVtkGView->getDocumentActor()->getIO(); aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), "Visibility", 0 ); displayer()->setVisibilityState(anIO->getEntry(), Qtx::HiddenState); +} - // * occ -- +void HEXABLOCKGUI::hideOccActor() +{ OCCViewer_ViewWindow* occView = currentOccGView == NULL ? NULL : currentOccGView->getViewWindow(); - DocumentModel* docModel = currentVtkGView->getDocumentModel(); + VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); + DocumentModel* docModel = (currentVtkGView == NULL ? NULL : currentVtkGView->getDocumentModel()); if (occView == NULL || docModel == NULL) return; SALOME_View* vf = dynamic_cast(occView->getViewManager()->getViewModel()); if (vf == NULL) return; -// vf->EraseAll(); SOCC_Prs* currentOccPrs = getOccPrs(currentDocGView); if (currentOccPrs != NULL) vf->Erase(currentOccPrs); @@ -1809,6 +1791,18 @@ void HEXABLOCKGUI::hideActor() occView->onResetView(); } +void HEXABLOCKGUI::showOnlyActor() +{ + showVtkActor(); + showOccActor(); +} + +void HEXABLOCKGUI::hideActor() +{ + hideVtkActor(); + hideOccActor(); +} + void HEXABLOCKGUI::showDockWidgets(bool isVisible) { @@ -2922,12 +2916,12 @@ QStringList HEXABLOCKGUI::getQuickDirList() 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; } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx index b0a6170..4d44098 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx @@ -20,8 +20,6 @@ #ifndef _HEXABLOCKGUI_HXX_ #define _HEXABLOCKGUI_HXX_ -#include "HEXABLOCKGUI_Export.hxx" - #include #include #include @@ -115,7 +113,7 @@ class OCCViewer_ViewWindow; class LightApp_VTKSelector; -class HEXABLOCK_EXPORT HEXABLOCKGUI : public SalomeApp_Module +class HexaExport HEXABLOCKGUI : public SalomeApp_Module { Q_OBJECT @@ -128,6 +126,7 @@ public: enum ViewType { VTK, OCC, + VTK_OCC, UNKNOWN }; @@ -201,6 +200,11 @@ public: void showLawInfoDialog(HEXA_NS::Law* law); void showPropagationInfoDialog(HEXA_NS::Propagation* propagation); + void showVtkActor(); + void showOccActor(); + void hideVtkActor(); + void hideOccActor(); + public slots: bool deactivateModule( SUIT_Study* theStudy); bool activateModule( SUIT_Study* theStudy); @@ -220,7 +224,6 @@ protected slots: virtual void onViewManagerRemoved( SUIT_ViewManager* ); void onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected ); - void showActor(); void hideActor(); void showOnlyActor(); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx deleted file mode 100755 index 4d4a27d..0000000 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx +++ /dev/null @@ -1,216 +0,0 @@ - -// 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 -#include -#include -#include -#include - - -#include "utilities.h" -#include "HEXABLOCKGUI.hxx" - - -#include "HEXABLOCKGUI_DocumentDelegate.hxx" - -using namespace std; -using namespace HEXABLOCK::GUI; - - -//QWidget* currentEditor = NULL; - -DocumentDelegate::DocumentDelegate(QDockWidget *dw, QObject *parent) - : QItemDelegate(parent), - _dw(dw), - _currentEditor(NULL) -{ -} - - -QWidget *DocumentDelegate::createEditor( QWidget *parent, - const QStyleOptionViewItem &option, - const QModelIndex &index ) const -{ - //close current editor if there's one before creating a new one - if (_currentEditor != NULL) - { - delete _currentEditor; - _currentEditor = NULL; - } - - HexaBaseDialog *editor = NULL; - - if (_dw->widget()) _dw->widget()->close(); - if ( !_dw->isVisible() ) _dw->setVisible(true); - - 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 HEXA_TREE : editor = new HexaDialog(_dw, HexaBaseDialog::INFO_MODE); break; - case VECTOR_TREE : editor = new VectorDialog(_dw, HexaBaseDialog::INFO_MODE); break; - -// case ELEMENTS_DIR_TREE : trouver le type exact (cylinder ou pipe) et creer la boite d'info en fonction. - - // * OBSOLETE ****** -// case CYLINDER_TREE : editor = new CylinderDialog(_dw, HexaBaseDialog::INFO_MODE); break; -// case PIPE_TREE : editor = new PipeDialog(_dw, HexaBaseDialog::INFO_MODE); break; - // ****************** - - case GROUP_TREE : editor = new GroupDialog(_dw, HexaBaseDialog::INFO_MODE/*UPDATE_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 ) - { - HEXABLOCKGUI::assocInProgress = false; - - //show the editor in the dockwidget - editor->resetSizeAndShow(_dw); - } - else - _dw->close(); - - _currentEditor = editor; - - return editor; -} - -//Close the current edition dialog -void DocumentDelegate::closeDialog() -{ - if (_currentEditor!=NULL) - { - _currentEditor->close(); - emit closeEditor(_currentEditor, NoHint); //Problem - delete _currentEditor; - _currentEditor = NULL; - } -} - -void DocumentDelegate::setEditorData( QWidget *editor, - const QModelIndex &index) const -{ - HexaBaseDialog* hexaEditor = dynamic_cast( editor ); - if (hexaEditor == NULL) return; - DocumentModel* documentModel = hexaEditor->getDocumentModel(); - if (documentModel == NULL) return; - - switch ( index.data(HEXA_TREE_ROLE).toInt() ){ - case VERTEX_TREE : { - HEXA_NS::Vertex *value = documentModel->getHexaPtr(index); - VertexDialog *vertexEditor = static_cast(editor); - vertexEditor->setValue(value); - } - break; - case EDGE_TREE : { - HEXA_NS::Edge *value = documentModel->getHexaPtr(index); - EdgeDialog *edgeEditor = static_cast(editor); - edgeEditor->setValue(value); - } - break; - case QUAD_TREE : { - HEXA_NS::Quad *value = documentModel->getHexaPtr(index); - QuadDialog *quadEditor = static_cast(editor); - quadEditor->setValue(value); - } - break; - case HEXA_TREE : { - HEXA_NS::Hexa *value = documentModel->getHexaPtr(index); - HexaDialog *hexaEditor = static_cast(editor); - hexaEditor->setValue(value); - } - break; - case VECTOR_TREE : { - HEXA_NS::Vector *value = documentModel->getHexaPtr(index); - VectorDialog *vectorEditor = static_cast(editor); - vectorEditor->setValue(value); - } - break; - - /* - case ELEMENTS_DIR_TREE : { - HEXA_NS::Elements* value = documentModel->getHexaPtr(index); - // trouver le type exact (cylinder ou pipe) pour choisir le bon editor - // editor->setValue(value) - } - break; - */ - - // ************ OBSOLETE ******************** -// case CYLINDER_TREE : { -// HEXA_NS::Cylinder *value = documentModel->getHexaPtr(index); -// CylinderDialog *cylinderEditor = static_cast(editor); -// cylinderEditor->setValue(value); -// } -// break; -// case PIPE_TREE : { -// HEXA_NS::Pipe *value = documentModel->getHexaPtr(index); -// PipeDialog *pipeEditor= static_cast(editor); -// pipeEditor->setValue(value); -// } -// break; - // ************ FIN OBSOLETE ***************** - - case GROUP_TREE : { - HEXA_NS::Group *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Group* >(); - GroupDialog *groupEditor = static_cast(editor); - groupEditor->setValue(value); - } - break; - case LAW_TREE : { - HEXA_NS::Law *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Law* >(); - LawDialog *lawEditor = static_cast(editor); - lawEditor->setValue(value); - } - break; - case PROPAGATION_TREE : { - HEXA_NS::Propagation *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Propagation* >(); - PropagationDialog *propagationEditor = static_cast(editor); - propagationEditor->setValue(value); - } - break; - } -} - - -bool DocumentDelegate::editorEvent ( QEvent *event, - QAbstractItemModel *model, - const QStyleOptionViewItem &option, - const QModelIndex &index ) -{ - return QItemDelegate::editorEvent ( event, model, option, index ); -} - -bool DocumentDelegate::eventFilter ( QObject * editor, QEvent * event ) -{ - if ( event->type() == QEvent::FocusOut ){ - return true; //do nothing for this signal - } - else if (event->type() == QEvent::HideToParent && editor != NULL) - { - //close the current editor when the tree is reduced - ((QWidget*) editor->parent())->close(); - } - - return false; -} diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx deleted file mode 100755 index a3cbe06..0000000 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx +++ /dev/null @@ -1,87 +0,0 @@ -// 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 -// -#ifndef __HEXABLOCKGUI_DOCUMENTDELEGATE_HXX_ -#define __HEXABLOCKGUI_DOCUMENTDELEGATE_HXX_ - -#include "HEXABLOCKGUI_Export.hxx" -// QEvent * event, QAbstractItemModel - -#include -#include -#include -#include -#include -#include - -#include - -#include "HEXABLOCKGUI_DocumentModel.hxx" -#include "HEXABLOCKGUI_DocumentSelectionModel.hxx" -#include "HEXABLOCKGUI_DocumentItem.hxx" -#include "HEXABLOCKGUI_DocumentPanel.hxx" - -namespace HEXABLOCK -{ - namespace GUI - { - class HEXABLOCK_EXPORT DocumentDelegate : public QItemDelegate - { - Q_OBJECT - - public: - /// close the editor - void closeDialog(); - - DocumentDelegate( QDockWidget *dw, QObject *parent = 0); - - /// create the editor - QWidget *createEditor( QWidget *parent, - const QStyleOptionViewItem &option, - const QModelIndex &index) const; - - /// set editor's data - void setEditorData( QWidget *editor, const QModelIndex &index) const; - - /// set the editor's model - void setModelData( QWidget *editor, - QAbstractItemModel *model, - const QModelIndex &index ) const {}; - - virtual void updateEditorGeometry( QWidget *editor, - const QStyleOptionViewItem &option, - const QModelIndex &index ) const {}; - - protected: - mutable QWidget* _currentEditor; - virtual bool editorEvent ( QEvent * event, - QAbstractItemModel * model, - const QStyleOptionViewItem & option, const QModelIndex & index ); - virtual bool eventFilter ( QObject * editor, QEvent * event ); - - private: - QDockWidget* _dw; // creator's container - - private slots: - // void commitEditor(); - - }; - } -} - -#endif diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx index 1872959..4bab98b 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx @@ -20,7 +20,6 @@ #ifndef _HEXABLOCKGUI_DOCUMENTITEM_HXX_ #define _HEXABLOCKGUI_DOCUMENTITEM_HXX_ -#include "HEXABLOCKGUI_Export.hxx" #include @@ -152,7 +151,7 @@ namespace HEXABLOCK // 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); @@ -170,7 +169,7 @@ namespace HEXABLOCK }; //=================================================================================== - class HEXABLOCK_EXPORT GraphicElementItem : public ElementItem + class HexaExport GraphicElementItem : public ElementItem { public: GraphicElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole): @@ -183,7 +182,7 @@ namespace HEXABLOCK 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): @@ -192,40 +191,40 @@ namespace HEXABLOCK } }; - 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 = ""); @@ -239,7 +238,7 @@ namespace HEXABLOCK // }; //----------------------------------------- - class HEXABLOCK_EXPORT ElementsItem : public StandardElementItem + class HexaExport ElementsItem : public StandardElementItem { public: ElementsItem( HEXA_NS::Elements* hexaElements, QString entry = "" ); @@ -252,7 +251,7 @@ namespace HEXABLOCK // }; //------------------------------------------------ - 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 ); @@ -264,35 +263,35 @@ namespace HEXABLOCK }; //------------------------------------------------ - 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 ); @@ -304,7 +303,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT LawItem : public QStandardItem + class HexaExport LawItem : public QStandardItem { public: LawItem( HEXA_NS::Law* hexaLaw ); @@ -316,7 +315,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT PropagationItem : public QStandardItem + class HexaExport PropagationItem : public QStandardItem { public: PropagationItem( HEXA_NS::Propagation* hexaPropagation ); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx index 2c89d3a..80fc85e 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx @@ -49,7 +49,10 @@ #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx" - +#include +#include +#include +#include //#define _DEVDEBUG_ @@ -238,6 +241,44 @@ int DocumentModel::getNbrUnusedElt(HEXA_NS::EnumElt eltType) return getNbrElt(eltType) - getNbrUsedElt(eltType); } +// compute the length of the given edge +double DocumentModel::getLength(const QModelIndex& iEdge) +{ + // * Get the pointer to the edge + HEXA_NS::Edge* edge = getHexaPtr(iEdge); + HEXA_NS::EdgeShape* geomEdge = getHexaPtr(iEdge); + + // * The edge can be from VTK or OCC View + if (edge != NULL) + return edge->getLength(); + else if (geomEdge != NULL) + return geomEdge->getLength(); + else + return 0.; +} + +// Compute the radius of the given edge +double DocumentModel::getRadius(const QModelIndex& iEdge) +{ + // * Get the pointer to the edge + // * In our case only an OCC edge can have a radius + HEXA_NS::EdgeShape* edge = getHexaPtr(iEdge); + if (edge == NULL) + return 0.; + + return edge->getRadius(); +} + +// Compute the angle of the given edge (internal angle) +double DocumentModel::getAngle(const QModelIndex& iEdge) +{ + // * Get the pointer to the edge + HEXA_NS::EdgeShape* edge = getHexaPtr(iEdge); + if (edge == NULL) + return 0.; + + return edge->getAngle(); +} //Load the current Document void DocumentModel::load() @@ -512,7 +553,7 @@ void DocumentModel::fillData() void DocumentModel::fillGeometry() { PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); - if (_hexaDocument == NULL || isEmpty() || pgsm == NULL) + if (_hexaDocument == NULL /*|| isEmpty()*/ || pgsm == NULL) return; HEXA_NS::NewShape* shape; @@ -1462,8 +1503,6 @@ QModelIndex DocumentModel::makeScale( const QModelIndex& ielts, const QModelInde return iElts; } - - QModelIndex DocumentModel::makeRotation( const QModelIndex& ielts, const QModelIndex& iv, const QModelIndex& ivec, double angle ) @@ -1666,7 +1705,7 @@ QModelIndex DocumentModel::replace( const QModelIndexList& iquadsPattern, } HEXA_NS::Elements* helts = _hexaDocument->replace( hquads, - hp1, hc1, hp2, hc2, hp3, hc3 ); + hp1, hc1, hp2, hc2, hp3, hc3 ); if ( BadElement(helts) ) return ielts; updateData(); @@ -1677,6 +1716,47 @@ QModelIndex DocumentModel::replace( const QModelIndexList& iquadsPattern, return ielts; } +QModelIndex DocumentModel::replace( const QModelIndexList& iquads_source, + const QModelIndexList& iquads_dest, + const QModelIndex& ip1_source, const QModelIndex& ic1_dest, + const QModelIndex& ip2_source, const QModelIndex& ic2_dest, + const QModelIndex& ip3_source, const QModelIndex& ic3_dest) +{ + QModelIndex ielts; + + HEXA_NS::Vertex* hp1 = getHexaPtr(ip1_source); + HEXA_NS::Vertex* hp2 = getHexaPtr(ip2_source); + HEXA_NS::Vertex* hp3 = getHexaPtr(ip3_source); + HEXA_NS::Vertex* hc1 = getHexaPtr(ic1_dest); + HEXA_NS::Vertex* hc2 = getHexaPtr(ic2_dest); + HEXA_NS::Vertex* hc3 = getHexaPtr(ic3_dest); + + HEXA_NS::Quads hquads_source, hquads_dest; + HEXA_NS::Quad* hquad = NULL; + foreach( const QModelIndex& iquad, iquads_source ){ + hquad = getHexaPtr(iquad); + hquads_source.push_back( hquad ); + } + + foreach( const QModelIndex& iquad, iquads_dest) { + hquad = getHexaPtr(iquad); + hquads_dest.push_back(hquad); + } + + HEXA_NS::Elements* helts = _hexaDocument->replaceHexas( hquads_source, + hquads_dest, + hp1, hc1, hp2, hc2, hp3, hc3); + if ( BadElement(helts) ) + return ielts; + + updateData(); + ElementsItem* eltsItem = new ElementsItem(helts); + _elementsDirItem->appendRow(eltsItem); + ielts = eltsItem->index(); + + return ielts; +} + QModelIndex DocumentModel::getGeomModelIndex(QString& id) const { QModelIndex result; @@ -2295,7 +2375,7 @@ QStandardItem* PatternDataModel::itemFromIndex ( const QModelIndex & index ) con //QVariant PatternBuilderModel::headerData ( int section, Qt::Orientation orientation, int role ) const //{ -// if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ +// if ( section == 0 && orientation == Qt::Horizontal && role == Qt::DisplayRole ){ // return QVariant( "Builder" ); // } else { // return QSortFilterProxyModel::headerData ( section, orientation, role ); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx index 26d216d..044459f 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx @@ -20,7 +20,6 @@ #ifndef _HEXABLOCKGUI_DOCUMENTMODEL_HXX_ #define _HEXABLOCKGUI_DOCUMENTMODEL_HXX_ -#include "HEXABLOCKGUI_Export.hxx" #include #include @@ -36,7 +35,7 @@ namespace HEXABLOCK { namespace GUI { - class HEXABLOCK_EXPORT DocumentModel : public QStandardItemModel + class HexaExport DocumentModel : public QStandardItemModel { Q_OBJECT public: @@ -74,6 +73,10 @@ namespace HEXABLOCK void refresh(); //refresh data bool isEmpty() const; + double getLength(const QModelIndex& iEdge); + double getRadius(const QModelIndex& iEdge); + double getAngle(const QModelIndex& iEdge); + void clearAll(); void clearData(); // void clearBuilder(); @@ -363,9 +366,14 @@ namespace HEXABLOCK bool performSymmetryPlane( const QModelIndex& elts, const QModelIndex& v, const QModelIndex& vec ); QModelIndex replace( const QModelIndexList& quadsPattern, - const QModelIndex& p1, const QModelIndex& c1, - const QModelIndex& p2, const QModelIndex& c2, - const QModelIndex& p3, const QModelIndex& c3 ); //NEW HEXA3 + const QModelIndex& ip1, const QModelIndex& ic1, + const QModelIndex& ip2, const QModelIndex& ic2, + const QModelIndex& ip3, const QModelIndex& ic3 ); //NEW HEXA3 + + QModelIndex replace( const QModelIndexList& iquads_source, const QModelIndexList& iquads_dest, + const QModelIndex& ip1_source, const QModelIndex& ic1_dest, + const QModelIndex& ip2_source, const QModelIndex& ic2_dest, + const QModelIndex& ip3_source, const QModelIndex& ic3_dest ); // ************ ASSOCIATION ************ @@ -480,7 +488,6 @@ namespace HEXABLOCK QStandardItem *_lawDirItem; QStandardItem *_propagationDirItem; - Qt::ItemFlags _vertexItemFlags; Qt::ItemFlags _edgeItemFlags; Qt::ItemFlags _quadItemFlags; @@ -493,7 +500,6 @@ namespace HEXABLOCK Qt::ItemFlags _groupItemFlags; Qt::ItemFlags _lawItemFlags; Qt::ItemFlags _propagationItemFlags; - }; diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx index 6852676..0c4db33 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx @@ -115,7 +115,6 @@ public: const QModelIndex &index) const{ QDoubleSpinBox *sb = new QDoubleSpinBox( parent ); sb->setMinimum(SPINBOX_POSITIVE_DOUBLE_MIN); - /////// sb->setMaximum(1000000000000000); //10e15 Abu : Pb en 32 bits sb->setMaximum(SPINBOX_DOUBLE_MAX); //10e9 sb->setDecimals(NB_DECIMALS); return sb; @@ -148,7 +147,6 @@ HexaBaseDialog::HexaBaseDialog( QWidget * parent, Mode editmode, Qt::WindowFlags _strHexaWidgetType[GEOMEDGE_TREE] = tr( "GEOMEDGE" ); _strHexaWidgetType[GEOMFACE_TREE] = tr( "GEOMFACE" ); - _strHexaWidgetType[GROUP_TREE] = tr( "GROUP" ); _strHexaWidgetType[LAW_TREE] = tr( "LAW" ); _strHexaWidgetType[PROPAGATION_TREE]= tr( "PROPAGATION" ); @@ -176,6 +174,59 @@ QModelIndexList HexaBaseDialog::getIndexList(QListWidget* itemsList, bool mapToS return iItems; } + +// ================================================================ computeAndSetDimension +void HexaBaseDialog::computeAndSetDimension(const QModelIndex& elt) +{ + // * Check if everything is OK for the computing + DocumentModel* docModel = getDocumentModel(); + if (docModel == NULL || _currentObj == NULL) + return; + + int selectedType = elt.data(HEXA_TREE_ROLE).toInt(); + if (selectedType != EDGE_TREE && selectedType != GEOMEDGE_TREE) + return; + + QListWidget* list = dynamic_cast(_currentObj); + QDoubleSpinBox* spb = dynamic_cast(_currentObj); + + if (list == NULL && spb == NULL) + return; + + // * Compute the value of the dimension + double value = 0.; + + if (_currentObj->property("Radius").isValid()) + value = docModel->getRadius(elt); + else if (_currentObj->property("Angle").isValid()) + value = docModel->getAngle(elt); + else if (_currentObj->property("Length").isValid()) + value = docModel->getLength(elt); + + if (value == 0.) + return; + + // * Set the value to the field (radius, length or height) + if (list != NULL) + { + QListWidgetItem* item = list->currentItem(); + if (item != NULL) + { + if (value != 0.) + { + item->setText(QString::number(value)); + list->editItem(item); + } + } + } + else if (spb != NULL) + { + spb->setValue(value); + spb->setFocus(); + spb->selectAll(); + } +} + // ============================================================= resetSizeAndShow void HexaBaseDialog::resetSizeAndShow(QDockWidget* parent) { @@ -278,6 +329,7 @@ void HexaBaseDialog::onCurrentSelectionChanged() highlightSelectedAssocs(); } +// ============================================================= clearCurrentObjectFocus void HexaBaseDialog::clearCurrentObjectFocus() { QWidget* currentWidget = dynamic_cast(_currentObj); @@ -426,21 +478,33 @@ void HexaBaseDialog::refreshHighlight() highlightSelectedAssocs(); } +bool HexaBaseDialog::isDimensionType(const QObject* obj) +{ + if (obj == NULL) + return false; + + return (obj->property("Radius").isValid()) || + (obj->property("Angle").isValid()) || + (obj->property("Length").isValid()); +} + // ============================================================== getObjectViewType HEXABLOCKGUI::ViewType HexaBaseDialog::getObjectViewType(QObject* obj) { if (obj == NULL) return HEXABLOCKGUI::UNKNOWN; - QVariant v = obj->property("GeomWidgetType"); - if ( v.isValid() ) - return HEXABLOCKGUI::OCC; + QVariant v1 = obj->property("GeomWidgetType"); + QVariant v2 = obj->property("HexaWidgetType"); - v = obj->property("HexaWidgetType"); - if ( v.isValid() ) + if (v1.isValid() && v2.isValid() && isDimensionType(obj)) + return HEXABLOCKGUI::VTK_OCC; + else if (v1.isValid()) + return HEXABLOCKGUI::OCC; + else if (v2.isValid()) return HEXABLOCKGUI::VTK; - - return HEXABLOCKGUI::UNKNOWN; + else + return HEXABLOCKGUI::UNKNOWN; } // ============================================================== _selectAndHighlight @@ -470,7 +534,6 @@ void HexaBaseDialog::_disallowSelection() // ============================================================== _allowVTKSelection bool HexaBaseDialog::_allowVTKSelection( QObject* obj ) { - bool isOk = false; QVariant v = obj->property("HexaWidgetType"); @@ -507,13 +570,16 @@ bool HexaBaseDialog::_allowOCCSelection( QObject* obj ) // ============================================================== _getSelector QItemSelectionModel* HexaBaseDialog::_getSelector( QObject* obj ) { + if (obj == NULL) + return NULL; + QItemSelectionModel* selector = NULL; HexaWidgetType wtype; QVariant v = obj->property("HexaWidgetType"); - if ( !v.isValid() ) { + QVariant v2 = obj->property("GeomWidgetType"); + if ( !v.isValid() || (v2.isValid() && isDimensionType(obj)) ) return NULL; - } wtype = v.value(); @@ -539,6 +605,7 @@ QItemSelectionModel* HexaBaseDialog::_getSelector( QObject* obj ) return selector; } +// ============================================================== getGeomObj DocumentModel::GeomObj* HexaBaseDialog::getGeomObj(const QModelIndex& index) { HEXA_NS::NewShape* aSh = getDocumentModel()->getHexaPtr(index); @@ -688,15 +755,29 @@ bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QListWidget */ void HexaBaseDialog::onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel ) { + QModelIndexList l = sel.indexes(); + + if ( l.count() == 0 ) + return; + QModelIndex selected = l[0]; + // * no edition for Info Dialogs - if ( _editMode == INFO_MODE ) + if ( _editMode == INFO_MODE || _currentObj == NULL || !selected.isValid()) return; - QLineEdit* aLineEdit = NULL; - QListWidget* aListWidget = NULL; + if (isDimensionType(_currentObj)) + { + // ** set the dimension of the selected object in the editor **/ + int selectedType = selected.data(HEXA_TREE_ROLE).toInt(); + if (selectedType == EDGE_TREE || selectedType == GEOMEDGE_TREE) + computeAndSetDimension(selected); + return; + } + + QLineEdit* aLineEdit = dynamic_cast(_currentObj); + QListWidget* aListWidget = dynamic_cast(_currentObj); // * fill the lineedit with selection - aLineEdit = dynamic_cast(_currentObj); if ( aLineEdit) { _onSelectionChanged( sel, aLineEdit ); @@ -704,8 +785,7 @@ void HexaBaseDialog::onSelectionChanged( const QItemSelection& sel, const QItemS } // * fill the listWidget with selection - aListWidget = dynamic_cast(_currentObj); - if ( aListWidget) + if (aListWidget) _onSelectionChanged( sel, aListWidget ); } @@ -736,10 +816,8 @@ void HexaBaseDialog::hideEvent ( QHideEvent * event ) { //Disconnection salome selection signals if (HEXABLOCKGUI::selectionMgr() != NULL) - { disconnect( HEXABLOCKGUI::selectionMgr() , SIGNAL(currentSelectionChanged()), this, SLOT(onCurrentSelectionChanged()) ); - } //Disconnect vtk window activation signals // if (HEXABLOCKGUI::currentDocGView->getViewWindow() != NULL) @@ -755,7 +833,6 @@ void HexaBaseDialog::hideEvent ( QHideEvent * event ) //Disconnect model selection signals disconnectDocumentGraphicView(); - getDocumentModel()->allowEdition(); QDialog::hideEvent( event ); @@ -838,13 +915,14 @@ bool HexaBaseDialog::_isLineOrListWidget(QObject *widget) */ void HexaBaseDialog::_highlightWidget(QObject *obj, Qt::GlobalColor clr) { - if (!_isLineOrListWidget(obj)) return; + QDoubleSpinBox* spb = dynamic_cast(obj); + if (!_isLineOrListWidget(obj) && spb == NULL) + return; - QWidget *widget = dynamic_cast(obj); //sure it's not NULL (_isLineOrListWidget(obj)) + QWidget *widget = dynamic_cast(obj); QPalette palette1 = widget->palette(); - palette1.setColor(widget->backgroundRole(), clr); + palette1.setColor(QPalette::Active, widget->backgroundRole(), clr); widget->setPalette(palette1); - }//_highlightWidget @@ -884,13 +962,15 @@ bool HexaBaseDialog::eventFilter(QObject *obj, QEvent *event) return false; // * Focus In ------ - - // allow vtk selection - if (getObjectViewType(obj) == HEXABLOCKGUI::VTK) + HEXABLOCKGUI::ViewType vtype = getObjectViewType(obj); + if (vtype == HEXABLOCKGUI::VTK_OCC) + { + _allowVTKSelection(obj); + _allowOCCSelection(obj); + } + else if (vtype == HEXABLOCKGUI::VTK) _allowVTKSelection( obj ); - - //allow occ selection - if (getObjectViewType(obj) == HEXABLOCKGUI::OCC) + else if (vtype == HEXABLOCKGUI::OCC) _allowOCCSelection( obj ); //Depending on the focused widget type, get the right selector for it @@ -930,7 +1010,6 @@ VertexDialog::VertexDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): _helpFileName = "gui_vertex.html"; setupUi( this ); _initWidget(editmode); - // setFocusProxy( name_le ); if ( editmode == NEW_MODE ){ setWindowTitle( tr("Vertex Construction") ); @@ -1056,7 +1135,7 @@ bool VertexDialog::apply(QModelIndex& result) } QString newName = name_le->text(); - if ( !newName.isEmpty() )/*{*/ + if ( !newName.isEmpty() ) getDocumentModel()->setName( iVertex, newName ); //the default name in the dialog box @@ -1067,8 +1146,6 @@ bool VertexDialog::apply(QModelIndex& result) // to select/highlight result result = patternDataModel->mapFromSource(iVertex); - // updateDialogBoxName(name_le, result); - // const char *defaultName = getDocumentModel()->getHexaPtr(last)->getName(); return isOk; } @@ -1083,9 +1160,6 @@ EdgeDialog::EdgeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): setupUi( this ); _initWidget(editmode); - // rb0->setFocusProxy( v0_le_rb0 ); - // rb1->setFocusProxy( vex_le_rb1 ); - if ( editmode == INFO_MODE ){ setWindowTitle( tr("Edge Information") ); rb1->hide(); @@ -1137,8 +1211,6 @@ void EdgeDialog::_initInputWidget( Mode editmode ) if (editmode == INFO_MODE) name_le->setReadOnly(true); - //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) ); - } // ============================================================== Clear @@ -1536,7 +1608,6 @@ void HexaDialog::_initInputWidget( Mode editmode ) if (editmode == INFO_MODE) name_le->setReadOnly(true); - } // ============================================================== clear @@ -1718,9 +1789,9 @@ bool HexaDialog::apply(QModelIndex& result) } 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] ); } @@ -2134,7 +2205,6 @@ bool MakeGridDialog::apply(QModelIndex& result) iNewElts = docModel->makeCartesian( icenter, ibase, ivec, iaxis, radius, angles, heights); } - } if ( !iNewElts.isValid() ) @@ -2171,19 +2241,60 @@ MakeCylinderDialog::~MakeCylinderDialog() void MakeCylinderDialog::_initInputWidget( Mode editmode ) { - origin_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE)); - axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - base_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE)); - installEventFilter(this); - origin_le->installEventFilter(this); - axis_le->installEventFilter(this); - base_le->installEventFilter(this); + rb0->installEventFilter(this); + rb1->installEventFilter(this); + rb2->installEventFilter(this); + + origin_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE)); + origin_le->installEventFilter(this); origin_le->setReadOnly(true); + + axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + axis_le->installEventFilter(this); axis_le->setReadOnly(true); + + base_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE)); + base_le->installEventFilter(this); base_le->setReadOnly(true); + ext_radius_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + ext_radius_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + ext_radius_spb->setProperty("Radius", QVariant::fromValue(true)); + ext_radius_spb->installEventFilter(this); + + int_radius_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + int_radius_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + int_radius_spb->setProperty("Radius", QVariant::fromValue(true)); + int_radius_spb->installEventFilter(this); + + angle_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + angle_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + angle_spb->setProperty("Angle", QVariant::fromValue(true)); + angle_spb->installEventFilter(this); + + height_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height_spb->setProperty("Length", QVariant::fromValue(true)); + height_spb->installEventFilter(this); + + radius_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + radius_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + radius_lw->setProperty("Radius", QVariant::fromValue(true)); + radius_lw->installEventFilter(this); + + + angle_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + angle_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + angle_lw->setProperty("Angle", QVariant::fromValue(true)); + angle_lw->installEventFilter(this); + + height_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height_lw->setProperty("Length", QVariant::fromValue(true)); + height_lw->installEventFilter(this); + radius_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(radius_lw)); radius_lw->setEditTriggers(QAbstractItemView::DoubleClicked); @@ -2409,10 +2520,49 @@ void MakePipeDialog::_initInputWidget( Mode editmode ) axis_le->installEventFilter(this); base_le->installEventFilter(this); + rb0->installEventFilter(this); + rb1->installEventFilter(this); + rb2->installEventFilter(this); + origin_le->setReadOnly(true); axis_le->setReadOnly(true); base_le->setReadOnly(true); + ext_radius_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + ext_radius_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + ext_radius_spb->setProperty("Radius", QVariant::fromValue(true)); + ext_radius_spb->installEventFilter(this); + + int_radius_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + int_radius_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + int_radius_spb->setProperty("Radius", QVariant::fromValue(true)); + int_radius_spb->installEventFilter(this); + + angle_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + angle_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + angle_spb->setProperty("Angle", QVariant::fromValue(true)); + angle_spb->installEventFilter(this); + + height_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height_spb->setProperty("Length", QVariant::fromValue(true)); + height_spb->installEventFilter(this); + + radius_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + radius_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + radius_lw->setProperty("Radius", QVariant::fromValue(true)); + radius_lw->installEventFilter(this); + + angle_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + angle_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + angle_lw->setProperty("Angle", QVariant::fromValue(true)); + angle_lw->installEventFilter(this); + + height_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height_lw->setProperty("Length", QVariant::fromValue(true)); + height_lw->installEventFilter(this); + radius_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(radius_lw)); radius_lw->setEditTriggers(QAbstractItemView::DoubleClicked); @@ -2630,6 +2780,26 @@ void MakeCylindersDialog::_initInputWidget( Mode editmode ) direction_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); direction2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + radius_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + radius_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + radius_spb->setProperty("Radius", QVariant::fromValue(true)); + radius_spb->installEventFilter(this); + + height_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height_spb->setProperty("Length", QVariant::fromValue(true)); + height_spb->installEventFilter(this); + + radius2_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + radius2_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + radius2_spb->setProperty("Radius", QVariant::fromValue(true)); + radius2_spb->installEventFilter(this); + + height2_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height2_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height2_spb->setProperty("Length", QVariant::fromValue(true)); + height2_spb->installEventFilter(this); + installEventFilter(this); center_le->installEventFilter(this); center2_le->installEventFilter(this); @@ -2721,7 +2891,36 @@ void MakePipesDialog::_initInputWidget( Mode editmode ) dir_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); dir2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - installEventFilter(this); + ext_radius_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + ext_radius_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + ext_radius_spb->setProperty("Radius", QVariant::fromValue(true)); + ext_radius_spb->installEventFilter(this); + + int_radius_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + int_radius_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + int_radius_spb->setProperty("Radius", QVariant::fromValue(true)); + int_radius_spb->installEventFilter(this); + + height_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height_spb->setProperty("Length", QVariant::fromValue(true)); + height_spb->installEventFilter(this); + + ext_radius2_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + ext_radius2_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + ext_radius2_spb->setProperty("Radius", QVariant::fromValue(true)); + ext_radius2_spb->installEventFilter(this); + + int_radius2_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + int_radius2_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + int_radius2_spb->setProperty("Radius", QVariant::fromValue(true)); + int_radius2_spb->installEventFilter(this); + + height2_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height2_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height2_spb->setProperty("Length", QVariant::fromValue(true)); + height2_spb->installEventFilter(this); + origin_le->installEventFilter(this); origin2_le->installEventFilter(this); dir_le->installEventFilter(this); @@ -2909,10 +3108,25 @@ void PrismQuadDialog::_initInputWidget( Mode editmode ) quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + length_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + length_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + length_spb->setProperty("Length", QVariant::fromValue(true)); + length_spb->installEventFilter(this); + + + height_lw->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height_lw->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height_lw->setProperty("Length", QVariant::fromValue(true)); + height_lw->installEventFilter(this); + installEventFilter(this); quads_lw->installEventFilter(this); axis_le->installEventFilter(this); + extrudeTop_rb->installEventFilter(this); + extrudeUni_rb->installEventFilter(this); + extrude_rb->installEventFilter(this); + axis_le->setReadOnly(true); QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); @@ -3095,6 +3309,11 @@ void JoinQuadDialog::_initInputWidget( Mode editmode ) vex2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); vex3_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + height_lw->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height_lw->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height_lw->setProperty("Length", QVariant::fromValue(true)); + height_lw->installEventFilter(this); + installEventFilter(this); quad_dest_le->installEventFilter(this); quads_lw->installEventFilter(this); @@ -3103,6 +3322,9 @@ void JoinQuadDialog::_initInputWidget( Mode editmode ) vex2_le->installEventFilter(this); vex3_le->installEventFilter(this); + joinUni_rb->installEventFilter(this); + join_rb->installEventFilter(this); + QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); delQuadShortcut->setContext( Qt::WidgetShortcut ); connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(removeQuad()) ); @@ -3753,8 +3975,16 @@ void CutEdgeDialog::_initInputWidget( Mode editmode ) e_le->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); e_le->installEventFilter(this); + cutUni_rb->installEventFilter(this); + cut_rb->installEventFilter(this); + e_le->setReadOnly(true); + height_lw->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + height_lw->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + height_lw->setProperty("Length", QVariant::fromValue(true)); + height_lw->installEventFilter(this); + height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); @@ -3882,6 +4112,9 @@ void MakeTransformationDialog::_initInputWidget( Mode editmode ) QValidator *validator = new QRegExpValidator(rx, this); installEventFilter(this); + rb0->installEventFilter(this); + rb1->installEventFilter(this); + rb2->installEventFilter(this); vec_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); @@ -3908,6 +4141,11 @@ void MakeTransformationDialog::_initInputWidget( Mode editmode ) vec_le_rb2->installEventFilter(this); elts_le_rb2->installEventFilter(this); + angle_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + angle_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + angle_spb->setProperty("Angle", QVariant::fromValue(true)); + angle_spb->installEventFilter(this); + vec_le_rb0->setReadOnly(true); elts_le_rb0->setReadOnly(true); @@ -4012,6 +4250,16 @@ bool MakeTransformationDialog::apply(QModelIndex& result) } result = patternDataModel->mapFromSource(iNewElts); + if (result.isValid()) + { + MESSAGE("======> Result is valid!"); + HEXA_NS::Elements* elts = getDocumentModel()->getHexaPtr(result); + MESSAGE("======> " << elts->getName()); + } + else + { + MESSAGE("======> Result is not valid!"); + } // result = patternBuilderModel->mapFromSource(iNewElts); return true; @@ -4209,6 +4457,11 @@ void PerformTransformationDialog::_initInputWidget( Mode editmode ) QRegExp rx(""); QValidator *validator = new QRegExpValidator(rx, this); + installEventFilter(this); + rb0->installEventFilter(this); + rb1->installEventFilter(this); + rb2->installEventFilter(this); + vec_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); vec_le_rb0->setValidator( validator ); @@ -4234,6 +4487,11 @@ void PerformTransformationDialog::_initInputWidget( Mode editmode ) vec_le_rb2->installEventFilter(this); elts_le_rb2->installEventFilter(this); + angle_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + angle_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + angle_spb->setProperty("Angle", QVariant::fromValue(true)); + angle_spb->installEventFilter(this); + vec_le_rb0->setReadOnly(true); elts_le_rb0->setReadOnly(true); vex_le_rb1->setReadOnly(true); @@ -4854,7 +5112,6 @@ void QuadAssocDialog::_initInputWidget( Mode editmode ) quad_le->installEventFilter(this); quad_le->setValidator( validator ); - faces_lw->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMFACE_TREE) ); faces_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_FACE) ); faces_lw->installEventFilter(this); @@ -5642,6 +5899,8 @@ HexaBaseDialog(parent, editmode, f) _helpFileName = "gui_replace_hexa.html"; setupUi( this ); _initWidget(editmode); + + radioButton->click(); } // ============================================================== Destructeur @@ -5660,15 +5919,27 @@ QModelIndexList ReplaceHexaDialog::getAssocsVTK() QListWidgetItem* item = NULL; //ListWidget content - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return assocs; int nbQuads = quads_lw->count(); for ( int r = 0; r < nbQuads; ++r ){ item = quads_lw->item(r); - // iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); //unsafe + //iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); //unsafe iQuad = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); - if ( iQuad.isValid() ) assocs << iQuad; + if ( iQuad.isValid() ) + assocs << iQuad; } + + if (radioButton_2->isChecked()) + { + nbQuads = quads_lw_2->count(); + for( int i = 0; i < nbQuads; ++i) + { + item = quads_lw_2->item(i); + iQuad = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); + if (iQuad.isValid()) + assocs << iQuad; + } + } + return assocs; } @@ -5698,12 +5969,18 @@ void ReplaceHexaDialog::_initInputWidget( Mode editmode ) quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); quads_lw->installEventFilter(this); + quads_lw_2->setProperty("HexaWidgetType", QVariant::fromValue(QUAD_TREE)); + quads_lw_2->installEventFilter(this); + if ( editmode == NEW_MODE ){ QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); + QShortcut* delQuadShortcut2 = new QShortcut( QKeySequence(Qt::Key_X), quads_lw_2 ); delQuadShortcut->setContext( Qt::WidgetShortcut ); - + delQuadShortcut2->setContext( Qt::WidgetShortcut ); connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(deleteQuadItem()) ); connect( quads_lw, SIGNAL(currentRowChanged(int)), this, SLOT(updateButtonBox(int)) ); + connect( delQuadShortcut2, SIGNAL(activated()), this, SLOT(deleteQuadItem2())); + connect( quads_lw_2, SIGNAL(currentRowChanged(int)), this, SLOT(updateButtonBox(int)) ); } c1_le->setReadOnly(true); @@ -5716,6 +5993,9 @@ void ReplaceHexaDialog::_initInputWidget( Mode editmode ) connect(quads_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection); + + connect(quads_lw_2, SIGNAL(itemSelectionChanged()), + this, SLOT(selectElementOfModel()), Qt::UniqueConnection); } // ============================================================== clear @@ -5764,6 +6044,13 @@ void ReplaceHexaDialog::deleteQuadItem() updateButtonBox(); } +// ============================================================== deleteQuadItem2 +void ReplaceHexaDialog::deleteQuadItem2() +{ + delete quads_lw_2->currentItem(); + updateButtonBox(); +} + // ============================================================== apply bool ReplaceHexaDialog::apply(QModelIndex& result) { @@ -5778,30 +6065,53 @@ bool ReplaceHexaDialog::apply(QModelIndex& result) QModelIndex ielts; //result QListWidgetItem* item = NULL; - QModelIndexList iquads; + QModelIndexList iquads_source; QModelIndex iquad; int nbQuads = quads_lw->count(); for ( int r = 0; r < nbQuads; ++r){ item = quads_lw->item(r); iquad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); if ( iquad.isValid() ) - iquads << iquad; + iquads_source << iquad; } - QModelIndex ic1 = patternDataModel->mapToSource( _index[c1_le] ); - QModelIndex ic2 = patternDataModel->mapToSource( _index[c2_le] ); - QModelIndex ic3 = patternDataModel->mapToSource( _index[c3_le] ); + QModelIndex ip1_source = patternDataModel->mapToSource( _index[p1_le] ); + QModelIndex ip2_source = patternDataModel->mapToSource( _index[p2_le] ); + QModelIndex ip3_source = patternDataModel->mapToSource( _index[p3_le] ); + + QModelIndex ic1_dest = patternDataModel->mapToSource( _index[c1_le] ); + QModelIndex ic2_dest = patternDataModel->mapToSource( _index[c2_le] ); + QModelIndex ic3_dest = patternDataModel->mapToSource( _index[c3_le] ); - QModelIndex ip1 = patternDataModel->mapToSource( _index[p1_le] ); - QModelIndex ip2 = patternDataModel->mapToSource( _index[p2_le] ); - QModelIndex ip3 = patternDataModel->mapToSource( _index[p3_le] ); + bool ipts_ok = ip1_source.isValid() && ip2_source.isValid() && ip3_source.isValid() && + ic1_dest.isValid() && ic2_dest.isValid() && ic3_dest.isValid(); - if ( ic1.isValid() && ic2.isValid() && ic3.isValid() - && ip1.isValid() && ip2.isValid() && ip3.isValid() ){ - ielts = getDocumentModel()->replace( iquads, - ip1, ic1, - ip2, ic2, - ip3, ic3 ); + if (ipts_ok) + { + if (radioButton->isChecked()) + { + ielts = getDocumentModel()->replace( iquads_source, + ip1_source, ic1_dest, + ip2_source, ic2_dest, + ip3_source, ic3_dest ); + } + else if (radioButton_2->isChecked()) + { + QModelIndexList iquads_dest; + nbQuads = quads_lw_2->count(); + for (int i = 0; i < nbQuads; ++i) + { + item = quads_lw_2->item(i); + iquad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if (iquad.isValid()) + iquads_dest << iquad; + } + + ielts = getDocumentModel()->replace( iquads_source, iquads_dest, + ip1_source, ic1_dest, + ip2_source, ic2_dest, + ip3_source, ic3_dest); + } } if ( !ielts.isValid() ){ @@ -5873,7 +6183,20 @@ void QuadRevolutionDialog::_initInputWidget( Mode editmode ) center_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + angle_spb->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + angle_spb->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + angle_spb->setProperty("Angle", QVariant::fromValue(true)); + angle_spb->installEventFilter(this); + + angles_lw->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + angles_lw->setProperty("GeomWidgetType", QVariant::fromValue(TopAbs_EDGE)); + angles_lw->setProperty("Angle", QVariant::fromValue(true)); + angles_lw->installEventFilter(this); + installEventFilter(this); + revolutionUni_rb->installEventFilter(this); + revolution_rb->installEventFilter(this); + quads_lw->installEventFilter(this); center_le->installEventFilter(this); axis_le->installEventFilter(this); @@ -6023,21 +6346,21 @@ MakeHemiSphereDialog::MakeHemiSphereDialog( QWidget* parent, Mode editmode, Qt:: connect( sphereTop_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); connect( sphereUni_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( sphere2_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( sphere_rb, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( sphere_rb, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + connect( sphere2_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( sphere_rb, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( sphere_rb, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); connect( sphericalTop_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); connect( sphericalUni_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( spherical2_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( spherical_rb, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( spherical_rb, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + connect( spherical2_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( spherical_rb, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( spherical_rb, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); connect( rindTop_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); connect( rindUni_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rind2_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rind_rb, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rind_rb, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + connect( rind2_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rind_rb, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rind_rb, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); } // ============================================================== Destructeur @@ -6053,12 +6376,66 @@ void MakeHemiSphereDialog::_initInputWidget( Mode editmode ) base_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); vplan_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + sphere_radext_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + sphere_radext_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + sphere_radext_spb->setProperty("Radius", QVariant::fromValue(true)); + + sphere_radint_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + sphere_radint_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + sphere_radint_spb->setProperty("Radius", QVariant::fromValue(true)); + + hole_rad_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + hole_rad_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + hole_rad_spb->setProperty("Radius", QVariant::fromValue(true)); + + radial_angle_spb->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + radial_angle_spb->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + radial_angle_spb->setProperty("Angle", QVariant::fromValue(true)); + + radius_lw_1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + radius_lw_1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + radius_lw_1->setProperty("Radius", QVariant::fromValue(true)); + + radius_lw_2->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + radius_lw_2->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + radius_lw_2->setProperty("Radius", QVariant::fromValue(true)); + + height_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + height_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + height_lw->setProperty("Length", QVariant::fromValue(true)); + + angle_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + angle_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + angle_lw->setProperty("Angle", QVariant::fromValue(true)); + installEventFilter(this); center_le->installEventFilter(this); hole_axis_le->installEventFilter(this); base_le->installEventFilter(this); vplan_le->installEventFilter(this); + sphere_radext_spb->installEventFilter(this); + sphere_radint_spb->installEventFilter(this); + hole_rad_spb->installEventFilter(this); + radial_angle_spb->installEventFilter(this); + radius_lw_1->installEventFilter(this); + radius_lw_2->installEventFilter(this); + height_lw->installEventFilter(this); + angle_lw->installEventFilter(this); + + sphere_rb->installEventFilter(this); + sphereTop_rb->installEventFilter(this); + sphereUni_rb->installEventFilter(this); + sphere2_rb->installEventFilter(this); + rind_rb->installEventFilter(this); + rindTop_rb->installEventFilter(this); + rindUni_rb->installEventFilter(this); + rind2_rb->installEventFilter(this); + spherical_rb->installEventFilter(this); + sphericalTop_rb->installEventFilter(this); + sphericalUni_rb->installEventFilter(this); + spherical2_rb->installEventFilter(this); + center_le->setReadOnly(true); hole_axis_le->setReadOnly(true); base_le->setReadOnly(true); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx index c123698..83254b6 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx @@ -19,8 +19,6 @@ #ifndef __HEXABLOCKGUI_DOCUMENTPANEL_HXX_ #define __HEXABLOCKGUI_DOCUMENTPANEL_HXX_ -#include "HEXABLOCKGUI_Export.hxx" - #define MAX_WIDTH 16777215 #define MAX_HEIGHT 16777215 #define MIN_WIDTH 5 @@ -79,13 +77,14 @@ #include "klinkitemselectionmodel.hxx" + Q_DECLARE_METATYPE(QModelIndex); namespace HEXABLOCK { namespace GUI { - class HEXABLOCK_EXPORT HexaBaseDialog : public QDialog + class HexaExport HexaBaseDialog : public QDialog { Q_OBJECT @@ -134,10 +133,6 @@ namespace HEXABLOCK return HEXABLOCKGUI::currentDocGView->getPatternGeomModel(); } -// PatternBuilderModel* getPatternBuilderModel() const { -// return HEXABLOCKGUI::currentDocGView->getPatternBuilderModel(); -// } - GroupsModel* getGroupsModel() const { return HEXABLOCKGUI::currentDocGView->getGroupsModel(); } @@ -151,10 +146,6 @@ namespace HEXABLOCK return HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel(); } -// PatternBuilderSelectionModel* getPatternBuilderSelectionModel() const { -// return HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel(); -// } - PatternGeomSelectionModel* getPatternGeomSelectionModel() const { return HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); } @@ -183,6 +174,7 @@ namespace HEXABLOCK return assocs; } virtual void setCurrentGeomObj(DocumentModel::GeomObj* geomObj) {} + virtual void computeAndSetDimension(const QModelIndex& elt); bool debugEdgeAssoc; //Temporary bool autoFocusSwitch; @@ -229,13 +221,15 @@ namespace HEXABLOCK void _updateCurrentObject(QObject*); + bool isDimensionType(const QObject* obj); + Mode _editMode; - QMap _index; - QObject* _currentObj; + QMap _index; + QObject* _currentObj; QMap _strHexaWidgetType; - QPushButton* _applyButton; - QString _helpFileName; + QPushButton* _applyButton; + QString _helpFileName; private: bool _isLineOrListWidget(QObject*); @@ -251,9 +245,7 @@ namespace HEXABLOCK }; - - - class HEXABLOCK_EXPORT VertexDialog : public HexaBaseDialog, + class HexaExport VertexDialog : public HexaBaseDialog, public Ui::VertexDialog { Q_OBJECT @@ -281,7 +273,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT EdgeDialog : public HexaBaseDialog, + class HexaExport EdgeDialog : public HexaBaseDialog, public Ui::EdgeDialog { Q_OBJECT @@ -307,7 +299,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT QuadDialog : public HexaBaseDialog, + class HexaExport QuadDialog : public HexaBaseDialog, public Ui::QuadDialog { Q_OBJECT @@ -334,7 +326,7 @@ namespace HEXABLOCK - class HEXABLOCK_EXPORT HexaDialog : public HexaBaseDialog, + class HexaExport HexaDialog : public HexaBaseDialog, public Ui::HexaDialog { Q_OBJECT @@ -369,7 +361,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT VectorDialog : public HexaBaseDialog, + class HexaExport VectorDialog : public HexaBaseDialog, public Ui::VectorDialog { Q_OBJECT @@ -394,7 +386,7 @@ namespace HEXABLOCK QModelIndex _ivalue; }; - class HEXABLOCK_EXPORT MakeGridDialog : public HexaBaseDialog, + class HexaExport MakeGridDialog : public HexaBaseDialog, public Ui::MakeGridDialog { Q_OBJECT @@ -423,7 +415,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT MakeCylinderDialog : public HexaBaseDialog, + class HexaExport MakeCylinderDialog : public HexaBaseDialog, public Ui::MakeCylinderDialog { Q_OBJECT @@ -451,7 +443,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT MakePipeDialog : public HexaBaseDialog, + class HexaExport MakePipeDialog : public HexaBaseDialog, public Ui::MakePipeDialog { Q_OBJECT @@ -479,7 +471,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT MakeCylindersDialog : public HexaBaseDialog, + class HexaExport MakeCylindersDialog : public HexaBaseDialog, public Ui::MakeCylindersDialog { Q_OBJECT @@ -498,7 +490,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT MakePipesDialog : public HexaBaseDialog, + class HexaExport MakePipesDialog : public HexaBaseDialog, public Ui::MakePipesDialog { Q_OBJECT @@ -518,7 +510,7 @@ namespace HEXABLOCK - class HEXABLOCK_EXPORT RemoveHexaDialog : public HexaBaseDialog, + class HexaExport RemoveHexaDialog : public HexaBaseDialog, public Ui::RemoveHexaDialog { Q_OBJECT @@ -537,7 +529,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT PrismQuadDialog : public HexaBaseDialog, + class HexaExport PrismQuadDialog : public HexaBaseDialog, public Ui::PrismQuadDialog { Q_OBJECT @@ -560,13 +552,13 @@ namespace HEXABLOCK 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 @@ -590,14 +582,14 @@ namespace HEXABLOCK 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 @@ -621,7 +613,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT DisconnectDialog : public HexaBaseDialog, + class HexaExport DisconnectDialog : public HexaBaseDialog, public Ui::DisconnectDialog { Q_OBJECT @@ -647,7 +639,7 @@ namespace HEXABLOCK - class HEXABLOCK_EXPORT CutEdgeDialog : public HexaBaseDialog, + class HexaExport CutEdgeDialog : public HexaBaseDialog, public Ui::CutEdgeDialog { Q_OBJECT @@ -671,7 +663,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT MakeTransformationDialog : public HexaBaseDialog, + class HexaExport MakeTransformationDialog : public HexaBaseDialog, public Ui::TransformationDialog { Q_OBJECT @@ -693,7 +685,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT MakeSymmetryDialog : public HexaBaseDialog, + class HexaExport MakeSymmetryDialog : public HexaBaseDialog, public Ui::SymmetryDialog { Q_OBJECT @@ -717,7 +709,7 @@ namespace HEXABLOCK - class HEXABLOCK_EXPORT PerformTransformationDialog : public HexaBaseDialog, + class HexaExport PerformTransformationDialog : public HexaBaseDialog, public Ui::TransformationDialog { Q_OBJECT @@ -739,7 +731,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT PerformSymmetryDialog : public HexaBaseDialog, + class HexaExport PerformSymmetryDialog : public HexaBaseDialog, public Ui::SymmetryDialog { Q_OBJECT @@ -760,7 +752,7 @@ namespace HEXABLOCK void updateHelpFileName(); }; -class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, +class HexaExport EdgeAssocDialog : public HexaBaseDialog, public Ui::EdgeAssocDialog { Q_OBJECT @@ -798,7 +790,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, }; - class HEXABLOCK_EXPORT QuadAssocDialog : public HexaBaseDialog, + class HexaExport QuadAssocDialog : public HexaBaseDialog, public Ui::QuadAssocDialog { Q_OBJECT @@ -829,7 +821,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, - class HEXABLOCK_EXPORT GroupDialog : public HexaBaseDialog, + class HexaExport GroupDialog : public HexaBaseDialog, public Ui::GroupDialog { Q_OBJECT @@ -861,7 +853,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, - class HEXABLOCK_EXPORT LawDialog : public HexaBaseDialog, + class HexaExport LawDialog : public HexaBaseDialog, public Ui::LawDialog { Q_OBJECT @@ -889,7 +881,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, - class HEXABLOCK_EXPORT PropagationDialog : public HexaBaseDialog, + class HexaExport PropagationDialog : public HexaBaseDialog, public Ui::PropagationDialog { Q_OBJECT @@ -909,7 +901,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, void _initInputWidget( Mode editmode ); protected slots: - //void updateHelpFileName(); + void updateHelpFileName(); void deletePropagationItem(); virtual void selectElementOfModel(); @@ -922,7 +914,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, // Define the compute mesh dialog box // ---------------------------------- - class HEXABLOCK_EXPORT ComputeMeshDialog : public HexaBaseDialog, + class HexaExport ComputeMeshDialog : public HexaBaseDialog, public Ui::ComputeMeshDialog { Q_OBJECT @@ -943,7 +935,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, - class HEXABLOCK_EXPORT ReplaceHexaDialog : public HexaBaseDialog, + class HexaExport ReplaceHexaDialog : public HexaBaseDialog, public Ui::ReplaceHexaDialog { Q_OBJECT @@ -963,6 +955,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, protected slots: void deleteQuadItem(); + void deleteQuadItem2(); void updateButtonBox(); private: @@ -973,7 +966,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, - class HEXABLOCK_EXPORT QuadRevolutionDialog : public HexaBaseDialog, + class HexaExport QuadRevolutionDialog : public HexaBaseDialog, public Ui::QuadRevolutionDialog { Q_OBJECT @@ -1002,7 +995,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, - class HEXABLOCK_EXPORT MakeHemiSphereDialog : public HexaBaseDialog, + class HexaExport MakeHemiSphereDialog : public HexaBaseDialog, public Ui::MakeHemiSphereDialog { Q_OBJECT @@ -1033,7 +1026,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, HEXA_NS::Elements *_value; }; - class HEXABLOCK_EXPORT ModelInfoDialog : public HexaBaseDialog, + class HexaExport ModelInfoDialog : public HexaBaseDialog, public Ui::ModelInfoDialog { Q_OBJECT @@ -1052,7 +1045,7 @@ class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog, virtual void _initInputWidget( Mode editmode ){} }; - class HEXABLOCK_EXPORT AddShapeDialog : public HexaBaseDialog, + class HexaExport AddShapeDialog : public HexaBaseDialog, public Ui::AddShapeDialog { Q_OBJECT diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx index 923f1de..7f55a54 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx @@ -20,15 +20,15 @@ #ifndef _HEXABLOCKGUI_DOCUMENTSELECTIONMODEL_HXX_ #define _HEXABLOCKGUI_DOCUMENTSELECTIONMODEL_HXX_ -#include "HEXABLOCKGUI_Export.hxx" +#include "hexa_base.hxx" #include -#include +//#include -#include +//#include #include -#include "klinkitemselectionmodel.hxx" +//#include "klinkitemselectionmodel.hxx" #include "HEXABLOCKGUI_DocumentModel.hxx" @@ -40,7 +40,7 @@ namespace HEXABLOCK namespace GUI { - class HEXABLOCK_EXPORT SelectionModel: public QItemSelectionModel + class HexaExport SelectionModel: public QItemSelectionModel { Q_OBJECT @@ -89,7 +89,7 @@ namespace HEXABLOCK // } // }; - class HEXABLOCK_EXPORT PatternDataSelectionModel : public SelectionModel + class HexaExport PatternDataSelectionModel : public SelectionModel { Q_OBJECT @@ -113,7 +113,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT PatternGeomSelectionModel : public SelectionModel + class HexaExport PatternGeomSelectionModel : public SelectionModel { Q_OBJECT @@ -134,7 +134,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT GroupsSelectionModel : public SelectionModel + class HexaExport GroupsSelectionModel : public SelectionModel { Q_OBJECT @@ -149,7 +149,7 @@ namespace HEXABLOCK }; - class HEXABLOCK_EXPORT MeshSelectionModel : public SelectionModel + class HexaExport MeshSelectionModel : public SelectionModel { Q_OBJECT diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_Exception.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_Exception.hxx index 6ba6a00..3cda2ab 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_Exception.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_Exception.hxx @@ -20,7 +20,7 @@ #ifndef __HEXABLOCKGUI_EXCEPTION_HXX__ #define __HEXABLOCKGUI_EXCEPTION_HXX__ -#include "HEXABLOCKGUI_Export.hxx" +#include "hexa_base.hxx" #include #include @@ -29,7 +29,7 @@ namespace HEXABLOCK { namespace GUI { - class HEXABLOCK_EXPORT Exception : public std::exception + class HexaExport Exception : public std::exception { protected: std::string _what; diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx index c4164c4..717694e 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx @@ -28,7 +28,7 @@ #include //HEXABLOCK Includes -#include "HEXABLOCKGUI_Export.hxx" +#include "hexa_base.hxx" #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx" namespace HEXABLOCK @@ -36,7 +36,7 @@ namespace HEXABLOCK namespace GUI { - class HEXABLOCK_EXPORT GraphicViewsHandler + class HexaExport GraphicViewsHandler { public: diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h b/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h index cab143c..cf93b4a 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h @@ -27,11 +27,11 @@ #ifndef HEXABLOCKGUI_OCCSELECTOR_H #define HEXABLOCKGUI_OCCSELECTOR_H -#include "HEXABLOCKGUI_Export.hxx" #include +#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* ); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx index d107751..ff1dfc2 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx @@ -22,8 +22,6 @@ #ifndef _HEXABLOCKGUI_OCCGRAPHICVIEW_HXX_ #define _HEXABLOCKGUI_OCCGRAPHICVIEW_HXX_ -#include "HEXABLOCKGUI_Export.hxx" - #include #include "HEXABLOCKGUI_SalomeTools.hxx" @@ -34,6 +32,7 @@ #include #include +#include "hexa_base.hxx" namespace HEXABLOCK { @@ -44,7 +43,7 @@ namespace HEXABLOCK * OccGraphicView ********************************************************************************/ - class HEXABLOCK_EXPORT OccGraphicView + class HexaExport OccGraphicView { public: diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_Resource.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_Resource.hxx index 87d1621..50e7a16 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_Resource.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_Resource.hxx @@ -20,7 +20,7 @@ #ifndef _HEXABLOCKGUI_RESOURCE_HXX_ #define _HEXABLOCKGUI_RESOURCE_HXX_ -#include "HEXABLOCKGUI_Export.hxx" +#include "hexa_base.hxx" #include @@ -29,7 +29,7 @@ class SUIT_ResourceMgr; -class HEXABLOCK_EXPORT HEXABLOCKGUI_Resource +class HexaExport HEXABLOCKGUI_Resource { public: HEXABLOCKGUI_Resource(SUIT_ResourceMgr* r); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx index c5097fd..3965885 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx @@ -20,7 +20,7 @@ #ifndef _HEXABLOCKGUI_SALOMETOOLS_HXX_ #define _HEXABLOCKGUI_SALOMETOOLS_HXX_ -#include "HEXABLOCKGUI_Export.hxx" +#include "hexa_base.hxx" #include #include @@ -41,48 +41,48 @@ namespace HEXABLOCK namespace GUI { -HEXABLOCK_EXPORT SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry ); +HexaExport SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry ); _PTR(Study) GetActiveStudyDocument(); -HEXABLOCK_EXPORT int GetNameOfSelectedElements( SVTK_ViewWindow *theWindow,/* SVTK_Selector* theSelector,*/ +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, +HexaExport void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj, const Handle(AIS_InteractiveContext)& theIC, SelectMgr_IndexedMapOfOwner& theMap ); -HEXABLOCK_EXPORT void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap, +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); 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); } } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_Trace.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_Trace.hxx index 9270812..cccd3e3 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_Trace.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_Trace.hxx @@ -23,7 +23,7 @@ #include #include -#include "HEXABLOCKGUI_Export.hxx" +#include "hexa_base.hxx" #include "HEXABLOCKGUI_Exception.hxx" #ifdef _DEVDEBUG_ @@ -34,7 +34,7 @@ namespace HEXABLOCK { namespace GUI { - extern HEXABLOCK_EXPORT int traceLevel; + extern HexaExport int traceLevel; } } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx index e5d0899..d1b74ea 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx @@ -20,8 +20,6 @@ #ifndef _HEXABLOCKGUI_VTKDOCUMENTGRAPHICVIEW_HXX_ #define _HEXABLOCKGUI_VTKDOCUMENTGRAPHICVIEW_HXX_ -#include "HEXABLOCKGUI_Export.hxx" - // SALOME GUI includes #include #include @@ -55,7 +53,7 @@ namespace HEXABLOCK 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); @@ -73,7 +71,7 @@ namespace HEXABLOCK }; // Abu - class HEXABLOCK_EXPORT Associate_Actor : public SALOME_Actor + class HexaExport Associate_Actor : public SALOME_Actor { public: Associate_Actor(HEXA_NS::Document* doc, const QString& entry); @@ -93,7 +91,7 @@ namespace HEXABLOCK /******************************************************************************** * VtkDocumentGraphicView ********************************************************************************/ - class HEXABLOCK_EXPORT VtkDocumentGraphicView : public QAbstractItemView + class HexaExport VtkDocumentGraphicView : public QAbstractItemView { Q_OBJECT diff --git a/src/HEXABLOCKGUI/MakeCylinder_QTD.ui b/src/HEXABLOCKGUI/MakeCylinder_QTD.ui index 00fb8e1..9df00a2 100644 --- a/src/HEXABLOCKGUI/MakeCylinder_QTD.ui +++ b/src/HEXABLOCKGUI/MakeCylinder_QTD.ui @@ -102,8 +102,8 @@ 0 0 - 354 - 638 + 348 + 619 @@ -224,7 +224,7 @@ 10.000000000000000 - 90.000000000000000 + 360.000000000000000 diff --git a/src/HEXABLOCKGUI/MakePipe_QTD.ui b/src/HEXABLOCKGUI/MakePipe_QTD.ui index c3ecb3f..4f4c43f 100644 --- a/src/HEXABLOCKGUI/MakePipe_QTD.ui +++ b/src/HEXABLOCKGUI/MakePipe_QTD.ui @@ -102,8 +102,8 @@ 0 0 - 337 - 638 + 331 + 619 @@ -221,7 +221,7 @@ 10.000000000000000 - 90.000000000000000 + 360.000000000000000 diff --git a/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx b/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx index 6278d9c..730c224 100755 --- a/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx +++ b/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx @@ -21,7 +21,8 @@ #ifndef MYBASICGUI_POINTDLG_H #define MYBASICGUI_POINTDLG_H -#include "HEXABLOCKGUI_Export.hxx" + + #include "MyGEOMBase_Skeleton.hxx" #include @@ -62,7 +63,8 @@ namespace HEXABLOCK // 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 @@ -111,8 +113,8 @@ private slots: 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); diff --git a/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx b/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx index c38723c..da14e2a 100755 --- a/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx +++ b/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx @@ -20,8 +20,8 @@ #ifndef MYGEOMBASE_SKELETON_H #define MYGEOMBASE_SKELETON_H -#include "HEXABLOCKGUI_Export.hxx" - + + #include "HEXABLOCKGUI_OccGraphicView.hxx" #include "HEXABLOCKGUI.hxx" #include "HEXABLOCKGUI_DocumentPanel.hxx" @@ -43,12 +43,14 @@ class QPushButton; # 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 diff --git a/src/HEXABLOCKGUI/ReplaceHexa_QTD.ui b/src/HEXABLOCKGUI/ReplaceHexa_QTD.ui index e387f00..451e657 100644 --- a/src/HEXABLOCKGUI/ReplaceHexa_QTD.ui +++ b/src/HEXABLOCKGUI/ReplaceHexa_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 287 - 500 + 285 + 669 @@ -20,6 +20,47 @@ Replace Hexahedron + + + + + 0 + 0 + + + + + + + + + + + 0 + 0 + + + + Hexa + + + + + + + + 0 + 0 + + + + Hexas + + + + + + @@ -36,8 +77,8 @@ 0 0 - 267 - 480 + 265 + 585 @@ -174,85 +215,113 @@ - Quad destination + Quad(s) destination - - - - - Point a - - - - - + + + - + 0 0 - - Select vertex - - - - - - false - - - - - - - Point b - - - - - - - - 0 - 0 - + + + 16777215 + 16777215 + - Select vertex - - - - - - false - - - - - - - Point c + Select hexa - - - - - 0 - 0 - - - - Select vertex - - - - - - false - + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Point a + + + + + + + + 0 + 0 + + + + Select vertex + + + + + + false + + + + + + + Point b + + + + + + + + 0 + 0 + + + + Select vertex + + + + + + false + + + + + + + Point c + + + + + + + + 0 + 0 + + + + Select vertex + + + + + + false + + + + @@ -269,10 +338,40 @@ p1_le p2_le p3_le - c1_le - c2_le - c3_le - + + + radioButton + clicked() + quads_lw_2 + hide() + + + 109 + 44 + + + 146 + 453 + + + + + radioButton_2 + clicked() + quads_lw_2 + show() + + + 232 + 44 + + + 146 + 453 + + + + diff --git a/src/HEXABLOCKGUI/Resource.hxx b/src/HEXABLOCKGUI/Resource.hxx index f745ea3..1b33510 100755 --- a/src/HEXABLOCKGUI/Resource.hxx +++ b/src/HEXABLOCKGUI/Resource.hxx @@ -20,7 +20,7 @@ #ifndef _RESOURCE_HXX_ #define _RESOURCE_HXX_ -#include "HEXABLOCKGUI_Export.hxx" +#include "hexa_base.hxx" #include #include @@ -183,7 +183,7 @@ namespace HEXABLOCK { namespace GUI { - class HEXABLOCK_EXPORT Resource { + class HexaExport Resource { public: Resource(); diff --git a/src/HEXABLOCKGUI/klinkitemselectionmodel.hxx b/src/HEXABLOCKGUI/klinkitemselectionmodel.hxx index 6172392..f861f74 100644 --- a/src/HEXABLOCKGUI/klinkitemselectionmodel.hxx +++ b/src/HEXABLOCKGUI/klinkitemselectionmodel.hxx @@ -22,8 +22,6 @@ #ifndef KLINKITEMSELECTIONMODEL_H #define KLINKITEMSELECTIONMODEL_H -#include "HEXABLOCKGUI_Export.hxx" - #include #include #include @@ -38,7 +36,7 @@ class KLinkItemSelectionModelPrivate; -class HEXABLOCK_EXPORT KLinkItemSelectionModel : public QItemSelectionModel +class HexaExport KLinkItemSelectionModel : public QItemSelectionModel { Q_OBJECT public: diff --git a/src/HEXABLOCKGUI/kmodelindexproxymapper.hxx b/src/HEXABLOCKGUI/kmodelindexproxymapper.hxx index eae0c54..6af03c9 100644 --- a/src/HEXABLOCKGUI/kmodelindexproxymapper.hxx +++ b/src/HEXABLOCKGUI/kmodelindexproxymapper.hxx @@ -22,10 +22,10 @@ #ifndef KMODELINDEXPROXYMAPPER_H #define KMODELINDEXPROXYMAPPER_H -#include "HEXABLOCKGUI_Export.hxx" - #include +#include "hexa_base.hxx" + // #include "kdeui_export.h" class QAbstractItemModel; @@ -33,7 +33,7 @@ class QModelIndex; class QItemSelection; class KModelIndexProxyMapperPrivate; -class HEXABLOCK_EXPORT KModelIndexProxyMapper : public QObject +class HexaExport KModelIndexProxyMapper : public QObject { Q_OBJECT public: diff --git a/src/HEXABLOCK_SWIG/hexablock_swig.py b/src/HEXABLOCK_SWIG/hexablock_swig.py index 9be3a70..856b6d0 100644 --- a/src/HEXABLOCK_SWIG/hexablock_swig.py +++ b/src/HEXABLOCK_SWIG/hexablock_swig.py @@ -526,7 +526,6 @@ Q_DIRECT = _hexablock_swig.Q_DIRECT 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 @@ -535,6 +534,7 @@ KS_Parabola = _hexablock_swig.KS_Parabola KS_BezierCurve = _hexablock_swig.KS_BezierCurve KS_BSplineCurve = _hexablock_swig.KS_BSplineCurve KS_OtherCurve = _hexablock_swig.KS_OtherCurve +KS_None = _hexablock_swig.KS_None CylSmall = _hexablock_swig.CylSmall CylBig = _hexablock_swig.CylBig NxInt = _hexablock_swig.NxInt @@ -561,6 +561,7 @@ set_special_option = _hexablock_swig.set_special_option sizeof_file = _hexablock_swig.sizeof_file read_file = _hexablock_swig.read_file get_time = _hexablock_swig.get_time +make_basename = _hexablock_swig.make_basename class EltBase(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, EltBase, name, value) @@ -669,6 +670,7 @@ class Edge(EltBase): def clearAssociation(*args): return _hexablock_swig.Edge_clearAssociation(*args) def setColor(*args): return _hexablock_swig.Edge_setColor(*args) def getWay(*args): return _hexablock_swig.Edge_getWay(*args) + def getLength(*args): return _hexablock_swig.Edge_getLength(*args) def __init__(self, *args): this = _hexablock_swig.new_Edge(*args) try: self.this.append(this) diff --git a/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc b/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc index 5b9833e..556a6aa 100644 --- a/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc +++ b/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc @@ -17703,6 +17703,43 @@ fail: } +SWIGINTERN PyObject *_wrap_make_basename(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + cpchar arg1 = (cpchar) 0 ; + string *arg2 = 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:make_basename",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "make_basename" "', argument " "1"" of type '" "cpchar""'"); + } + arg1 = reinterpret_cast< cpchar >(buf1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_string, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "make_basename" "', argument " "2"" of type '" "string &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "make_basename" "', argument " "2"" of type '" "string &""'"); + } + arg2 = reinterpret_cast< string * >(argp2); + result = (int)Hex::make_basename((char const *)arg1,*arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return NULL; +} + + SWIGINTERN int Epsil_set(PyObject *) { SWIG_Error(SWIG_AttributeError,"Variable Epsil is read-only."); return 1; @@ -19852,6 +19889,28 @@ fail: } +SWIGINTERN PyObject *_wrap_Edge_getLength(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Edge *arg1 = (Hex::Edge *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Edge_getLength",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Edge_getLength" "', argument " "1"" of type '" "Hex::Edge *""'"); + } + arg1 = reinterpret_cast< Hex::Edge * >(argp1); + result = (double)(arg1)->getLength(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_new_Edge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; @@ -31444,6 +31503,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"sizeof_file", _wrap_sizeof_file, METH_VARARGS, NULL}, { (char *)"read_file", _wrap_read_file, METH_VARARGS, NULL}, { (char *)"get_time", _wrap_get_time, METH_VARARGS, NULL}, + { (char *)"make_basename", _wrap_make_basename, METH_VARARGS, NULL}, { (char *)"EltBase_countHexa", _wrap_EltBase_countHexa, METH_VARARGS, NULL}, { (char *)"EltBase_countQuad", _wrap_EltBase_countQuad, METH_VARARGS, NULL}, { (char *)"EltBase_countEdge", _wrap_EltBase_countEdge, METH_VARARGS, NULL}, @@ -31508,6 +31568,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Edge_clearAssociation", _wrap_Edge_clearAssociation, METH_VARARGS, NULL}, { (char *)"Edge_setColor", _wrap_Edge_setColor, METH_VARARGS, NULL}, { (char *)"Edge_getWay", _wrap_Edge_getWay, METH_VARARGS, NULL}, + { (char *)"Edge_getLength", _wrap_Edge_getLength, METH_VARARGS, NULL}, { (char *)"new_Edge", _wrap_new_Edge, METH_VARARGS, NULL}, { (char *)"delete_Edge", _wrap_delete_Edge, METH_VARARGS, NULL}, { (char *)"Edge_swigregister", Edge_swigregister, METH_VARARGS, NULL}, @@ -32686,7 +32747,6 @@ SWIGEXPORT void SWIG_init(void) { 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))); @@ -32695,6 +32755,7 @@ SWIGEXPORT void SWIG_init(void) { 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, "KS_None",SWIG_From_int(static_cast< int >(Hex::KS_None))); 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))); -- 2.39.2