~alanbell/dasher/ircfix-lp579181

« back to all changes in this revision

Viewing changes to Src/DasherCore/DasherViewSquare.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-11-14 12:03:42 UTC
  • mfrom: (1.2.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20061114120342-pebcosas78lczcgz
Tags: 4.3.1-0ubuntu1
* New upstream release:
  - 4.3.1:
    - Bugfixes
    - Translation updates
  - 4.3.0:
    - Mainly work on two button dynamic mode to provide a platform for 
      user tests
* debian/patches/10_remove-extra-qualifier.patch:
  - fix FTBFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
  /// Convert input coordinates to dasher coordinates and evolve the model
53
53
  ///
54
54
 
55
 
  void TapOnDisplay(screenint mousex, screenint mousey, unsigned long Time, myint &iDasherX, myint &iDasherY);
56
 
  void TapOnDisplay(screenint mousex,screenint mousey, unsigned long Time, myint &iDasherX, myint &iDasherY, VECTOR_SYMBOL_PROB* pAdded = NULL, int* pNumDeleted = NULL);
 
55
  void GetCoordinates(unsigned long Time, myint &iDasherX, myint &iDasherY);
57
56
  
58
57
  ///
59
58
  /// \todo Document this
86
85
 
87
86
  void GetScaleFactor( int eOrientation, myint *iScaleFactorX, myint *iScaleFactorY );
88
87
 
89
 
 
90
88
  ///
91
89
  /// Event handler
92
90
  ///
94
92
  virtual void HandleEvent(Dasher::CEvent * pEvent);
95
93
 
96
94
  /// 
97
 
  /// Get the automatic calibration offset
98
 
  ///
99
 
 
100
 
  int GetAutoOffset() const;
101
 
 
102
 
  bool IsNodeVisible(myint y1, myint y2);
103
 
 
104
 
  ///
105
 
  /// \todo Document this
106
 
  ///
107
 
 
108
 
  virtual void ResetSum();
109
 
 
110
 
  ///
111
 
  /// \todo Document this
112
 
  ///
113
 
 
114
 
  virtual void ResetSumCounter();
115
 
 
116
 
  ///
117
 
  /// Reset the automatic calibration offset
118
 
  ///
119
 
 
120
 
  virtual void ResetYAutoOffset();
121
 
 
122
 
  double xmap(double x) const;
123
 
  double ymap(double x) const {
124
 
    return m_ymap.map( (myint)x );
125
 
  };
126
 
 
127
 
  /// 
128
95
  /// Convert a screen co-ordinate to Dasher co-ordinates
129
96
  ///
130
97
 
136
103
 
137
104
  void Dasher2Screen(myint iDasherX, myint iDasherY, screenint & iScreenX, screenint & iScreenY);
138
105
 
139
 
  ///
140
 
  /// Convert input device position to Dasher co-ordinates
141
 
  ///
142
 
 
143
 
  void Input2Dasher(screenint iInputX, screenint iInputY, myint & iDasherX, myint & iDasherY, int iType, int iMode);
144
 
 
145
106
 
146
107
private:
147
 
 
 
108
  double xmap(double x) const;
 
109
  double ymap(double x) const {
 
110
    return m_ymap.map( (myint)x );
 
111
  };
148
112
 
149
113
  ///
150
114
  /// Recursively render all nodes in a tree. Responsible for all the Render_node calls
158
122
  
159
123
  void RenderGroups(CDasherNode * Render, myint y1, myint y2, int mostleft);
160
124
 
161
 
 
162
125
  /// Render a single node
163
126
  /// \param Character Symbol ID to be drawn
164
127
  /// \param Color The colour to draw it
174
137
 
175
138
  int RenderNode(const int Color, myint y1, myint y2, int &mostleft, const std::string &sDisplayText, bool bShove);
176
139
 
 
140
  bool IsNodeVisible(myint y1, myint y2);
 
141
 
177
142
  void RecursiveRenderGroups(SGroupInfo *pCurrentGroup, CDasherNode *pNode, myint y1, myint y2, int mostleft);
178
143
 
179
144
  ///
180
 
  /// Trunates co-ordinates to fit on screen
181
 
  ///
182
 
 
183
 
  void TruncateToScreen(screenint & iX, screenint & iY);
184
 
 
185
 
  ///
186
 
  /// Get minimum visible Dasher Y co-ordinate
187
 
  /// \deprecated Use VisibleRegion.
188
 
  ///
189
 
 
190
 
  myint DasherVisibleMinY();
191
 
 
192
 
  ///
193
 
  /// Get maximum visible Dasher Y co-ordinate
194
 
  /// \deprecated Use VisibleRegion.
195
 
  ///
196
 
 
197
 
  myint DasherVisibleMaxY();
198
 
 
199
 
  ///
200
 
  /// Get maximum visible Dasher X co-ordinate
201
 
  /// \deprecated Use VisibleRegion.
202
 
  ///
203
 
 
204
 
  myint DasherVisibleMaxX();
205
 
 
206
 
  ///
207
145
  /// Get the bounding box of the visible region.
208
146
  ///
209
147
 
210
148
  void VisibleRegion( myint &iDasherMinX, myint &iDasherMinY, myint &iDasherMaxX, myint &iDasherMaxY );
211
 
 
212
 
  ///
213
 
  /// Unused
214
 
  ///
215
 
 
216
 
  myint m_iDasherXCache;
217
 
 
218
 
  ///
219
 
  /// Unused
220
 
  ///
221
 
 
222
 
  myint m_iDasherYCache;
223
149
#ifdef _WIN32
224
150
  ///
225
151
  /// FIXME - couldn't find windows version of round(double) so here's one!
234
160
 
235
161
  };
