Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
MCCCS a0ce32
#ifndef NOT_Symmetric_EXP_POTENTIAL_H
MCCCS a0ce32
#define NOT_Symmetric_EXP_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
/**
Toshihiro Shimizu 890ddd
 * @brief This class is to use a not symmetric exponential potential.
Shinya Kitaoka 120a6e
 *
Toshihiro Shimizu 890ddd
 *  @code
Toshihiro Shimizu 890ddd
 *          __|_
Shinya Kitaoka 120a6e
 *        /   | |
Toshihiro Shimizu 890ddd
 *    __/     |  \___
Toshihiro Shimizu 890ddd
 *
Toshihiro Shimizu 890ddd
 *                                         2
Toshihiro Shimizu 890ddd
 *                    {   -[(x  - t) / d1]
Toshihiro Shimizu 890ddd
 *                    {  e [             ]   for x < 0
Toshihiro Shimizu 890ddd
 *                    {
Toshihiro Shimizu 890ddd
 *      potential(x)= {
Toshihiro Shimizu 890ddd
 *                    {                     2
Shinya Kitaoka 120a6e
 *                    {   -[(x  - t) / d2]
Toshihiro Shimizu 890ddd
 *                    {  e [             ] for x >= 0
Shinya Kitaoka 120a6e
 *
Toshihiro Shimizu 890ddd
 * con d   min( length_at_param, action_length *0.5)
Shinya Kitaoka 120a6e
 *      1
MCCCS a0ce32
 * ed  d   min( curve_length - length_at_param, action_length *0.5)
Toshihiro Shimizu 890ddd
 *      2
Toshihiro Shimizu 890ddd
 *  @endcode
Toshihiro Shimizu 890ddd
 */
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tcommon.h"
Toshihiro Shimizu 890ddd
#include "tstroke.h"
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 {
MCCCS a0ce32
class DVAPI NotSymmetricExpPotential final : public Potential {
Toshihiro Shimizu 890ddd
public:
MCCCS a0ce32
  virtual ~NotSymmetricExpPotential();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // chiama compute_value ma effettua un controllo del parametro
Shinya Kitaoka 473e70
  double value_(double radiusToTest) const override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void setParameters_(const TStroke *ref, double par, double al) override;
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 range_;  // range of mapping
Shinya Kitaoka 120a6e
  double par_;
Shinya Kitaoka 120a6e
  double actionLength_;   // lunghezza dell'azione
Shinya Kitaoka 120a6e
  double strokeLength_;   // lunghezza stroke
MCCCS a0ce32
  double lengthAtParam_;  // lunghezza nel pto di movimento
Shinya Kitaoka 120a6e
  double leftFactor_;     // fattore di shape x la curva a sinistra
Shinya Kitaoka 120a6e
  double rightFactor_;    // fattore di shape x la curva a dx
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
}
MCCCS a0ce32
#endif /* NOT_Symmetric_EXP_POTENTIAL_H */
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
//  End Of File
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------