1 /* === S Y N F I G ========================================================= */
3 ** \brief Header file for implementation of the "Plant" layer
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2007, 2008 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === S T A R T =========================================================== */
26 #ifndef __SYNFIG_PLANT_H
27 #define __SYNFIG_PLANT_H
29 /* === H E A D E R S ======================================================= */
33 #include <synfig/layer_composite.h>
34 #include <synfig/segment.h>
35 #include <synfig/blinepoint.h>
36 #include <synfig/value.h>
37 #include <synfig/gradient.h>
38 #include <synfig/angle.h>
40 #include <synfig/rect.h>
42 /* === M A C R O S ========================================================= */
44 /* === T Y P E D E F S ===================================================== */
46 /* === C L A S S E S & S T R U C T S ======================================= */
48 using namespace synfig;
52 class Plant : public synfig::Layer_Composite
54 SYNFIG_LAYER_MODULE_EXT
57 std::vector<synfig::BLinePoint> bline;
62 synfig::Gradient gradient;
69 Particle(const synfig::Point &point,const synfig::Color& color):
70 point(point),color(color) { }
73 mutable std::vector<Particle> particle_list;
74 mutable synfig::Rect bounding_rect;
75 synfig::Angle split_angle;
76 synfig::Vector gravity;
77 synfig::Real velocity;
78 synfig::Real perp_velocity;
85 synfig::Real random_factor;
90 mutable bool needs_sync_;
91 mutable synfig::Mutex mutex;
93 void branch(int n, int depth,float t, float stunt_growth, synfig::Point position,synfig::Vector velocity)const;
102 void calc_bounding_rect()const;
104 virtual bool set_param(const String & param, const synfig::ValueBase &value);
106 virtual ValueBase get_param(const String & param)const;
108 virtual bool set_version(const synfig::String &ver);
110 virtual Vocab get_param_vocab()const;
112 virtual bool accelerated_render(synfig::Context context,synfig::Surface *surface,int quality, const synfig::RendDesc &renddesc, synfig::ProgressCallback *cb)const;\
114 virtual synfig::Rect get_bounding_rect(synfig::Context context)const;
117 /* === E N D =============================================================== */