236
162
#endif
237
 
  //    myint s_Y1,s_Y2,s_Y3;
238
 
  
239
 
  // Variables for speed control
240
 
  
241
 
  //
242
 
  // AUTO-SPEED-CONTROL  
243
 
/*   double m_dBitrate; //  stores max bit rate internally */
244
 
/*   double m_dSampleScale, m_dSampleOffset; // internal, control sample size */
245
 
/*   int m_nSpeedCounter;  // keep track of how many samples */
246
 
/*   int m_nSpeedSamples;  // upper limit on #samples */
247
 
/*   double m_dSpeedMax, m_dSpeedMin; // bit rate always within this range */
248
 
/*   double m_dTier1, m_dTier2, m_dTier3, m_dTier4; // variance tolerance tiers  */
249
 
/*   double m_dChange1, m_dChange2, m_dChange3, m_dChange4; // fractional changes to bit rate */
250
 
/*   double m_dMinRRate; // controls rate at which min. r adapts HIGHER===SLOWER! */
251
 
/*   double m_dSensitivity; // not used, control sensitivity of auto speed control */
252
 
/*   typedef std::deque<double> DOUBLE_DEQUE; */
253
 
/*   DOUBLE_DEQUE m_dequeAngles; // store angles for statistics */
254
 
  
255
 
/*   //variables for adaptive radius calculations... */
256
 
/*   double m_dSigma1, m_dSigma2, m_dMinRadius; */
257
163
 
258
164
  // Class definitions
259
165
 
267
173
    myint m_Y1, m_Y2, m_Y3;
268
174
  };
269
175
 
270
 
  // the x and y non-linearities
271
 
 
272
 
  void AutoCalibrate(screenint * mousex, screenint * mousey);
273
 
 
274
 
  ///
275
 
  /// \deprecated See Dasher2Screen
276
 
  ///
277
 
 
278
 
  screenint dasherx2screen(myint sx) const;
279
 
 
280
 
  ///
281
 
  /// \deprecated See Dasher2Screen
282
 
  ///
283
 
 
284
 
  screenint dashery2screen(myint sy) const;
285
 
 
286
 
  ///
287
 
  /// \deprecated See Dasher2Screen
288
 
  ///
289
 
 
290
 
  Cint32 dashery2screen(myint y1, myint y2, screenint & s1, screenint & s2) const;
291
 
 
292
 
  double eyetracker_get_x(double x, double y);
293
 
  double eyetracker_get_y(double x, double y);
294
176
  double xmax(double x, double y) const;
295
 
 
296
177
  double ixmap(double x) const;
297
 
 
298
 
 
299
178
  inline void Crosshair(myint sx);
300
179
 
 
180
  // Called on screen size changes
 
181
  void SetScaleFactor();
 
182
 
301
183
  // Data
302
184
 
303
185
  bool bInBox;                  // Whether we're in the mouseposstart box
306
188
 
307
189
  double m_dXmpa, m_dXmpb, m_dXmpc, m_dXmpd;
308
190
  screenint CanvasX, CanvasY, CanvasBorder;
309
 
 
310
 
  int m_ySum, m_ySumCounter, m_yFilterTimescale, m_ySigBiasPixels, m_ySigBiasPercentage, m_yAutoOffset;
311
 
 
312
191
  Cymap m_ymap;
313
192
 
314
 
  // Called on screen size changes
315
 
  void SetScaleFactor();
316
 
 
317
193
  // Cached values for scaling
318
194
  myint iLRScaleFactorX;
319
195
  myint iLRScaleFactorY;