|
|
9cf8be |
#pragma once
|
|
|
9cf8be |
|
|
|
9cf8be |
#ifndef MODIFIERASSISTANTS_INCLUDED
|
|
|
9cf8be |
#define MODIFIERASSISTANTS_INCLUDED
|
|
|
9cf8be |
|
|
|
9cf8be |
// TnzTools includes
|
|
|
9cf8be |
#include <tools assistant.h=""></tools>
|
|
|
9cf8be |
#include <tools inputmanager.h=""></tools>
|
|
|
9cf8be |
|
|
|
9cf8be |
#undef DVAPI
|
|
|
9cf8be |
#undef DVVAR
|
|
|
9cf8be |
#ifdef TNZTOOLS_EXPORTS
|
|
|
9cf8be |
#define DVAPI DV_EXPORT_API
|
|
|
9cf8be |
#define DVVAR DV_EXPORT_VAR
|
|
|
9cf8be |
#else
|
|
|
9cf8be |
#define DVAPI DV_IMPORT_API
|
|
|
9cf8be |
#define DVVAR DV_IMPORT_VAR
|
|
|
9cf8be |
#endif
|
|
|
9cf8be |
|
|
|
9cf8be |
|
|
|
9cf8be |
//===================================================================
|
|
|
9cf8be |
|
|
|
9cf8be |
//*****************************************************************************************
|
|
|
9cf8be |
// TModifierAssistants definition
|
|
|
9cf8be |
//*****************************************************************************************
|
|
|
9cf8be |
|
|
|
6be163 |
class DVAPI TModifierAssistants: public TInputModifier {
|
|
|
9cf8be |
public:
|
|
|
fa009d |
typedef TSubTrackHandler Handler;
|
|
|
fa009d |
class DVAPI Interpolator: public TTrackInterpolator {
|
|
|
9cf8be |
public:
|
|
|
fa009d |
const double magnetism;
|
|
|
9cf8be |
TGuidelineList guidelines;
|
|
|
fa009d |
inline Interpolator(TTrack &track, double magnetism):
|
|
|
fa009d |
TTrackInterpolator(track),
|
|
|
fa009d |
magnetism(magnetism > 0 ? (magnetism < 1 ? magnetism : 1) : 0)
|
|
|
fa009d |
{ }
|
|
|
fa009d |
TTrackPoint interpolate(double index) override;
|
|
|
9cf8be |
};
|
|
|
9cf8be |
|
|
|
362052 |
private:
|
|
|
362052 |
bool scanAssistants(
|
|
|
362052 |
const TPointD *positions,
|
|
|
362052 |
int positionsCount,
|
|
|
362052 |
TGuidelineList *outGuidelines,
|
|
|
3d32e2 |
bool draw,
|
|
|
fa009d |
bool enabledOnly,
|
|
|
fa009d |
bool drawGuidelines ) const;
|
|
|
362052 |
|
|
|
9cf8be |
public:
|
|
|
fa009d |
double magnetism;
|
|
|
493cac |
double sensitiveLength;
|
|
|
9cf8be |
|
|
|
fa009d |
explicit TModifierAssistants(double magnetism = 1);
|
|
|
9cf8be |
|
|
|
9cf8be |
void modifyTrack(
|
|
|
9cf8be |
const TTrack &track,
|
|
|
9cf8be |
TTrackList &outTracks ) override;
|
|
|
362052 |
|
|
|
362052 |
TRectD calcDrawBounds(const TTrackList &tracks, const THoverList &hovers) override;
|
|
|
362052 |
|
|
|
362052 |
void drawTrack(const TTrack &track) override;
|
|
|
362052 |
void draw(const TTrackList &tracks, const THoverList &hovers) override;
|
|
|
9cf8be |
};
|
|
|
9cf8be |
|
|
|
9cf8be |
|
|
|
9cf8be |
#endif
|