Elements* disconnectVertex (Hexa* maille, Vertex* noeud);
Elements* disconnectEdges (Hexas thexas, Edges edges);
- Elements* replace (Quads pattern, Vertex* p1, Vertex* c1,
- Vertex* p2, Vertex* c2, Vertex* p3, Vertex* c3);
+ Elements* replace (Quads pattern, Quads cible, Vertex* p1, Vertex* c1,
+ Vertex* p2, Vertex* c2);
int mergeVertices (Vertex* v1, Vertex* v2);
int mergeEdges (Edge* e1, Edge* e2, Vertex* v1, Vertex* v2);
void clearAssoEdges ();
void clearAssoQuads ();
+ // PERIMES
+ Elements* replaceHexa (Quads pattern, Vertex* p1, Vertex* c1, Vertex* p2,
+ Vertex* c2, Vertex* p3, Vertex* c3);
+ Elements* replace (Quads pattern, Vertex* p1, Vertex* c1, Vertex* p2,
+ Vertex* c2, Vertex* p3, Vertex* c3)
+ { return replaceHexa (pattern, p1, c1, p2, c2, p3, c3); }
+
+ Elements* replaceHexas (Quads pattern, Quads cible, Vertex* p1, Vertex* c1,
+ Vertex* p2, Vertex* c2, Vertex* p3, Vertex* c3)
+ { return replace (pattern, cible, p1, c1, p2, c2); }
+
+
public:
~Document ();
Hexa* hexa = new Hexa (q_a, q_b, q_c, q_d, q_e, q_f);
return hexa;
}
-// ========================================================= replace
-Elements* Document::replace (Quads pattern, Vertex* p1, Vertex* c1,
+// ========================================================= replaceHexa
+Elements* Document::replaceHexa (Quads pattern, Vertex* p1, Vertex* c1,
Vertex* p2, Vertex* c2, Vertex* p3, Vertex* c3)
{
- DumpStart ("replace", pattern << p1 << c1 << p2 << c2 << p3 << c3);
+ DumpStart ("replaceHexa", pattern << p1 << c1 << p2 << c2 << p3 << c3);
Elements* t_hexas = new Elements (this);
int ier = t_hexas->replaceHexas (pattern, p1, c1, p2, c2, p3, c3);
DumpReturn (t_hexas);
return t_hexas;
}
+// ========================================================= repla
+Elements* Document::replace (Quads motif, Quads cible, Vertex* p1, Vertex* c1, Vertex* p2, Vertex* c2)
+{
+ DumpStart ("replace", motif << cible << p1 << c1 << p2 << c2);
+
+ 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;
+}
// ========================================================= print_replace
void print_replace (Edge* zig, Edge* zag)
{
#include "HexXmlWriter.hxx"
#include "HexNewShape.hxx"
#include "HexAssoEdge.hxx"
+#include "HexVertexShape.hxx"
static int niveau = 0;
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;
+}
+// ========================================================= findAssociation
+int Edge::findAssociation (NewShape* geom)
+{
+ Real3 point, p2;
+ if (geom==NULL)
+ return NOTHING;
+
+ e_vertex [V_AMONT]-> getAssoCoord (point);
+ e_vertex [V_AVAL ]-> getAssoCoord (p2);
+
+ EdgeShape* gline = geom->findEdge (point, p2);
+ if (gline==NULL)
+ {
+ cout << " *** FindAssociation " << el_name << endl;
+ for (int nv=0 ; nv < V_TWO ; ++nv)
+ {
+ e_vertex [nv]-> getAssoCoord (point);
+ VertexShape* shape = geom->findVertex (point);
+ cout << " *** Vertex nro " << nv;
+ if (shape==NULL)
+ {
+ cout << " absent : ";
+ PutCoord (point);
+ }
+ else
+ {
+ cout << " : Subid = " << shape->getIdent() << endl;
+ }
+ }
+ return NOTHING;
+ }
+
+ clearAssociation ();
+ addAssociation (gline, 0, 1);
+ return gline->getIdent();
+}
+// ========================================================= setAssociation
+int Edge::setAssociation (NewShape* geom, int subid)
+{
+ if (geom == NULL)
+ {
+ if (el_root->debug ())
+ cout << " Edge " << el_name << " addAssociation of NULL ignored"
+ << endl;
+ return HERR;
+ }
+
+ EdgeShape* gline = geom->findEdge (subid);
+ if (gline == NULL)
+ {
+ if (el_root->debug ())
+ cout << " Edge " << el_name << " addAssociation bad subid : "
+ << subid << endl;
+ return HERR;
+ }
+
+ Real3 p1, p2, pa, pb;
+ gline->getCoords (p1, p2);
+ e_vertex [V_AMONT]-> getAssoCoord (pa);
+ e_vertex [V_AVAL ]-> getAssoCoord (pb);
+
+ double da1 = calc_d2 (pa, p1);
+ double da2 = calc_d2 (pa, p2);
+ double db1 = calc_d2 (pb, p1);
+ double db2 = calc_d2 (pb, p2);
+
+ cout << "setAssociation " << el_name << " :" <<endl;
+
+ if (da2 < da1 && db1 < db2)
+ {
+ e_vertex [V_AMONT]->setAssociation (p2);
+ e_vertex [V_AVAL ]->setAssociation (p1);
+ }
+ else
+ {
+ e_vertex [V_AMONT]->setAssociation (p1);
+ e_vertex [V_AVAL ]->setAssociation (p2);
+ }
+
+
+ clearAssociation ();
+ int ier = addAssociation (gline, 0, 1);
+ return ier;
+}
END_NAMESPACE_HEXA
public:
virtual Vertex* getVertex (int nro);
- int addAssociation (NewShape* geom, int subid, double deb, double fin);
+ int addAssociation (NewShape* geom, int subid, double deb, double fin);
+ int setAssociation (NewShape* geom, int subid);
+ int findAssociation (NewShape* geom);
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 ()
// ========================================================= samePoints
bool EdgeShape::samePoints (double* point1, double* point2)
{
- const double Epsilon2 = 1e-6;
+ const double Epsilon2 = 1e-4;
bool rep = same_coords (point1, point2, Epsilon2);
return rep;
}
else
return NOTHING;
}
+// ========================================================= definedBy
+bool EdgeShape::definedBy (double p1[], double p2[])
+{
+ if (maj_curve)
+ updateCurve ();
+
+ bool rep = false;
+ if (samePoints (p1, lin_start))
+ rep = samePoints (p2, lin_end);
+ else if (samePoints (p1, lin_end))
+ rep = samePoints (p2, lin_start);
+ return rep;
+}
// ========================================================= getParam
double EdgeShape::getParam (double* coord)
{
return -1.0;
GeomAdaptor_Curve adapt_curve (handle);
- kind_of = (EnumKindOfShape) (adapt_curve.GetType() + 1);
/******************
enum GeomAbs_CurveType { GeomAbs_Line, GeomAbs_Circle, GeomAbs_Ellipse,
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();
+#ifndef NO_CASCADE
+ 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;
+ }
+#endif
+}
+// ====================================================== 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 definedBy (double p1[], double p2[]);
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;
}
return NULL;
}
+// ====================================================== findVertex
+VertexShape* NewShape::findVertex (double point[])
+{
+ int nbre = tab_vertex.size ();
+ for (int nro=0 ; nro < nbre ; nro++)
+ {
+ VertexShape* shape = tab_vertex [nro];
+ if (shape->definedBy (point))
+ return shape;
+ }
+ return NULL;
+}
// ====================================================== findEdge
EdgeShape* NewShape::findEdge (int shid)
{
}
return NULL;
}
+// ====================================================== findEdge
+EdgeShape* NewShape::findEdge (double p1[], double p2[])
+{
+ int nbre = tab_edge.size ();
+ for (int nro=0 ; nro < nbre ; nro++)
+ {
+ EdgeShape* shape = tab_edge [nro];
+ if (shape->definedBy (p1, p2))
+ return shape;
+ }
+ return NULL;
+}
// ====================================================== findFace
FaceShape* NewShape::findFace (int shid)
{
void addAssociation (Quad* elt, int subid);
VertexShape* findVertex (int subid);
+ VertexShape* findVertex (double point[]);
EdgeShape* findEdge (int subid);
+ EdgeShape* findEdge (double p1[], double p2[]);
FaceShape* findFace (int subid);
SubShape* findSubShape (int subid);
+
const TopoDS_Shape& getGeoShape (int subid);
int saveBrep ();
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 ();
py = ss_coord[dir_y];
pz = ss_coord[dir_z];
}
+#if 0
// ====================================================== getShape
const TopoDS_Shape& VertexShape::getShape()
{
return SubShape::getShape ();
}
+#endif
// ====================================================== addAssociation
void VertexShape::addAssociation (Vertex* elt)
{
else
return NULL;
}
+// ====================================================== definedBy
+bool VertexShape::definedBy (double point[])
+{
+ if (maj_coords)
+ updateCoords ();
+
+ const double Epsilon2 = 1e-4;
+ bool rep = same_coords (point, ss_coord, Epsilon2);
+ return rep;
+}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ====================================================== saveXml
void VertexShape::saveXml (XmlWriter* xml)
void getCoords (double& px, double& py, double& pz);
void saveXml (XmlWriter* xml);
- virtual const TopoDS_Shape& getShape(); // #mbarry
+ // virtual const TopoDS_Shape& getShape(); // #mbarry
+ bool definedBy (double point[]);
private :
void updateCoords ();
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 };
HexaExport double calc_norme (double v1[]);
HexaExport double calc_distance (double v1[], double v2[]);
+HexaExport double calc_d2 (double v1[], double v2[]);
HexaExport void calc_vecteur (double pta[], double ptb[], double vab[]);
HexaExport void copy_vecteur (double va [], double vb []);
HexaExport void calc_milieu (double pta[], double ptb[], double milieu[]);
Real3 vv = { v2[dir_x]-v1[dir_x], v2[dir_y]-v1[dir_y], v2[dir_z]-v1[dir_z] };
return calc_norme (vv);
}
+// ======================================================== calc_d2
+double calc_d2 (double v1[], double v2[])
+{
+ double dd = carre (v2[dir_x]-v1[dir_x]) + carre (v2[dir_y]-v1[dir_y])
+ + carre (v2[dir_z]-v1[dir_z]);
+ return dd;
+}
// ========================================================= calc_vecteur
void calc_vecteur (double pta[], double ptb[], double vab[])
{
#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;
}
#include <QModelIndex>
#include <QDockWidget>
-
#include "klinkitemselectionmodel.hxx"
#include <OB_Browser.h>
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 "HEXABLOCKGUI_Browser.hxx"
+#include "HEXABLOCKGUI.hxx"
+
+#include "Hex.hxx"
+#include "HexDocument.hxx"
+
+#include <LightApp_Module.h>
+#include <LightApp_Study.h>
+#include <LightApp_Application.h>
+#include <LightApp_DataModel.h>
+#include <LightApp_DataObject.h>
+
+// --------------------------------------------------- classe SaLObject
+class SalObject : public LightApp_DataObject
+{
+public :
+ SalObject (cpchar nom="") : LightApp_DataObject (NULL)
+ { obj_name = nom ; obj_entry = "6.6.66" ; }
+
+ virtual ~SalObject () { cout << "SalObject::delete" << endl ; }
+ virtual QString name () const { return obj_name ; }
+ virtual QString entry () const { return obj_entry ; }
+ void rename (cpchar nom) { obj_name = nom ; }
+
+private :
+ QString obj_name;
+ QString obj_entry;
+};
+//--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
+// --------------------------------------------------- classe SaLModel
+class SalModel : public LightApp_DataModel
+{
+public :
+ SalModel (HEXABLOCKGUI* guy);
+ void clear ();
+ void addItem (cpchar fils);
+
+private :
+ CAM_ModuleObject* obj_root;
+};
+
+// =================================================== Constructeur SalModel
+SalModel::SalModel (HEXABLOCKGUI* guy)
+ : LightApp_DataModel (guy)
+{
+/* **********************************************
+ LightApp_Study* study = (LightApp_Study*) guy->activeStudy();
+ obj_root = createModuleObject (study->root());
+
+ obj_root ->setDataModel (this);
+ setRoot (obj_root);
+
+ SalObject* obj1 = new SalObject ("Document1");
+ SalObject* obj2 = new SalObject ("Document2");
+
+ PutData (obj1->name ().toStdString());
+ PutData (obj2->name ().toStdString());
+
+ obj_root->appendChild (obj1);
+ obj_root->appendChild (obj2);
+ PutData (obj_root->childCount());
+
+ ********************************************** */
+}
+// ================================================================ clear
+void SalModel::clear ()
+{
+ const bool nodel = false;
+ while (true)
+ {
+ SUIT_DataObject* obj = obj_root->firstChild ();
+ if (obj==NULL)
+ return;
+ obj_root->removeChild (obj, nodel);
+ cout << " Delete object " << obj->name ().toStdString()
+ << endl;
+ }
+}
+// ================================================================ addItem
+void SalModel::addItem (cpchar name)
+{
+ SalObject* obj1 = new SalObject (name);
+ obj_root->appendChild (obj1);
+}
+//--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
+// =================================================== Constructeur H.G.Browser
+HEXABLOCKGUI_Browser::HEXABLOCKGUI_Browser (HEXABLOCKGUI* guy)
+{
+ hexa_gui = guy;
+ hexa_root = HEXA_NS::Hex::getInstance ();
+ data_model = NULL;
+}
+
+// =============================================================== rebuildTree
+void HEXABLOCKGUI_Browser::rebuildTree ()
+{
+ if (data_model==NULL)
+ data_model = new SalModel (hexa_gui);
+
+ data_model->clear ();
+
+ int nbre = hexa_root->countDocument ();
+ for (int nro=0 ; nro<nbre ; nro++)
+ {
+ Document* doc = hexa_root->getDocument (nro);
+ cpchar nom = doc->getName ();
+ data_model->addItem (nom);
+ }
+
+ hexa_gui->updateObjBrowser( true );
+}
+
--- /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_BROWSER_HXX_
+#define _HEXABLOCKGUI_BROWSER_HXX_
+
+//--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
+
+#include "hexa_base.hxx"
+#include "HEXABLOCKGUI_Export.hxx"
+
+using namespace Hex;
+
+class HEXABLOCKGUI;
+class SalModel;
+
+class HEXABLOCK_EXPORT HEXABLOCKGUI_Browser
+{
+public :
+ HEXABLOCKGUI_Browser (HEXABLOCKGUI* dad);
+ void rebuildTree ();
+
+
+private :
+ Hex::Hex* hexa_root;
+ SalModel* data_model;
+ HEXABLOCKGUI* hexa_gui;
+};
+#endif
#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 );
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);
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,
public Ui::VertexDialog
{
void updateHelpFileName();
private slots:
- //void addQuad();
+ void addQuad();
void removeQuad();
- //void clearQuads();
+ void clearQuads();
};
void updateHelpFileName();
private slots:
- //void addQuad();
+ void addQuad();
void removeQuad();
- //void clearQuads();
+ void clearQuads();
};
void _initInputWidget( Mode editmode );
protected slots:
- //void updateHelpFileName();
+ void updateHelpFileName();
void deletePropagationItem();
virtual void selectElementOfModel();
protected slots:
void deleteQuadItem();
+ void deleteQuadItem2();
void updateButtonBox();
+ void updateHelpFileName();
private:
HEXA_NS::Elements *_value;
#include "HEXABLOCKGUI_Export.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"
#ifndef _HEXABLOCKGUI_MODEL_HXX_
#define _HEXABLOCKGUI_MODEL_HXX_
-#include <SalomeApp_DataModel.h>
+#include "HEXABLOCKGUI_Export.hxx"
-#include "hexa_base.hxx"
+#include <SalomeApp_DataModel.h>
-class HexaExport HEXABLOCKGUI_Model : public SalomeApp_DataModel
+class HEXABLOCK_EXPORT HEXABLOCKGUI_Model : public SalomeApp_DataModel
{
public:
HEXABLOCKGUI_Model(CAM_Module* theModule);
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
rad2degres = _hexablock_swig.rad2degres
calc_norme = _hexablock_swig.calc_norme
calc_distance = _hexablock_swig.calc_distance
+calc_d2 = _hexablock_swig.calc_d2
calc_vecteur = _hexablock_swig.calc_vecteur
copy_vecteur = _hexablock_swig.copy_vecteur
calc_milieu = _hexablock_swig.calc_milieu
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)
__repr__ = _swig_repr
def getVertex(*args): return _hexablock_swig.Edge_getVertex(*args)
def addAssociation(*args): return _hexablock_swig.Edge_addAssociation(*args)
+ def setAssociation(*args): return _hexablock_swig.Edge_setAssociation(*args)
+ def findAssociation(*args): return _hexablock_swig.Edge_findAssociation(*args)
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_calc_d2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ double *arg1 ;
+ double *arg2 ;
+ double result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:calc_d2",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "calc_d2" "', argument " "1"" of type '" "double []""'");
+ }
+ arg1 = reinterpret_cast< double * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "calc_d2" "', argument " "2"" of type '" "double []""'");
+ }
+ arg2 = reinterpret_cast< double * >(argp2);
+ result = (double)Hex::calc_d2(arg1,arg2);
+ resultobj = SWIG_From_double(static_cast< double >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_calc_vecteur(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
double *arg1 ;
}
+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_setAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ Hex::Edge *arg1 = (Hex::Edge *) 0 ;
+ Hex::NewShape *arg2 = (Hex::NewShape *) 0 ;
+ int arg3 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Edge_setAssociation",&obj0,&obj1,&obj2)) 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_setAssociation" "', argument " "1"" of type '" "Hex::Edge *""'");
+ }
+ arg1 = reinterpret_cast< Hex::Edge * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__NewShape, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Edge_setAssociation" "', argument " "2"" of type '" "Hex::NewShape *""'");
+ }
+ arg2 = reinterpret_cast< Hex::NewShape * >(argp2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Edge_setAssociation" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = static_cast< int >(val3);
+ result = (int)(arg1)->setAssociation(arg2,arg3);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Edge_findAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ Hex::Edge *arg1 = (Hex::Edge *) 0 ;
+ Hex::NewShape *arg2 = (Hex::NewShape *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Edge_findAssociation",&obj0,&obj1)) 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_findAssociation" "', argument " "1"" of type '" "Hex::Edge *""'");
+ }
+ arg1 = reinterpret_cast< Hex::Edge * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__NewShape, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Edge_findAssociation" "', argument " "2"" of type '" "Hex::NewShape *""'");
+ }
+ arg2 = reinterpret_cast< Hex::NewShape * >(argp2);
+ result = (int)(arg1)->findAssociation(arg2);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_Edge_clearAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
Hex::Edge *arg1 = (Hex::Edge *) 0 ;
}
+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 ;
PyObject *resultobj = 0;
Hex::Document *arg1 = (Hex::Document *) 0 ;
Hex::Quads arg2 ;
- Hex::Vertex *arg3 = (Hex::Vertex *) 0 ;
+ Hex::Quads arg3 ;
Hex::Vertex *arg4 = (Hex::Vertex *) 0 ;
Hex::Vertex *arg5 = (Hex::Vertex *) 0 ;
Hex::Vertex *arg6 = (Hex::Vertex *) 0 ;
Hex::Vertex *arg7 = (Hex::Vertex *) 0 ;
- Hex::Vertex *arg8 = (Hex::Vertex *) 0 ;
Hex::Elements *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
- void *argp3 = 0 ;
- int res3 = 0 ;
void *argp4 = 0 ;
int res4 = 0 ;
void *argp5 = 0 ;
int res6 = 0 ;
void *argp7 = 0 ;
int res7 = 0 ;
- void *argp8 = 0 ;
- int res8 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj4 = 0 ;
PyObject * obj5 = 0 ;
PyObject * obj6 = 0 ;
- PyObject * obj7 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:Document_replace",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_replace",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_replace" "', argument " "1"" of type '" "Hex::Document *""'");
arg2 = *ptr;
if (SWIG_IsNewObj(res)) delete ptr;
}
- res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 );
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_replace" "', argument " "3"" of type '" "Hex::Vertex *""'");
+ {
+ std::vector<Hex::Quad*,std::allocator<Hex::Quad * > > *ptr = (std::vector<Hex::Quad*,std::allocator<Hex::Quad * > > *)0;
+ int res = swig::asptr(obj2, &ptr);
+ if (!SWIG_IsOK(res) || !ptr) {
+ SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_replace" "', argument " "3"" of type '" "Hex::Quads""'");
+ }
+ arg3 = *ptr;
+ if (SWIG_IsNewObj(res)) delete ptr;
}
- arg3 = reinterpret_cast< Hex::Vertex * >(argp3);
res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 );
if (!SWIG_IsOK(res4)) {
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_replace" "', argument " "4"" of type '" "Hex::Vertex *""'");
SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_replace" "', argument " "7"" of type '" "Hex::Vertex *""'");
}
arg7 = reinterpret_cast< Hex::Vertex * >(argp7);
- res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_Hex__Vertex, 0 | 0 );
- if (!SWIG_IsOK(res8)) {
- SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "Document_replace" "', argument " "8"" of type '" "Hex::Vertex *""'");
- }
- arg8 = reinterpret_cast< Hex::Vertex * >(argp8);
- result = (Hex::Elements *)(arg1)->replace(arg2,arg3,arg4,arg5,arg6,arg7,arg8);
+ result = (Hex::Elements *)(arg1)->replace(arg2,arg3,arg4,arg5,arg6,arg7);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 );
return resultobj;
fail:
{ (char *)"rad2degres", _wrap_rad2degres, METH_VARARGS, NULL},
{ (char *)"calc_norme", _wrap_calc_norme, METH_VARARGS, NULL},
{ (char *)"calc_distance", _wrap_calc_distance, METH_VARARGS, NULL},
+ { (char *)"calc_d2", _wrap_calc_d2, METH_VARARGS, NULL},
{ (char *)"calc_vecteur", _wrap_calc_vecteur, METH_VARARGS, NULL},
{ (char *)"copy_vecteur", _wrap_copy_vecteur, METH_VARARGS, NULL},
{ (char *)"calc_milieu", _wrap_calc_milieu, METH_VARARGS, NULL},
{ (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 *)"Vertex_swigregister", Vertex_swigregister, METH_VARARGS, NULL},
{ (char *)"Edge_getVertex", _wrap_Edge_getVertex, METH_VARARGS, NULL},
{ (char *)"Edge_addAssociation", _wrap_Edge_addAssociation, METH_VARARGS, NULL},
+ { (char *)"Edge_setAssociation", _wrap_Edge_setAssociation, METH_VARARGS, NULL},
+ { (char *)"Edge_findAssociation", _wrap_Edge_findAssociation, 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)));