Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gwaldron/osgearth
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferey committed Feb 24, 2012
2 parents 3c961ef + 2f4c8a5 commit 6ab3f98
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
12 changes: 6 additions & 6 deletions src/osgEarthDrivers/model_simple/SimpleModelSource.cpp
Expand Up @@ -103,12 +103,12 @@ class SimpleModelSource : public ModelSource


if (_options.orientation().isSet()) if (_options.orientation().isSet())
{ {
//Apply the rotation //Apply the rotation
osg::Matrix rot_mat; osg::Matrix rot_mat;
rot_mat.makeRotate( rot_mat.makeRotate(
osg::DegreesToRadians((*_options.orientation()).y()), osg::Vec3(1,0,0), osg::DegreesToRadians((*_options.orientation()).y()), osg::Vec3(1,0,0),
osg::DegreesToRadians((*_options.orientation()).x()), osg::Vec3(0,0,1), osg::DegreesToRadians((*_options.orientation()).x()), osg::Vec3(0,0,1),
osg::DegreesToRadians((*_options.orientation()).z()), osg::Vec3(0,1,0) ); osg::DegreesToRadians((*_options.orientation()).z()), osg::Vec3(0,1,0) );
matrix.preMult(rot_mat); matrix.preMult(rot_mat);
} }


Expand Down
62 changes: 31 additions & 31 deletions src/osgEarthQt/LOSCreationDialog.cpp
Expand Up @@ -165,7 +165,7 @@ void LOSCreationDialog::initUi(const std::string& name, osg::Group* los)
_p1Dragger = new LOSIntersectingDragger; _p1Dragger = new LOSIntersectingDragger;
_p1Dragger->setNode( _mapNode ); _p1Dragger->setNode( _mapNode );
_p1Dragger->setHandleEvents( true ); _p1Dragger->setHandleEvents( true );
_p1Dragger->addDraggerCallback(new LOSPointDraggerCallback(_map, this, LOSPoint::P2P_START)); _p1Dragger->addDraggerCallback(new LOSPointDraggerCallback(_map, this, P2P_START));
_p1Dragger->setColor(osg::Vec4(0,1,1,0)); _p1Dragger->setColor(osg::Vec4(0,1,1,0));
_p1Dragger->setPickColor(osg::Vec4(1,0,1,0)); _p1Dragger->setPickColor(osg::Vec4(1,0,1,0));
_p1Dragger->setupDefaultGeometry(); _p1Dragger->setupDefaultGeometry();
Expand All @@ -174,7 +174,7 @@ void LOSCreationDialog::initUi(const std::string& name, osg::Group* los)
_p2Dragger = new LOSIntersectingDragger; _p2Dragger = new LOSIntersectingDragger;
_p2Dragger->setNode( _mapNode ); _p2Dragger->setNode( _mapNode );
_p2Dragger->setHandleEvents( true ); _p2Dragger->setHandleEvents( true );
_p2Dragger->addDraggerCallback(new LOSPointDraggerCallback(_map, this, LOSPoint::P2P_END)); _p2Dragger->addDraggerCallback(new LOSPointDraggerCallback(_map, this, P2P_END));
_p2Dragger->setColor(osg::Vec4(0,1,1,0)); _p2Dragger->setColor(osg::Vec4(0,1,1,0));
_p2Dragger->setPickColor(osg::Vec4(1,0,1,0)); _p2Dragger->setPickColor(osg::Vec4(1,0,1,0));
_p2Dragger->setupDefaultGeometry(); _p2Dragger->setupDefaultGeometry();
Expand All @@ -183,7 +183,7 @@ void LOSCreationDialog::initUi(const std::string& name, osg::Group* los)
_radDragger = new LOSIntersectingDragger; _radDragger = new LOSIntersectingDragger;
_radDragger->setNode( _mapNode ); _radDragger->setNode( _mapNode );
_radDragger->setHandleEvents( true ); _radDragger->setHandleEvents( true );
_radDragger->addDraggerCallback(new LOSPointDraggerCallback(_map, this, LOSPoint::RADIAL_CENTER)); _radDragger->addDraggerCallback(new LOSPointDraggerCallback(_map, this, RADIAL_CENTER));
_radDragger->setColor(osg::Vec4(0,1,1,0)); _radDragger->setColor(osg::Vec4(0,1,1,0));
_radDragger->setPickColor(osg::Vec4(1,0,1,0)); _radDragger->setPickColor(osg::Vec4(1,0,1,0));
_radDragger->setupDefaultGeometry(); _radDragger->setupDefaultGeometry();
Expand Down Expand Up @@ -307,11 +307,11 @@ void LOSCreationDialog::initUi(const std::string& name, osg::Group* los)
if (_mapNode->getTerrain()->getHeight(pos.x(), pos.y(), &height)) if (_mapNode->getTerrain()->getHeight(pos.x(), pos.y(), &height))
pos.set(pos.x(), pos.y(), height); pos.set(pos.x(), pos.y(), height);


