1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_PLANT_H
26 #define __SYNFIG_PLANT_H
28 /* === H E A D E R S ======================================================= */
32 #include <synfig/layer_composite.h>
33 #include <synfig/segment.h>
34 #include <synfig/blinepoint.h>
35 #include <synfig/value.h>
36 #include <synfig/gradient.h>
37 #include <synfig/angle.h>
39 #include <synfig/rect.h>
41 /* === M A C R O S ========================================================= */
43 /* === T Y P E D E F S ===================================================== */
45 /* === C L A S S E S & S T R U C T S ======================================= */
47 using namespace synfig;
51 class Plant : public synfig::Layer_Composite
53 SYNFIG_LAYER_MODULE_EXT
56 std::vector<synfig::BLinePoint> bline;
59 synfig::Gradient gradient;
66 Particle(const synfig::Point &point,const synfig::Color& color):
67 point(point),color(color) { }
70 mutable std::vector<Particle> particle_list;
71 mutable synfig::Rect bounding_rect;
72 synfig::Angle split_angle;
73 synfig::Vector gravity;
74 synfig::Real velocity;
75 synfig::Real perp_velocity;
82 synfig::Real random_factor;
86 mutable bool needs_sync_;
87 mutable synfig::Mutex mutex;
89 void branch(int n, int depth,float t, float stunt_growth, synfig::Point position,synfig::Vector velocity)const;
96 void calc_bounding_rect()const;
98 virtual bool set_param(const String & param, const synfig::ValueBase &value);
100 virtual ValueBase get_param(const String & param)const;
102 virtual Vocab get_param_vocab()const;
104 virtual bool accelerated_render(synfig::Context context,synfig::Surface *surface,int quality, const synfig::RendDesc &renddesc, synfig::ProgressCallback *cb)const;\
106 virtual synfig::Rect get_bounding_rect(synfig::Context context)const;
109 /* === E N D =============================================================== */