tahoma2d/toonz/sources/stdfx/particlesengine.h

89 lines
3.8 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 PARTICLESENGINE_H
#define PARTICLESENGINE_H
#include "tlevel.h"
#include "particles.h"
#include "particlesfx.h"
class Particle;
2016-06-15 18:43:10 +12:00
class Particles_Engine {
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
ParticlesFx *m_parent;
double m_frame;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
Particles_Engine(ParticlesFx *parent, double frame);
~Particles_Engine(){};
// Destructor
void scramble_particles(void);
void fill_range_struct(struct particles_values &values,
struct particles_ranges &ranges);
void fill_value_struct(struct particles_values &value, double frame);
void roll_particles(TTile *tile, std::map<int, TTile *> porttiles,
const TRenderSettings &ri,
std::list<Particle> &myParticles,
struct particles_values &values, float cx, float cy,
int frame, int curr_frame, int level_n,
bool *random_level, float dpi, std::vector<int> lastframe,
int &totalparticles);
void normalize_values(struct particles_values &values,
const TRenderSettings &ri);
void render_particles(
TFlash *flash, TTile *tile, std::vector<TRasterFxPort *> part_ports,
const TRenderSettings &ri, TDimension &p_size, TPointD &p_offset,
std::map<int, TRasterFxPort *> ctrl_ports, std::vector<TLevelP> partLevel,
float dpi, int curr_frame, int shrink, double startx, double starty,
double endx, double endy, std::vector<int> lastframe, unsigned long fxId);
void do_render(TFlash *flash, Particle *part, TTile *tile,
std::vector<TRasterFxPort *> part_ports,
std::map<int, TTile *> porttiles, const TRenderSettings &ri,
TDimension &p_size, TPointD &p_offset, int lastframe,
std::vector<TLevelP> partLevel,
struct particles_values &values, double opacity_range,
int curr_frame,
std::map<std::pair<int, int>, double> &partScales);
bool port_is_used(int i, struct particles_values &values);
/*-
do_source_gradationがONのとき
Histogramを格納しながら領域を登録する -*/
void fill_regions(int frame, std::vector<std::vector<TPointD>> &myregions,
TTile *ctrl1, bool multi, int thres,
bool do_source_gradation,
std::vector<std::vector<int>> &myHistogram);
void fill_single_region(std::vector<std::vector<TPointD>> &myregions,
TTile *ctrl1, int thres, bool do_source_gradation,
std::vector<std::vector<int>> &myHistogram);
/*-- Perspective
DistributionがONのときSizeに刺さったControlImageが粒子の発生分布を決める
SourceのControlが刺さっている場合は
--*/
void fill_regions_with_size_map(std::vector<std::vector<TPointD>> &myregions,
std::vector<std::vector<int>> &myHistogram,
TTile *sizeTile, TTile *sourceTile,
int thres);
void fill_subregions(int cont_index,
std::vector<std::vector<TPointD>> &myregions,
TTile *ctrl1, int thres);
void normalize_array(std::vector<std::vector<TPointD>> &myregions,
TPointD pos, int lx, int ly, int regioncounter,
std::vector<int> &myarray, std::vector<int> &lista,
std::vector<int> &listb, std::vector<int> & final);
void fill_array(TTile *ctrl1, int &regioncount, std::vector<int> &myarray,
std::vector<int> &lista, std::vector<int> &listb, int thres);
2016-03-19 06:57:51 +13:00
};
#endif