void
SGModelPlacement::init( osg::Node * model )
{
- // remove previous model (in case of reinit)
- _transform->removeChild(0,1);
+ // remove previous models (in case of reinit)
+ _transform->removeChild(0, _transform->getNumChildren());
if (model != 0) {
_transform->addChild(model);
}
_selector->setValue(0, 1);
}
+void
+SGModelPlacement::add( osg::Node* model )
+{
+ if (model != 0) {
+ _transform->addChild(model);
+ }
+}
+
void SGModelPlacement::clear()
{
_selector = NULL;
_selector->setValue(0, visible);
}
-void
-SGModelPlacement::setLongitudeDeg (double lon_deg)
-{
- _position.setLongitudeDeg(lon_deg);
-}
-
-void
-SGModelPlacement::setLatitudeDeg (double lat_deg)
-{
- _position.setLatitudeDeg(lat_deg);
-}
-
-void
-SGModelPlacement::setElevationFt (double elev_ft)
-{
- _position.setElevationFt(elev_ft);
-}
-
-void
-SGModelPlacement::setPosition (double lon_deg, double lat_deg, double elev_ft)
-{
- _position = SGGeod::fromDegFt(lon_deg, lat_deg, elev_ft);
-}
-
void
SGModelPlacement::setPosition(const SGGeod& position)
{
virtual void init( osg::Node* model );
void clear();
+ void add( osg::Node* model );
virtual void update();
virtual bool getVisible () const;
virtual void setVisible (bool visible);
- virtual double getLongitudeDeg () const { return _position.getLongitudeDeg(); }
- virtual double getLatitudeDeg () const { return _position.getLatitudeDeg(); }
- virtual double getElevationFt () const { return _position.getElevationFt(); }
-
- virtual void setLongitudeDeg (double lon_deg);
- virtual void setLatitudeDeg (double lat_deg);
- virtual void setElevationFt (double elev_ft);
- virtual void setPosition (double lon_deg, double lat_deg, double elev_ft);
void setPosition(const SGGeod& position);
const SGGeod& getPosition() const { return _position; }