33#ifndef IPTSD_CORE_GENERIC_APPLICATION_HPP
44#define IPTSD_CORE_GENERIC_APPLICATION_HPP
55
6- #include " cone.hpp"
76#include " config.hpp"
87#include " device.hpp"
98#include " dft.hpp"
@@ -88,14 +87,6 @@ class Application {
8887 */
8988 DftStylus m_dft;
9089
91- /*
92- * The touch rejection cone has its origin at the current coordinates of the
93- * stylus. It is rotated in the direction of palm inputs, so that when
94- * writing with the stylus, the hand holding it has less chance of accidentally
95- * triggering any inputs.
96- */
97- Cone m_cone;
98-
9990public:
10091 Application (const Config &config,
10192 const DeviceInfo &info,
@@ -105,7 +96,6 @@ class Application {
10596 , m_metadata {metadata}
10697 , m_finder {config.contacts ()}
10798 , m_dft {config, metadata}
108- , m_cone {config.cone_angle , config.cone_distance }
10999 {
110100 if (m_config.width == 0 || m_config.height == 0 )
111101 throw std::runtime_error (" Invalid config: The screen size is 0!" );
@@ -231,18 +221,13 @@ class Application {
231221 contact.orientation = 1.0 - contact.orientation ;
232222 }
233223
234- // Update touch rejection cone
235- this ->update_touch_cone ();
236-
237224 // Hand off the found contacts to the handler code.
238225 this ->on_contacts (m_contacts);
239226 }
240227
241228 /* !
242229 * Handles incoming IPTS stylus data.
243230 *
244- * Position data from the stylus updates the position of the touch rejection cone.
245- *
246231 * @param[in] data The data to process.
247232 */
248233 void process_stylus (const ipts::StylusData &data)
@@ -254,13 +239,6 @@ class Application {
254239 corrected.x += off.x ();
255240 corrected.y += off.y ();
256241
257- // Scale to physical coordinates
258- const f64 x = corrected.x * m_config.width ;
259- const f64 y = corrected.y * m_config.height ;
260-
261- // Update rejection cone
262- m_cone.update_position (x, y);
263-
264242 // Hand off the stylus data to the handler code.
265243 this ->on_stylus (corrected);
266244 }
@@ -279,47 +257,6 @@ class Application {
279257 this ->process_stylus (m_dft.get_stylus ());
280258 }
281259
282- /* !
283- * Updates the palm rejection cone with the positions of all palms on the display.
284- *
285- * Then marks all contacts inside of the cone as palms.
286- */
287- void update_touch_cone ()
288- {
289- // The cone has never seen a position update, so its inactive
290- if (!m_cone.alive ())
291- return ;
292-
293- if (!m_cone.active ())
294- return ;
295-
296- if (!m_config.touch_check_cone )
297- return ;
298-
299- for (const contacts::Contact<f64 > &contact : m_contacts) {
300- if (contact.valid .value_or (true ))
301- continue ;
302-
303- // Scale to physical coordinates
304- const f64 x = contact.mean .x () * m_config.width ;
305- const f64 y = contact.mean .y () * m_config.height ;
306-
307- m_cone.update_direction (x, y);
308- }
309-
310- // Mark all contacts inside of the cone as palms
311- for (contacts::Contact<f64 > &contact : m_contacts) {
312- if (!contact.valid .value_or (true ))
313- continue ;
314-
315- // Scale to physical coordinates
316- const f64 x = contact.mean .x () * m_config.width ;
317- const f64 y = contact.mean .y () * m_config.height ;
318-
319- contact.valid = m_cone.check (x, y);
320- }
321- }
322-
323260 /* !
324261 * Calculates the tilt-based offset of the stylus position.
325262 *
0 commit comments