From adb442a5eab50efa5b332898f1f622bea778add9 Mon Sep 17 00:00:00 2001 From: rnv Date: Tue, 12 Mar 2019 13:25:50 +0300 Subject: [PATCH] [CEA 13302] Policy for c++ files ? using namespaces in c++ header files. boost_ptr / shared_ptr --- src/HEXABLOCK/Hex.cxx | 4 +- src/HEXABLOCK/Hex.hxx | 6 +- src/HEXABLOCK/HexBiCylinder.cxx | 2 +- src/HEXABLOCK/HexBiCylinder.hxx | 4 +- src/HEXABLOCK/HexCloner.cxx | 10 +-- src/HEXABLOCK/HexDocument.cxx | 22 ++--- src/HEXABLOCK/HexDocument.hxx | 4 +- src/HEXABLOCK/HexDocument_Xml.cxx | 88 +++++++++---------- src/HEXABLOCK/HexDocument_asso.cxx | 4 +- src/HEXABLOCK/HexDocument_quads.cxx | 68 +++++++------- src/HEXABLOCK/HexDocument_skin.cxx | 6 +- src/HEXABLOCK/HexDocument_tools.cxx | 2 +- src/HEXABLOCK/HexDumpStudy.cxx | 8 +- src/HEXABLOCK/HexDumpStudy.hxx | 10 +-- src/HEXABLOCK/HexEdge.cxx | 6 +- src/HEXABLOCK/HexEdge.hxx | 2 +- src/HEXABLOCK/HexElements.cxx | 12 +-- src/HEXABLOCK/HexElements_bis.cxx | 2 +- src/HEXABLOCK/HexElements_check.cxx | 12 +-- src/HEXABLOCK/HexElements_grid.cxx | 6 +- src/HEXABLOCK/HexElements_ter.cxx | 14 +-- src/HEXABLOCK/HexEltBase.cxx | 4 +- src/HEXABLOCK/HexEltBase.hxx | 6 +- src/HEXABLOCK/HexGroup.cxx | 2 +- src/HEXABLOCK/HexGroup.hxx | 2 +- src/HEXABLOCK/HexHexa.cxx | 2 +- src/HEXABLOCK/HexKas_functions.cxx | 18 ++-- src/HEXABLOCK/HexKas_functions.hxx | 6 +- src/HEXABLOCK/HexNewShape.cxx | 6 +- src/HEXABLOCK/HexNewShape.hxx | 2 +- src/HEXABLOCK/HexQpattern.hxx | 6 +- src/HEXABLOCK/HexQuad.cxx | 2 +- src/HEXABLOCK/HexShape.cxx | 4 +- src/HEXABLOCK/HexShape.hxx | 18 ++-- src/HEXABLOCK/HexSubShape.hxx | 4 +- src/HEXABLOCK/HexVertexShape.hxx | 2 +- src/HEXABLOCK/HexWitness.cxx | 10 +-- src/HEXABLOCK/HexXmlTree.cxx | 40 ++++----- src/HEXABLOCK/HexXmlTree.hxx | 38 ++++---- src/HEXABLOCK/HexXmlWriter.cxx | 14 +-- src/HEXABLOCK/HexXmlWriter.hxx | 6 +- src/HEXABLOCK/hexa_base.hxx | 17 ++-- src/HEXABLOCK/hexa_utils.cxx | 6 +- src/HEXABLOCK/test_hexa6.cxx | 28 +++--- .../HEXABLOCKGUI_DocumentModel.cxx | 26 +++--- .../HEXABLOCKGUI_DocumentModel.hxx | 26 +++--- src/HEXABLOCK_SWIG/hexablock_swig.i | 14 +-- src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc | 28 +++--- 48 files changed, 314 insertions(+), 315 deletions(-) diff --git a/src/HEXABLOCK/Hex.cxx b/src/HEXABLOCK/Hex.cxx index 7ee6a07..54be9d1 100644 --- a/src/HEXABLOCK/Hex.cxx +++ b/src/HEXABLOCK/Hex.cxx @@ -85,7 +85,7 @@ Document* Hex::addDocument (cpchar nomdoc) if (actif) glob->dump << nomdoc; - string name; + std::string name; makeName (nomdoc, name); Document* doc = new Document (name.c_str(), this); @@ -160,7 +160,7 @@ Document* Hex::findDocument (cpchar name) return NULL; } // ======================================================== makeName -void Hex::makeName (cpchar radical, string& name) +void Hex::makeName (cpchar radical, std::string& name) { char cnum [8]; int numero = 0; diff --git a/src/HEXABLOCK/Hex.hxx b/src/HEXABLOCK/Hex.hxx index b88056b..bac5057 100644 --- a/src/HEXABLOCK/Hex.hxx +++ b/src/HEXABLOCK/Hex.hxx @@ -45,7 +45,7 @@ public: Document* addDocument (cpchar name="default"); Document* loadDocument (cpchar name); Document* findDocument (cpchar name); - Document* findDocument (const string& name) + Document* findDocument (const std::string& name) { return findDocument (name.c_str()) ; } void what (); int sizeofMessage (); @@ -54,7 +54,7 @@ public: #ifndef SWIG int loadAllDocs (cpchar flow); int saveAllDocs (cpchar filename); - void makeName (cpchar radical, string& name); + void makeName (cpchar radical, std::string& name); void lockDump(); void restoreDump(); @@ -66,7 +66,7 @@ public: private: static Hex* first_instance; - vector liste_documents; + std::vector liste_documents; Globale* glob; #endif // not SWIG }; diff --git a/src/HEXABLOCK/HexBiCylinder.cxx b/src/HEXABLOCK/HexBiCylinder.cxx index 4584ed7..c71bd68 100644 --- a/src/HEXABLOCK/HexBiCylinder.cxx +++ b/src/HEXABLOCK/HexBiCylinder.cxx @@ -886,7 +886,7 @@ int BiCylinder::assoIntersection (int nxs, int nzs) int ier = HOK; Real3 pse, psw, sorig, sbase; Real3 pbe, pbw, borig, bbase; - string brep; + std::string brep; int ny0 = 0; int nyd = NbrCotes/2; int MiddleSlice1 = 3; diff --git a/src/HEXABLOCK/HexBiCylinder.hxx b/src/HEXABLOCK/HexBiCylinder.hxx index ea3a6dc..b225ffa 100644 --- a/src/HEXABLOCK/HexBiCylinder.hxx +++ b/src/HEXABLOCK/HexBiCylinder.hxx @@ -108,8 +108,8 @@ private : Real3 cross_oribig, cross_dirbig; Real3 cross_orismall, cross_dirsmall; - map map_vertex, map_edge, map_quad, map_hexa; - map :: iterator it_map; + std::map map_vertex, map_edge, map_quad, map_hexa; + std::map :: iterator it_map; int nbr_hexas1, nbr_quads1, nbr_edges1, nbr_vertex1; double cross_rayext [V_TWO]; diff --git a/src/HEXABLOCK/HexCloner.cxx b/src/HEXABLOCK/HexCloner.cxx index 0335362..5eddb58 100644 --- a/src/HEXABLOCK/HexCloner.cxx +++ b/src/HEXABLOCK/HexCloner.cxx @@ -34,7 +34,7 @@ BEGIN_NAMESPACE_HEXA -void transfo_brep (string& brep, Matrix* matrice, string& trep); +void transfo_brep (std::string& brep, Matrix* matrice, std::string& trep); static bool db = false; // ============================================================= Constructeur @@ -98,8 +98,8 @@ Edge* Cloner::clonerEdge (Edge* orig) for (int nro=0 ; nro < nbass ; nro++) { Shape* shape = tab_asso [nro]; - string brep = shape->getBrep(); - string trep; + std::string brep = shape->getBrep(); + std::string trep; transfo_brep (brep, matrice, trep); Shape* tshape = new Shape (trep); tshape->setBounds (shape->getStart(), shape->getEnd()); @@ -146,8 +146,8 @@ Quad* Cloner::clonerQuad (Quad* orig) for (int nro=0 ; nro < nbass ; nro++) { Shape* shape = tab_asso [nro]; - string brep = shape->getBrep(); - string trep; + std::string brep = shape->getBrep(); + std::string trep; transfo_brep (brep, matrice, trep); Shape* tshape = new Shape (trep); copie ->addAssociation (tshape); diff --git a/src/HEXABLOCK/HexDocument.cxx b/src/HEXABLOCK/HexDocument.cxx index e55c9c6..16e1ae6 100644 --- a/src/HEXABLOCK/HexDocument.cxx +++ b/src/HEXABLOCK/HexDocument.cxx @@ -676,13 +676,13 @@ int Document::mergeVertices (Vertex* vpar, Vertex* vold) return ier; } - map rep_quad; - map rep_edge; - map rep_vertex; + std::map rep_quad; + std::map rep_edge; + std::map rep_vertex; - map :: iterator itq; - map :: iterator ited; - map :: iterator itv; + std::map :: iterator itq; + std::map :: iterator ited; + std::map :: iterator itv; rep_vertex [vold] = vpar; int nbparv = vold->getNbrParents (); @@ -875,7 +875,7 @@ Law* Document::findLaw (const char* name) { DumpStart ("findLaw", name); - string nom = name; + std::string nom = name; Law* loi = NULL; for (int nro=0 ;loi==NULL && nromakeName (prefix, name); el_name = name; @@ -1124,7 +1124,7 @@ bool Document::isEmpty () return nombre <= 0 && countLaw () <= 1; } // ======================================================== getNextName -cpchar Document::getNextName (EnumElt type, string& buff) +cpchar Document::getNextName (EnumElt type, std::string& buff) { char name [8]; EltBase::makeName (type, doc_nbr_elt [type], name); @@ -1134,12 +1134,12 @@ cpchar Document::getNextName (EnumElt type, string& buff) } // ======================================================== getNextName -string Document::getNextName (EnumElt type) +std::string Document::getNextName (EnumElt type) { char name [8]; EltBase::makeName (type, doc_nbr_elt [type], name); - return string(name); + return std::string(name); } // ======================================================== lockDump diff --git a/src/HEXABLOCK/HexDocument.hxx b/src/HEXABLOCK/HexDocument.hxx index b1f31bf..b383374 100644 --- a/src/HEXABLOCK/HexDocument.hxx +++ b/src/HEXABLOCK/HexDocument.hxx @@ -343,8 +343,8 @@ public: void reorderQuads (); // --------------------------------------------------- Evols Hexa5 - cpchar getNextName (EnumElt type, string& name); - string getNextName (EnumElt type); + cpchar getNextName (EnumElt type, std::string& name); + std::string getNextName (EnumElt type); virtual char* makeVarName (char* name); void lockDump(); diff --git a/src/HEXABLOCK/HexDocument_Xml.cxx b/src/HEXABLOCK/HexDocument_Xml.cxx index 16b89d3..2339db3 100644 --- a/src/HEXABLOCK/HexDocument_Xml.cxx +++ b/src/HEXABLOCK/HexDocument_Xml.cxx @@ -50,7 +50,7 @@ BEGIN_NAMESPACE_HEXA // ======================================================== get_coords -int get_coords (const string& chaine, double& x, double& y, double& z) +int get_coords (const std::string& chaine, double& x, double& y, double& z) { // int nv = sscanf (chaine.c_str (), "%lg %lg %lg", &x, &y, &z); cpchar buffer = chaine.c_str (); @@ -59,7 +59,7 @@ int get_coords (const string& chaine, double& x, double& y, double& z) return HOK; } // ======================================================== get_coords -int get_coords (const string& chaine, double& x, double& y) +int get_coords (const std::string& chaine, double& x, double& y) { cpchar buffer = chaine.c_str (); int nv = sscanf (buffer, "%lg %lg", &x, &y); @@ -67,7 +67,7 @@ int get_coords (const string& chaine, double& x, double& y) return HOK; } // ======================================================== parse_name -int parse_name (XmlTree* node, const string& nom, EltBase* elt) +int parse_name (XmlTree* node, const std::string& nom, EltBase* elt) { int lg = nom.size(); int nroid = 0; @@ -76,7 +76,7 @@ int parse_name (XmlTree* node, const string& nom, EltBase* elt) elt->setId (nroid); - const string& name = node->findValue ("name"); + const std::string& name = node->findValue ("name"); if (name=="") return HERR; @@ -84,11 +84,11 @@ int parse_name (XmlTree* node, const string& nom, EltBase* elt) return HOK; } // ======================================================== get_names -void get_names (const string& chaine, int size, vector& table) +void get_names (const std::string& chaine, int size, std::vector& table) { table.clear (); int lg = chaine.size(); - string mot = ""; + std::string mot = ""; bool encours = false; for (int nc=0 ; nc t_vertex; - map t_edge; - map t_quad; - map t_hexa; - map t_vector; - vector tname; + std::map t_vertex; + std::map t_edge; + std::map t_quad; + std::map t_hexa; + std::map t_vector; + std::vector tname; - const string& version = xml.findValue ("version"); + const std::string& version = xml.findValue ("version"); if (version == "") { cout << " **** Format du fichier XML perime" << endl; return HERR; } - const string& name = xml.findValue ("name"); + const std::string& name = xml.findValue ("name"); if (name != el_name) setName (name.c_str()); @@ -200,12 +200,12 @@ int Document::parseXml (XmlTree& xml) for (int nro=0 ; nro < nbrelts ; nro++) { XmlTree* node = rubrique->getChild (nro); - const string& type = node->getName(); + const std::string& type = node->getName(); double px, py, pz; if (type=="Vertex") { - const string& nom = node->findValue ("id"); - const string& coords = node->findValue ("coord"); + const std::string& nom = node->findValue ("id"); + const std::string& coords = node->findValue ("coord"); get_coords (coords, px, py, pz); vertex = addVertex (px, py, pz); @@ -225,11 +225,11 @@ int Document::parseXml (XmlTree& xml) for (int nro=0 ; nro < nbrelts ; nro++) { XmlTree* node = rubrique->getChild (nro); - const string& type = node->getName(); + const std::string& type = node->getName(); if (type=="Edge") { - const string& nom = node->findValue ("id"); - const string& vertices = node->findValue ("vertices"); + const std::string& nom = node->findValue ("id"); + const std::string& vertices = node->findValue ("vertices"); get_names (vertices, V_TWO, tname); edge = new Edge (t_vertex [tname[0]], t_vertex [tname[1]]); t_edge [nom] = edge; @@ -248,11 +248,11 @@ int Document::parseXml (XmlTree& xml) for (int nro=0 ; nro < nbrelts ; nro++) { XmlTree* node = rubrique->getChild (nro); - const string& type = node->getName(); + const std::string& type = node->getName(); if (type=="Quad") { - const string& nom = node->findValue ("id"); - const string& edges = node->findValue ("edges"); + const std::string& nom = node->findValue ("id"); + const std::string& edges = node->findValue ("edges"); get_names (edges, V_TWO, tname); quad = new Quad (t_edge [tname[0]], t_edge [tname[1]], @@ -272,8 +272,8 @@ int Document::parseXml (XmlTree& xml) for (int nro=0 ; nro < nbrelts ; nro++) { XmlTree* node = rubrique->getChild (nro); - const string& nom = node->findValue ("id"); - const string& quads = node->findValue ("quads"); + const std::string& nom = node->findValue ("id"); + const std::string& quads = node->findValue ("quads"); get_names (quads, V_TWO, tname); Hexa* hexa = new Hexa (t_quad [tname[0]], t_quad [tname[1]], @@ -290,8 +290,8 @@ int Document::parseXml (XmlTree& xml) { XmlTree* node = rubrique->getChild (nro); double px, py, pz; - const string& nom = node->findValue ("id"); - const string& coords = node->findValue ("coord"); + const std::string& nom = node->findValue ("id"); + const std::string& coords = node->findValue ("coord"); get_coords (coords, px, py, pz); Vector* vector = addVector (px, py, pz); @@ -305,10 +305,10 @@ int Document::parseXml (XmlTree& xml) for (int nro=0 ; nro < nbrelts ; nro++) { XmlTree* node = rubrique->getChild (nro); - const string& id = node->findValue ("id"); - const string& kind = node->findValue ("kind"); - const string& nodes = node->findValue ("nodes"); - const string& coeff = node->findValue ("coeff"); + const std::string& id = node->findValue ("id"); + const std::string& kind = node->findValue ("kind"); + const std::string& nodes = node->findValue ("nodes"); + const std::string& coeff = node->findValue ("coeff"); int nbnodes = atoi (nodes.c_str()); double koeff = atof (coeff.c_str()); @@ -326,9 +326,9 @@ int Document::parseXml (XmlTree& xml) for (int nro=0 ; nro < nbrelts ; nro++) { XmlTree* node = rubrique->getChild (nro); - const string& nmedge = node->findValue ("edge"); - const string& nmlaw = node->findValue ("law"); - // const string& nmway = node->findValue ("way"); + const std::string& nmedge = node->findValue ("edge"); + const std::string& nmlaw = node->findValue ("law"); + // const std::string& nmway = node->findValue ("way"); edge = t_edge [nmedge]; Law* law = findLaw (nmlaw.c_str()); @@ -345,8 +345,8 @@ int Document::parseXml (XmlTree& xml) { XmlTree* ndgroup = rubrique->getChild (nro); XmlTree* node = ndgroup ->getChild (0); - const string& nom = node->findValue ("name"); - const string& ckind = node->findValue ("kind"); + const std::string& nom = node->findValue ("name"); + const std::string& ckind = node->findValue ("kind"); EnumGroup kind = Group::getKind (ckind); Group* groupe = addGroup (nom.c_str(), kind); @@ -356,7 +356,7 @@ int Document::parseXml (XmlTree& xml) for (int nelt=1 ; nelt < nbrelts ; nelt++) { node = ndgroup ->getChild (nelt); - const string& id = node->findValue ("id"); + const std::string& id = node->findValue ("id"); switch (type) { case EL_HEXA : groupe->addElement (t_hexa [id]); @@ -770,7 +770,7 @@ void Document::hputError (cpchar mess, EltBase* e1, EltBase* e2) // ======================================================== parseSubShape SubShape* Document::parseSubShape (XmlTree* node) { - const string& name = node->findValue ("shape"); + const std::string& name = node->findValue ("shape"); int subid = node->findInteger ("subid"); NewShape* shape = findShape (name); if (shape==NULL) @@ -801,7 +801,7 @@ void Document::parseAssociation (XmlTree* node, Edge* edge) if (shape->getDim()!=1) return; - const string& inter = node->findValue ("interval"); + const std::string& inter = node->findValue ("interval"); double pdeb, pfin; get_coords (inter, pdeb, pfin); @@ -829,12 +829,12 @@ void Document::parseShapes (XmlTree& root) for (int nro=0 ; nro < nbrelts ; nro++) { XmlTree* node = rubrique->getChild (nro); - const string& type = node->getName(); + const std::string& type = node->getName(); if (type=="Shape") { - const string& nom = node->findValue ("id" ); + const std::string& nom = node->findValue ("id" ); int orig = node->findInteger ("type"); - const string& brep = node->findValue ("brep"); + const std::string& brep = node->findValue ("brep"); NewShape* shape = new NewShape (this, (EnumShape)orig); parse_name (node, nom, shape); @@ -848,7 +848,7 @@ void Document::parseShapes (XmlTree& root) { Real3 point; XmlTree* sommet = node->getChild (nv); - const string& coords = sommet->findValue ("coord"); + const std::string& coords = sommet->findValue ("coord"); get_coords (coords, point[dir_x], point[dir_y], point[dir_z]); doc_cloud->addPoint (point); } diff --git a/src/HEXABLOCK/HexDocument_asso.cxx b/src/HEXABLOCK/HexDocument_asso.cxx index 55b42db..da5d19b 100644 --- a/src/HEXABLOCK/HexDocument_asso.cxx +++ b/src/HEXABLOCK/HexDocument_asso.cxx @@ -34,9 +34,9 @@ BEGIN_NAMESPACE_HEXA static bool db = on_debug (); // == getenv ("HEXA_DB") > 0 -int vertexInLine (Vertex* vfirst, Edges& mline, vector &tsens); +int vertexInLine (Vertex* vfirst, Edges& mline, std::vector &tsens); // ====================================================== vertexInLine -int vertexInLine (Vertex* vfirst, Edges& mline, vector &tsens) +int vertexInLine (Vertex* vfirst, Edges& mline, std::vector &tsens) { int nbseg = mline.size (); diff --git a/src/HEXABLOCK/HexDocument_quads.cxx b/src/HEXABLOCK/HexDocument_quads.cxx index cab2f49..da4a30b 100644 --- a/src/HEXABLOCK/HexDocument_quads.cxx +++ b/src/HEXABLOCK/HexDocument_quads.cxx @@ -48,7 +48,7 @@ static bool db = false; // ======================================================== copyDocument Document* Document::copyDocument () { - string nom = "CopyOf_"; + std::string nom = "CopyOf_"; nom += el_name; Document* clone = new Document (nom.c_str()); @@ -624,11 +624,11 @@ Elements* Document::replace (Quads motif, Quads cible, Vertex* p1, Vertex* c1, // ========================================================= print_replace void print_replace (Edge* zig, Edge* zag) { - cout << zig->getName() << " = (" << zig->getVertex(0)->getName() + std::cout << zig->getName() << " = (" << zig->getVertex(0)->getName() << ", " << zig->getVertex(1)->getName() << ") est clone en "; - cout << zag->getName() << " = (" << zag->getVertex(0)->getName() - << ", " << zag->getVertex(1)->getName() << ")" << endl; + std::cout << zag->getName() << " = (" << zag->getVertex(0)->getName() + << ", " << zag->getVertex(1)->getName() << ")" << std::endl; } // ========================================================= only_in_hexas bool only_in_hexas (Hexas& thexas, Quad* quad) @@ -656,11 +656,11 @@ bool only_in_hexas (Hexas& thexas, Edge* edge) Quad* quad = edge->getParent (nq); if (NOT only_in_hexas (thexas, quad)) { - cout << " ... inMoreHexas " << edge->makeDefinition() << endl; + std::cout << " ... inMoreHexas " << edge->makeDefinition() << std::endl; return false; } } - cout << " ... only_in_hexas " << edge->makeDefinition() << endl; + std::cout << " ... only_in_hexas " << edge->makeDefinition() << std::endl; return true; } // ========================================================= replace_vertex @@ -676,7 +676,7 @@ Elements* Document::disconnectEdges (Hexas thexas, Edges tedges) DumpStart ("disconnectEdges", thexas << tedges); if (db) - cout << " +++ Disconnect Edges" << endl; + std::cout << " +++ Disconnect Edges" << std::endl; Elements* grid = new Elements (this); @@ -687,9 +687,9 @@ Elements* Document::disconnectEdges (Hexas thexas, Edges tedges) if (nbhexas != nbedges) { - cout << " **** Error in Document::disconnectEdges\n" << endl; - cout << " **** Number of Edges and number of Hexas are different\n" - << endl; + std::cout << " **** Error in Document::disconnectEdges\n" << std::endl; + std::cout << " **** Number of Edges and number of Hexas are different\n" + << std::endl; return NULL; } else if (nbhexas==1) @@ -703,22 +703,22 @@ Elements* Document::disconnectEdges (Hexas thexas, Edges tedges) { if (BadElement (tedges[nro])) { - cout << " **** Eddge number " << nro+1 << " is incorrect" - << endl; + std::cout << " **** Eddge number " << nro+1 << " is incorrect" + << std::endl; return NULL; } if (BadElement (thexas[nro])) { - cout << " **** Hexa number " << nro+1 << " is incorrect" - << endl; + std::cout << " **** Hexa number " << nro+1 << " is incorrect" + << std::endl; return NULL; } if (db) - cout << nro+1 << " hexa = " << thexas[nro]->getName () + std::cout << nro+1 << " hexa = " << thexas[nro]->getName () << ", edge = " << tedges[nro]->getName () << " = (" << tedges[nro]->getVertex(0)->getName () << ", " << tedges[nro]->getVertex(1)->getName () - << ")" << endl; + << ")" << std::endl; } for (int nro=0 ; nrofindEdge (tedges[nro]); if (ned==NOTHING) { - cout << " **** Edge number " << nro+1 - << " doesnt belong to correspondant hexa" << endl; + std::cout << " **** Edge number " << nro+1 + << " doesnt belong to correspondant hexa" << std::endl; return NULL; } } - vector tvertex (nbedges+1); + std::vector tvertex (nbedges+1); for (int nro=1 ; nrocommonVertex (tedges[nro-1]); if (tvertex[nro]==NULL) { - cout << " **** Edge number " << nro - << " doesnt intesect next edge" << endl; + std::cout << " **** Edge number " << nro + << " doesnt intesect next edge" << std::endl; return NULL; } } @@ -755,24 +755,24 @@ Elements* Document::disconnectEdges (Hexas thexas, Edges tedges) int ned = thexas[nro]->findEdge (tedges[nro]); if (ned==NOTHING) { - cout << " **** Edge number " << nro+1 - << " doesnt belong to correspondant hexa" << endl; + std::cout << " **** Edge number " << nro+1 + << " doesnt belong to correspondant hexa" << std::endl; return NULL; } } // Fin des controles, on peut y aller ... - map state_edge; - map state_quad; + std::map state_edge; + std::map state_quad; enum { UNDEFINED, REPLACED, AS_IS }; - map new_vertex; - map new_edge; - map new_quad; + std::map new_vertex; + std::map new_edge; + std::map new_quad; - map :: iterator it_vertex; - map :: iterator it_edge; - map :: iterator it_quad; + std::map :: iterator it_vertex; + std::map :: iterator it_edge; + std::map :: iterator it_quad; #define VertexIsNew(v) (it_vertex=new_vertex.find(v))!=new_vertex.end() @@ -786,8 +786,8 @@ Elements* Document::disconnectEdges (Hexas thexas, Edges tedges) new_vertex [tvertex[nro]] = node1; if (db) { - cout << nro << " : " << tvertex[nro]->getName() - << " est clone en " << node1->getName() << endl; + std::cout << nro << " : " << tvertex[nro]->getName() + << " est clone en " << node1->getName() << std::endl; } if (nro>0) @@ -802,7 +802,7 @@ Elements* Document::disconnectEdges (Hexas thexas, Edges tedges) } if (db) - cout << "_____________________________ Autres substitutions" << endl; + std::cout << "_____________________________ Autres substitutions" << std::endl; // Un edge non remplace, qui contient un vertex remplace // commun a plus de 2 faces (donc appartenant a un autre hexa) diff --git a/src/HEXABLOCK/HexDocument_skin.cxx b/src/HEXABLOCK/HexDocument_skin.cxx index 1e64cd2..9c8b214 100644 --- a/src/HEXABLOCK/HexDocument_skin.cxx +++ b/src/HEXABLOCK/HexDocument_skin.cxx @@ -38,7 +38,7 @@ struct OrientedQuad Vertex* v2; }; -void propagateOrientation (queue &queue_quads, Quad* orig); +void propagateOrientation (std::queue &queue_quads, Quad* orig); void makeSkin (Quad* orig); // ========================================================= reorderFaces @@ -79,7 +79,7 @@ void Document::reorderQuads () void makeSkin (Quad* orig) { OrientedQuad triplet; - queue queue_quads; + std::queue queue_quads; orig->setOrientation(); // Q_DIRECT=1, Q_INVERSE=2 propagateOrientation (queue_quads, orig); @@ -103,7 +103,7 @@ void makeSkin (Quad* orig) } } // ==================================================== propagateOrientation -void propagateOrientation (queue &queue_quads, Quad* orig) +void propagateOrientation (std::queue &queue_quads, Quad* orig) { OrientedQuad triplet; // Q_DIRECT : le sens des vertex est l'exterieur diff --git a/src/HEXABLOCK/HexDocument_tools.cxx b/src/HEXABLOCK/HexDocument_tools.cxx index 7395770..96ff731 100644 --- a/src/HEXABLOCK/HexDocument_tools.cxx +++ b/src/HEXABLOCK/HexDocument_tools.cxx @@ -328,7 +328,7 @@ int Document::saveVtk (cpchar radical, int &nro) sprintf (num, "%d", nro); nro ++; - string filename = radical; + std::string filename = radical; filename += num; filename += ".vtk"; int ier = saveVtk (filename.c_str()); diff --git a/src/HEXABLOCK/HexDumpStudy.cxx b/src/HEXABLOCK/HexDumpStudy.cxx index 96090bf..1d384d2 100644 --- a/src/HEXABLOCK/HexDumpStudy.cxx +++ b/src/HEXABLOCK/HexDumpStudy.cxx @@ -49,7 +49,7 @@ DumpStudy::DumpStudy () if (fic_dump==NULL) fic_dump = stdout; - string buff; + std::string buff; cpchar when = get_time (buff); fprintf (fic_dump, "\n"); @@ -117,7 +117,7 @@ DumpStudy& DumpStudy::operator << (cpchar val) if (NOT is_open) return *this; - string valeur ("'"); + std::string valeur ("'"); valeur += val; valeur += "'"; @@ -270,7 +270,7 @@ void DumpStudy::restore (bool reactive) is_open = false; } // =================================================== getBegin -void DumpStudy::getBegin (string& begin) +void DumpStudy::getBegin (std::string& begin) { begin = right_part; begin += ")"; @@ -351,7 +351,7 @@ void DumpStudy::closeVector () cpchar DumpStudy::findName (EltBase* elt) { cpchar name = "Unknown"; - map :: iterator iter = map_name.find (elt); + std::map :: iterator iter = map_name.find (elt); if (iter != map_name.end()) name = iter->second.c_str(); else diff --git a/src/HEXABLOCK/HexDumpStudy.hxx b/src/HEXABLOCK/HexDumpStudy.hxx index 1ce8b79..ba4b4e8 100644 --- a/src/HEXABLOCK/HexDumpStudy.hxx +++ b/src/HEXABLOCK/HexDumpStudy.hxx @@ -65,13 +65,13 @@ public : bool lock (); void restore (bool reactive); - void getBegin (string& begin); + void getBegin (std::string& begin); private : cpchar findName (EltBase* elt); void addArgVector (EnumElt type, TabElts& table); void addArgument (cpchar arg); - void addArgument (string& arg) { addArgument (arg.c_str()) ; } + void addArgument (std::string& arg) { addArgument (arg.c_str()) ; } void declareVectors (); void addVector (cpchar name); void majVector (cpchar value); @@ -82,12 +82,12 @@ private : std::vector tab_declar; int tab_count [EL_MAXI]; - string curr_vector; + std::string curr_vector; int nbr_values; FILE* fic_dump; - string this_name; - string right_part; + std::string this_name; + std::string right_part; bool is_open; int nbr_nulls; int nbr_args; diff --git a/src/HEXABLOCK/HexEdge.cxx b/src/HEXABLOCK/HexEdge.cxx index 64489b1..e3308cd 100644 --- a/src/HEXABLOCK/HexEdge.cxx +++ b/src/HEXABLOCK/HexEdge.cxx @@ -161,7 +161,7 @@ Quad* Edge::getParent (int nro) void Edge::saveXml (XmlWriter* xml) { char buffer[12]; - string vertices = e_vertex [V_AMONT]->getName(buffer); + std::string vertices = e_vertex [V_AMONT]->getName(buffer); vertices += " "; vertices += e_vertex [V_AVAL ]->getName(buffer); @@ -247,9 +247,9 @@ void Edge::dumpPlus () } } // ======================================================== makeDefinition -string Edge::makeDefinition () +std::string Edge::makeDefinition () { - string definition = el_name; + std::string definition = el_name; definition += " = ("; definition += e_vertex [V_AMONT]->getName(); diff --git a/src/HEXABLOCK/HexEdge.hxx b/src/HEXABLOCK/HexEdge.hxx index 7060e62..6ded234 100644 --- a/src/HEXABLOCK/HexEdge.hxx +++ b/src/HEXABLOCK/HexEdge.hxx @@ -81,7 +81,7 @@ public: virtual void duplicate (); Edge* getClone () { return e_clone ; } double* getVector (double vecteur[]); - string makeDefinition (); + std::string makeDefinition (); int addAssociation (EdgeShape* gline, double deb, double fin); int checkAssociation (); diff --git a/src/HEXABLOCK/HexElements.cxx b/src/HEXABLOCK/HexElements.cxx index 087d093..a4021b4 100644 --- a/src/HEXABLOCK/HexElements.cxx +++ b/src/HEXABLOCK/HexElements.cxx @@ -513,13 +513,13 @@ int Elements::cutHexas (const Edges& t_edges, int nbcuts) // 1) marquage des hexas el_root->markAll (NO_USED); // 2) Memo noeuds - vector q_amont; - vector q_aval; - map vis_a_vis; + std::vector q_amont; + std::vector q_aval; + std::map vis_a_vis; int nbnodes = t_edges.size(); - vector v_amont (nbnodes); - vector v_aval (nbnodes); + std::vector v_amont (nbnodes); + std::vector v_aval (nbnodes); int nbfaces = 0; for (int nro=0; nro tab_pilier (nbpiliers); + std::vector tab_pilier (nbpiliers); int nbinter = nbcuts + 1; for (int ned=0; nedaddShape (name.c_str(), SH_EXTRUD); grid_geom -> openShape(); } diff --git a/src/HEXABLOCK/HexElements_check.cxx b/src/HEXABLOCK/HexElements_check.cxx index 06d3576..8e7378f 100644 --- a/src/HEXABLOCK/HexElements_check.cxx +++ b/src/HEXABLOCK/HexElements_check.cxx @@ -551,7 +551,7 @@ void Elements::checkContour (Quads& tquad, Vertex* v1, Vertex* v2, bool target, { tedge.clear (); cpchar who = target ? "Target" : "Pattern"; - string nmedge = target ? "Vertices of target (args 5 and 6)" + std::string nmedge = target ? "Vertices of target (args 5 and 6)" : "Vertices of pattern (args 3 and 4)" ; nmedge += "don't define an edge" ; @@ -563,8 +563,8 @@ void Elements::checkContour (Quads& tquad, Vertex* v1, Vertex* v2, bool target, return; } - map edge_count; - map :: iterator iter; + std::map edge_count; + std::map :: iterator iter; int nbre = tquad.size(); for (int nq=0 ; nq edge_count; - map :: iterator iter; + std::map edge_count; + std::map :: iterator iter; int nbre = tquad.size(); for (int nq=0 ; nq ker_hedge (nbsecteurs*size_vz); - vector ker_hquad (nbsecteurs*size_vz); - vector ker_vquad (nbsecteurs*size_vz); + std::vector ker_hedge (nbsecteurs*size_vz); + std::vector ker_hquad (nbsecteurs*size_vz); + std::vector ker_vquad (nbsecteurs*size_vz); for (int nz=0 ; nzaddShape (name, SH_CYLINDER); geom -> openShape(); - string brep; + std::string brep; // Real3 vk = { normal->getDx(), normal->getDy(), normal->getDz() }; // normer_vecteur (vk); @@ -283,7 +283,7 @@ void Elements::assoCircle (double* center, Edge* ed1, Edge* ed2, NewShape* geom) { Real3 oa, ob, normal; Real3 pta, ptb, ptc, ptd; - string brep; + std::string brep; // Les 2 edges dont les petits cotes d'un rectangle de rapport L/l=sqrt(2) // Soit le cercle circonscrit a ce rectangle. @@ -366,7 +366,7 @@ int Elements::propagateAssociation (Edge* orig, Edge* dest, Edge* dir) if (vo1==NULL || vd1==NULL) return HERR; - string trep; + std::string trep; Real3 pa, pb, vdir1, vdir2; calc_vecteur (vo1->getPoint (pa), vd1->getPoint (pb), vdir1); calc_vecteur (vo2->getPoint (pa), vd2->getPoint (pb), vdir2); @@ -381,7 +381,7 @@ int Elements::propagateAssociation (Edge* orig, Edge* dest, Edge* dir) Shape* shape = tab_shapes[nro]; if (shape!=NULL) { - string brep = shape->getBrep(); + std::string brep = shape->getBrep(); translate_brep (brep, vdir1, trep); // Shape* tshape = new Shape (trep); // tshape->setBounds (shape->getStart(), shape->getEnd()); @@ -396,7 +396,7 @@ int Elements::propagateAssociation (Edge* orig, Edge* dest, Edge* dir) Shape* shape = vo1->getAssociation (); if (shape!=NULL && vd1->getAssociation ()==NULL) { - string brep = shape->getBrep(); + std::string brep = shape->getBrep(); translate_brep (brep, vdir, trep); // Shape* tshape = new Shape (trep); // vd1->setAssociation (tshape); @@ -430,7 +430,7 @@ int Elements::prismAssociation (Edge* lorig, Edge* ldest, int nh) char name [24]; sprintf (name, "0x%lx#%d", (unsigned long) shape, nh); - map::iterator iter = map_shape.find (name); + std::map::iterator iter = map_shape.find (name); if (iter != map_shape.end()) subid = iter->second; else @@ -660,7 +660,7 @@ int Elements::saveVtk (cpchar radical, int &nro) sprintf (num, "%d", nro); nro ++; - string filename = radical; + std::string filename = radical; filename += num; filename += ".vtk"; int ier = saveVtk (filename.c_str()); diff --git a/src/HEXABLOCK/HexEltBase.cxx b/src/HEXABLOCK/HexEltBase.cxx index abe1b45..c8f9313 100644 --- a/src/HEXABLOCK/HexEltBase.cxx +++ b/src/HEXABLOCK/HexEltBase.cxx @@ -173,14 +173,14 @@ bool EltBase::debug (int niv) return el_root != NULL && el_root->getLevel() > niv ; } // ========================================================= getNextName -string EltBase::getNextName () +std::string EltBase::getNextName () { if (el_root != NULL) return el_root->getNextName (el_type); char name [16]; makeName (el_type, 0, name); - return string (name); + return std::string (name); } END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexEltBase.hxx b/src/HEXABLOCK/HexEltBase.hxx index 3e00a9f..1ab727b 100644 --- a/src/HEXABLOCK/HexEltBase.hxx +++ b/src/HEXABLOCK/HexEltBase.hxx @@ -102,19 +102,19 @@ public : void dumpRef (); cpchar getName (); - void setName (const string& nom) { el_name = nom ; } + void setName (const std::string& nom) { el_name = nom ; } void setName (cpchar nom) { el_name = nom ; } bool debug (int niv=0); bool isAssociated () { return is_associated ; } - string getNextName (); + std::string getNextName (); protected : EnumElt el_type; EltBase* el_next; int el_id; Document* el_root; - string el_name; + std::string el_name; int el_status; int el_mark; diff --git a/src/HEXABLOCK/HexGroup.cxx b/src/HEXABLOCK/HexGroup.cxx index 247a46d..7f66196 100644 --- a/src/HEXABLOCK/HexGroup.cxx +++ b/src/HEXABLOCK/HexGroup.cxx @@ -32,7 +32,7 @@ static const cpchar kind_name[] = { "HexaCell", "QuadCell", "EdgeCell", Group::Group (Document* dad, cpchar nom, EnumGroup grp) : EltBase (dad, EL_GROUP) { - string name = std::string(nom); + std::string name = std::string(nom); name.erase (name.find_last_not_of (" \n\r\t" ) + 1); name.erase (0, name.find_first_not_of (" \n\r\t" )); diff --git a/src/HEXABLOCK/HexGroup.hxx b/src/HEXABLOCK/HexGroup.hxx index c9307d8..9172c26 100644 --- a/src/HEXABLOCK/HexGroup.hxx +++ b/src/HEXABLOCK/HexGroup.hxx @@ -47,7 +47,7 @@ public : EnumElt getTypeElt () { return grp_typelt ; } static EnumGroup getKind (cpchar kind); - static EnumGroup getKind (const string& k) { return getKind (k.c_str());} + static EnumGroup getKind (const std::string& k) { return getKind (k.c_str());} private : int grp_id; diff --git a/src/HEXABLOCK/HexHexa.cxx b/src/HEXABLOCK/HexHexa.cxx index 689c1e0..3dc9903 100644 --- a/src/HEXABLOCK/HexHexa.cxx +++ b/src/HEXABLOCK/HexHexa.cxx @@ -422,7 +422,7 @@ void Hexa::propager (Propagation* prop, int nro) void Hexa::saveXml (XmlWriter* xml) { char ident[12]; - string quads; + std::string quads; for (int nro=0 ; nrogetVertex(V_AVAL )->clearAssociation(); // } // ====================================================== clean_brep -void clean_brep (string& brep) +void clean_brep (std::string& brep) { TopoDS_Shape shape; BRep_Builder builder; - istringstream stream_brep (brep); + std::istringstream stream_brep (brep); BRepTools::Read (shape, stream_brep, builder); BRepTools::Clean (shape); - ostringstream stream_shape; + std::ostringstream stream_shape; BRepTools::Write (shape, stream_shape); brep = stream_shape.str(); } diff --git a/src/HEXABLOCK/HexKas_functions.hxx b/src/HEXABLOCK/HexKas_functions.hxx index cbf0cdd..0004bdb 100644 --- a/src/HEXABLOCK/HexKas_functions.hxx +++ b/src/HEXABLOCK/HexKas_functions.hxx @@ -36,10 +36,10 @@ int HexaExport geom_create_cylcyl (double* borig, double* bnorm, double* bbase, int HexaExport geom_asso_cylcyl (Edge* edge); bool HexaExport same_coords (gp_Pnt& pa, gp_Pnt& pb, double epsil2=1e-6); -void HexaExport save_brep (cpchar nom, string brep, int& nro); -void HexaExport clean_brep (string& brep); +void HexaExport save_brep (cpchar nom, std::string brep, int& nro); +void HexaExport clean_brep (std::string& brep); -void HexaExport geom_make_brep (TopoDS_Shape& shape, string& brep); +void HexaExport geom_make_brep (TopoDS_Shape& shape, std::string& brep); int HexaExport geom_brep2point (rcstring brep, double& px, double& py, double& pz); int HexaExport geom_brep2shape (rcstring brep, TopoDS_Shape& shape); diff --git a/src/HEXABLOCK/HexNewShape.cxx b/src/HEXABLOCK/HexNewShape.cxx index 40c3a0c..56e1eb6 100644 --- a/src/HEXABLOCK/HexNewShape.cxx +++ b/src/HEXABLOCK/HexNewShape.cxx @@ -437,7 +437,7 @@ int NewShape::addPoint (double* point) int subid = tab_vertex.size() + 2; sprintf (suffix, ":vertex_%02d", subid); - string name = el_name + suffix; + std::string name = el_name + suffix; VertexShape* sub_shape = new VertexShape (this, subid, point); sub_shape->setName (name); @@ -447,7 +447,7 @@ int NewShape::addPoint (double* point) // ===================================================== saveBrep int NewShape::saveBrep () { - string filename = el_name + ".brep"; + std::string filename = el_name + ".brep"; int ier = updateBrep (); if (ier != HOK) @@ -518,7 +518,7 @@ void NewShape::parseShape (const TopoDS_Shape& shape) void NewShape::addSubShape (const TopoDS_Shape& shape) { char chnum [32]; - string name; + std::string name; sh_indice ++; int subid = map_shape.Add (shape); diff --git a/src/HEXABLOCK/HexNewShape.hxx b/src/HEXABLOCK/HexNewShape.hxx index b356abb..86eb1f8 100644 --- a/src/HEXABLOCK/HexNewShape.hxx +++ b/src/HEXABLOCK/HexNewShape.hxx @@ -103,7 +103,7 @@ private : // ________________________________________________________ TopoDS_Shape geo_shape; EnumShape sh_origin; - string geo_brep; + std::string geo_brep; bool brep_defined, shape_defined; TopTools_IndexedMapOfShape map_shape; diff --git a/src/HEXABLOCK/HexQpattern.hxx b/src/HEXABLOCK/HexQpattern.hxx index ac77d4c..32df27c 100644 --- a/src/HEXABLOCK/HexQpattern.hxx +++ b/src/HEXABLOCK/HexQpattern.hxx @@ -94,9 +94,9 @@ private : void projeter (Vertex* vertex, double& ux, double& uy); private : - vector pat_vertex; - vector pat_edge; - vector pat_quad; + std::vector pat_vertex; + std::vector pat_edge; + std::vector pat_quad; Quads old_top, old_bottom; Hexas old_hexa; diff --git a/src/HEXABLOCK/HexQuad.cxx b/src/HEXABLOCK/HexQuad.cxx index 553a613..048bcc0 100644 --- a/src/HEXABLOCK/HexQuad.cxx +++ b/src/HEXABLOCK/HexQuad.cxx @@ -470,7 +470,7 @@ Edge* Quad::getOpposEdge (Edge* start, int& sens) void Quad::saveXml (XmlWriter* xml) { char buffer[12]; - string edges; + std::string edges; for (int nro=0 ; nro tab_assoc; + std::vector tab_assoc; }; END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexWitness.cxx b/src/HEXABLOCK/HexWitness.cxx index 6979180..154f017 100644 --- a/src/HEXABLOCK/HexWitness.cxx +++ b/src/HEXABLOCK/HexWitness.cxx @@ -98,12 +98,12 @@ void Witness::printMessage () if (nbre ==0) return; - cout << endl - << " ... In function :" << endl; - cout << bla_bla [0] << endl << endl; + std::cout << std::endl + << " ... In function :" << std::endl; + std::cout << bla_bla [0] << std::endl << std::endl; for (int nro=1 ; nro tab_attributs; - vector tab_values; - vector tab_items; + std::vector tab_attributs; + std::vector tab_values; + std::vector tab_items; // Lecture - string fic_buffer; + std::string fic_buffer; int len_buffer; int nro_ligne; int fic_pos; diff --git a/src/HEXABLOCK/HexXmlWriter.cxx b/src/HEXABLOCK/HexXmlWriter.cxx index 39c0925..7926453 100644 --- a/src/HEXABLOCK/HexXmlWriter.cxx +++ b/src/HEXABLOCK/HexXmlWriter.cxx @@ -71,12 +71,12 @@ int XmlWriter::setFileName (cpchar nomfic) int pext = strlen (nomfic) - 4; if (pext > 0) { - string sext = &nomfic[pext]; + std::string sext = &nomfic[pext]; set_minus (sext); suff = sext != ".xml"; } - string fname = nomfic; + std::string fname = nomfic; if (suff) fname += ".xml"; @@ -136,7 +136,7 @@ void XmlWriter::endMark () void XmlWriter::openMark (cpchar balise) { jumpLine (); - string mot = "<"; + std::string mot = "<"; mot += balise; ecrire (mot); @@ -147,8 +147,8 @@ void XmlWriter::openMark (cpchar balise) // ========================================================= closeMark void XmlWriter::closeMark (bool jump) { - string balise = pile_mark.top (); - string mot = " 0) { - string space (xml_pos, ' '); + std::string space (xml_pos, ' '); addMot (space.c_str()); } } @@ -207,7 +207,7 @@ void XmlWriter::alaLigne (bool force) // ========================================================= addAttribute void XmlWriter::addAttribute (cpchar cle, cpchar valeur) { - string phrase = " "; + std::string phrase = " "; phrase += cle; phrase += " = \""; phrase += valeur; diff --git a/src/HEXABLOCK/HexXmlWriter.hxx b/src/HEXABLOCK/HexXmlWriter.hxx index e99ef1f..cee32cc 100644 --- a/src/HEXABLOCK/HexXmlWriter.hxx +++ b/src/HEXABLOCK/HexXmlWriter.hxx @@ -49,13 +49,13 @@ public : void addAttribute (cpchar attrib, cpchar valeur); // attrib="valeur" void addAttribute (cpchar attrib, int valeur); void addAttribute (cpchar attrib, double valeur); - void addAttribute (cpchar attrib, string& valeur); + void addAttribute (cpchar attrib, std::string& valeur); private : void jumpLine (); void alaLigne (bool force=false); void ecrire (cpchar mot); - void ecrire (string& mot) { ecrire (mot.c_str()) ; } + void ecrire (std::string& mot) { ecrire (mot.c_str()) ; } void addMot (cpchar mot); private : @@ -85,7 +85,7 @@ inline void XmlWriter::addAttribute (cpchar attrib, double valeur) addAttribute (attrib, buffer); } // ====================================================== addAttribute (stl) -inline void XmlWriter::addAttribute (cpchar attrib, string& valeur) +inline void XmlWriter::addAttribute (cpchar attrib, std::string& valeur) { addAttribute (attrib, valeur.c_str()); } diff --git a/src/HEXABLOCK/hexa_base.hxx b/src/HEXABLOCK/hexa_base.hxx index 1815540..d322d49 100644 --- a/src/HEXABLOCK/hexa_base.hxx +++ b/src/HEXABLOCK/hexa_base.hxx @@ -83,13 +83,12 @@ typedef FILE* pfile; typedef const std::string& rcstring; // Impressions de mise au point #include -using namespace std; -#define HexDisplay(x) cout << " ... " #x " = " << x << endl -#define PutData(x) cout << " ... " #x " = " << x << endl -#define PutCoord(x) cout << " ... " #x " = (" << x[0] << ", " \ - << x[1] << ", " << x[2] << ")" << endl -#define Echo(m) cout << " _______________ " << m << endl +#define HexDisplay(x) std::cout << " ... " #x " = " << x << std::endl +#define PutData(x) std::cout << " ... " #x " = " << x << std::endl +#define PutCoord(x) std::cout << " ... " #x " = (" << x[0] << ", " \ + << x[1] << ", " << x[2] << ")" << std::endl +#define Echo(m) std::cout << " _______________ " << m << std::endl // #define Libere(obj) { if (obj!=NULL) free (obj) ; obj=NULL; } // #define Destroy(obj) { delete obj ; obj=NULL ; } @@ -279,15 +278,15 @@ HexaExport bool on_debug(); // == getenv ("HEXA_DB") > 0 HexaExport bool in_test (); // == getenv ("HEXA_TEST") > 0 HexaExport int niv_debug(); // Implemente prochainement -HexaExport void set_minus (string& chaine); +HexaExport void set_minus (std::string& chaine); HexaExport bool special_option (); HexaExport void set_special_option (bool opt); HexaExport int sizeof_file (cpchar filename); HexaExport char* read_file (cpchar filename, int& size); -HexaExport cpchar get_time (string& buffer); -HexaExport int make_basename (cpchar filename, string& base); +HexaExport cpchar get_time (std::string& buffer); +HexaExport int make_basename (cpchar filename, std::string& base); const double Epsil = 1e-6; const double UnEpsil = 0.999999; diff --git a/src/HEXABLOCK/hexa_utils.cxx b/src/HEXABLOCK/hexa_utils.cxx index 57bb969..5e133d3 100644 --- a/src/HEXABLOCK/hexa_utils.cxx +++ b/src/HEXABLOCK/hexa_utils.cxx @@ -64,7 +64,7 @@ bool in_test () } // ======================================================== set_minus -void set_minus (string& chaine) +void set_minus (std::string& chaine) { int lg = chaine.size(); for (int nc=0 ; ncgetName() + std::cout << " nearest : " << vertex->getName() << " -> " << result->getName() - << " ( " << px << ", " << py << ", " << pz << ") " << endl; + << " ( " << px << ", " << py << ", " << pz << ") " << std::endl; return result; } // ======================================================== eplucher -void eplucher (Hex::Document* doc, Hex::Elements* grid, string& radical) +void eplucher (Hex::Document* doc, Hex::Elements* grid, std::string& radical) { int nbfic = 0; int nbre = grid->countHexa(); @@ -355,25 +355,25 @@ int test_pipes6 (int nbargs, cpchar tabargs[]) for (int narg=1 ; narg " << endl; - cout << " avec args parmi :" << endl; - cout << " -cyl : croisement de 2 cylindres " << endl; - cout << " -pipe : croisement de 2 tuyaux " << endl; - cout << " -left : Forme en T, barre a gauche " << endl; - cout << " -right : Forme en T, barre a droite " << endl; + std::cout << " Syntax : " << std::endl; + std::cout << " $ " << tabargs[0] << " " << std::endl; + std::cout << " avec args parmi :" << std::endl; + std::cout << " -cyl : croisement de 2 cylindres " << std::endl; + std::cout << " -pipe : croisement de 2 tuyaux " << std::endl; + std::cout << " -left : Forme en T, barre a gauche " << std::endl; + std::cout << " -right : Forme en T, barre a droite " << std::endl; return HOK; } } - string radical = pipe ? "makePipes" : "makeCylinders"; + std::string radical = pipe ? "makePipes" : "makeCylinders"; double rext1 = 2*sqrt (2.0); double rext2 = 3*sqrt (2.0); @@ -720,7 +720,7 @@ int test_monica (int nbargs, cpchar tabargs[]) save_file (); Hex::Hexa* trou = plaque->getHexaIJK (1, 1, 0); - vector tabv0, tabv1; + std::vector tabv0, tabv1; for (int nv=0 ; nv<8 ; nv++) tabv1.push_back (trou->getVertex(nv)); @@ -740,7 +740,7 @@ int test_monica (int nbargs, cpchar tabargs[]) for (int nv=0 ; nv<8 ; nv++) { int ier = doc->mergeVertices (tabv0[nv], tabv1[nv]); - cout << " nro = " << nv << ", ier = " << ier << endl; + std::cout << " nro = " << nv << ", ier = " << ier << std::endl; Hex::what (); save_file (); } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx index 1ae6364..60b97c1 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx @@ -2598,7 +2598,7 @@ QModelIndex DocumentModel::makeCartesianUni(const QModelIndex& icenter, QModelIndex DocumentModel::makeCartesian(const QModelIndex& icenter, const QModelIndex& ibase, const QModelIndex& ivec, const QModelIndex& iaxis, - vector& radius, vector& angles, vector& heights) + std::vector& radius, std::vector& angles, std::vector& heights) { QModelIndex result; @@ -2656,7 +2656,7 @@ QModelIndex DocumentModel::makeSphereUni (QModelIndex& icenter, QModelIndex DocumentModel::makeSphere (QModelIndex& icenter, QModelIndex& ivec_x, QModelIndex& ivec_z, - vector& tray, vector& tang, vector& thaut) + std::vector& tray, std::vector& tang, std::vector& thaut) { QModelIndex result; @@ -2709,7 +2709,7 @@ QModelIndex DocumentModel::makeSphericalUni (QModelIndex& icenter, QModelIndex DocumentModel::makeSpherical (QModelIndex& icenter, QModelIndex& ivec_x, QModelIndex& ivec_z, - vector& rayon, + std::vector& rayon, int crit) { QModelIndex result; @@ -2766,7 +2766,7 @@ QModelIndex DocumentModel::makeRindUni (QModelIndex& icenter, QModelIndex DocumentModel::makeRind (QModelIndex& icenter, QModelIndex& ivec_x, QModelIndex& ivec_z, - vector& tray, vector& tang, vector& thaut) + std::vector& tray, std::vector& tang, std::vector& thaut) { QModelIndex result; @@ -2819,7 +2819,7 @@ QModelIndex DocumentModel::makeCylinderUni(QModelIndex& iorig, QModelIndex& ivec } QModelIndex DocumentModel::makeCylinder(QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, - vector& tray, vector& tang, vector& thaut) + std::vector& tray, std::vector& tang, std::vector& thaut) { QModelIndex result; @@ -2893,7 +2893,7 @@ QModelIndex DocumentModel::makePipeUni(QModelIndex& iorig, QModelIndex& ivecx, Q } QModelIndex DocumentModel::makePipe(QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, - vector& tray, vector& tang, vector& thaut) + std::vector& tray, std::vector& tang, std::vector& thaut) { QModelIndex result; @@ -2954,7 +2954,7 @@ QModelIndex DocumentModel::joinQuadUni(QModelIndex& istart, QModelIndex& idest, } QModelIndex DocumentModel::joinQuad(QModelIndex& istart, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1, - QModelIndex& iva2, QModelIndex& ivb2, vector& tlen) + QModelIndex& iva2, QModelIndex& ivb2, std::vector& tlen) { QModelIndex result; @@ -3000,7 +3000,7 @@ QModelIndex DocumentModel::joinQuadsUni(QModelIndexList& istarts, QModelIndex& i } QModelIndex DocumentModel::joinQuads(QModelIndexList& istarts, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1, - QModelIndex& iva2, QModelIndex& ivb2, vector& tlen) + QModelIndex& iva2, QModelIndex& ivb2, std::vector& tlen) { QModelIndex result; @@ -3044,7 +3044,7 @@ QModelIndex DocumentModel::revolutionQuadUni(QModelIndex& istart, QModelIndex& i } QModelIndex DocumentModel::revolutionQuad(QModelIndex& istart, QModelIndex& icenter, QModelIndex& iaxis, - vector& angles) + std::vector& angles) { QModelIndex result; @@ -3084,7 +3084,7 @@ QModelIndex DocumentModel::revolutionQuadsUni(QModelIndexList& istarts, QModelIn } QModelIndex DocumentModel::revolutionQuads(QModelIndexList& istarts, QModelIndex& icenter, QModelIndex& iaxis, - vector& angles) + std::vector& angles) { QModelIndex result; @@ -3137,7 +3137,7 @@ QModelIndex DocumentModel::extrudeQuadUni(QModelIndex& istart, QModelIndex& dv, return result; } -QModelIndex DocumentModel::extrudeQuad(QModelIndex& istart, QModelIndex& dv, vector& tlen) +QModelIndex DocumentModel::extrudeQuad(QModelIndex& istart, QModelIndex& dv, std::vector& tlen) { QModelIndex result; @@ -3188,7 +3188,7 @@ QModelIndex DocumentModel::extrudeQuadsUni (QModelIndexList& istarts, QModelInde return result; } -QModelIndex DocumentModel::extrudeQuads(QModelIndexList& istarts, QModelIndex& iaxis, vector& tlen) +QModelIndex DocumentModel::extrudeQuads(QModelIndexList& istarts, QModelIndex& iaxis, std::vector& tlen) { QModelIndex result; @@ -3222,7 +3222,7 @@ QModelIndex DocumentModel::cutUni(QModelIndex& iEdge, int nbre) return result; } -QModelIndex DocumentModel::cut(QModelIndex& iEdge, vector& tlen) +QModelIndex DocumentModel::cut(QModelIndex& iEdge, std::vector& tlen) { QModelIndex result; diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx index cf65a53..88b7ea5 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx @@ -207,7 +207,7 @@ namespace HEXABLOCK QModelIndex makeCartesianUni(const QModelIndex& icenter, const QModelIndex& ibase, const QModelIndex& ivec, const QModelIndex& iaxis, double lx, double ly, double lz, int nx, int ny, int nz); QModelIndex makeCartesian(const QModelIndex& icenter, const QModelIndex& ibase, const QModelIndex& ivec, - const QModelIndex& iaxis, vector& radius, vector& angles, vector& heights); + const QModelIndex& iaxis, std::vector& radius, std::vector& angles, std::vector& heights); // ====== SPHERE @@ -221,7 +221,7 @@ namespace HEXABLOCK QModelIndex makeSphere (QModelIndex& icenter, QModelIndex& ivec_x, QModelIndex& ivec_z, - vector& tray, vector& tang, vector& thaut); + std::vector& tray, std::vector& tang, std::vector& thaut); // ====== SPHERICAL @@ -234,7 +234,7 @@ namespace HEXABLOCK QModelIndex makeSpherical (QModelIndex& icenter, QModelIndex& ivec_x, QModelIndex& ivec_z, - vector& rayon, + std::vector& rayon, int crit); // =========== RIND @@ -248,7 +248,7 @@ namespace HEXABLOCK QModelIndex makeRind (QModelIndex& icenter, QModelIndex& ivec_x, QModelIndex& ivec_z, - vector& tray, vector& tang, vector& thaut); + std::vector& tray, std::vector& tang, std::vector& thaut); // ======== Cylinder QModelIndex makeCylinderTop(int nr, int na, int nh); @@ -258,7 +258,7 @@ namespace HEXABLOCK int nr, int na, int nh); QModelIndex makeCylinder (QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, - vector& tray, vector& tang, vector& thaut); + std::vector& tray, std::vector& tang, std::vector& thaut); // ======== Cylinders QModelIndex makeCylinders (QModelIndex& iorig1, QModelIndex& ivecz1, double r1, double h1, @@ -272,7 +272,7 @@ namespace HEXABLOCK int nr, int na, int nh); QModelIndex makePipe (QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, - vector& tray, vector& tang, vector& thaut); + std::vector& tray, std::vector& tang, std::vector& thaut); // ======== Pipes QModelIndex makePipes (QModelIndex& iorig1, QModelIndex& ivecz1, double rint1, double rex1, double h1, @@ -283,39 +283,39 @@ namespace HEXABLOCK QModelIndex& iv3, QModelIndex& iv4, int nb); QModelIndex joinQuad (QModelIndex& istart, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1, - QModelIndex& iva2, QModelIndex& ivb2, vector& tlen); + QModelIndex& iva2, QModelIndex& ivb2, std::vector& tlen); QModelIndex joinQuadsUni (QModelIndexList& istarts, QModelIndex& idest, QModelIndex& iv1, QModelIndex& iv2, QModelIndex& iv3, QModelIndex& iv4, int nb); QModelIndex joinQuads (QModelIndexList& istarts, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1, - QModelIndex& iva2, QModelIndex& ivb2, vector& tlen); + QModelIndex& iva2, QModelIndex& ivb2, std::vector& tlen); // ======== Quad Revolution QModelIndex revolutionQuadUni(QModelIndex& istart, QModelIndex& icenter, QModelIndex& iaxis, double angle, int nbre); QModelIndex revolutionQuad(QModelIndex& istart, QModelIndex& icenter, QModelIndex& iaxis, - vector& angles); + std::vector& angles); QModelIndex revolutionQuadsUni(QModelIndexList& istarts, QModelIndex& icenter, QModelIndex& iaxis, double angle, int nbre); QModelIndex revolutionQuads(QModelIndexList& istarts, QModelIndex& icenter, QModelIndex& iaxis, - vector& angles); + std::vector& angles); // ==== PrismQuad or ExtrudeQuad QModelIndex extrudeQuadTop (QModelIndex& istart, int nbre); QModelIndex extrudeQuadUni (QModelIndex& istart, QModelIndex& dv, double len, int nbre); - QModelIndex extrudeQuad (QModelIndex& istart, QModelIndex& dv, vector& tlen); + QModelIndex extrudeQuad (QModelIndex& istart, QModelIndex& dv, std::vector& tlen); QModelIndex extrudeQuadsTop (QModelIndexList& istarts, int nbre); QModelIndex extrudeQuadsUni (QModelIndexList& istarts, QModelIndex& axis, double len, int nbre); - QModelIndex extrudeQuads (QModelIndexList& istarts, QModelIndex& iaxis, vector& tlen); + QModelIndex extrudeQuads (QModelIndexList& istarts, QModelIndex& iaxis, std::vector& tlen); // ==== Cut Edge QModelIndex cutUni (QModelIndex& iEdge, int nbre); - QModelIndex cut (QModelIndex& iEdge, vector& tlen); + QModelIndex cut (QModelIndex& iEdge, std::vector& tlen); // ============================== END NEW ================================ diff --git a/src/HEXABLOCK_SWIG/hexablock_swig.i b/src/HEXABLOCK_SWIG/hexablock_swig.i index 34c4f35..0213b0c 100644 --- a/src/HEXABLOCK_SWIG/hexablock_swig.i +++ b/src/HEXABLOCK_SWIG/hexablock_swig.i @@ -35,13 +35,13 @@ %include "std_vector.i" namespace std { -%template(VectorHexas) vector ; -%template(VectorQuads) vector ; -%template(VectorEdges) vector ; -%template(VectorVertices) vector ; -%template(VectorShapes) vector ; -%template(VectorReal) vector ; -%template(VectorInt) vector ; +%template(VectorHexas) std::vector ; +%template(VectorQuads) std::vector ; +%template(VectorEdges) std::vector ; +%template(VectorVertices) std::vector ; +%template(VectorShapes) std::vector ; +%template(VectorReal) std::vector ; +%template(VectorInt) std::vector ; } %include "hexa_base.hxx" diff --git a/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc b/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc index 4d79000..6668174 100644 --- a/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc +++ b/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc @@ -20923,7 +20923,7 @@ fail: SWIGINTERN PyObject *_wrap_set_minus(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - string *arg1 = 0 ; + std::string *arg1 = 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -20936,7 +20936,7 @@ SWIGINTERN PyObject *_wrap_set_minus(PyObject *SWIGUNUSEDPARM(self), PyObject *a if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "set_minus" "', argument " "1"" of type '" "string &""'"); } - arg1 = reinterpret_cast< string * >(argp1); + arg1 = reinterpret_cast< std::string * >(argp1); Hex::set_minus(*arg1); resultobj = SWIG_Py_Void(); return resultobj; @@ -21043,7 +21043,7 @@ fail: SWIGINTERN PyObject *_wrap_get_time(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; - string *arg1 = 0 ; + std::string *arg1 = 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; @@ -21057,7 +21057,7 @@ SWIGINTERN PyObject *_wrap_get_time(PyObject *SWIGUNUSEDPARM(self), PyObject *ar if (!argp1) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "get_time" "', argument " "1"" of type '" "string &""'"); } - arg1 = reinterpret_cast< string * >(argp1); + arg1 = reinterpret_cast< std::string * >(argp1); result = (cpchar)Hex::get_time(*arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; @@ -21069,7 +21069,7 @@ fail: SWIGINTERN PyObject *_wrap_make_basename(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; cpchar arg1 = (cpchar) 0 ; - string *arg2 = 0 ; + std::string *arg2 = 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; @@ -21092,7 +21092,7 @@ SWIGINTERN PyObject *_wrap_make_basename(PyObject *SWIGUNUSEDPARM(self), PyObjec if (!argp2) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "make_basename" "', argument " "2"" of type '" "string &""'"); } - arg2 = reinterpret_cast< string * >(argp2); + arg2 = reinterpret_cast< std::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; @@ -22469,7 +22469,7 @@ fail: SWIGINTERN PyObject *_wrap_EltBase_setName__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; - string *arg2 = 0 ; + std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -22490,8 +22490,8 @@ SWIGINTERN PyObject *_wrap_EltBase_setName__SWIG_0(PyObject *SWIGUNUSEDPARM(self if (!argp2) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "EltBase_setName" "', argument " "2"" of type '" "string const &""'"); } - arg2 = reinterpret_cast< string * >(argp2); - (arg1)->setName((string const &)*arg2); + arg2 = reinterpret_cast< std::string * >(argp2); + (arg1)->setName((std::string const &)*arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -22707,7 +22707,7 @@ SWIGINTERN PyObject *_wrap_EltBase_getNextName(PyObject *SWIGUNUSEDPARM(self), P void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; - string result; + std::string result; if (!PyArg_ParseTuple(args,(char *)"O:EltBase_getNextName",&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); @@ -22716,7 +22716,7 @@ SWIGINTERN PyObject *_wrap_EltBase_getNextName(PyObject *SWIGUNUSEDPARM(self), P } arg1 = reinterpret_cast< Hex::EltBase * >(argp1); result = (arg1)->getNextName(); - resultobj = SWIG_NewPointerObj((new string(static_cast< const string& >(result))), SWIGTYPE_p_string, SWIG_POINTER_OWN | 0 ); + resultobj = SWIG_NewPointerObj((new std::string(static_cast< const std::string& >(result))), SWIGTYPE_p_string, SWIG_POINTER_OWN | 0 ); return resultobj; fail: return NULL; @@ -32594,7 +32594,7 @@ fail: SWIGINTERN PyObject *_wrap_Hex_findDocument__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Hex::Hex *arg1 = (Hex::Hex *) 0 ; - string *arg2 = 0 ; + std::string *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -32616,8 +32616,8 @@ SWIGINTERN PyObject *_wrap_Hex_findDocument__SWIG_1(PyObject *SWIGUNUSEDPARM(sel if (!argp2) { SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Hex_findDocument" "', argument " "2"" of type '" "string const &""'"); } - arg2 = reinterpret_cast< string * >(argp2); - result = (Hex::Document *)(arg1)->findDocument((string const &)*arg2); + arg2 = reinterpret_cast< std::string * >(argp2); + result = (Hex::Document *)(arg1)->findDocument((std::string const &)*arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, 0 | 0 ); return resultobj; fail: -- 2.39.2