| #pragma once |
| |
| #ifndef T_L2LAUTOCLOSER_H |
| #define T_L2LAUTOCLOSER_H |
| |
| #include <memory> |
| |
| #include "tgeometry.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TVECTORIMAGE_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| #ifdef _WIN32 |
| #pragma warning(disable : 4251) |
| #endif |
| |
| |
| class TStroke; |
| |
| |
| |
| |
| class DVAPI TL2LAutocloser { |
| class Imp; |
| std::unique_ptr<Imp> m_imp; |
| |
| public: |
| TL2LAutocloser(); |
| ~TL2LAutocloser(); |
| |
| struct Segment { |
| |
| TStroke *stroke0, *stroke1; |
| double w0, w1; |
| TThickPoint p0, p1; |
| double dist2; |
| }; |
| |
| |
| void setMaxDistance2(double dist2); |
| double getMaxDistance2() const; |
| |
| |
| |
| |
| |
| void search(std::vector<Segment> &segments, TStroke *stroke0, |
| TStroke *stroke1); |
| |
| |
| void search(std::vector<Segment> &segments, TStroke *stroke0, |
| TStroke *stroke1, const std::vector<DoublePair> &intersection); |
| |
| |
| void draw(); |
| |
| private: |
| |
| TL2LAutocloser(const TL2LAutocloser &); |
| const TL2LAutocloser &operator=(const TL2LAutocloser &); |
| }; |
| |
| |
| |
| #endif |