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,
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
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
virtual void clearAssociation ();
void setColor (double valeur);
bool getWay () { return e_way ; }
+ double getLength ();
Edge (Vertex* va, Vertex* vb);
#include <GCPnts_AbscissaPoint.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <Geom_Circle.hxx>
+
+/****************
+#include <Standard_Stream.hxx>
+#include <GEOMImpl_IMeasureOperations.hxx>
+#include <GEOMImpl_Types.hxx>
+#include <GEOMImpl_MeasureDriver.hxx>
+#include <GEOMImpl_IMeasure.hxx>
+#include <GEOMImpl_IShapesOperations.hxx>
+#include <GEOMUtils.hxx>
+#include <GEOMAlgo_ShapeInfo.hxx>
+#include <GEOMAlgo_ShapeInfoFiller.hxx>
+*********************************/
BEGIN_NAMESPACE_HEXA
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 ()
return -1.0;
GeomAdaptor_Curve adapt_curve (handle);
- kind_of = (EnumKindOfShape) (adapt_curve.GetType() + 1);
/******************
enum GeomAbs_CurveType { GeomAbs_Line, GeomAbs_Circle, GeomAbs_Ellipse,
is_associated = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ // ------- Cf GEOMImpl_IMeasureOperations.cxx
+
// ====================================================== updateCurve
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
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 :
Real3 lin_start;
Real3 lin_end;
double lin_length, par_mini, par_maxi;
+ double lin_radius, lin_angle;
bool maj_curve;
Edges tab_assoc;
sub_ident = id;
sub_dim = dim;
maj_brep = maj_shape = true;
+ kind_of = KS_None;
}
// ====================================================== getShape
const TopoDS_Shape& SubShape::getShape ()
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 ();
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 };
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
+
HEXABLOCKGUI.hxx
HEXABLOCKGUI_VtkDocumentGraphicView.hxx
HEXABLOCKGUI_DocumentPanel.hxx
- HEXABLOCKGUI_DocumentDelegate.hxx
HEXABLOCKGUI_DocumentSelectionModel.hxx
HEXABLOCKGUI_DocumentModel.hxx
kmodelindexproxymapper.hxx
HEXABLOCKGUI_DocumentSelectionModel.cxx
HEXABLOCKGUI_DocumentItem.hxx
HEXABLOCKGUI_DocumentItem.cxx
- HEXABLOCKGUI_DocumentDelegate.hxx
- HEXABLOCKGUI_DocumentDelegate.cxx
HEXABLOCKGUI_DocumentPanel.hxx
HEXABLOCKGUI_DocumentPanel.cxx
HEXABLOCKGUI_SalomeTools.hxx
#include <Visual3d_ViewManager.hxx>
+#include <Graphic3d_Structure.hxx>
+#include <Graphic3d_Group.hxx>
#include <V3d_PerspectiveView.hxx>
#include <V3d_AmbientLight.hxx>
+#include <Graphic3d_GraphicDevice.hxx>
+#include <Graphic3d_Array1OfVertex.hxx>
#include <V3d_DirectionalLight.hxx>
#include <Xw_Window.hxx>
#include <V3d_TypeOfShadingModel.hxx>
{
docGView->setViewWindow(graphicViewsHandler->createVtkWindow());
docGView->getViewWindow()->installEventFilter(this);
+ showAllMenus();
}
else
docGView->setViewWindow(currentDocGView->getViewWindow());
SVTK_ViewWindow* window = dynamic_cast<SVTK_ViewWindow*>(svw);
if (window != NULL)
{
-
//VTK clean close
if (currentDocGView != NULL && currentDocGView->getViewWindow() == window)
{ //HexaBlock Vtk Window has been closed
// if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
currentOccGView->getViewWindow()->removeEventFilter(this);
-
currentOccGView->setViewWindow(NULL);
}
}
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;
//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();
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;
if (vf == NULL)
return;
-// vf->EraseAll();
if (lastOccPrs != NULL)
vf->Erase(lastOccPrs);
currentOccGView->globalSelection();
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();
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<SALOME_View*>(occView->getViewManager()->getViewModel());
if (vf == NULL)
return;
-// vf->EraseAll();
SOCC_Prs* currentOccPrs = getOccPrs(currentDocGView);
if (currentOccPrs != NULL)
vf->Erase(currentOccPrs);
occView->onResetView();
}
+void HEXABLOCKGUI::showOnlyActor()
+{
+ showVtkActor();
+ showOccActor();
+}
+
+void HEXABLOCKGUI::hideActor()
+{
+ hideVtkActor();
+ hideOccActor();
+}
+
void HEXABLOCKGUI::showDockWidgets(bool isVisible)
{
extern "C"
{
- HEXABLOCK_EXPORT CAM_Module* createModule()
+ HexaExport CAM_Module* createModule()
{
return new HEXABLOCKGUI();
}
- HEXABLOCK_EXPORT char* getModuleVersion()
+ HexaExport char* getModuleVersion()
{
return (char*)HEXABLOCK_VERSION_STR;
}
#ifndef _HEXABLOCKGUI_HXX_
#define _HEXABLOCKGUI_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
#include <iostream>
#include <map>
#include <set>
class LightApp_VTKSelector;
-class HEXABLOCK_EXPORT HEXABLOCKGUI : public SalomeApp_Module
+class HexaExport HEXABLOCKGUI : public SalomeApp_Module
{
Q_OBJECT
enum ViewType {
VTK,
OCC,
+ VTK_OCC,
UNKNOWN
};
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);
virtual void onViewManagerRemoved( SUIT_ViewManager* );
void onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected );
- void showActor();
void hideActor();
void showOnlyActor();
+++ /dev/null
-
-// 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 <iostream>
-#include <QtGui>
-#include <qpixmap.h>
-#include <qrect.h>
-#include <qstyle.h>
-
-
-#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<HexaBaseDialog*>( 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<HEXA_NS::Vertex *>(index);
- VertexDialog *vertexEditor = static_cast<VertexDialog*>(editor);
- vertexEditor->setValue(value);
- }
- break;
- case EDGE_TREE : {
- HEXA_NS::Edge *value = documentModel->getHexaPtr<HEXA_NS::Edge*>(index);
- EdgeDialog *edgeEditor = static_cast<EdgeDialog*>(editor);
- edgeEditor->setValue(value);
- }
- break;
- case QUAD_TREE : {
- HEXA_NS::Quad *value = documentModel->getHexaPtr<HEXA_NS::Quad*>(index);
- QuadDialog *quadEditor = static_cast<QuadDialog*>(editor);
- quadEditor->setValue(value);
- }
- break;
- case HEXA_TREE : {
- HEXA_NS::Hexa *value = documentModel->getHexaPtr<HEXA_NS::Hexa*>(index);
- HexaDialog *hexaEditor = static_cast<HexaDialog*>(editor);
- hexaEditor->setValue(value);
- }
- break;
- case VECTOR_TREE : {
- HEXA_NS::Vector *value = documentModel->getHexaPtr<HEXA_NS::Vector*>(index);
- VectorDialog *vectorEditor = static_cast<VectorDialog*>(editor);
- vectorEditor->setValue(value);
- }
- break;
-
- /*
- case ELEMENTS_DIR_TREE : {
- HEXA_NS::Elements* value = documentModel->getHexaPtr<HEXA_NS::Elements*>(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<HEXA_NS::Cylinder*>(index);
-// CylinderDialog *cylinderEditor = static_cast<CylinderDialog*>(editor);
-// cylinderEditor->setValue(value);
-// }
-// break;
-// case PIPE_TREE : {
-// HEXA_NS::Pipe *value = documentModel->getHexaPtr<HEXA_NS::Pipe*>(index);
-// PipeDialog *pipeEditor= static_cast<PipeDialog*>(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<GroupDialog*>(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<LawDialog*>(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<PropagationDialog*>(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;
-}
+++ /dev/null
-// 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 <QEvent>
-#include <QItemDelegate>
-#include <QModelIndex>
-#include <QObject>
-#include <QSize>
-#include <QSpinBox>
-
-#include <QDockWidget>
-
-#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
#ifndef _HEXABLOCKGUI_DOCUMENTITEM_HXX_
#define _HEXABLOCKGUI_DOCUMENTITEM_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
#include <QStandardItem>
// QVariant::UserType
//===================================================================================
- class HEXABLOCK_EXPORT ElementItem : public QStandardItem
+ class HexaExport ElementItem : public QStandardItem
{
public:
ElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole);
};
//===================================================================================
- class HEXABLOCK_EXPORT GraphicElementItem : public ElementItem
+ class HexaExport GraphicElementItem : public ElementItem
{
public:
GraphicElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
int IDinActor;
};
- class HEXABLOCK_EXPORT StandardElementItem : public ElementItem
+ class HexaExport StandardElementItem : public ElementItem
{
public:
StandardElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
}
};
- class HEXABLOCK_EXPORT VertexItem : public GraphicElementItem
+ class HexaExport VertexItem : public GraphicElementItem
{
public:
VertexItem( HEXA_NS::Vertex* hexaVertex, QString entry = "");
};
- class HEXABLOCK_EXPORT EdgeItem : public GraphicElementItem
+ class HexaExport EdgeItem : public GraphicElementItem
{
public:
EdgeItem( HEXA_NS::Edge* hexaEdge, QString entry = "");
};
//-----------------------------------------
- class HEXABLOCK_EXPORT QuadItem : public GraphicElementItem
+ class HexaExport QuadItem : public GraphicElementItem
{
public:
QuadItem( HEXA_NS::Quad* hexaQuad, QString entry = "");
};
//-----------------------------------------
- class HEXABLOCK_EXPORT HexaItem : public GraphicElementItem
+ class HexaExport HexaItem : public GraphicElementItem
{
public:
HexaItem( HEXA_NS::Hexa* hexaHexa, QString entry = "");
};
//-----------------------------------------
- class HEXABLOCK_EXPORT VectorItem : public StandardElementItem
+ class HexaExport VectorItem : public StandardElementItem
{
public:
VectorItem( HEXA_NS::Vector* hexaVector, QString entry = "");
};
//-----------------------------------------
-// class HEXABLOCK_EXPORT CylinderItem : public StandardElementItem
+// class HexaExport CylinderItem : public StandardElementItem
// {
// public:
// CylinderItem( HEXA_NS::Cylinder* hexaCyl, QString entry = "");
// };
//-----------------------------------------
- class HEXABLOCK_EXPORT ElementsItem : public StandardElementItem
+ class HexaExport ElementsItem : public StandardElementItem
{
public:
ElementsItem( HEXA_NS::Elements* hexaElements, QString entry = "" );
// };
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomItem: public StandardElementItem
+ class HexaExport GeomItem: public StandardElementItem
{
public:
GeomItem( HEXA_NS::EltBase* geomShape, QString entry, HexaType ttype, HexaTreeRole treeRole, HEXA_NS::EltBase* assoc = NULL );
};
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomShapeItem: public GeomItem
+ class HexaExport GeomShapeItem: public GeomItem
{
public:
GeomShapeItem( HEXA_NS::NewShape* shape, HEXA_NS::EltBase* assoc = NULL);
};
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomPointItem: public GeomItem
+ class HexaExport GeomPointItem: public GeomItem
{
public:
GeomPointItem( HEXA_NS::VertexShape* geomPoint, HEXA_NS::Vertex* associatedVertex = NULL);
};
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomEdgeItem: public GeomItem
+ class HexaExport GeomEdgeItem: public GeomItem
{
public:
GeomEdgeItem( HEXA_NS::EdgeShape* geomEdge, HEXA_NS::Edge* associatedEdge = NULL);
};
//------------------------------------------------
- class HEXABLOCK_EXPORT GeomFaceItem: public GeomItem
+ class HexaExport GeomFaceItem: public GeomItem
{
public:
GeomFaceItem( HEXA_NS::FaceShape* geomFace, HEXA_NS::Quad* associatedQuad = NULL);
};
//-----------------------------------------
- class HEXABLOCK_EXPORT GroupItem : public QStandardItem
+ class HexaExport GroupItem : public QStandardItem
{
public:
GroupItem( HEXA_NS::Group* hexaGroup );
};
- class HEXABLOCK_EXPORT LawItem : public QStandardItem
+ class HexaExport LawItem : public QStandardItem
{
public:
LawItem( HEXA_NS::Law* hexaLaw );
};
- class HEXABLOCK_EXPORT PropagationItem : public QStandardItem
+ class HexaExport PropagationItem : public QStandardItem
{
public:
PropagationItem( HEXA_NS::Propagation* hexaPropagation );
#include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
-
+#include <Geom_Circle.hxx>
+#include <gp_Circ.hxx>
+#include <BRep_Tool.hxx>
+#include <TopoDS_Edge.hxx>
//#define _DEVDEBUG_
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<HEXA_NS::Edge*>(iEdge);
+ HEXA_NS::EdgeShape* geomEdge = getHexaPtr<HEXA_NS::EdgeShape*>(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<HEXA_NS::EdgeShape*>(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<HEXA_NS::EdgeShape*>(iEdge);
+ if (edge == NULL)
+ return 0.;
+
+ return edge->getAngle();
+}
//Load the current Document
void DocumentModel::load()
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;
return iElts;
}
-
-
QModelIndex DocumentModel::makeRotation( const QModelIndex& ielts,
const QModelIndex& iv,
const QModelIndex& ivec, double angle )
}
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();
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<HEXA_NS::Vertex*>(ip1_source);
+ HEXA_NS::Vertex* hp2 = getHexaPtr<HEXA_NS::Vertex*>(ip2_source);
+ HEXA_NS::Vertex* hp3 = getHexaPtr<HEXA_NS::Vertex*>(ip3_source);
+ HEXA_NS::Vertex* hc1 = getHexaPtr<HEXA_NS::Vertex*>(ic1_dest);
+ HEXA_NS::Vertex* hc2 = getHexaPtr<HEXA_NS::Vertex*>(ic2_dest);
+ HEXA_NS::Vertex* hc3 = getHexaPtr<HEXA_NS::Vertex*>(ic3_dest);
+
+ HEXA_NS::Quads hquads_source, hquads_dest;
+ HEXA_NS::Quad* hquad = NULL;
+ foreach( const QModelIndex& iquad, iquads_source ){
+ hquad = getHexaPtr<HEXA_NS::Quad*>(iquad);
+ hquads_source.push_back( hquad );
+ }
+
+ foreach( const QModelIndex& iquad, iquads_dest) {
+ hquad = getHexaPtr<HEXA_NS::Quad*>(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;
//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 );
#ifndef _HEXABLOCKGUI_DOCUMENTMODEL_HXX_
#define _HEXABLOCKGUI_DOCUMENTMODEL_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
#include <QTemporaryFile>
#include <QStandardItemModel>
{
namespace GUI
{
- class HEXABLOCK_EXPORT DocumentModel : public QStandardItemModel
+ class HexaExport DocumentModel : public QStandardItemModel
{
Q_OBJECT
public:
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();
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 ************
QStandardItem *_lawDirItem;
QStandardItem *_propagationDirItem;
-
Qt::ItemFlags _vertexItemFlags;
Qt::ItemFlags _edgeItemFlags;
Qt::ItemFlags _quadItemFlags;
Qt::ItemFlags _groupItemFlags;
Qt::ItemFlags _lawItemFlags;
Qt::ItemFlags _propagationItemFlags;
-
};
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;
_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" );
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<QListWidget*>(_currentObj);
+ QDoubleSpinBox* spb = dynamic_cast<QDoubleSpinBox*>(_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)
{
highlightSelectedAssocs();
}
+// ============================================================= clearCurrentObjectFocus
void HexaBaseDialog::clearCurrentObjectFocus()
{
QWidget* currentWidget = dynamic_cast<QWidget*>(_currentObj);
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
// ============================================================== _allowVTKSelection
bool HexaBaseDialog::_allowVTKSelection( QObject* obj )
{
-
bool isOk = false;
QVariant v = obj->property("HexaWidgetType");
// ============================================================== _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<HexaWidgetType>();
return selector;
}
+// ============================================================== getGeomObj
DocumentModel::GeomObj* HexaBaseDialog::getGeomObj(const QModelIndex& index)
{
HEXA_NS::NewShape* aSh = getDocumentModel()->getHexaPtr<HEXA_NS::NewShape*>(index);
*/
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<QLineEdit*>(_currentObj);
+ QListWidget* aListWidget = dynamic_cast<QListWidget*>(_currentObj);
// * fill the lineedit with selection
- aLineEdit = dynamic_cast<QLineEdit*>(_currentObj);
if ( aLineEdit)
{
_onSelectionChanged( sel, aLineEdit );
}
// * fill the listWidget with selection
- aListWidget = dynamic_cast<QListWidget*>(_currentObj);
- if ( aListWidget)
+ if (aListWidget)
_onSelectionChanged( sel, aListWidget );
}
{
//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)
//Disconnect model selection signals
disconnectDocumentGraphicView();
-
getDocumentModel()->allowEdition();
QDialog::hideEvent( event );
*/
void HexaBaseDialog::_highlightWidget(QObject *obj, Qt::GlobalColor clr)
{
- if (!_isLineOrListWidget(obj)) return;
+ QDoubleSpinBox* spb = dynamic_cast<QDoubleSpinBox*>(obj);
+ if (!_isLineOrListWidget(obj) && spb == NULL)
+ return;
- QWidget *widget = dynamic_cast<QWidget*>(obj); //sure it's not NULL (_isLineOrListWidget(obj))
+ QWidget *widget = dynamic_cast<QWidget*>(obj);
QPalette palette1 = widget->palette();
- palette1.setColor(widget->backgroundRole(), clr);
+ palette1.setColor(QPalette::Active, widget->backgroundRole(), clr);
widget->setPalette(palette1);
-
}//_highlightWidget
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
_helpFileName = "gui_vertex.html";
setupUi( this );
_initWidget(editmode);
- // setFocusProxy( name_le );
if ( editmode == NEW_MODE ){
setWindowTitle( tr("Vertex Construction") );
}
QString newName = name_le->text();
- if ( !newName.isEmpty() )/*{*/
+ if ( !newName.isEmpty() )
getDocumentModel()->setName( iVertex, newName );
//the default name in the dialog box
// to select/highlight result
result = patternDataModel->mapFromSource(iVertex);
- // updateDialogBoxName(name_le, result);
- // const char *defaultName = getDocumentModel()->getHexaPtr(last)->getName();
return isOk;
}
setupUi( this );
_initWidget(editmode);
- // rb0->setFocusProxy( v0_le_rb0 );
- // rb1->setFocusProxy( vex_le_rb1 );
-
if ( editmode == INFO_MODE ){
setWindowTitle( tr("Edge Information") );
rb1->hide();
if (editmode == INFO_MODE)
name_le->setReadOnly(true);
- //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) );
-
}
// ============================================================== Clear
if (editmode == INFO_MODE)
name_le->setReadOnly(true);
-
}
// ============================================================== clear
}
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] );
}
iNewElts = docModel->makeCartesian( icenter, ibase, ivec, iaxis,
radius, angles, heights);
}
-
}
if ( !iNewElts.isValid() )
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);
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);
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);
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);
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 );
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);
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()) );
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);
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_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);
}
result = patternDataModel->mapFromSource(iNewElts);
+ if (result.isValid())
+ {
+ MESSAGE("======> Result is valid!");
+ HEXA_NS::Elements* elts = getDocumentModel()->getHexaPtr<HEXA_NS::Elements*>(result);
+ MESSAGE("======> " << elts->getName());
+ }
+ else
+ {
+ MESSAGE("======> Result is not valid!");
+ }
// result = patternBuilderModel->mapFromSource(iNewElts);
return true;
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 );
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);
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);
_helpFileName = "gui_replace_hexa.html";
setupUi( this );
_initWidget(editmode);
+
+ radioButton->click();
}
// ============================================================== Destructeur
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<QModelIndex>() ); //unsafe
+ //iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() ); //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;
}
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);
connect(quads_lw, SIGNAL(itemSelectionChanged()),
this, SLOT(selectElementOfModel()), Qt::UniqueConnection);
+
+ connect(quads_lw_2, SIGNAL(itemSelectionChanged()),
+ this, SLOT(selectElementOfModel()), Qt::UniqueConnection);
}
// ============================================================== clear
updateButtonBox();
}
+// ============================================================== deleteQuadItem2
+void ReplaceHexaDialog::deleteQuadItem2()
+{
+ delete quads_lw_2->currentItem();
+ updateButtonBox();
+}
+
// ============================================================== apply
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<QModelIndex>() );
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<QModelIndex>() );
+ 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() ){
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);
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
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);
#ifndef __HEXABLOCKGUI_DOCUMENTPANEL_HXX_
#define __HEXABLOCKGUI_DOCUMENTPANEL_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
#define MAX_WIDTH 16777215
#define MAX_HEIGHT 16777215
#define MIN_WIDTH 5
#include "klinkitemselectionmodel.hxx"
+
Q_DECLARE_METATYPE(QModelIndex);
namespace HEXABLOCK
{
namespace GUI
{
- class HEXABLOCK_EXPORT HexaBaseDialog : public QDialog
+ class HexaExport HexaBaseDialog : public QDialog
{
Q_OBJECT
return HEXABLOCKGUI::currentDocGView->getPatternGeomModel();
}
-// PatternBuilderModel* getPatternBuilderModel() const {
-// return HEXABLOCKGUI::currentDocGView->getPatternBuilderModel();
-// }
-
GroupsModel* getGroupsModel() const {
return HEXABLOCKGUI::currentDocGView->getGroupsModel();
}
return HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel();
}
-// PatternBuilderSelectionModel* getPatternBuilderSelectionModel() const {
-// return HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel();
-// }
-
PatternGeomSelectionModel* getPatternGeomSelectionModel() const {
return HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel();
}
return assocs;
}
virtual void setCurrentGeomObj(DocumentModel::GeomObj* geomObj) {}
+ virtual void computeAndSetDimension(const QModelIndex& elt);
bool debugEdgeAssoc; //Temporary
bool autoFocusSwitch;
void _updateCurrentObject(QObject*);
+ bool isDimensionType(const QObject* obj);
+
Mode _editMode;
- QMap<QObject*, QModelIndex> _index;
- QObject* _currentObj;
+ QMap<QObject*, QModelIndex> _index;
+ QObject* _currentObj;
QMap<HexaWidgetType, QString> _strHexaWidgetType;
- QPushButton* _applyButton;
- QString _helpFileName;
+ QPushButton* _applyButton;
+ QString _helpFileName;
private:
bool _isLineOrListWidget(QObject*);
};
-
-
- class HEXABLOCK_EXPORT VertexDialog : public HexaBaseDialog,
+ class HexaExport VertexDialog : public HexaBaseDialog,
public Ui::VertexDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT EdgeDialog : public HexaBaseDialog,
+ class HexaExport EdgeDialog : public HexaBaseDialog,
public Ui::EdgeDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT QuadDialog : public HexaBaseDialog,
+ class HexaExport QuadDialog : public HexaBaseDialog,
public Ui::QuadDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT HexaDialog : public HexaBaseDialog,
+ class HexaExport HexaDialog : public HexaBaseDialog,
public Ui::HexaDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT VectorDialog : public HexaBaseDialog,
+ class HexaExport VectorDialog : public HexaBaseDialog,
public Ui::VectorDialog
{
Q_OBJECT
QModelIndex _ivalue;
};
- class HEXABLOCK_EXPORT MakeGridDialog : public HexaBaseDialog,
+ class HexaExport MakeGridDialog : public HexaBaseDialog,
public Ui::MakeGridDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakeCylinderDialog : public HexaBaseDialog,
+ class HexaExport MakeCylinderDialog : public HexaBaseDialog,
public Ui::MakeCylinderDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakePipeDialog : public HexaBaseDialog,
+ class HexaExport MakePipeDialog : public HexaBaseDialog,
public Ui::MakePipeDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakeCylindersDialog : public HexaBaseDialog,
+ class HexaExport MakeCylindersDialog : public HexaBaseDialog,
public Ui::MakeCylindersDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakePipesDialog : public HexaBaseDialog,
+ class HexaExport MakePipesDialog : public HexaBaseDialog,
public Ui::MakePipesDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT RemoveHexaDialog : public HexaBaseDialog,
+ class HexaExport RemoveHexaDialog : public HexaBaseDialog,
public Ui::RemoveHexaDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT PrismQuadDialog : public HexaBaseDialog,
+ class HexaExport PrismQuadDialog : public HexaBaseDialog,
public Ui::PrismQuadDialog
{
Q_OBJECT
void updateHelpFileName();
private slots:
- //void addQuad();
+ void addQuad();
void removeQuad();
- //void clearQuads();
+ void clearQuads();
};
- class HEXABLOCK_EXPORT JoinQuadDialog : public HexaBaseDialog,
+ class HexaExport JoinQuadDialog : public HexaBaseDialog,
public Ui::JoinQuadDialog
{
Q_OBJECT
void updateHelpFileName();
private slots:
- //void addQuad();
+ void addQuad();
void removeQuad();
- //void clearQuads();
+ void clearQuads();
};
- class HEXABLOCK_EXPORT MergeDialog : public HexaBaseDialog,
+ class HexaExport MergeDialog : public HexaBaseDialog,
public Ui::MergeDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT DisconnectDialog : public HexaBaseDialog,
+ class HexaExport DisconnectDialog : public HexaBaseDialog,
public Ui::DisconnectDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT CutEdgeDialog : public HexaBaseDialog,
+ class HexaExport CutEdgeDialog : public HexaBaseDialog,
public Ui::CutEdgeDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakeTransformationDialog : public HexaBaseDialog,
+ class HexaExport MakeTransformationDialog : public HexaBaseDialog,
public Ui::TransformationDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MakeSymmetryDialog : public HexaBaseDialog,
+ class HexaExport MakeSymmetryDialog : public HexaBaseDialog,
public Ui::SymmetryDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT PerformTransformationDialog : public HexaBaseDialog,
+ class HexaExport PerformTransformationDialog : public HexaBaseDialog,
public Ui::TransformationDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT PerformSymmetryDialog : public HexaBaseDialog,
+ class HexaExport PerformSymmetryDialog : public HexaBaseDialog,
public Ui::SymmetryDialog
{
Q_OBJECT
void updateHelpFileName();
};
-class HEXABLOCK_EXPORT EdgeAssocDialog : public HexaBaseDialog,
+class HexaExport EdgeAssocDialog : public HexaBaseDialog,
public Ui::EdgeAssocDialog
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT QuadAssocDialog : public HexaBaseDialog,
+ class HexaExport QuadAssocDialog : public HexaBaseDialog,
public Ui::QuadAssocDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT GroupDialog : public HexaBaseDialog,
+ class HexaExport GroupDialog : public HexaBaseDialog,
public Ui::GroupDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT LawDialog : public HexaBaseDialog,
+ class HexaExport LawDialog : public HexaBaseDialog,
public Ui::LawDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT PropagationDialog : public HexaBaseDialog,
+ class HexaExport PropagationDialog : public HexaBaseDialog,
public Ui::PropagationDialog
{
Q_OBJECT
void _initInputWidget( Mode editmode );
protected slots:
- //void updateHelpFileName();
+ void updateHelpFileName();
void deletePropagationItem();
virtual void selectElementOfModel();
// Define the compute mesh dialog box
// ----------------------------------
- class HEXABLOCK_EXPORT ComputeMeshDialog : public HexaBaseDialog,
+ class HexaExport ComputeMeshDialog : public HexaBaseDialog,
public Ui::ComputeMeshDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT ReplaceHexaDialog : public HexaBaseDialog,
+ class HexaExport ReplaceHexaDialog : public HexaBaseDialog,
public Ui::ReplaceHexaDialog
{
Q_OBJECT
protected slots:
void deleteQuadItem();
+ void deleteQuadItem2();
void updateButtonBox();
private:
- class HEXABLOCK_EXPORT QuadRevolutionDialog : public HexaBaseDialog,
+ class HexaExport QuadRevolutionDialog : public HexaBaseDialog,
public Ui::QuadRevolutionDialog
{
Q_OBJECT
- class HEXABLOCK_EXPORT MakeHemiSphereDialog : public HexaBaseDialog,
+ class HexaExport MakeHemiSphereDialog : public HexaBaseDialog,
public Ui::MakeHemiSphereDialog
{
Q_OBJECT
HEXA_NS::Elements *_value;
};
- class HEXABLOCK_EXPORT ModelInfoDialog : public HexaBaseDialog,
+ class HexaExport ModelInfoDialog : public HexaBaseDialog,
public Ui::ModelInfoDialog
{
Q_OBJECT
virtual void _initInputWidget( Mode editmode ){}
};
- class HEXABLOCK_EXPORT AddShapeDialog : public HexaBaseDialog,
+ class HexaExport AddShapeDialog : public HexaBaseDialog,
public Ui::AddShapeDialog
{
Q_OBJECT
#ifndef _HEXABLOCKGUI_DOCUMENTSELECTIONMODEL_HXX_
#define _HEXABLOCKGUI_DOCUMENTSELECTIONMODEL_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <QItemSelectionModel>
-#include <LightApp_SelectionMgr.h>
+//#include <LightApp_SelectionMgr.h>
-#include <SVTK_ViewWindow.h>
+//#include <SVTK_ViewWindow.h>
#include <SVTK_Selector.h>
-#include "klinkitemselectionmodel.hxx"
+//#include "klinkitemselectionmodel.hxx"
#include "HEXABLOCKGUI_DocumentModel.hxx"
namespace GUI
{
- class HEXABLOCK_EXPORT SelectionModel: public QItemSelectionModel
+ class HexaExport SelectionModel: public QItemSelectionModel
{
Q_OBJECT
// }
// };
- class HEXABLOCK_EXPORT PatternDataSelectionModel : public SelectionModel
+ class HexaExport PatternDataSelectionModel : public SelectionModel
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT PatternGeomSelectionModel : public SelectionModel
+ class HexaExport PatternGeomSelectionModel : public SelectionModel
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT GroupsSelectionModel : public SelectionModel
+ class HexaExport GroupsSelectionModel : public SelectionModel
{
Q_OBJECT
};
- class HEXABLOCK_EXPORT MeshSelectionModel : public SelectionModel
+ class HexaExport MeshSelectionModel : public SelectionModel
{
Q_OBJECT
#ifndef __HEXABLOCKGUI_EXCEPTION_HXX__
#define __HEXABLOCKGUI_EXCEPTION_HXX__
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <string>
#include <exception>
{
namespace GUI
{
- class HEXABLOCK_EXPORT Exception : public std::exception
+ class HexaExport Exception : public std::exception
{
protected:
std::string _what;
#include <QMap>
//HEXABLOCK Includes
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx"
namespace HEXABLOCK
namespace GUI
{
- class HEXABLOCK_EXPORT GraphicViewsHandler
+ class HexaExport GraphicViewsHandler
{
public:
#ifndef HEXABLOCKGUI_OCCSELECTOR_H
#define HEXABLOCKGUI_OCCSELECTOR_H
-#include "HEXABLOCKGUI_Export.hxx"
#include <LightApp_OCCSelector.h>
+#include "hexa_base.hxx"
-class HEXABLOCK_EXPORT HEXABLOCKGUI_OCCSelector : public LightApp_OCCSelector
+class HexaExport HEXABLOCKGUI_OCCSelector : public LightApp_OCCSelector
{
public:
HEXABLOCKGUI_OCCSelector( OCCViewer_Viewer*, SUIT_SelectionMgr* );
#ifndef _HEXABLOCKGUI_OCCGRAPHICVIEW_HXX_
#define _HEXABLOCKGUI_OCCGRAPHICVIEW_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
-
#include <OCCViewer_ViewWindow.h>
#include "HEXABLOCKGUI_SalomeTools.hxx"
#include <QModelIndex>
#include <QModelIndexList>
+#include "hexa_base.hxx"
namespace HEXABLOCK
{
* OccGraphicView
********************************************************************************/
- class HEXABLOCK_EXPORT OccGraphicView
+ class HexaExport OccGraphicView
{
public:
#ifndef _HEXABLOCKGUI_RESOURCE_HXX_
#define _HEXABLOCKGUI_RESOURCE_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <QtGui>
-class HEXABLOCK_EXPORT HEXABLOCKGUI_Resource
+class HexaExport HEXABLOCKGUI_Resource
{
public:
HEXABLOCKGUI_Resource(SUIT_ResourceMgr* r);
#ifndef _HEXABLOCKGUI_SALOMETOOLS_HXX_
#define _HEXABLOCKGUI_SALOMETOOLS_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <SalomeApp_Application.h>
#include <SALOME_Actor.h>
namespace GUI
{
-HEXABLOCK_EXPORT SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry );
+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);
}
}
#include <iostream>
#include <sstream>
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include "HEXABLOCKGUI_Exception.hxx"
#ifdef _DEVDEBUG_
namespace HEXABLOCK {
namespace GUI {
- extern HEXABLOCK_EXPORT int traceLevel;
+ extern HexaExport int traceLevel;
}
}
#ifndef _HEXABLOCKGUI_VTKDOCUMENTGRAPHICVIEW_HXX_
#define _HEXABLOCKGUI_VTKDOCUMENTGRAPHICVIEW_HXX_
-#include "HEXABLOCKGUI_Export.hxx"\r
-\r
// SALOME GUI includes
#include <LightApp_Displayer.h>
#include <SUIT_ViewWindow.h>
namespace GUI
{
- class HEXABLOCK_EXPORT Document_Actor : public SALOME_Actor
+ class HexaExport Document_Actor : public SALOME_Actor
{
public:
Document_Actor(HEXA_NS::Document* doc, const QString& entry);
};
// Abu
- class HEXABLOCK_EXPORT Associate_Actor : public SALOME_Actor
+ class HexaExport Associate_Actor : public SALOME_Actor
{
public:
Associate_Actor(HEXA_NS::Document* doc, const QString& entry);
/********************************************************************************
* VtkDocumentGraphicView
********************************************************************************/
- class HEXABLOCK_EXPORT VtkDocumentGraphicView : public QAbstractItemView
+ class HexaExport VtkDocumentGraphicView : public QAbstractItemView
{
Q_OBJECT
<rect>
<x>0</x>
<y>0</y>
- <width>354</width>
- <height>638</height>
+ <width>348</width>
+ <height>619</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<double>10.000000000000000</double>
</property>
<property name="value">
- <double>90.000000000000000</double>
+ <double>360.000000000000000</double>
</property>
</widget>
</item>
<rect>
<x>0</x>
<y>0</y>
- <width>337</width>
- <height>638</height>
+ <width>331</width>
+ <height>619</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<double>10.000000000000000</double>
</property>
<property name="value">
- <double>90.000000000000000</double>
+ <double>360.000000000000000</double>
</property>
</widget>
</item>
#ifndef MYBASICGUI_POINTDLG_H
#define MYBASICGUI_POINTDLG_H
-#include "HEXABLOCKGUI_Export.hxx"\r
+
+
#include "MyGEOMBase_Skeleton.hxx"
#include <QMap>
// class : MyBasicGUI_PointDlg
// purpose :
//=================================================================================
-typedef class HEXABLOCK_EXPORT MyBasicGUI_PointDlg : public MyGEOMBase_Skeleton
+#include "hexa_base.hxx"
+typedef class HexaExport MyBasicGUI_PointDlg : public MyGEOMBase_Skeleton
{
Q_OBJECT
void ClickParamCoord( int );
void onBtnPopup( QAction* );
void updateSize();
- // void onRefPointChanged(const QString& pointName);
- // void onStartPointSelected(const QString& pointName);
+ void onRefPointChanged(const QString& pointName);
+ void onStartPointSelected(const QString& pointName);
void onParamValueChanged(double newValue);
void onXCoordChanged(double newValue);
void onYCoordChanged(double newValue);
#ifndef MYGEOMBASE_SKELETON_H
#define MYGEOMBASE_SKELETON_H
-#include "HEXABLOCKGUI_Export.hxx"\r
-\r
+
+
#include "HEXABLOCKGUI_OccGraphicView.hxx"
#include "HEXABLOCKGUI.hxx"
#include "HEXABLOCKGUI_DocumentPanel.hxx"
# define DBL_DIGITS_DISPLAY 13
#endif // COORD_MIN
+#include "hexa_base.hxx"
+
namespace HEXABLOCK
{
namespace GUI
{
-class HEXABLOCK_EXPORT MyGEOMBase_Skeleton : public HexaBaseDialog
+class HexaExport MyGEOMBase_Skeleton : public HexaBaseDialog
{
Q_OBJECT
<rect>
<x>0</x>
<y>0</y>
- <width>287</width>
- <height>500</height>
+ <width>285</width>
+ <height>669</height>
</rect>
</property>
<property name="minimumSize">
<string>Replace Hexahedron</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QRadioButton" name="radioButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Hexa</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Hexas</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
<rect>
<x>0</x>
<y>0</y>
- <width>267</width>
- <height>480</height>
+ <width>265</width>
+ <height>585</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
</sizepolicy>
</property>
<property name="title">
- <string>Quad destination</string>
+ <string>Quad(s) destination</string>
</property>
- <layout class="QFormLayout" name="formLayout_3">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Point a</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="c1_le">
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <widget class="QListWidget" name="quads_lw_2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="toolTip">
- <string>Select vertex</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Point b</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="c2_le">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
</property>
<property name="toolTip">
- <string>Select vertex</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="readOnly">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Point c</string>
+ <string>Select hexa</string>
</property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="c3_le">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>Select vertex</string>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="readOnly">
- <bool>false</bool>
- </property>
+ <item>
+ <widget class="QWidget" name="widget_3" native="true">
+ <layout class="QFormLayout" name="formLayout">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+ </property>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Point a</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="c1_le">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Select vertex</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Point b</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="c2_le">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Select vertex</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Point c</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="c3_le">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Select vertex</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
</layout>
<tabstop>p1_le</tabstop>
<tabstop>p2_le</tabstop>
<tabstop>p3_le</tabstop>
- <tabstop>c1_le</tabstop>
- <tabstop>c2_le</tabstop>
- <tabstop>c3_le</tabstop>
</tabstops>
<resources/>
- <connections/>
+ <connections>
+ <connection>
+ <sender>radioButton</sender>
+ <signal>clicked()</signal>
+ <receiver>quads_lw_2</receiver>
+ <slot>hide()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>109</x>
+ <y>44</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>146</x>
+ <y>453</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>radioButton_2</sender>
+ <signal>clicked()</signal>
+ <receiver>quads_lw_2</receiver>
+ <slot>show()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>232</x>
+ <y>44</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>146</x>
+ <y>453</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
</ui>
#ifndef _RESOURCE_HXX_
#define _RESOURCE_HXX_
-#include "HEXABLOCKGUI_Export.hxx"
+#include "hexa_base.hxx"
#include <QColor>
#include <QFont>
namespace HEXABLOCK {
namespace GUI {
- class HEXABLOCK_EXPORT Resource {
+ class HexaExport Resource {
public:
Resource();
#ifndef KLINKITEMSELECTIONMODEL_H
#define KLINKITEMSELECTIONMODEL_H
-#include "HEXABLOCKGUI_Export.hxx"\r
-
#include <QtCore/QObject>
#include <QtGui/QItemSelectionModel>
#include <QtGui/QAbstractProxyModel>
class KLinkItemSelectionModelPrivate;
-class HEXABLOCK_EXPORT KLinkItemSelectionModel : public QItemSelectionModel
+class HexaExport KLinkItemSelectionModel : public QItemSelectionModel
{
Q_OBJECT
public:
#ifndef KMODELINDEXPROXYMAPPER_H
#define KMODELINDEXPROXYMAPPER_H
-#include "HEXABLOCKGUI_Export.hxx"\r
-
#include <QObject>
+#include "hexa_base.hxx"
+
// #include "kdeui_export.h"
class QAbstractItemModel;
class QItemSelection;
class KModelIndexProxyMapperPrivate;
-class HEXABLOCK_EXPORT KModelIndexProxyMapper : public QObject
+class HexaExport KModelIndexProxyMapper : public QObject
{
Q_OBJECT
public:
Q_INVERSE = _hexablock_swig.Q_INVERSE
Q_UNDEFINED = _hexablock_swig.Q_UNDEFINED
Q_WAITING = _hexablock_swig.Q_WAITING
-KS_None = _hexablock_swig.KS_None
KS_Line = _hexablock_swig.KS_Line
KS_Circle = _hexablock_swig.KS_Circle
KS_Ellipse = _hexablock_swig.KS_Ellipse
KS_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
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)
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)
}
+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;
}
+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 ;
{ (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},
{ (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},
SWIG_Python_SetConstant(d, "Q_INVERSE",SWIG_From_int(static_cast< int >(Hex::Q_INVERSE)));
SWIG_Python_SetConstant(d, "Q_UNDEFINED",SWIG_From_int(static_cast< int >(Hex::Q_UNDEFINED)));
SWIG_Python_SetConstant(d, "Q_WAITING",SWIG_From_int(static_cast< int >(Hex::Q_WAITING)));
- SWIG_Python_SetConstant(d, "KS_None",SWIG_From_int(static_cast< int >(Hex::KS_None)));
SWIG_Python_SetConstant(d, "KS_Line",SWIG_From_int(static_cast< int >(Hex::KS_Line)));
SWIG_Python_SetConstant(d, "KS_Circle",SWIG_From_int(static_cast< int >(Hex::KS_Circle)));
SWIG_Python_SetConstant(d, "KS_Ellipse",SWIG_From_int(static_cast< int >(Hex::KS_Ellipse)));
SWIG_Python_SetConstant(d, "KS_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)));