Use the prefix std:: instead of the directive using namespace std;

This commit is contained in:
ana 2010-04-14 11:20:29 +00:00
parent 8d7e376e8e
commit a45dff2ade
12 changed files with 21 additions and 37 deletions

View File

@ -83,7 +83,6 @@ static int MYDEBUG = 0;
static GEOM_Engine* TheEngine = NULL; static GEOM_Engine* TheEngine = NULL;
using namespace std;
static TCollection_AsciiString BuildIDFromObject(Handle(GEOM_Object)& theObject) static TCollection_AsciiString BuildIDFromObject(Handle(GEOM_Object)& theObject)
{ {

View File

@ -91,7 +91,6 @@
#include <GEOMImpl_Types.hxx> #include <GEOMImpl_Types.hxx>
#include <Graphic3d_HArray1OfBytes.hxx> #include <Graphic3d_HArray1OfBytes.hxx>
using namespace std;
//================================================================ //================================================================
// Function : getActiveStudy // Function : getActiveStudy
@ -190,7 +189,7 @@ SUIT_SelectionFilter* GEOM_Displayer::getComplexFilter( const QList<int>* aSubSh
// Function : getEntry // Function : getEntry
// Purpose : // Purpose :
//================================================================ //================================================================
static string getEntry( GEOM::GEOM_Object_ptr object ) static std::string getEntry( GEOM::GEOM_Object_ptr object )
{ {
SUIT_Session* session = SUIT_Session::session(); SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() ); SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
@ -200,7 +199,7 @@ static string getEntry( GEOM::GEOM_Object_ptr object )
if ( strcmp(IOR.in(), "") != 0 ) if ( strcmp(IOR.in(), "") != 0 )
{ {
SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy(); SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy();
_PTR(SObject) SO ( study->studyDS()->FindObjectIOR( string(IOR) ) ); _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( std::string(IOR) ) );
if ( SO ) if ( SO )
return SO->GetID(); return SO->GetID();
} }
@ -212,7 +211,7 @@ static string getEntry( GEOM::GEOM_Object_ptr object )
// Function : getName // Function : getName
// Purpose : // Purpose :
//================================================================ //================================================================
static string getName( GEOM::GEOM_Object_ptr object ) static std::string getName( GEOM::GEOM_Object_ptr object )
{ {
SUIT_Session* session = SUIT_Session::session(); SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() ); SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
@ -222,7 +221,7 @@ static string getName( GEOM::GEOM_Object_ptr object )
if ( strcmp(IOR.in(), "") != 0 ) if ( strcmp(IOR.in(), "") != 0 )
{ {
SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy(); SalomeApp_Study* study = ( SalomeApp_Study* )app->activeStudy();
_PTR(SObject) aSObj ( study->studyDS()->FindObjectIOR( string(IOR) ) ); _PTR(SObject) aSObj ( study->studyDS()->FindObjectIOR( std::string(IOR) ) );
_PTR(GenericAttribute) anAttr; _PTR(GenericAttribute) anAttr;
@ -327,7 +326,7 @@ void GEOM_Displayer::Display( GEOM::GEOM_Object_ptr theObj, const bool updateVie
if ( theObj->_is_nil() ) if ( theObj->_is_nil() )
return; return;
string entry = getEntry( theObj ); std::string entry = getEntry( theObj );
if ( entry != "" ) { if ( entry != "" ) {
Display(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()), Display(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()),
updateViewer); updateViewer);
@ -371,7 +370,7 @@ void GEOM_Displayer::Erase( GEOM::GEOM_Object_ptr theObj,
const bool forced, const bool forced,
const bool updateViewer ) const bool updateViewer )
{ {
string entry = getEntry( theObj ); std::string entry = getEntry( theObj );
if ( entry != "" ) if ( entry != "" )
{ {
Erase(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()), Erase(new SALOME_InteractiveObject(entry.c_str(), "GEOM", getName(theObj).c_str()),
@ -699,7 +698,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
if ( strcmp(IOR.in(), "") != 0 ) if ( strcmp(IOR.in(), "") != 0 )
{ {
_PTR(Study) aStudy = study->studyDS(); _PTR(Study) aStudy = study->studyDS();
_PTR(SObject) aMainSObject( aStudy->FindObjectIOR( string(IOR) ) ); _PTR(SObject) aMainSObject( aStudy->FindObjectIOR( std::string(IOR) ) );
_PTR(ChildIterator) it( aStudy->NewChildIterator( aMainSObject ) ); _PTR(ChildIterator) it( aStudy->NewChildIterator( aMainSObject ) );
for( ; it->More(); it->Next() ) for( ; it->More(); it->Next() )
{ {
@ -1426,12 +1425,12 @@ SALOMEDS::Color GEOM_Displayer::getUniqueColor( const QList<SALOMEDS::Color>& th
if( aTolerance < 1 ) if( aTolerance < 1 )
break; break;
} }
//cout << "Iteration N" << anIterations << " (tolerance=" << aTolerance << ")"<< endl; //std::cout << "Iteration N" << anIterations << " (tolerance=" << aTolerance << ")"<< std::endl;
aHue = (int)( 360.0 * rand() / RAND_MAX ); aHue = (int)( 360.0 * rand() / RAND_MAX );
//cout << "Hue = " << aHue << endl; //std::cout << "Hue = " << aHue << std::endl;
//cout << "Auto colors : "; //std::cout << "Auto colors : ";
bool ok = true; bool ok = true;
QList<SALOMEDS::Color>::const_iterator it = theReservedColors.constBegin(); QList<SALOMEDS::Color>::const_iterator it = theReservedColors.constBegin();
QList<SALOMEDS::Color>::const_iterator itEnd = theReservedColors.constEnd(); QList<SALOMEDS::Color>::const_iterator itEnd = theReservedColors.constEnd();
@ -1442,21 +1441,21 @@ SALOMEDS::Color GEOM_Displayer::getUniqueColor( const QList<SALOMEDS::Color>& th
int h, s, v; int h, s, v;
aQColor.getHsv( &h, &s, &v ); aQColor.getHsv( &h, &s, &v );
//cout << h << " "; //std::cout << h << " ";
if( abs( h - aHue ) < aTolerance ) if( abs( h - aHue ) < aTolerance )
{ {
ok = false; ok = false;
//cout << "break (diff = " << abs( h - aHue ) << ")"; //std::cout << "break (diff = " << abs( h - aHue ) << ")";
break; break;
} }
} }
//cout << endl; //std::cout << std::endl;
if( ok ) if( ok )
break; break;
} }
//cout << "Hue of the returned color = " << aHue << endl; //std::cout << "Hue of the returned color = " << aHue << std::endl;
QColor aColor; QColor aColor;
aColor.setHsv( aHue, 255, 255 ); aColor.setHsv( aHue, 255, 255 );

View File

@ -68,9 +68,6 @@
#include <vtkRenderer.h> #include <vtkRenderer.h>
using namespace std;
static GEOM_Client ShapeReader; static GEOM_Client ShapeReader;
inline OCCViewer_Viewer* GetOCCViewer(SUIT_Application* theApp){ inline OCCViewer_Viewer* GetOCCViewer(SUIT_Application* theApp){
@ -135,7 +132,7 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry, bool isUpdated)
if (CORBA::is_nil(Geom)) if (CORBA::is_nil(Geom))
return; return;
string aFatherIOR; std::string aFatherIOR;
_PTR(SComponent) father = aStudy->FindComponent("GEOM"); _PTR(SComponent) father = aStudy->FindComponent("GEOM");
if (!father) if (!father)
return; return;
@ -154,14 +151,14 @@ void GEOM_Swig::createAndDisplayGO (const char* Entry, bool isUpdated)
if (!obj->FindAttribute(anAttr, "AttributeIOR")) if (!obj->FindAttribute(anAttr, "AttributeIOR"))
return; return;
_PTR(AttributeIOR) anIOR(anAttr); _PTR(AttributeIOR) anIOR(anAttr);
string anIORValue = anIOR->Value(); std::string anIORValue = anIOR->Value();
GEOM::GEOM_Object_var aShape = Geom->GetIORFromString(anIORValue.c_str()); GEOM::GEOM_Object_var aShape = Geom->GetIORFromString(anIORValue.c_str());
TopoDS_Shape Shape = ShapeReader.GetShape(Geom,aShape); TopoDS_Shape Shape = ShapeReader.GetShape(Geom,aShape);
if (!Shape.IsNull()) { if (!Shape.IsNull()) {
if (obj->FindAttribute(anAttr, "AttributeName")) { if (obj->FindAttribute(anAttr, "AttributeName")) {
_PTR(AttributeName) aName (anAttr); _PTR(AttributeName) aName (anAttr);
string aNameValue = aName->Value(); std::string aNameValue = aName->Value();
// open transaction // open transaction
/*SUIT_Operation* op = new SalomeApp_ImportOperation (app); /*SUIT_Operation* op = new SalomeApp_ImportOperation (app);
op->start(); op->start();

View File

@ -41,7 +41,6 @@
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
using namespace std;
//======================================================================= //=======================================================================
//function : GetID //function : GetID

View File

@ -19,7 +19,6 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
using namespace std;
#ifndef _GEOMImpl_ICurvesOperations_HXX_ #ifndef _GEOMImpl_ICurvesOperations_HXX_
#define _GEOMImpl_ICurvesOperations_HXX_ #define _GEOMImpl_ICurvesOperations_HXX_
@ -67,13 +66,13 @@ class GEOMImpl_ICurvesOperations : public GEOM_IOperations {
Handle(GEOM_Object) thePnt2, Handle(GEOM_Object) thePnt2,
Handle(GEOM_Object) thePnt3); Handle(GEOM_Object) thePnt3);
Standard_EXPORT Handle(GEOM_Object) MakeSplineBezier (list<Handle(GEOM_Object)> thePoints); Standard_EXPORT Handle(GEOM_Object) MakeSplineBezier (std::list<Handle(GEOM_Object)> thePoints);
Standard_EXPORT Handle(GEOM_Object) MakeSplineInterpolation (list<Handle(GEOM_Object)> thePoints, Standard_EXPORT Handle(GEOM_Object) MakeSplineInterpolation (std::list<Handle(GEOM_Object)> thePoints,
bool theIsClosed = false); bool theIsClosed = false);
Standard_EXPORT Handle(GEOM_Object) MakeSketcher (const char* theCommand, Standard_EXPORT Handle(GEOM_Object) MakeSketcher (const char* theCommand,
list<double> theWorkingPlane); std::list<double> theWorkingPlane);
Standard_EXPORT Handle(GEOM_Object) Make3DSketcher (list<double> theCoordinates); Standard_EXPORT Handle(GEOM_Object) Make3DSketcher (std::list<double> theCoordinates);
Standard_EXPORT Handle(GEOM_Object) MakeSketcherOnPlane (const char* theCommand, Standard_EXPORT Handle(GEOM_Object) MakeSketcherOnPlane (const char* theCommand,
Handle(GEOM_Object) theWorkingPlane); Handle(GEOM_Object) theWorkingPlane);
}; };

View File

@ -58,8 +58,6 @@
// OCCT Includes // OCCT Includes
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
using namespace std;
typedef QMap<QString, QString> FilterMap; typedef QMap<QString, QString> FilterMap;
static QString lastUsedFilter; static QString lastUsedFilter;

View File

@ -59,7 +59,6 @@
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
using namespace std;
//================================================================================= //=================================================================================
// class : GEOMBase_TransparencyDlg() // class : GEOMBase_TransparencyDlg()

View File

@ -27,7 +27,6 @@
#define isNewStudy(a,b) (a > 0 && a != b) #define isNewStudy(a,b) (a > 0 && a != b)
using namespace std;
//============================================================================= //=============================================================================
// constructor: // constructor:
//============================================================================= //=============================================================================

View File

@ -70,7 +70,6 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
using namespace std;
static void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj, static void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
const Handle(AIS_InteractiveContext)& theIC, const Handle(AIS_InteractiveContext)& theIC,

View File

@ -57,7 +57,6 @@
#include "utilities.h" #include "utilities.h"
using namespace std;
// SALOME // SALOME
#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) ) #define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) )

View File

@ -32,8 +32,6 @@
#include "GEOM_InteractiveObject.ixx" #include "GEOM_InteractiveObject.ixx"
using namespace std;
GEOM_InteractiveObject::GEOM_InteractiveObject() GEOM_InteractiveObject::GEOM_InteractiveObject()
: SALOME_InteractiveObject() : SALOME_InteractiveObject()
{ {

View File

@ -61,7 +61,6 @@
#include "utilities.h" #include "utilities.h"
using namespace std;
#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) ) #define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) )
#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) ) #define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) )