tahoma2d/toonz/sources/include/ext/LinearPotential.h

66 lines
1.6 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef LINEAR_POTENTIAL_H
#define LINEAR_POTENTIAL_H
/**
* @author Fabrizio Morciano <fabrizio.morciano@gmail.com>
*/
//#include "tcommon.h"
//#include "tstroke.h"
#include "ext/Potential.h"
#undef DVAPI
#undef DVVAR
#ifdef TNZEXT_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
2016-06-15 18:43:10 +12:00
namespace ToonzExt {
class DVAPI LinearPotential final : public Potential {
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
virtual ~LinearPotential();
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
double value_(double radiusToTest) const override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
void setParameters_(const TStroke *ref, double w,
2016-06-20 14:23:05 +12:00
double actionLength) override;
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
Potential *clone() override;
2016-03-19 06:57:51 +13:00
private:
2016-06-15 18:43:10 +12:00
double compute_shape(double) const; // funzione ausiliaria per
// il calcolo del parametro
// da usare
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
double compute_value(double) const; // funzione ausiliaria per
// il calcolo del potenziale senza
// controllo del parametro
const TStroke *ref_;
double
/**
* @brief Range of mapping
*
* Only an interval of potential function will be used to
* map the transformation.
2016-06-15 18:43:10 +12:00
*/
range_,
par_, //! Parameter of selection.
actionLength_, //! Action length, how many units to move.
strokeLength_, //! Stroke Length.
2016-09-06 01:20:21 +12:00
lengthAtParam_, //! Length at <code>par_</code>
2016-06-15 18:43:10 +12:00
leftFactor_, //! How many units to move on the left of curve.
rightFactor_; //! How many units to move on the right of curve.
2016-03-19 06:57:51 +13:00
};
}
#endif /* LINEAR_POTENTIAL_H */
//-----------------------------------------------------------------------------
// End Of File
//-----------------------------------------------------------------------------