1 /* === S I N F G =========================================================== */
3 ** \brief Template Header
5 ** $Id: plant.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === S T A R T =========================================================== */
24 #ifndef __SINFG_PLANT_H
25 #define __SINFG_PLANT_H
27 /* === H E A D E R S ======================================================= */
31 #include <sinfg/layer_composite.h>
32 #include <sinfg/segment.h>
33 #include <sinfg/blinepoint.h>
34 #include <sinfg/value.h>
35 #include <sinfg/gradient.h>
36 #include <sinfg/angle.h>
38 #include <sinfg/rect.h>
40 /* === M A C R O S ========================================================= */
42 /* === T Y P E D E F S ===================================================== */
44 /* === C L A S S E S & S T R U C T S ======================================= */
46 using namespace sinfg;
50 class Plant : public sinfg::Layer_Composite
52 SINFG_LAYER_MODULE_EXT
55 std::vector<sinfg::BLinePoint> bline;
58 sinfg::Gradient gradient;
65 Particle(const sinfg::Point &point,const sinfg::Color& color):
66 point(point),color(color) { }
69 mutable std::vector<Particle> particle_list;
70 mutable sinfg::Rect bounding_rect;
71 sinfg::Angle split_angle;
72 sinfg::Vector gravity;
80 sinfg::Real random_factor;
84 mutable bool needs_sync_;
87 void branch(int n, int depth,float t, float stunt_growth, sinfg::Point position,sinfg::Vector velocity)const;
95 void calc_bounding_rect()const;
97 virtual bool set_param(const String & param, const sinfg::ValueBase &value);
99 virtual ValueBase get_param(const String & param)const;
101 virtual Vocab get_param_vocab()const;
103 virtual bool accelerated_render(sinfg::Context context,sinfg::Surface *surface,int quality, const sinfg::RendDesc &renddesc, sinfg::ProgressCallback *cb)const;\
105 virtual sinfg::Rect get_bounding_rect(sinfg::Context context)const;
108 /* === E N D =============================================================== */