setLOSPoint(LOSPoint::P2P_START, pos, true); setLOSPoint(P2P_START, pos, true);


if (_ui.p1AltBox->value() == hat) if (_ui.p1AltBox->value() == hat)
{ {
updatePoint(LOSPoint::P2P_START); updatePoint(P2P_START);
updateLOSNodes(); updateLOSNodes();
} }
else else
Expand All @@ -321,7 +321,7 @@ void LOSCreationDialog::initUi(const std::string& name, osg::Group* los)
} }
else else
{ {
setLOSPoint(LOSPoint::P2P_START, pos, true); setLOSPoint(P2P_START, pos, true);
} }
} }


Expand All @@ -343,11 +343,11 @@ void LOSCreationDialog::initUi(const std::string& name, osg::Group* los)
if (_mapNode->getTerrain()->getHeight(pos.x(), pos.y(), &height)) if (_mapNode->getTerrain()->getHeight(pos.x(), pos.y(), &height))
pos.set(pos.x(), pos.y(), height); pos.set(pos.x(), pos.y(), height);


setLOSPoint(LOSPoint::P2P_END, pos, true); setLOSPoint(P2P_END, pos, true);


if (_ui.p2AltBox->value() == hat) if (_ui.p2AltBox->value() == hat)
{ {
updatePoint(LOSPoint::P2P_END); updatePoint(P2P_END);
updateLOSNodes(); updateLOSNodes();
} }
else else
Expand All @@ -357,7 +357,7 @@ void LOSCreationDialog::initUi(const std::string& name, osg::Group* los)
} }
else else
{ {
setLOSPoint(LOSPoint::P2P_END, pos, true); setLOSPoint(P2P_END, pos, true);
} }
} }
} }
Expand Down Expand Up @@ -404,11 +404,11 @@ void LOSCreationDialog::initUi(const std::string& name, osg::Group* los)
if (_mapNode->getTerrain()->getHeight(pos.x(), pos.y(), &height)) if (_mapNode->getTerrain()->getHeight(pos.x(), pos.y(), &height))
pos.set(pos.x(), pos.y(), height); pos.set(pos.x(), pos.y(), height);


setLOSPoint(LOSPoint::RADIAL_CENTER, pos, true); setLOSPoint(RADIAL_CENTER, pos, true);


