Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef LINEAR_POTENTIAL_H
Toshihiro Shimizu 890ddd
#define LINEAR_POTENTIAL_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/**
Toshihiro Shimizu 890ddd
 * @author  Fabrizio Morciano <fabrizio.morciano@gmail.com></fabrizio.morciano@gmail.com>
Toshihiro Shimizu 890ddd
 */
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//#include "tcommon.h"
Toshihiro Shimizu 890ddd
//#include "tstroke.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "ext/Potential.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TNZEXT_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace ToonzExt {
Shinya Kitaoka d1f6c4
class DVAPI LinearPotential final : public Potential {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  virtual ~LinearPotential();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  double value_(double radiusToTest) const override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void setParameters_(const TStroke *ref, double w,
Shinya Kitaoka 38fd86
                      double actionLength) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  Potential *clone() override;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 120a6e
  double compute_shape(double) const;  // funzione ausiliaria per
Shinya Kitaoka 120a6e
  // il calcolo del parametro
Shinya Kitaoka 120a6e
  // da usare
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  double compute_value(double) const;  // funzione ausiliaria per
Shinya Kitaoka 120a6e
  // il calcolo del potenziale senza
Shinya Kitaoka 120a6e
  // controllo del parametro
Shinya Kitaoka 120a6e
  const TStroke *ref_;
Shinya Kitaoka 120a6e
  double
Shinya Kitaoka 120a6e
      /**
Shinya Kitaoka 120a6e
* @brief Range of mapping
Shinya Kitaoka 120a6e
*
Shinya Kitaoka 120a6e
* Only an interval of potential function will be used to
Shinya Kitaoka 120a6e
* map the tranformation.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
      range_,
Shinya Kitaoka 120a6e
      par_,            //! Parameter of selection.
Shinya Kitaoka 120a6e
      actionLength_,   //! Action length, how many units to move.
Shinya Kitaoka 120a6e
      strokeLength_,   //! Stroke Length.
MCCCS a0ce32
      lengthAtParam_,  //! Length at par_
Shinya Kitaoka 120a6e
      leftFactor_,     //! How many units to move on the left of curve.
Shinya Kitaoka 120a6e
      rightFactor_;    //! How many units to move on the right of curve.
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
#endif /* LINEAR_POTENTIAL_H */
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
//  End Of File
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------