Fixed Locator::setTransform method so it takes a const Matrixd&, and improved
the setting of Locator in the gdal plugin.
This commit is contained in:
parent
41dc911166
commit
ae5883dd23
@ -77,7 +77,7 @@ class OSGTERRAIN_EXPORT Locator : public osg::Object
|
||||
|
||||
|
||||
/** Set the transformation from local coordinates to model coordinates.*/
|
||||
void setTransform(osg::Matrixd& transform) { _transform = transform; _inverse.invert(_transform); }
|
||||
void setTransform(const osg::Matrixd& transform) { _transform = transform; _inverse.invert(_transform); }
|
||||
|
||||
/** Set the transformation from local coordinates to model coordinates.*/
|
||||
const osg::Matrixd& getTransform() const { return _transform; }
|
||||
|
@ -119,7 +119,14 @@ void DataSetLayer::setUpLocator()
|
||||
0.0, 0.0, 1.0, 0.0,
|
||||
geoTransform[0], geoTransform[3], 0.0, 1.0);
|
||||
|
||||
locator->setTransform(matrix);
|
||||
|
||||
int nPixels = _dataset->GetRasterXSize();
|
||||
int nLines = _dataset->GetRasterYSize();
|
||||
|
||||
locator->setTransform(
|
||||
osg::Matrixd::scale(static_cast<double>(nPixels-1), static_cast<double>(nLines-1), 1.0) *
|
||||
matrix);
|
||||
|
||||
locator->setDefinedInFile(true);
|
||||
|
||||
setLocator(locator.get());
|
||||
@ -167,7 +174,10 @@ void DataSetLayer::setUpLocator()
|
||||
0.0, 0.0, 1.0, 0.0,
|
||||
adfDstGeoTransform[0], adfDstGeoTransform[3], 0.0, 1.0);
|
||||
|
||||
locator->setTransform(matrix);
|
||||
locator->setTransform(
|
||||
osg::Matrixd::scale(static_cast<double>(nPixels-1), static_cast<double>(nLines-1), 1.0) *
|
||||
matrix);
|
||||
|
||||
locator->setDefinedInFile(true);
|
||||
|
||||
setLocator(locator.get());
|
||||
|
@ -112,9 +112,9 @@ BEGIN_OBJECT_REFLECTOR(osgTerrain::Locator)
|
||||
__C5_osg_EllipsoidModel_P1__getEllipsoidModel,
|
||||
"Get the const EllipsoidModel. ",
|
||||
"");
|
||||
I_Method1(void, setTransform, IN, osg::Matrixd &, transform,
|
||||
I_Method1(void, setTransform, IN, const osg::Matrixd &, transform,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setTransform__osg_Matrixd_R1,
|
||||
__void__setTransform__C5_osg_Matrixd_R1,
|
||||
"Set the transformation from local coordinates to model coordinates. ",
|
||||
"");
|
||||
I_Method0(const osg::Matrixd &, getTransform,
|
||||
@ -176,8 +176,8 @@ BEGIN_OBJECT_REFLECTOR(osgTerrain::Locator)
|
||||
I_SimpleProperty(const std::string &, Format,
|
||||
__C5_std_string_R1__getFormat,
|
||||
__void__setFormat__C5_std_string_R1);
|
||||
I_SimpleProperty(osg::Matrixd &, Transform,
|
||||
0,
|
||||
__void__setTransform__osg_Matrixd_R1);
|
||||
I_SimpleProperty(const osg::Matrixd &, Transform,
|
||||
__C5_osg_Matrixd_R1__getTransform,
|
||||
__void__setTransform__C5_osg_Matrixd_R1);
|
||||
END_REFLECTOR
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user