void ossimSpectraboticsRedEdgeModel::updateModel()
{
   ossimGpt gpt;
   ossimGpt wgs84Pt;
   double metersPerDegree = wgs84Pt.metersPerDegree().x;
   double degreePerMeter = 1.0/metersPerDegree;
   double latShift = computeParameterOffset(1)*theMeanGSD*degreePerMeter;
   double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter;

   gpt = m_ecefPlatformPosition;
   double height = gpt.height();
   gpt.height(height + computeParameterOffset(5));
   gpt.latd(gpt.latd() + latShift);
   gpt.lond(gpt.lond() + lonShift);
   m_adjEcefPlatformPosition = gpt;
   ossimLsrSpace lsrSpace(m_adjEcefPlatformPosition);

   NEWMAT::Matrix heading = ossimMatrix4x4::createRotationZMatrix(m_heading+computeParameterOffset(4), OSSIM_RIGHT_HANDED);
   NEWMAT::Matrix roll = ossimMatrix4x4::createRotationYMatrix(m_roll+computeParameterOffset(2), OSSIM_RIGHT_HANDED);
   NEWMAT::Matrix pitch = ossimMatrix4x4::createRotationXMatrix(m_pitch+computeParameterOffset(3), OSSIM_LEFT_HANDED);
   ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
   NEWMAT::Matrix orientation = heading*pitch*roll;//roll*pitch*heading;
   m_compositeMatrix        = (lsrMatrix.getData()*orientation);
   m_compositeMatrixInverse = m_compositeMatrix.i();

   theBoundGndPolygon.resize(4);
   // ossim_float64 w = theImageClipRect.width()*2.0;
   // ossim_float64 h = theImageClipRect.height()*2.0;
   theExtrapolateImageFlag = false;
   theExtrapolateGroundFlag = false;


   lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
   theBoundGndPolygon[0] = gpt;
   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
   theBoundGndPolygon[1] = gpt;
   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
   theBoundGndPolygon[2] = gpt;
   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
   theBoundGndPolygon[3] = gpt;
}
Esempio n. 2
0
void ossimBuckeyeSensor::updateModel()
{
	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::updateModel: entering..." << std::endl;
	ossimGpt gpt;
	ossimGpt wgs84Pt;
	double metersPerDegree = wgs84Pt.metersPerDegree().x;
	double degreePerMeter = 1.0/metersPerDegree;
	double latShift = -computeParameterOffset(1)*degreePerMeter;
	double lonShift = computeParameterOffset(0)*degreePerMeter;

	gpt = theEcefPlatformPosition;
	double height = gpt.height();
	gpt.height(height + computeParameterOffset(5));
	gpt.latd(gpt.latd() + latShift);
	gpt.lond(gpt.lond() + lonShift);
	theAdjEcefPlatformPosition = gpt;
	ossimLsrSpace lsrSpace(theAdjEcefPlatformPosition, theHeading+computeParameterOffset(4));

	// make a left handed roational matrix;
	ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
	NEWMAT::Matrix orientation = (ossimMatrix4x4::createRotationXMatrix(thePitch+computeParameterOffset(3), OSSIM_LEFT_HANDED)*
		ossimMatrix4x4::createRotationYMatrix(theRoll+computeParameterOffset(2), OSSIM_LEFT_HANDED));
	theCompositeMatrix        = (lsrMatrix.getData()*orientation);
	theCompositeMatrixInverse = theCompositeMatrix.i();

	theBoundGndPolygon.resize(4);
	// ossim_float64 w = theImageClipRect.width()*2.0;
	// ossim_float64 h = theImageClipRect.height()*2.0;
	theExtrapolateImageFlag = false;
	theExtrapolateGroundFlag = false;

	lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
	theBoundGndPolygon[0] = gpt;
	lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
	theBoundGndPolygon[1] = gpt;
	lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
	theBoundGndPolygon[2] = gpt;
	lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
	theBoundGndPolygon[3] = gpt;
	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::updateModel: returning..." << std::endl;
}
void rspfApplanixEcefModel::updateModel()
{
   rspfGpt gpt;
   rspfGpt wgs84Pt;
   double metersPerDegree = wgs84Pt.metersPerDegree().x;
   double degreePerMeter = 1.0/metersPerDegree;
   double latShift = -computeParameterOffset(1)*theMeanGSD*degreePerMeter;
   double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter;

   gpt = theEcefPlatformPosition;
   double height = gpt.height();
   gpt.height(height + computeParameterOffset(5));
   gpt.latd(gpt.latd() + latShift);
   gpt.lond(gpt.lond() + lonShift);
   theAdjEcefPlatformPosition = gpt;
   rspfLsrSpace lsrSpace(theAdjEcefPlatformPosition, theHeading+computeParameterOffset(4));

   // make a left handed roational matrix;
   rspfMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
   NEWMAT::Matrix orientation = (rspfMatrix4x4::createRotationXMatrix(thePitch+computeParameterOffset(3), RSPF_LEFT_HANDED)*
                                 rspfMatrix4x4::createRotationYMatrix(theRoll+computeParameterOffset(2), RSPF_LEFT_HANDED));
   theCompositeMatrix        = (lsrMatrix.getData()*orientation);
   theCompositeMatrixInverse = theCompositeMatrix.i();

   theBoundGndPolygon.resize(4);
   // rspf_float64 w = theImageClipRect.width()*2.0;
   // rspf_float64 h = theImageClipRect.height()*2.0;
   theExtrapolateImageFlag = false;
   theExtrapolateGroundFlag = false;

   lineSampleToWorld(theImageClipRect.ul(),gpt);//+rspfDpt(-w, -h), gpt);
   theBoundGndPolygon[0] = gpt;
   lineSampleToWorld(theImageClipRect.ur(),gpt);//+rspfDpt(w, -h), gpt);
   theBoundGndPolygon[1] = gpt;
   lineSampleToWorld(theImageClipRect.lr(),gpt);//+rspfDpt(w, h), gpt);
   theBoundGndPolygon[2] = gpt;
   lineSampleToWorld(theImageClipRect.ll(),gpt);//+rspfDpt(-w, h), gpt);
   theBoundGndPolygon[3] = gpt;
}