From 1a9dafdece9e16387cec3e95c8a4e8aaa4b553c0 Mon Sep 17 00:00:00 2001 From: cnr-isti-vclab Date: Mon, 9 Jul 2007 22:47:18 +0000 Subject: [PATCH] Removed using namespace std and modified accordingly. --- wrap/gui/trackball.cpp | 6 ++++-- wrap/gui/trackmode.cpp | 27 ++++++++++++++------------- wrap/gui/trackmode.h | 5 +++-- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/wrap/gui/trackball.cpp b/wrap/gui/trackball.cpp index 719def7d..783995e2 100644 --- a/wrap/gui/trackball.cpp +++ b/wrap/gui/trackball.cpp @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.21 2007/06/20 12:59:43 corsini +adjust wheel back-compatibility + Revision 1.20 2007/06/13 17:15:08 benedetti Added one-level undo system and sticky trackmodes. @@ -97,7 +100,6 @@ Adding copyright. #include using namespace vcg; -using namespace std; Transform::Transform() { track.SetIdentity(); @@ -300,7 +302,7 @@ void Trackball::DrawIcon() { void Trackball::Reset() { track.SetIdentity(); undo_track = track; - map::iterator i; + std::map::iterator i; for(i = modes.begin(); i != modes.end(); i++){ TrackMode * mode=(*i).second; if(mode!=NULL) diff --git a/wrap/gui/trackmode.cpp b/wrap/gui/trackmode.cpp index 28f92f6a..4f16d8de 100644 --- a/wrap/gui/trackmode.cpp +++ b/wrap/gui/trackmode.cpp @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.23 2007/06/13 17:15:09 benedetti +Added one-level undo system and sticky trackmodes. + Revision 1.22 2007/05/28 08:10:47 fiorin Removed type cast warnings @@ -94,8 +97,6 @@ Adding copyright. #include #include - -using namespace std; using namespace vcg; using namespace vcg::trackutils; @@ -226,8 +227,8 @@ void AxisMode::Apply (Trackball * tb, float WheelNotch) void AxisMode::Apply (Trackball * tb, Point3f new_point) { - pair< Point3f,bool > hitOld = HitNearestPointOnAxis (tb, axis, tb->last_point); - pair< Point3f,bool > hitNew = HitNearestPointOnAxis (tb, axis, new_point); + std::pair< Point3f,bool > hitOld = HitNearestPointOnAxis (tb, axis, tb->last_point); + std::pair< Point3f,bool > hitNew = HitNearestPointOnAxis (tb, axis, new_point); if (hitOld.second && hitNew.second){ tb->Translate (hitNew.first - hitOld.first); } @@ -241,8 +242,8 @@ void AxisMode::Draw(Trackball * tb){ // Plane mode implementation. void PlaneMode::Apply (Trackball * tb, Point3f new_point) { - pair< Point3f, bool > hitOld = HitPlane(tb,tb->last_point,plane); - pair< Point3f, bool > hitNew = HitPlane(tb,new_point,plane); + std::pair< Point3f, bool > hitOld = HitPlane(tb,tb->last_point,plane); + std::pair< Point3f, bool > hitNew = HitPlane(tb,new_point,plane); if(hitOld.second && hitNew.second){ tb->Translate (hitNew.first - hitOld.first); } @@ -287,7 +288,7 @@ void CylinderMode::Draw(Trackball * tb){ } // Path mode implementation. -void PathMode::Init(const vector < Point3f > &pts) +void PathMode::Init(const std::vector < Point3f > &pts) { unsigned int npts = int(pts.size()); assert(npts >= 2); @@ -301,12 +302,12 @@ void PathMode::Init(const vector < Point3f > &pts) for(unsigned int i=1;i &pts) +void AreaMode::Init(const std::vector < Point3f > &pts) { unsigned int npts = int(pts.size()); @@ -579,7 +580,7 @@ void AreaMode::Init(const vector < Point3f > &pts) } min_side_length=Distance(points[0],points[1]); for(unsigned int i=1;icamera.Project(status)-new_point; begin_action=false; } - pair< Point3f, bool > hitNew = HitPlane(tb,new_point+delta_mouse,plane); + std::pair< Point3f, bool > hitNew = HitPlane(tb,new_point+delta_mouse,plane); if(! hitNew.second){ return; } @@ -644,7 +645,7 @@ Point3f AreaMode::Move(Point3f start,Point3f end) for (i = 0, j = np-1; i < np; j = i++) { Segment3f side(points[i],points[j]); Point3f pseg,psid; - pair res=SegmentSegmentDistance(segment,side,pseg,psid); + std::pair res=SegmentSegmentDistance(segment,side,pseg,psid); if(res.first < EPSILON && ! res.second){ float dist= Distance(pt,pseg); if(dist < EPSILON){ diff --git a/wrap/gui/trackmode.h b/wrap/gui/trackmode.h index 5f56bf9a..95076547 100644 --- a/wrap/gui/trackmode.h +++ b/wrap/gui/trackmode.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.13 2007/06/25 10:21:38 fiorin +Added some std:: here and there + Revision 1.12 2007/06/13 17:15:09 benedetti Added one-level undo system and sticky trackmodes. @@ -69,8 +72,6 @@ Adding copyright. #include #include -using namespace std; - namespace vcg { class Trackball;