1 // userdata.hxx -- two classes for populating ssg user data slots in association
2 // with our implimenation of random surface objects.
4 // Written by David Megginson, started December 2001.
6 // Copyright (C) 2001 - 2003 Curtis L. Olson - http://www.flightgear.org/~curt
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 #ifndef _SG_USERDATA_HXX
26 #define _SG_USERDATA_HXX
28 #include <simgear/compiler.h>
34 #include <osg/Referenced>
35 #include <osg/Geometry>
42 class SGMatModelGroup;
48 * the application must call sgUserDataInit() and specify the
49 * following values (needed by the model loader callback at draw time)
50 * before drawing any scenery.
52 void sgUserDataInit( SGModelLib *m, const string &r,
53 SGPropertyNode *p, double t );
57 * User data for populating leaves when they come in range.
59 class SGLeafUserData : public osg::Referenced
71 void setup_triangle( int i );
76 * User data for populating triangles when they come in range.
78 class SGTriUserData : public osg::Referenced
87 SGMatModelGroup * object_group;
89 SGLeafUserData * leafData;
92 void fill_in_triangle();
93 void add_object_to_triangle(SGMatModel * object);
94 void makeWorldMatrix (sgMat4 ROT, double hdg_deg );
97 #endif // _SG_USERDATA_HXX