<commit_before>#ifndef OSC_POLYGON_HPP_INCLUDED
#define OSC_POLYGON_HPP_INCLUDED

#include "osc_common_draw.hpp"
#include "Polygon.h"
#include "FigureGraphic.hpp"
#include "InputGestureDirectObjects.hpp"
#include "InputGestureDirectFingers.hpp"


class OSCPolygonObject :public FigureGraphic, public OSCCommonDrawObject
{
    public:
    Figures::Polygon polygon;
    int id;
    bool drawstroke;
    bool drawpolygon;
    ofColor poly_color;
    ofColor stroke_color;
    int linewidth;
    void AddPoint(ofPoint point)
    {
        polygon.AddVertex(point);
    }
    void Clear()
    {
        polygon = Figures::Polygon();
    }
    bool collide(ofPoint point)
    {
        return polygon.Collide(point);
    }
    void SetTexture(std::string texture)
    {
        if(texture.compare("none")== 0)
        {
            polygon.SetTexture("");
        }
        else
            polygon.SetTexture(texture);
    }
    OSCPolygonObject():FigureGraphic(&polygon),drawpolygon(true),drawstroke(false),linewidth(1),id(0)
    {
        this->registerMyEvent(InputGestureDirectObjects::I().newObject,&OSCPolygonObject::newObject);
        this->registerMyEvent(InputGestureDirectObjects::I().enterObject,&OSCPolygonObject::newObject);
        this->registerMyEvent(InputGestureDirectObjects::I().removeObject,&OSCPolygonObject::removeObject);
        this->registerMyEvent(InputGestureDirectObjects::I().exitObject,&OSCPolygonObject::removeObject);
        this->registerMyEvent(InputGestureDirectObjects::I().updateObject,&OSCPolygonObject::updateObject);
        this->registerMyEvent(InputGestureDirectFingers::I().newCursor, &OSCPolygonObject::newCursor);
        this->registerMyEvent(InputGestureDirectFingers::I().enterCursor, &OSCPolygonObject::newCursor);
        this->registerMyEvent(InputGestureDirectFingers::I().removeCursor, &OSCPolygonObject::removeCursor);
        this->registerMyEvent(InputGestureDirectFingers::I().exitCursor, &OSCPolygonObject::removeCursor);
        this->registerMyEvent(InputGestureDirectFingers::I().updateCursor, &OSCPolygonObject::updateCursor);
        hasAlpha(true);
        color.set(255,255,255,255);
    }
    void newCursor(InputGestureDirectFingers::newCursorArgs & a)
    {
        DirectFinger *df = a.finger;
        ofxOscMessage msg1;
        msg1.setAddress("/figure/addfinger");
        OscPacker(msg1) << (int)id << (int)df->s_id;
        OSCDispatcher::Instance().sender.sendMessage(msg1);

        ofxOscMessage msg;
        msg.setAddress("/figure/finger");
        OscPacker(msg) << (int)id <<(int)df->s_id << (float) df->getX() << (float) df->getY();
        OSCDispatcher::Instance().sender.sendMessage(msg);
    }
    void removeCursor(InputGestureDirectFingers::removeCursorArgs & a)
    {
        DirectFinger *df = a.finger;
        ofxOscMessage msg1;
        msg1.setAddress("/figure/rmfinger");
        OscPacker(msg1) << (int)id << (int)df->s_id;
        OSCDispatcher::Instance().sender.sendMessage(msg1);
    }
    void updateCursor(InputGestureDirectFingers::updateCursorArgs & a)<commit_msg>report position on finger remove<commit_after>#ifndef OSC_POLYGON_HPP_INCLUDED
#define OSC_POLYGON_HPP_INCLUDED

#include "osc_common_draw.hpp"
#include "Polygon.h"
#include "FigureGraphic.hpp"
#include "InputGestureDirectObjects.hpp"
#include "InputGestureDirectFingers.hpp"


class OSCPolygonObject :public FigureGraphic, public OSCCommonDrawObject
{
    public:
    Figures::Polygon polygon;
    int id;
    bool drawstroke;
    bool drawpolygon;
    ofColor poly_color;
    ofColor stroke_color;
    int linewidth;
    void AddPoint(ofPoint point)
    {
        polygon.AddVertex(point);
    }
    void Clear()
    {
        polygon = Figures::Polygon();
    }
    bool collide(ofPoint point)
    {
        return polygon.Collide(point);
    }
    void SetTexture(std::string texture)
    {
        if(texture.compare("none")== 0)
        {
            polygon.SetTexture("");
        }
        else
            polygon.SetTexture(texture);
    }
    OSCPolygonObject():FigureGraphic(&polygon),drawpolygon(true),drawstroke(false),linewidth(1),id(0)
    {
        this->registerMyEvent(InputGestureDirectObjects::I().newObject,&OSCPolygonObject::newObject);
        this->registerMyEvent(InputGestureDirectObjects::I().enterObject,&OSCPolygonObject::newObject);
        this->registerMyEvent(InputGestureDirectObjects::I().removeObject,&OSCPolygonObject::removeObject);
        this->registerMyEvent(InputGestureDirectObjects::I().exitObject,&OSCPolygonObject::removeObject);
        this->registerMyEvent(InputGestureDirectObjects::I().updateObject,&OSCPolygonObject::updateObject);
        this->registerMyEvent(InputGestureDirectFingers::I().newCursor, &OSCPolygonObject::newCursor);
        this->registerMyEvent(InputGestureDirectFingers::I().enterCursor, &OSCPolygonObject::newCursor);
        this->registerMyEvent(InputGestureDirectFingers::I().removeCursor, &OSCPolygonObject::removeCursor);
        this->registerMyEvent(InputGestureDirectFingers::I().exitCursor, &OSCPolygonObject::removeCursor);
        this->registerMyEvent(InputGestureDirectFingers::I().updateCursor, &OSCPolygonObject::updateCursor);
        hasAlpha(true);
        color.set(255,255,255,255);
    }
    void newCursor(InputGestureDirectFingers::newCursorArgs & a)
    {
        DirectFinger *df = a.finger;
        ofxOscMessage msg1;
        msg1.setAddress("/figure/addfinger");
        OscPacker(msg1) << (int)id << (int)df->s_id;
        OSCDispatcher::Instance().sender.sendMessage(msg1);

        ofxOscMessage msg;
        msg.setAddress("/figure/finger");
        OscPacker(msg) << (int)id <<(int)df->s_id << (float) df->getX() << (float) df->getY();
        OSCDispatcher::Instance().sender.sendMessage(msg);
    }
    void removeCursor(InputGestureDirectFingers::removeCursorArgs & a)
    {
        DirectFinger *df = a.finger;
        ofxOscMessage msg1;
        msg1.setAddress("/figure/rmfinger");
        OscPacker(msg1) << (int)id << (int)df->s_id << (float) df->getX() << (float) df->getY();
        OSCDispatcher::Instance().sender.sendMessage(msg1);
    }
    void updateCursor(InputGestureDirectFingers::updateCursorArgs & a)
{'fraction_non_alphanumeric': 0.13066623648975642, 'fraction_numerical': 0.0074205517018874016, 'mean_word_length': 4.044751830756713, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4850750', 'n_tokens_mistral': 2016, 'n_tokens_neox': 1942, 'n_words': 235}