Salome HOME
Bug moteur + ajout cas test
[modules/hexablock.git] / src / HEXABLOCK / HexElements_ter.cxx
index 4cb09dfaaa093dcd327966a6beb04e00c57b4746..1c129cb3bc49c32f958d7ca7517e8cb102848f4f 100755 (executable)
 
 BEGIN_NAMESPACE_HEXA
 
-// static bool db=false;
+static bool db=false;
 
-// ====================================================== makeRind
-int Elements::makeRind (EnumGrid type, Vertex* center, Vector* vx, Vector* vz,
-                        double radext, double radint, double radhole,
-                       Vertex* plorig, double angle, int nr, int na, int nl)
-{
-   double phi1;
-   int ier = controlRind (type, center, vx, vz, radext, radint, radhole,
-                          plorig, angle, nr, na, nl, cyl_phi0, phi1);
-   if (ier!=HOK)
-      return ier;
-
-   resize (type, nr, na, nl);
-
-   cyl_radext  = radext;
-   cyl_radint  = radint;
-   cyl_radhole = radhole;
-   cyl_closed  = type==GR_HEMISPHERIC || type==GR_RIND;
-
-   double theta  = cyl_closed ? 2*M_PI : M_PI*angle/180;
-   cyl_dphi      = (phi1-cyl_phi0)/ size_hz;
-   cyl_dtheta    = theta / size_hy;
-
-   int nb_secteurs = cyl_closed ? size_vy-1 : size_vy;
-
-   for (int ny=0 ; ny<nb_secteurs ; ny++)
-       for (int nx=0 ; nx<size_vx ; nx++)
-           for (int nz=0 ; nz<size_vz ; nz++)
-               {
-               double px, py, pz;
-               getCylPoint (nx, ny, nz, px, py, pz);
-               Vertex* node = el_root->addVertex (px, py, pz);
-               setVertex (node, nx, ny, nz);
-               }
-   if (cyl_closed)
-      for (int nx=0 ; nx<size_vx ; nx++)
-          for (int nz=0 ; nz<size_vz ; nz++)
-              {
-              Vertex* node = getVertexIJK (nx, 0, nz);
-              setVertex (node, nx, size_vy-1, nz);
-              }
-
-   transfoVertices (center, vx, vz);
-   fillGrid ();
-   assoCylinder (center, vz, angle);
-   return HOK;
-}
 // ====================================================== getCylPoint
 int Elements::getCylPoint (int nr, int na, int nh, double& px, double& py,
                            double& pz)
@@ -249,8 +203,9 @@ void Elements::assoCylinders (double* ori, double* vk, double angle,
                double pmax = t_angles [ny+1]/360;
                Edge*  edge = getEdgeJ (nx, ny, nz);
                geom->addAssociation (edge, subid, pmin, pmax);
-               cout << " assoCylinders : ny= " << ny << ", nz= " << nz 
-                    << " param = (" << pmin << ", " << pmax  << ")\n";
+               if (db) cout << " assoCylinders : ny= " << ny 
+                            << ", nz= " << nz << " param = (" 
+                            << pmin << ", " << pmax  << ")\n";
                }
            }
        }
@@ -356,7 +311,7 @@ void Elements::assoCircle (double* center, Edge* ed1, Edge* ed2, NewShape* geom)
    double rayon = calc_norme (oa);
    int    subid = geom->addCircle (center, rayon, normal, oa);
 
-   const double alpha = atan (sqrt(2)/2)/M_PI; //  angle proche de 70.528 degres
+   const double alpha = atan (sqrt(2.)/2)/M_PI; //  angle proche de 70.528 degres
    // asso1->setBounds (0,   alpha);
    // asso2->setBounds (0.5, alpha + 0.5);