diff --git a/wrap/gui/trackball.cpp b/wrap/gui/trackball.cpp index a8621b05..3a151fa5 100644 --- a/wrap/gui/trackball.cpp +++ b/wrap/gui/trackball.cpp @@ -24,6 +24,10 @@ History $Log: not supported by cvs2svn $ +Revision 1.17 2007/01/15 15:04:15 tarini +added "ToAscii" and "SetFromAscii" methods to load/store current trackball status from/to ascii strings +(intended uses: clipboard operations and comments inside png snapshots!) + Revision 1.16 2006/07/26 13:54:45 cignoni Reversed the direction of wheel scaling and added middle mouse panning @@ -218,7 +222,7 @@ bool Trackball::SetFromAscii(char * st){ int res= sscanf(st, "trackball(%f,%f,%f,%f,%f,%f,%f,%f,%f)", f+0,f+1,f+2,f+3,f+4,f+5,f+6,f+7,f+8 ); - return res=9; + return (res==9); } diff --git a/wrap/gui/trackball.h b/wrap/gui/trackball.h index aad0e8b3..7cba4d6c 100644 --- a/wrap/gui/trackball.h +++ b/wrap/gui/trackball.h @@ -25,6 +25,10 @@ History $Log: not supported by cvs2svn $ +Revision 1.12 2007/01/15 15:04:15 tarini +added "ToAscii" and "SetFromAscii" methods to load/store current trackball status from/to ascii strings +(intended uses: clipboard operations and comments inside png snapshots!) + Revision 1.11 2006/08/23 15:40:57 marfr960 *** empty log message *** @@ -223,7 +227,7 @@ namespace vcg { void Store(); void HistorySize(int lenght); - //internals +/* //internals // commented out no more used this stuff! enum Action { NONE = 0, VIEW_ROTATE = 1, // Axis Constrained Rotation @@ -237,7 +241,7 @@ namespace vcg { //scale trackball and model TRACK_SCALE = 13 }; - +*/ // loads/stores current status from/to ascii stings void ToAscii(char * st); bool SetFromAscii(char * st); diff --git a/wrap/gui/trackmode.h b/wrap/gui/trackmode.h index 23643da2..e4c9205c 100644 --- a/wrap/gui/trackmode.h +++ b/wrap/gui/trackmode.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.9 2006/02/13 13:10:27 cignoni +Added Zmode for moving objects along the perpendicular to the viewplane + Revision 1.8 2004/07/18 06:54:08 cignoni Added Scaling @@ -64,7 +67,7 @@ public: virtual ~TrackMode() {} virtual void Apply(Trackball *trackball, Point3f new_point) = 0; virtual void Apply(Trackball *trackball, float WheelNotch); - + virtual const char *Name()=0; virtual void Draw() {} protected: Plane3f GetViewPlane(const View &view, const Point3f ¢er); @@ -76,16 +79,17 @@ public: class SphereMode: public TrackMode { public: void Apply(Trackball *trackball, Point3f new_point); + const char* Name() {return "SphereMode";}; protected: Point3f Hit(Trackball *trackball, const Point3f &p); bool HitHyper(Point3f center, float radius, Point3f viewpoint, Plane3f vp, Point3f hitplane, Point3f &hit) ; - }; class CylinderMode: public TrackMode { public: CylinderMode(const Line3f &/*line*/, float /*radius = 1*/) {} void Apply(Trackball * /*trackball*/, Point3f /*new_point*/) {} + const char* Name() {return "CylinderMode";}; protected: Line3f line; float radius; @@ -95,6 +99,7 @@ class PlaneMode: public TrackMode { public: PlaneMode(const Plane3f &pl): plane(pl) {} void Apply(Trackball *trackball, Point3f new_point); + const char* Name() {return "PlaneMode";}; protected: Plane3f plane; }; @@ -102,6 +107,7 @@ protected: // Move the object along the Z of the Camera // complement of the Plane mode class ZMode: public TrackMode { + const char* Name() {return "ZMode";}; public: void Apply(Trackball *trackball, Point3f new_point); }; @@ -110,12 +116,14 @@ class LineMode: public TrackMode { public: LineMode(const Line3f &/*line*/) {} void Apply(Trackball * /*trackball*/, Point3f /*new_point*/) {} + const char* Name() {return "LineMode";}; protected: Line3f line; }; class ScaleMode: public TrackMode { public: + const char* Name() {return "ScaleMode";}; void Apply(Trackball *trackball, Point3f new_point); };