if (_ui.radAltBox->value() == hat) if (_ui.radAltBox->value() == hat)
{ {
updatePoint(LOSPoint::RADIAL_CENTER); updatePoint(RADIAL_CENTER);
updateLOSNodes(); updateLOSNodes();
} }
else else
Expand All @@ -418,7 +418,7 @@ void LOSCreationDialog::initUi(const std::string& name, osg::Group* los)
} }
else else
{ {
setLOSPoint(LOSPoint::RADIAL_CENTER, pos, true); setLOSPoint(RADIAL_CENTER, pos, true);
} }
} }
} }
Expand Down Expand Up @@ -531,7 +531,7 @@ void LOSCreationDialog::updatePoint(LOSPoint point)
{ {
switch(point) switch(point)
{ {
case LOSPoint::P2P_START: case P2P_START:
{ {
double alt = _ui.p1AltBox->value(); double alt = _ui.p1AltBox->value();
if (_ui.p2pRelativeCheckBox->checkState() == Qt::Checked) if (_ui.p2pRelativeCheckBox->checkState() == Qt::Checked)
Expand All @@ -549,7 +549,7 @@ void LOSCreationDialog::updatePoint(LOSPoint point)
updateDragger(_p1Dragger, osg::Vec3d(x, y, z)); updateDragger(_p1Dragger, osg::Vec3d(x, y, z));
} }
break; break;
case LOSPoint::P2P_END: case P2P_END:
{ {
double alt = _ui.p2AltBox->value(); double alt = _ui.p2AltBox->value();
if (_ui.p2pRelativeCheckBox->checkState() == Qt::Checked) if (_ui.p2pRelativeCheckBox->checkState() == Qt::Checked)
Expand All @@ -567,7 +567,7 @@ void LOSCreationDialog::updatePoint(LOSPoint point)
updateDragger(_p2Dragger, osg::Vec3d(x, y, z)); updateDragger(_p2Dragger, osg::Vec3d(x, y, z));
} }
break; break;
case LOSPoint::RADIAL_CENTER: case RADIAL_CENTER:
{ {
double alt = _ui.radAltBox->value(); double alt = _ui.radAltBox->value();
if (_ui.radRelativeCheckBox->checkState() == Qt::Checked) if (_ui.radRelativeCheckBox->checkState() == Qt::Checked)
Expand Down Expand Up @@ -608,19 +608,19 @@ void LOSCreationDialog::getLOSPoint(LOSPoint point, osg::Vec3d& out_point, bool


switch(point) switch(point)
{ {
case LOSPoint::P2P_START: case P2P_START:
alt = _ui.p1AltBox->value(); alt = _ui.p1AltBox->value();
if (!relative && _ui.p2pRelativeCheckBox->checkState() == Qt::Checked) if (!relative && _ui.p2pRelativeCheckBox->checkState() == Qt::Checked)
alt += _p1BaseAlt; alt += _p1BaseAlt;
out_point.set(_ui.p1LonBox->value(), _ui.p1LatBox->value(), alt); out_point.set(_ui.p1LonBox->value(), _ui.p1LatBox->value(), alt);
break; break;
case LOSPoint::P2P_END: case P2P_END:
alt = _ui.p2AltBox->value(); alt = _ui.p2AltBox->value();
if (!relative && _ui.p2pRelativeCheckBox->checkState() == Qt::Checked) if (!relative && _ui.p2pRelativeCheckBox->checkState() == Qt::Checked)
alt += _p2BaseAlt; alt += _p2BaseAlt;
out_point.set(_ui.p2LonBox->value(), _ui.p2LatBox->value(), alt); out_point.set(_ui.p2LonBox->value(), _ui.p2LatBox->value(), alt);
break; break;
case LOSPoint::RADIAL_CENTER: case RADIAL_CENTER:
alt = _ui.radAltBox->value(); alt = _ui.radAltBox->value();
if (!relative && _ui.radRelativeCheckBox->checkState() == Qt::Checked) if (!relative && _ui.radRelativeCheckBox->checkState() == Qt::Checked)
alt += _radBaseAlt; alt += _radBaseAlt;
Expand All @@ -634,7 +634,7 @@ void LOSCreationDialog::setLOSPoint(LOSPoint point, const osg::Vec3d& value, boo
_updatingUi = !updateUi; _updatingUi = !updateUi;
switch(point) switch(point)
{ {
case LOSPoint::P2P_START: case P2P_START:
_ui.p1LatBox->setValue(value.y()); _ui.p1LatBox->setValue(value.y());
_ui.p1LonBox->setValue(value.x()); _ui.p1LonBox->setValue(value.x());


Expand All @@ -644,7 +644,7 @@ void LOSCreationDialog::setLOSPoint(LOSPoint point, const osg::Vec3d& value, boo
_ui.p1AltBox->setValue(value.z()); _ui.p1AltBox->setValue(value.z());


break; break;
case LOSPoint::P2P_END: case P2P_END:
_ui.p2LatBox->setValue(value.y()); _ui.p2LatBox->setValue(value.y());
_ui.p2LonBox->setValue(value.x()); _ui.p2LonBox->setValue(value.x());


Expand All @@ -654,7 +654,7 @@ void LOSCreationDialog::setLOSPoint(LOSPoint point, const osg::Vec3d& value, boo
_ui.p2AltBox->setValue(value.z()); _ui.p2AltBox->setValue(value.z());


break; break;
case LOSPoint::RADIAL_CENTER: case RADIAL_CENTER:
_ui.radLatBox->setValue(value.y()); _ui.radLatBox->setValue(value.y());
_ui.radLonBox->setValue(value.x()); _ui.radLonBox->setValue(value.x());


Expand All @@ -672,10 +672,10 @@ bool LOSCreationDialog::isAltitudeRelative(LOSPoint point)
{ {
switch(point) switch(point)
{ {
case LOSPoint::P2P_START: case P2P_START:
case LOSPoint::P2P_END: case P2P_END:
return _ui.p2pRelativeCheckBox->checkState() == Qt::Checked; return _ui.p2pRelativeCheckBox->checkState() == Qt::Checked;
case LOSPoint::RADIAL_CENTER: case RADIAL_CENTER:
return _ui.radRelativeCheckBox->checkState() == Qt::Checked; return _ui.radRelativeCheckBox->checkState() == Qt::Checked;
} }


Expand Down Expand Up @@ -922,11 +922,11 @@ void LOSCreationDialog::onLocationValueChanged(double d)
QObject* s = sender(); QObject* s = sender();


if (s == _ui.p1LatBox || s == _ui.p1LonBox || s == _ui.p1AltBox) if (s == _ui.p1LatBox || s == _ui.p1LonBox || s == _ui.p1AltBox)
updatePoint(LOSPoint::P2P_START); updatePoint(P2P_START);
else if (s == _ui.p2LatBox || s == _ui.p2LonBox || s == _ui.p2AltBox) else if (s == _ui.p2LatBox || s == _ui.p2LonBox || s == _ui.p2AltBox)
updatePoint(LOSPoint::P2P_END); updatePoint(P2P_END);
else if (s == _ui.radLatBox || s == _ui.radLonBox || s == _ui.radAltBox) else if (s == _ui.radLatBox || s == _ui.radLonBox || s == _ui.radAltBox)
updatePoint(LOSPoint::RADIAL_CENTER); updatePoint(RADIAL_CENTER);
} }


updateLOSNodes(); updateLOSNodes();
Expand All @@ -940,12 +940,12 @@ void LOSCreationDialog::onRelativeCheckChanged(int state)


if (s == _ui.p2pRelativeCheckBox) if (s == _ui.p2pRelativeCheckBox)
{ {
updatePoint(LOSPoint::P2P_START); updatePoint(P2P_START);
updatePoint(LOSPoint::P2P_END); updatePoint(P2P_END);
} }
else if (s == _ui.radRelativeCheckBox) else if (s == _ui.radRelativeCheckBox)
{ {
updatePoint(LOSPoint::RADIAL_CENTER); updatePoint(RADIAL_CENTER);
} }
} }


Expand Down Expand Up @@ -997,4 +997,4 @@ void LOSCreationDialog::onSpokesBoxChanged(int value)
void LOSCreationDialog::onRadiusBoxChanged(double value) void LOSCreationDialog::onRadiusBoxChanged(double value)
{ {
updateLOSNodes(); updateLOSNodes();
} }

0 comments on commit 6ab3f98

Please sign in to comment.