From 175cce9a07f43a5d440082133ef76bd949c97145 Mon Sep 17 00:00:00 2001 From: abuhsing Date: Wed, 4 Dec 2013 11:49:22 +0000 Subject: [PATCH] Abu : evol Associations Modified Files: Tag: V7_main src/HEXABLOCK/HexDocument.hxx src/HEXABLOCK/HexDocument_quads.cxx src/HEXABLOCK/HexDocument_v6.cxx src/HEXABLOCK/HexEdge.cxx src/HEXABLOCK/HexEdge.hxx src/HEXABLOCK/HexEdgeShape.cxx src/HEXABLOCK/HexEdgeShape.hxx src/HEXABLOCK/HexNewShape.cxx src/HEXABLOCK/HexNewShape.hxx src/HEXABLOCK/HexVertexShape.cxx src/HEXABLOCK/HexVertexShape.hxx src/HEXABLOCK/hexa_base.hxx src/HEXABLOCK/hexa_utils.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx src/HEXABLOCK_SWIG/hexablock_swig.py src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc ---------------------------------------------------------------------- --- src/HEXABLOCK/HexDocument.hxx | 19 ++- src/HEXABLOCK/HexDocument_quads.cxx | 22 ++- src/HEXABLOCK/HexDocument_v6.cxx | 18 --- src/HEXABLOCK/HexEdge.cxx | 85 +++++++++++ src/HEXABLOCK/HexEdge.hxx | 4 +- src/HEXABLOCK/HexEdgeShape.cxx | 19 ++- src/HEXABLOCK/HexEdgeShape.hxx | 1 + src/HEXABLOCK/HexNewShape.cxx | 24 ++++ src/HEXABLOCK/HexNewShape.hxx | 3 + src/HEXABLOCK/HexVertexShape.cxx | 12 ++ src/HEXABLOCK/HexVertexShape.hxx | 3 +- src/HEXABLOCK/hexa_base.hxx | 1 + src/HEXABLOCK/hexa_utils.cxx | 7 + .../HEXABLOCKGUI_DocumentPanel.hxx | 1 + src/HEXABLOCK_SWIG/hexablock_swig.py | 3 + src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc | 134 +++++++++++++++--- 16 files changed, 307 insertions(+), 49 deletions(-) diff --git a/src/HEXABLOCK/HexDocument.hxx b/src/HEXABLOCK/HexDocument.hxx index 9a2307d..4a02ca5 100755 --- a/src/HEXABLOCK/HexDocument.hxx +++ b/src/HEXABLOCK/HexDocument.hxx @@ -107,11 +107,8 @@ public : 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* replaceHexas (Quads pattern, Quads cible, 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); @@ -304,6 +301,18 @@ public : 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 (); diff --git a/src/HEXABLOCK/HexDocument_quads.cxx b/src/HEXABLOCK/HexDocument_quads.cxx index 7470fbc..746d4a4 100755 --- a/src/HEXABLOCK/HexDocument_quads.cxx +++ b/src/HEXABLOCK/HexDocument_quads.cxx @@ -591,11 +591,11 @@ Hexa* Document::addHexaQuadsACDE (AnaQuads& strquads) 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); @@ -608,6 +608,22 @@ Elements* Document::replace (Quads pattern, Vertex* p1, Vertex* c1, 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) { diff --git a/src/HEXABLOCK/HexDocument_v6.cxx b/src/HEXABLOCK/HexDocument_v6.cxx index 29e8be2..a8ba2e6 100644 --- a/src/HEXABLOCK/HexDocument_v6.cxx +++ b/src/HEXABLOCK/HexDocument_v6.cxx @@ -1144,22 +1144,4 @@ Elements* Document::cut (Edge* edge, RealVector& tlen) DumpReturn (grid); return grid; } -// ========================================================= replaceHexas -Elements* Document::replaceHexas (Quads pattern, Quads cible, Vertex* p1, - Vertex* c1, Vertex* p2, Vertex* c2, - Vertex* p3, Vertex* c3) -{ - DumpStart ("replace", pattern << cible << p1 << c1 << p2 << c2 << p3 << c3); - - Elements* t_hexas = new Elements (this); - - //if (BadElement (edge)) - { - t_hexas->setError (HERR); - Mess << "This function is not yet implemented"; - } - - DumpReturn (t_hexas); - return t_hexas; -} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexEdge.cxx b/src/HEXABLOCK/HexEdge.cxx index e0e34a3..b5c5404 100755 --- a/src/HEXABLOCK/HexEdge.cxx +++ b/src/HEXABLOCK/HexEdge.cxx @@ -28,6 +28,7 @@ #include "HexXmlWriter.hxx" #include "HexNewShape.hxx" #include "HexAssoEdge.hxx" +#include "HexVertexShape.hxx" static int niveau = 0; @@ -526,4 +527,88 @@ double Edge::getLength () 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 << " :" <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 diff --git a/src/HEXABLOCK/HexEdge.hxx b/src/HEXABLOCK/HexEdge.hxx index e86ea12..8b60c1f 100755 --- a/src/HEXABLOCK/HexEdge.hxx +++ b/src/HEXABLOCK/HexEdge.hxx @@ -31,7 +31,9 @@ class HexaExport Edge : public EltBase 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 ; } diff --git a/src/HEXABLOCK/HexEdgeShape.cxx b/src/HEXABLOCK/HexEdgeShape.cxx index b652529..0b90d6b 100755 --- a/src/HEXABLOCK/HexEdgeShape.cxx +++ b/src/HEXABLOCK/HexEdgeShape.cxx @@ -134,7 +134,7 @@ int EdgeShape::getPoint (double param, double* point) // ========================================================= 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; } @@ -151,6 +151,19 @@ int EdgeShape::onExtremity (double* point) 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) { @@ -244,14 +257,14 @@ void EdgeShape::updateCurve () 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; - PutData (lin_radius); - PutData (lin_angle); } +#endif } // ====================================================== getAngle double EdgeShape::getAngle () diff --git a/src/HEXABLOCK/HexEdgeShape.hxx b/src/HEXABLOCK/HexEdgeShape.hxx index 4c5404c..38f1062 100644 --- a/src/HEXABLOCK/HexEdgeShape.hxx +++ b/src/HEXABLOCK/HexEdgeShape.hxx @@ -27,6 +27,7 @@ public : 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[]); diff --git a/src/HEXABLOCK/HexNewShape.cxx b/src/HEXABLOCK/HexNewShape.cxx index 7f109cf..3018526 100755 --- a/src/HEXABLOCK/HexNewShape.cxx +++ b/src/HEXABLOCK/HexNewShape.cxx @@ -291,6 +291,18 @@ VertexShape* NewShape::findVertex (int shid) } 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) { @@ -303,6 +315,18 @@ 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) { diff --git a/src/HEXABLOCK/HexNewShape.hxx b/src/HEXABLOCK/HexNewShape.hxx index eb57659..2dec047 100644 --- a/src/HEXABLOCK/HexNewShape.hxx +++ b/src/HEXABLOCK/HexNewShape.hxx @@ -51,11 +51,14 @@ public : // for Others 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 (); diff --git a/src/HEXABLOCK/HexVertexShape.cxx b/src/HEXABLOCK/HexVertexShape.cxx index d532eb2..2e06e05 100755 --- a/src/HEXABLOCK/HexVertexShape.cxx +++ b/src/HEXABLOCK/HexVertexShape.cxx @@ -83,6 +83,7 @@ void VertexShape::getCoords (double& px, double& py, double& pz) py = ss_coord[dir_y]; pz = ss_coord[dir_z]; } +#if 0 // ====================================================== getShape const TopoDS_Shape& VertexShape::getShape() { @@ -97,6 +98,7 @@ const TopoDS_Shape& VertexShape::getShape() return SubShape::getShape (); } +#endif // ====================================================== addAssociation void VertexShape::addAssociation (Vertex* elt) { @@ -111,6 +113,16 @@ Vertex* VertexShape::getAssociation (int nro) 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) diff --git a/src/HEXABLOCK/HexVertexShape.hxx b/src/HEXABLOCK/HexVertexShape.hxx index a04a843..549b9bc 100644 --- a/src/HEXABLOCK/HexVertexShape.hxx +++ b/src/HEXABLOCK/HexVertexShape.hxx @@ -21,7 +21,8 @@ public : 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 (); diff --git a/src/HEXABLOCK/hexa_base.hxx b/src/HEXABLOCK/hexa_base.hxx index 10b62be..32065ea 100755 --- a/src/HEXABLOCK/hexa_base.hxx +++ b/src/HEXABLOCK/hexa_base.hxx @@ -263,6 +263,7 @@ HexaExport inline double rad2degres (double angle) { return (angle*180.0/M_PI 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[]); diff --git a/src/HEXABLOCK/hexa_utils.cxx b/src/HEXABLOCK/hexa_utils.cxx index 7188589..cf05020 100755 --- a/src/HEXABLOCK/hexa_utils.cxx +++ b/src/HEXABLOCK/hexa_utils.cxx @@ -104,6 +104,13 @@ double calc_distance (double v1[], double v2[]) 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[]) { diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx index 83254b6..ee6110f 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx @@ -957,6 +957,7 @@ class HexaExport EdgeAssocDialog : public HexaBaseDialog, void deleteQuadItem(); void deleteQuadItem2(); void updateButtonBox(); + void updateHelpFileName(); private: HEXA_NS::Elements *_value; diff --git a/src/HEXABLOCK_SWIG/hexablock_swig.py b/src/HEXABLOCK_SWIG/hexablock_swig.py index 856b6d0..4453b2f 100644 --- a/src/HEXABLOCK_SWIG/hexablock_swig.py +++ b/src/HEXABLOCK_SWIG/hexablock_swig.py @@ -547,6 +547,7 @@ deg2radians = _hexablock_swig.deg2radians 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 @@ -667,6 +668,8 @@ class Edge(EltBase): __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) diff --git a/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc b/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc index 556a6aa..fa1932d 100644 --- a/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc +++ b/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc @@ -17136,6 +17136,37 @@ fail: } +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 ; @@ -19816,6 +19847,77 @@ fail: } +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 ; @@ -23401,17 +23503,14 @@ SWIGINTERN PyObject *_wrap_Document_replace(PyObject *SWIGUNUSEDPARM(self), PyOb 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 ; @@ -23420,8 +23519,6 @@ SWIGINTERN PyObject *_wrap_Document_replace(PyObject *SWIGUNUSEDPARM(self), PyOb int res6 = 0 ; void *argp7 = 0 ; int res7 = 0 ; - void *argp8 = 0 ; - int res8 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; @@ -23429,9 +23526,8 @@ SWIGINTERN PyObject *_wrap_Document_replace(PyObject *SWIGUNUSEDPARM(self), PyOb 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 *""'"); @@ -23446,11 +23542,15 @@ SWIGINTERN PyObject *_wrap_Document_replace(PyObject *SWIGUNUSEDPARM(self), PyOb 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 > *ptr = (std::vector > *)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 *""'"); @@ -23471,12 +23571,7 @@ SWIGINTERN PyObject *_wrap_Document_replace(PyObject *SWIGUNUSEDPARM(self), PyOb 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: @@ -31487,6 +31582,7 @@ static PyMethodDef SwigMethods[] = { { (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}, @@ -31565,6 +31661,8 @@ static PyMethodDef SwigMethods[] = { { (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}, -- 2.39.2