Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "ext/SelfLoopDeformation.h"
Toshihiro Shimizu 890ddd
#include "DeformationSelector.h"
Toshihiro Shimizu 890ddd
#include <tstroke.h></tstroke.h>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
using namespace ToonzExt;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// REGISTER(SelfLoopDeformation);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
SelfLoopDeformation::SelfLoopDeformation() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
SelfLoopDeformation::~SelfLoopDeformation() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void SelfLoopDeformation::activate_impl(Context *, DraggerStatus *) {
Shinya Kitaoka 120a6e
  assert(!"SelfLoopDeformation::activate not yet implemented!");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
bool SelfLoopDeformation::check(Context *dragger, DraggerStatus *status) {
Shinya Kitaoka 120a6e
  assert(status && dragger && "Not dragger or status available");
Shinya Kitaoka 120a6e
  assert(!"SelfLoopDeformation::check not yet implemented!");
Shinya Kitaoka 120a6e
  //  lengthOfAction_ = status->lengthOfAction_;
Shinya Kitaoka 120a6e
  //  deformerSensibility_ = status->deformerSensibility_;
Shinya Kitaoka 120a6e
  //  stroke2move_ = status->stroke2change_;
Shinya Kitaoka 120a6e
  TStroke *s = stroke2move_;
Shinya Kitaoka 120a6e
  //  double &w = status->w_;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (s->isSelfLoop()) {
Shinya Kitaoka 120a6e
    //    dragger->changeDeformation(SelfLoopDeformation::instance());
Shinya Kitaoka 120a6e
    //    SelfLoopDeformation::instance()->activate(dragger,
Shinya Kitaoka 120a6e
    //                                              status);
Shinya Kitaoka 120a6e
    return true;
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  return false;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void SelfLoopDeformation::update_impl(Context *, const TPointD &delta) {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void SelfLoopDeformation::deactivate_impl(Context *) {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void SelfLoopDeformation::draw(Designer *dr) {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
SelfLoopDeformation *SelfLoopDeformation::instance() {
Shinya Kitaoka 120a6e
  static SelfLoopDeformation singleton;
Shinya Kitaoka 120a6e
  return &singleton;
Toshihiro Shimizu 890ddd
}