1 // placement.hxx - manage the placment of a 3D model.
2 // Written by David Megginson, started 2002.
4 // This file is in the Public Domain, and comes with no warranty.
7 #ifndef _SG_PLACEMENT_HXX
8 #define _SG_PLACEMENT_HXX 1
11 # error This library requires C++
17 #include <simgear/math/point3d.hxx>
18 #include <simgear/props/props.hxx>
19 #include <simgear/structure/ssgSharedPtr.hxx>
22 // Don't pull in the headers, since we don't need them here.
24 class ssgPlacementTransform;
27 // Has anyone done anything *really* stupid, like making min and max macros?
36 ////////////////////////////////////////////////////////////////////////
38 ////////////////////////////////////////////////////////////////////////
41 * A wrapper for a model with a definite placement.
43 class SGModelPlacement
48 virtual ~SGModelPlacement ();
50 virtual void init( ssgBranch * model );
52 virtual void update();
54 virtual ssgEntity * getSceneGraph () { return (ssgEntity *)_selector; }
56 virtual SGLocation * getSGLocation () { return _location; }
58 virtual bool getVisible () const;
59 virtual void setVisible (bool visible);
61 virtual double getLongitudeDeg () const { return _lon_deg; }
62 virtual double getLatitudeDeg () const { return _lat_deg; }
63 virtual double getElevationFt () const { return _elev_ft; }
65 virtual void setLongitudeDeg (double lon_deg);
66 virtual void setLatitudeDeg (double lat_deg);
67 virtual void setElevationFt (double elev_ft);
68 virtual void setPosition (double lon_deg, double lat_deg, double elev_ft);
69 void setPosition(const SGGeod& position);
71 virtual double getRollDeg () const { return _roll_deg; }
72 virtual double getPitchDeg () const { return _pitch_deg; }
73 virtual double getHeadingDeg () const { return _heading_deg; }
75 virtual void setRollDeg (double roll_deg);
76 virtual void setPitchDeg (double pitch_deg);
77 virtual void setHeadingDeg (double heading_deg);
78 virtual void setOrientation (double roll_deg, double pitch_deg,
80 void setOrientation(const SGQuatd& orientation);
82 ssgPlacementTransform * getTransform(void)
97 ssgSharedPtr<ssgSelector> _selector;
98 ssgSharedPtr<ssgPlacementTransform> _position;
101 SGLocation * _location;
104 #endif // _SG_PLACEMENT_HXX