Laxkit  0.0.7.1
doublepanner.h
1 //
2 //
3 // The Laxkit, a windowing toolkit
4 // Copyright (C) 2004-2006 by Tom Lechner
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Library General Public
8 // License as published by the Free Software Foundation; either
9 // version 2 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Library General Public License for more details.
15 //
16 // You should have received a copy of the GNU Library General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // Please consult http://laxkit.sourceforge.net about where to send any
21 // correspondence about this software.
22 //
23 #ifndef _LAX_DOUBLEPANNER_H
24 #define _LAX_DOUBLEPANNER_H
25 
26 #include <lax/anxapp.h>
27 #include <lax/vectors.h>
28 #include <lax/pancontroller.h>
29 
30 
31 namespace Laxkit {
32 
34 {
35  protected:
36  double *ctm,ictm[6];
37 
38  int Minx,Maxx,Miny,Maxy; // screen coords of viewport bounding box
39  double spaceminx,spacemaxx,spaceminy,spacemaxy; // workspace bounds
41 
42  public:
44  DoublePanner(anXWindow *w=NULL,PanController *pan=NULL,char npanislocal=0);
45  ~DoublePanner();
46 
47  virtual flatpoint realtoscreen(double x,double y);
48  virtual flatpoint realtoscreen(flatpoint p);
49  virtual flatpoint screentoreal(int x,int y);
50  virtual flatpoint screentoreal(flatpoint p);
51 
52  //essentially panner functions:
53  virtual char Updates(char toupdatepanner);
54  virtual void syncPanner(int all=0);
55  virtual void syncFromPanner(int all=0);
56  virtual char onscreen(int x,int y) { return x>=Minx && x<=Maxx && y>=Miny && y<=Maxy; }
57  virtual void ShiftScreen(int dx,int dy);
58  virtual void ShiftReal(double dx,double dy);
59  virtual void Center(double minx,double maxx,double miny,double maxy);
60  virtual void CenterPoint(flatpoint p);
61  virtual void CenterReal();
62  virtual int NewTransform(double *d);
63  virtual int NewTransform(double a,double b,double c,double d,double x0,double y0);
64  virtual void PushAndNewTransform(double *m);
65  virtual void PushAndNewAxes(flatpoint p,flatpoint x,flatpoint y);
66  virtual void PushAxes();
67  virtual void PopAxes();
68  virtual void NewAxis(flatpoint o,flatpoint xtip);
69  virtual void NewAxis(flatpoint o,flatvector x,flatvector y);
70  virtual void Newangle(double angle,int dir=0,int dec=1);
71  virtual void Rotate(double angle,int x,int y,int dec=1);
72  virtual void Newmag(double xs,double ys=-1)/*ys=-1*/;
73  virtual void Zoomr(double m,flatpoint p);
74  virtual void Zoom(double m,int x,int y);
75  virtual void Zoom(double m);
76  virtual double GetMag(int c=0);
77  virtual double GetVMag(int x,int y);
78  virtual void SetView(double minx,double maxx,double miny,double maxy);
79  virtual int RealSpace(double minx,double maxx,double miny,double maxy);
80  virtual void RealSpace(double *minx,double *maxx,double *miny, double *maxy);
81  virtual void getTransformedSpace(long *minx,long *maxx,long *miny,long *maxy);
82  virtual void WrapWindow(anXWindow *nw);
83 };
84 
85 } // namespace Laxkit
86 
87 #endif

Mon Feb 17 2014 11:52:56, Laxkit