X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHEXABLOCK%2FHexBiCylinder.hxx;h=8f566a61cef9db1f1d87d26f2eca2553cbcd1bf5;hb=f3d5693095483a5028dc812cee8697096159690b;hp=b26e22153776c49b1c7c4ae2a77d86ad01cbdbb9;hpb=6b02c4b9784848b0a660e0e54f88447af8433c50;p=modules%2Fhexablock.git diff --git a/src/HEXABLOCK/HexBiCylinder.hxx b/src/HEXABLOCK/HexBiCylinder.hxx index b26e221..8f566a6 100755 --- a/src/HEXABLOCK/HexBiCylinder.hxx +++ b/src/HEXABLOCK/HexBiCylinder.hxx @@ -1,24 +1,23 @@ // Class : Gestion des tutaux en T (like castles in scotland) -// Copyright (C) 2009-2011 CEA/DEN, EDF R&D +// Copyright (C) 2009-2014 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 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, or (at your option) any later version. // -// 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. +// 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 +// 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef __BI_CYLINDER_H_ #define __BI_CYLINDER_H_ @@ -28,19 +27,11 @@ BEGIN_NAMESPACE_HEXA -class BiCylinder : public Elements +class HexaExport BiCylinder : public Elements { -public: - virtual int countHexa () { return nbr_hexas ; } - virtual int countQuad () { return nbr_quads ; } - virtual int countEdge () { return nbr_edges ; } - virtual int countVertex () { return nbr_vertex ; } - public: BiCylinder (Document* doc); - virtual ~BiCylinder () {} - Hexa* getHexaIJK (int part, int nx, int ny, int nz); Quad* getQuadIJ (int part, int nx, int ny, int nz); Quad* getQuadJK (int part, int nx, int ny, int nz); @@ -50,22 +41,38 @@ public: Edge* getEdgeK (int part, int nx, int ny, int nz); Vertex* getVertexIJK (int part, int nx, int ny, int nz); +#ifndef SWIG +public : + virtual ~BiCylinder () {} // Tutaux en T (like castles in scotland) - int crossCylinders (Cylinder* cyl1, Cylinder* cyl2); + int makeCylinders (Vertex* ori1, double* vz1, double ray1, double h1, + Vertex* ori2, double* vz2, double ray2, double h2); + + int makePipes (Vertex* ori1, double* z1, double ri1, double rx1, double h1, + Vertex* ori2, double* z2, double ri2, double rx2, double h2, + bool fill=false); + + virtual int countHexa () { return nbr_hexas ; } + virtual int countQuad () { return nbr_quads ; } + virtual int countEdge () { return nbr_edges ; } + virtual int countVertex () { return nbr_vertex ; } + + // int crossCylinders (Cylinder* cyl1, Cylinder* cyl2); // perime private : - + enum { NbrSlices=5, NbrVslices=NbrSlices+1, NbrCotes=4 }; - void createLittleCyl (); - void createBigCyl (); - void adjustLittleSlice (int nx, int nzs); + void createLittlePipe (); + void createBigPipe (); + void adjustLittleSlice (int nx, int nzs); + void adjustLittleSquare (int nk); - Vertex* addVertex (double px, double py, double pz, + Vertex* addVertex (double px, double py, double pz, int cyl, int ni, int nj, int nk); - Edge* addEdge (Vertex* v1, Vertex* v2, + Edge* addEdge (Vertex* v1, Vertex* v2, int cyl, int dir, int nx, int ny, int nz); - Quad* addQuad (Edge* e1, Edge* e2, Edge* e3, Edge* e4, + Quad* addQuad (Edge* e1, Edge* e2, Edge* e3, Edge* e4, int cyl, int dir, int nx, int ny, int nz); Hexa* addHexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf, int cyl, int nx, int ny, int nz); @@ -76,31 +83,31 @@ private : Quad* findQuad (Edge* e1, Edge* e2, int dir, int nx, int ny, int nz); Hexa* findHexa (Quad* qa, Quad* qb, int nx, int ny, int nz); - Edge* findEdge (Vertex* v1, Vertex* v2); - Quad* findQuad (Edge* e1, Edge* e2); + Edge* findEdge (Vertex* v1, Vertex* v2); // A replacer dans HexElements - void assoCylinder (int cyl, double* normal); - void assoCylinders (double* snormal, double* gnormal); + void assoCylinders (); void assoSlice (int cyl, int nx, int nzs, double* norm); - void assoArc (int cyl, int nx, int ny, int nz, string& brep, double ray); - int assoIntersection (int nx, int nzlice, double* snorm, double* bnorm); + void assoArc (int cyl, int nx, int ny, int nz, int subid); + void assoArc (int cyl, int ny, Vertex* v1, Vertex* v2, int subid); + int assoIntersection (int nx, int nzlice); void addSlice (int cyl, int i, int k, double h, double r, bool find=false); - void fillSlice (int cyl, int nia, int nka, int nib, int nkb, int nic, + void addCarre (int cyl, int k, double h, double r, bool find=false); + void addCube (int cyl, int k, int i=0, int k1=-1); + void fillSlice (int cyl, int nia, int nka, int nib, int nkb, int nic, int nkc, int nid, int nkd, bool med=false); - void fillSmallCyl (); double getAngle (int nj) { return (2*((nj)%4)+1)*M_PI/4; } - int getKey (int cyl, int ni, int nj, int nk) + int getKey (int cyl, int ni, int nj, int nk) { return 1000*(cyl+1) + 100*ni + 10*nj + nk; } - int getKey (int cyl, int dd, int ni, int nj, int nk) + int getKey (int cyl, int dd, int ni, int nj, int nk) { return 10000*(cyl+1) + 1000*dd + 100*ni + 10*nj + nk; } private : - Cylinder* cross_cyl1; // Petit - Cylinder* cross_cyl2; // gros Real3 cross_center; - + Real3 cross_oribig, cross_dirbig; + Real3 cross_orismall, cross_dirsmall; + map map_vertex, map_edge, map_quad, map_hexa; map :: iterator it_map; @@ -110,6 +117,9 @@ private : double cross_hauteur [V_TWO]; bool at_right, at_left; + + NewShape* grid_geom; +#endif }; END_NAMESPACE_HEXA #endif