1 #pragma once
2 
3 #ifndef PLASTICDEFORMERFX_H
4 #define PLASTICDEFORMERFX_H
5 
6 // TnzLib includes
7 #include "toonz/txshsimplelevel.h"
8 #include "toonz/tstageobject.h"
9 
10 // TnzBase includes
11 #include "trasterfx.h"
12 
13 //=====================================================
14 
15 //    Forward declarations
16 
17 class TXsheet;
18 
19 //=====================================================
20 
21 //***************************************************************************************************
22 //    PlasticDeformerFx  declaration
23 //***************************************************************************************************
24 
25 //! PlasticDeformerFx is a hidden fx used to inject data about a plastic
26 //! deformation just above a
27 //! TLevelColumnFx instance.
28 class PlasticDeformerFx final : public TRasterFx {
29   FX_DECLARATION(PlasticDeformerFx)
30 
31   bool m_was64bit = false;
32 
33 public:
34   TXsheet *m_xsh;          //!< The Fx's enclosing Xsheet
35   int m_col;               //!< The input column index
36   TAffine m_texPlacement;  //!< Texture to mesh reference transform
37 
38   TRasterFxPort m_port;  //!< Input port
39 
40 public:
41   PlasticDeformerFx();
42 
43   TFx *clone(bool recursive = true) const override;
44 
45   bool canHandle(const TRenderSettings &info, double frame) override;
46 
47   std::string getAlias(double frame,
48                        const TRenderSettings &info) const override;
49   bool doGetBBox(double frame, TRectD &bbox,
50                  const TRenderSettings &info) override;
51 
52   void doCompute(TTile &tile, double frame,
53                  const TRenderSettings &info) override;
54   void doDryCompute(TRectD &rect, double frame,
55                     const TRenderSettings &info) override;
56 
getPluginId()57   std::string getPluginId() const override { return std::string(); }
58 
59 private:
60   void buildRenderSettings(double, TRenderSettings &);
61 
62   bool buildTextureData(double, TRenderSettings &, TAffine &);
63   bool buildTextureDataSl(double, TRenderSettings &, TAffine &);
64 
65   // not implemented
66   PlasticDeformerFx(const PlasticDeformerFx &);
67   PlasticDeformerFx &operator=(const PlasticDeformerFx &);
68 };
69 
70 #endif  // PLASTICDEFORMERFX_H
71