OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ossimSensorModelFactory Class Reference

#include <ossimSensorModelFactory.h>

Inheritance diagram for ossimSensorModelFactory:
ossimProjectionFactoryBase ossimObjectFactory ossimObject ossimReferenced

Public Member Functions

virtual ossimProjectioncreateProjection (const ossimFilename &filename, ossim_uint32 entryIdx) const
 takes a filename. More...
 
virtual ossimProjectioncreateProjection (const ossimString &spec) const
 
virtual ossimProjectioncreateProjection (const ossimKeywordlist &kwl, const char *prefix=0) const
 Take a keywordlist. More...
 
virtual ossimObjectcreateObject (const ossimString &typeName) const
 
virtual ossimObjectcreateObject (const ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual void getTypeNameList (std::vector< ossimString > &typeList) const
 
- Public Member Functions inherited from ossimProjectionFactoryBase
virtual ossimProjectioncreateProjection (ossimImageHandler *handler) const
 
- Public Member Functions inherited from ossimObjectFactory
virtual ~ossimObjectFactory ()
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 

Static Public Member Functions

static ossimSensorModelFactoryinstance ()
 

Protected Member Functions

 ossimSensorModelFactory ()
 
bool isNitf (const ossimFilename &filename) const
 
bool isLandsat (const ossimFilename &filename) const
 
void findCoarseGrid (ossimFilename &result, const ossimFilename &geomFile) const
 
- Protected Member Functions inherited from ossimProjectionFactoryBase
ossimProjectioncreateProjectionFromGeometryFile (const ossimFilename &imageFile, ossim_uint32 entryIdx) const
 This method takes the filename and tries to find an external ".geom" file. More...
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 19 of file ossimSensorModelFactory.h.

Constructor & Destructor Documentation

◆ ossimSensorModelFactory()

ossimSensorModelFactory::ossimSensorModelFactory ( )
inlineprotected

Definition at line 57 of file ossimSensorModelFactory.h.

57 {}

Member Function Documentation

◆ createObject() [1/2]

ossimObject * ossimSensorModelFactory::createObject ( const ossimString typeName) const
virtual

Creates an object given a type name.

Implements ossimObjectFactory.

Definition at line 243 of file ossimSensorModelFactory.cpp.

References createProjection().

244 {
245  return createProjection(typeName);
246 }
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
takes a filename.

◆ createObject() [2/2]

ossimObject * ossimSensorModelFactory::createObject ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Creates and object given a keyword list.

Implements ossimObjectFactory.

Definition at line 252 of file ossimSensorModelFactory.cpp.

References createProjection().

254 {
255  return createProjection(kwl, prefix);
256 }
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
takes a filename.

◆ createProjection() [1/3]

ossimProjection * ossimSensorModelFactory::createProjection ( const ossimFilename filename,
ossim_uint32  entryIdx 
) const
virtual

takes a filename.

This filename can be an image file or it can also be a ossim .geom file. It could be other forms of geom files as well. The factories job will be to determine what parser to use and return a projection if successful.

Implements ossimProjectionFactoryBase.

Definition at line 293 of file ossimSensorModelFactory.cpp.

References ossimKeywordlist::add(), ossimKeywordlist::addFile(), ossimString::c_str(), ossimKeywordlist::clear(), ossimProjectionFactoryBase::createProjectionFromGeometryFile(), ossimString::empty(), ossimFilename::exists(), ossimKeywordlist::find(), findCoarseGrid(), ossimErrorStatusInterface::getErrorStatus(), ossimRefPtr< T >::release(), ossimFilename::setExtension(), STATIC_TYPE_NAME, ossimKeywordNames::TYPE_KW, and ossimRefPtr< T >::valid().

Referenced by createObject(), and createProjection().

295 {
296  // ossimFilename::exists() currently does not work with s3 url's.
297  // if(!filename.exists()) return 0;
298 
299  if(filename.empty()) return 0;
300 
301  static const char MODULE[] = "ossimSensorModelFactory::createProjection";
302 
303  ossimKeywordlist kwl;
305 
306  ossimFilename geomFile = filename;
307  geomFile = geomFile.setExtension("geom");
308 
309  if(geomFile.exists()&&
310  kwl.addFile(filename.c_str()))
311  {
312  ossimFilename coarseGrid;
313 
314  const char* type = kwl.find(ossimKeywordNames::TYPE_KW);
315  if(type)
316  {
317  if(ossimString(type) ==
319  {
320  findCoarseGrid(coarseGrid, filename);
321 
322  if(coarseGrid.exists() &&(coarseGrid != ""))
323  {
324  kwl.add("grid_file_name",
325  coarseGrid.c_str(),
326  true);
327  model = new ossimCoarseGridModel(kwl);
328  if(!model->getErrorStatus())
329  {
330  return model.release();
331  }
332  model = 0;
333  }
334  }
335  }
336  kwl.clear();
337  }
338 
339  // See if there is an external geomtry.
341  createProjectionFromGeometryFile(filename, entryIdx);
342  if (proj.valid())
343  {
344  return proj.release();
345  }
346 
347  if(model.valid())
348  {
349  model = 0;
350  }
351 
352  // first check for override
353  //
354  if(geomFile.exists()&&kwl.addFile(geomFile.c_str()))
355  {
356  model = createProjection(kwl);
357  if(model.valid())
358  {
359  return model.release();
360  }
361  model = 0;
362  }
363 
364  if(traceDebug())
365  {
367  << MODULE << " DEBUG: Testing ossimCoarsGridModel" << std::endl;
368  }
369 
370  ifstream input(geomFile.c_str());
371  char ecgTest[4] = { 0 };
372  input.read(ecgTest, 3); // even if `read()` fails, it will be initialized thanks to `= { 0 };`
373  input.close();
374  if(std::string(ecgTest) == "eCG")
375  {
376  ossimKeywordlist kwlTemp;
377  kwlTemp.add("type",
378  "ossimCoarseGridModel",
379  true);
380  kwlTemp.add("geom_file",
381  geomFile.c_str(),
382  true);
383  return createProjection(kwlTemp);
384  }
385 
386  if(traceDebug())
387  {
389  << MODULE << " DEBUG: testing ossimRpcModel" << std::endl;
390  }
391 
392  //---
393  // Test for quick bird rpc. Could be either a tiff or nitf so not wrapped
394  // around "isNitf()" anymore.
395  //---
396  if(traceDebug())
397  {
399  << MODULE << " DEBUG: testing ossimQuickbirdRpcModel"
400  << std::endl;
401  }
402 
404  if(qbModel->parseFile(filename))
405  {
406  if(traceDebug())
407  {
409  << MODULE << " DEBUG: returning ossimQuickbirdRpcModel"
410  << std::endl;
411  }
412  model = qbModel.get();
413  qbModel = 0;
414  return model.release();
415  }
416  else
417  {
418  qbModel = 0;
419  }
420 
421 // ossimRefPtr<ossimRpcModel> qbModel = new ossimQuickbirdRpcModel;
422 // if(qbModel->parseFile(filename))
423 // {
424 // if(traceDebug())
425 // {
426 // ossimNotify(ossimNotifyLevel_DEBUG)
427 // << MODULE << " DEBUG: returning ossimQuickbirdRpcModel"
428 // << std::endl;
429 // }
430 // model = qbModel.get();
431 // qbModel = 0;
432 // return model.release();
433 // }
434 // else
435 // {
436 // qbModel = 0;
437 // }
438 //
439  //---
440  // Test for ikonos rpc. Could be tiff or nitf which is handled in
441  // parseFile method.
442  //---
444  if(ikModel->parseFile(filename))
445  {
446  if(traceDebug())
447  {
449  << MODULE << " DEBUG returning ossimQuickbirdRpcModel"
450  << std::endl;
451  }
452  model = ikModel.get();
453  ikModel = 0;
454  return model.release();
455  }
456  else
457  {
458  ikModel = 0;
459  }
460  if(isNitf(filename))
461  {
462  if(traceDebug())
463  {
465  << MODULE << " DEBUG: testing ossimNitfRsmModel" << std::endl;
466  }
468 
469  if(rsmModel->parseFile(filename, entryIdx))
470  {
471  model = rsmModel.get();
472  rsmModel = 0;
473  return model.release();
474  }
475  else
476  {
477  rsmModel = 0;
478  }
479  if(traceDebug())
480  {
482  << MODULE << " DEBUG: testing ossimNitfRsmModel" << std::endl;
483  }
484 
486  if ( rpcModel->parseFile(filename, entryIdx) ) // filename = NITF_file
487  {
488  model = rpcModel.get();
489  rpcModel = 0;
490  return model.release();
491  }
492  else
493  {
494  rpcModel = 0;
495  }
496 
497  if(traceDebug())
498  {
500  << MODULE << " DEBUG: testing ossimIkinosRpcModel" << std::endl;
501  }
502 
503  // RP - This model crashes routinely if it ever happens to get a hold of a NITF
504  //model = new ossimNitfMapModel(filename); // filename = NITF_file
505  //if(!model->getErrorStatus())
506  //{
507  // return model.release();
508  //}
509  //model = 0;
510  }
511  else if(isLandsat(filename))
512  {
513  model = new ossimLandSatModel(filename);
514  if(!model->getErrorStatus())
515  {
516  return model.release();
517  }
518  model = 0;
519  }
520 
521  model = new ossimRS1SarModel(filename);
523  {
524  return model.release();
525  }
526  model = 0;
527 
528  // SPOT:
529  ossimFilename spot5Test = geomFile;
530  if(!spot5Test.exists())
531  {
532  spot5Test = geomFile.path();
533  spot5Test = spot5Test.dirCat(ossimFilename("METADATA.DIM"));
534  if (spot5Test.exists() == false)
535  {
536  spot5Test = geomFile.path();
537  spot5Test = spot5Test.dirCat(ossimFilename("metadata.dim"));
538  }
539  }
540  if(spot5Test.exists())
541  {
542  //---
543  // Check the basename of the input file. So we don't create a projection
544  // for ancillary files, icon.jpg amd preview.jpg.
545  //---
546  ossimFilename baseName = filename.file();
547  baseName.downcase();
548 
549  if ( (baseName != "icon.jpg" ) && ( baseName != "preview.jpg" ) )
550  {
553  if(meta->loadXmlFile(spot5Test))
554  {
555  model = new ossimSpot5Model(meta.get());
556  if(!model->getErrorStatus())
557  {
558  return model.release();
559  }
560  }
561  }
562  }
563  model = 0;
564 
565  ossimFilename ppjFilename = filename;
566  ppjFilename = ppjFilename.setExtension("ppj");
567  if(traceDebug())
568  {
570  << MODULE << " DEBUG: testing ossimPpjFrameSensor" << std::endl;
571  }
572  if(ppjFilename.exists())
573  {
575 
576  if(ppjFile->readFile(ppjFilename))
577  {
579  ossimDpt imageSize = ppjFile->getImageSize();
580  sensor->setFocalLength(ppjFile->getIntrinsic()[0][0], ppjFile->getIntrinsic()[1][1]);
581  sensor->setPrincipalPoint(ppjFile->getPrincipalPoint());
582  sensor->setecef2CamMatrix(ppjFile->getExtrinsic().SymSubMatrix(1,3));
583  sensor->setCameraPosition(ppjFile->getPlatformPosition());
584  sensor->setImageSize(imageSize);
585  sensor->setImageRect(ossimDrect(0,0,imageSize.x-1, imageSize.y-1));
586  sensor->setRefImgPt(ossimDpt(imageSize.x*.5, imageSize.y*.5));
588  sensor->updateModel();
589  return sensor.release();
590  }
591  ppjFile = 0;
592  }
593 
594  ossimFilename hdrFilename = filename;
595  hdrFilename = hdrFilename.setExtension("hdr"); // image.hdr
596  if ( !hdrFilename.exists() )
597  {
598  hdrFilename = filename;
599  hdrFilename.string() += ".hdr"; // image.ras.hdr
600  }
601  if(traceDebug())
602  {
604  << MODULE << " DEBUG: testing ossimAlphaSensor\nheader file: " << hdrFilename << std::endl;
605  }
606  if(hdrFilename.exists())
607  {
609  if(supData->readSupportFiles(hdrFilename))
610  {
611  if (supData->isHSI())
612  {
613  if(traceDebug())
614  {
616  << MODULE << " DEBUG: loading ossimAlphaSensorHSI" << std::endl;
617  }
619  if ( sensor->initialize( *(supData.get()) ) )
620  {
621  return (ossimProjection*)sensor.release();
622  }
623  }
624  else
625  {
626  if(traceDebug())
627  {
629  << MODULE << " DEBUG: loading ossimAlphaSensorHRI" << std::endl;
630  }
632  if ( sensor->initialize( *(supData.get()) ) )
633  {
634  return (ossimProjection*)sensor.release();
635  }
636  }
637  }
638  supData = 0;
639  }
640 
641  model = new ossimCoarseGridModel(geomFile);
642  if(model.valid())
643  {
644  if(!model->getErrorStatus())
645  {
646  return model.release();
647  }
648  model = 0;
649  }
650 
651  return model.release();
652 }
virtual bool readSupportFiles(const ossimFilename &hdrFile)
const NEWMAT::Matrix & getExtrinsic() const
virtual bool readFile(const ossimFilename &file)
bool loadXmlFile(const ossimFilename &file, bool processSwir=false)
ossimProjection * createProjectionFromGeometryFile(const ossimFilename &imageFile, ossim_uint32 entryIdx) const
This method takes the filename and tries to find an external ".geom" file.
Represents serializable keyword/value map.
bool addFile(const char *file)
static const ossimErrorCode OSSIM_OK
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
double y
Definition: ossimDpt.h:165
bool isLandsat(const ossimFilename &filename) const
virtual bool parseFile(const ossimFilename &nitfFile, ossim_uint32 entryIndex=0)
void setFocalLength(double focX, double focY)
void setCameraPosition(const ossimGpt &value)
static const char * TYPE_KW
const ossimDpt & getImageSize() const
#define STATIC_TYPE_NAME(T)
Definition: ossimRtti.h:325
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
void findCoarseGrid(ossimFilename &result, const ossimFilename &geomFile) const
bool isNitf(const ossimFilename &filename) const
const ossimDpt & getPrincipalPoint() const
virtual bool parseFile(const ossimFilename &nitfFile, ossim_uint32 entryIndex=0)
Method to parse an nitf file and initialize model.
bool exists() const
void setAveragePrjectedHeight(double averageProjectedHeight)
T * release()
Definition: ossimRefPtr.h:93
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
virtual bool initialize(const ossimAlphaSensorSupportData &supData)
Initializes model from support data and calls update Model on success.
void setImageRect(const ossimDrect &imageRect)
void setPrincipalPoint(const ossimDpt &value)
virtual bool parseFile(const ossimFilename &file)
virtual ossimErrorCode getErrorStatus() const
const ossimGpt & getPlatformPosition() const
double x
Definition: ossimDpt.h:164
ossimFilename dirCat(const ossimFilename &file) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
bool empty() const
Definition: ossimString.h:411
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
takes a filename.
virtual bool initialize(const ossimAlphaSensorSupportData &supData)
Initializes model from support data and calls update Model on success.
ossimFilename file() const
void setRefImgPt(const ossimDpt &pt)
Sets the center line sampe of the image.
const NEWMAT::Matrix & getIntrinsic() const
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
ossimFilename path() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void setecef2CamMatrix(const NEWMAT::Matrix &value)
void setImageSize(const ossimDpt &size)
const std::string & string() const
Definition: ossimString.h:414
virtual bool parseFile(const ossimFilename &file)
Public method for parsing generic image file.

◆ createProjection() [2/3]

ossimProjection * ossimSensorModelFactory::createProjection ( const ossimString spec) const
virtual

METHOD: create() Attempts to create an instance of the Product given a Specifier or keywordlist. Returns successfully constructed product or NULL.

Implements ossimProjectionFactoryBase.

Definition at line 133 of file ossimSensorModelFactory.cpp.

References STATIC_TYPE_NAME.

134 {
135  //***
136  // Name should represent the model type:
137  //***
139  {
140  return new ossimSkyBoxLearSensor;
141  }
142  if(name == STATIC_TYPE_NAME(ossimIpodSensor))
143  {
144  return new ossimIpodSensor;
145  }
147  {
148  return new ossimCoarseGridModel;
149  }
150  if(name == STATIC_TYPE_NAME(ossimBuckeyeSensor))
151  {
152  return new ossimBuckeyeSensor;
153  }
154 
155  if (name == STATIC_TYPE_NAME(ossimRpcModel))
156  {
157  return new ossimRpcModel;
158  }
159 
161  {
162  return new ossimLandSatModel;
163  }
164 
165 // if(name == STATIC_TYPE_NAME(ossimNitfMapModel))
166 // {
167 // return new ossimNitfMapModel;
168 // }
169 
171  {
172  return new ossimQuickbirdRpcModel;
173  }
174 
176  {
177  return new ossimIkonosRpcModel;
178  }
179 
181  {
182  return new ossimNitfRpcModel;
183  }
184  if(name == STATIC_TYPE_NAME(ossimFcsiModel))
185  {
186  return new ossimFcsiModel;
187  }
189  {
190  return new ossimApplanixUtmModel;
191  }
193  {
194  return new ossimApplanixEcefModel;
195  }
196  if(name == STATIC_TYPE_NAME(ossimSpot5Model))
197  {
198  return new ossimSpot5Model;
199  }
200  if(name == STATIC_TYPE_NAME(ossimSarModel))
201  {
202  return new ossimSarModel;
203  }
205  {
206  return new ossimRS1SarModel;
207  }
209  {
210  return new ossimPpjFrameSensor;
211  }
213  {
214  return new ossimAlphaSensorHRI;
215  }
217  {
218  return new ossimAlphaSensorHSI;
219  }
221  {
222  return new ossimNitfRsmModel();
223  }
225  {
226  return new ossimSpectraboticsRedEdgeModel();
227  }
228 
229 
230  //***
231  // ADD_MODEL: (Please leave this comment for the next programmer)
232  //***
233 // if(name == MY_NEW_MODEL)
234 // return new myNewModel;
235 
236  return NULL;
237 }
#define STATIC_TYPE_NAME(T)
Definition: ossimRtti.h:325

◆ createProjection() [3/3]

ossimProjection * ossimSensorModelFactory::createProjection ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Take a keywordlist.

Implements ossimProjectionFactoryBase.

Definition at line 93 of file ossimSensorModelFactory.cpp.

References createProjection(), ossimKeywordlist::find(), ossimKeywordNames::GEOM_FILE_KW, ossimProjection::loadState(), ossimRefPtr< T >::release(), ossimKeywordNames::TYPE_KW, and ossimRefPtr< T >::valid().

95 {
97 
98  //
99  // Permit specification of geometry file name in lieu of type:
100  //
101  const char* value = keywordList.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
102  if (value)
103  {
104  result = createProjection(ossimFilename(value), 0);
105  }
106  //
107  // Search for occurence of "type" keyword:
108  //
109  else
110  {
111  value = keywordList.find(prefix, ossimKeywordNames::TYPE_KW);
112  if(value)
113  {
114  result = createProjection(ossimString(value));
115  if(result.valid())
116  {
117  if(!result->loadState(keywordList, prefix))
118  {
119  result = 0;
120  }
121  }
122  }
123  }
124 
125  return result.release();
126 }
bool valid() const
Definition: ossimRefPtr.h:75
static const char * TYPE_KW
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
T * release()
Definition: ossimRefPtr.h:93
static const char * GEOM_FILE_KW
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
takes a filename.

◆ findCoarseGrid()

void ossimSensorModelFactory::findCoarseGrid ( ossimFilename result,
const ossimFilename geomFile 
) const
protected

Definition at line 688 of file ossimSensorModelFactory.cpp.

References ossimFilename::exists(), ossimFilename::fileNoExtension(), ossimDirectory::OSSIM_DIR_FILES, ossimFilename::path(), ossimFilename::setExtension(), and ossimFilename::setFile().

Referenced by createProjection().

690 {
691  result = geomFile;
692  result.setFile(result.fileNoExtension()+"_ocg");
693  result.setExtension("dat");
694 
695  if(!result.exists())
696  {
697  result = geomFile;
698  result.setExtension("dat");
699  }
700 
701  // let's find a .dat file in the current directory
702  //
703  if(!result.exists())
704  {
705  result = "";
706  ossimDirectory directoryList(geomFile.path());
707  ossimFilename file;
708  if(directoryList.getFirst(file,
710  {
711  ossimString testString = "OSSIM_DBL_GRID";
712  char tempBuf[14];
713  do
714  {
715  if(file.ext().downcase() == "dat")
716  {
717  std::ifstream in(file.c_str());
718  if(in)
719  {
720  in.read((char*)tempBuf, 14);
721  in.close();
722  if(ossimString(tempBuf, tempBuf+14) == testString)
723  {
724  result = file;
725  }
726  }
727 
728  }
729  }while((directoryList.getNext(file))&&(result == ""));
730  }
731  // try to find it
732  }
733 }
ossimFilename & setFile(const ossimString &f)
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
bool exists() const
ossimFilename fileNoExtension() const
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
ossimFilename path() const

◆ getTypeNameList()

void ossimSensorModelFactory::getTypeNameList ( std::vector< ossimString > &  typeList) const
virtual

This should return the type name of all objects in all factories. This is the name used to construct the objects dynamially and this name must be unique.

Implements ossimObjectFactory.

Definition at line 262 of file ossimSensorModelFactory.cpp.

References STATIC_TYPE_NAME.

264 {
265  typeList.push_back(STATIC_TYPE_NAME(ossimApplanixEcefModel));
266  typeList.push_back(STATIC_TYPE_NAME(ossimApplanixUtmModel));
267  typeList.push_back(STATIC_TYPE_NAME(ossimCoarseGridModel));
268  typeList.push_back(STATIC_TYPE_NAME(ossimRpcModel));
269  typeList.push_back(STATIC_TYPE_NAME(ossimIkonosRpcModel));
270  typeList.push_back(STATIC_TYPE_NAME(ossimQuickbirdRpcModel));
271  typeList.push_back(STATIC_TYPE_NAME(ossimNitfRpcModel));
272  typeList.push_back(STATIC_TYPE_NAME(ossimLandSatModel));
273 // typeList.push_back(STATIC_TYPE_NAME(ossimNitfMapModel));
274  typeList.push_back(STATIC_TYPE_NAME(ossimFcsiModel));
275  typeList.push_back(STATIC_TYPE_NAME(ossimSpot5Model));
276  typeList.push_back(STATIC_TYPE_NAME(ossimSarModel));
277  typeList.push_back(STATIC_TYPE_NAME(ossimRS1SarModel));
278  typeList.push_back(STATIC_TYPE_NAME(ossimBuckeyeSensor));
279  typeList.push_back(STATIC_TYPE_NAME(ossimSkyBoxLearSensor));
280  typeList.push_back(STATIC_TYPE_NAME(ossimIpodSensor));
281  typeList.push_back(STATIC_TYPE_NAME(ossimPpjFrameSensor));
282  typeList.push_back(STATIC_TYPE_NAME(ossimAlphaSensorHRI));
283  typeList.push_back(STATIC_TYPE_NAME(ossimAlphaSensorHSI));
284  typeList.push_back(STATIC_TYPE_NAME(ossimNitfRsmModel));
286  //***
287  // ADD_MODEL: Please leave this comment for the next programmer. Add above.
288  //***
289  //typeList.push_back(ossimString(MY_NEW_MODEL));
290 
291 }
#define STATIC_TYPE_NAME(T)
Definition: ossimRtti.h:325

◆ instance()

ossimSensorModelFactory * ossimSensorModelFactory::instance ( )
static

METHOD: instance() For accessing static instance of concrete factory.

Definition at line 84 of file ossimSensorModelFactory.cpp.

Referenced by ossimProjectionFactoryRegistry::initializeDefaults().

85 {
86  static ossimSensorModelFactory inst;
87  return &inst;
88 }

◆ isLandsat()

bool ossimSensorModelFactory::isLandsat ( const ossimFilename filename) const
protected

Definition at line 670 of file ossimSensorModelFactory.cpp.

References ossimString::contains(), ossimString::downcase(), and ossimErrorStatusInterface::getErrorStatus().

671 {
672  ossimFilename temp(filename);
673  temp.downcase();
674  ossimRefPtr<ossimFfL7> ff_headerp;
675  if (temp.contains("header.dat"))
676  {
677  ff_headerp = new ossimFfL5(filename);
678  }
679  else
680  {
681  ff_headerp = new ossimFfL7(filename);
682  }
683  bool r = !(ff_headerp->getErrorStatus());
684  ff_headerp = 0;
685  return r;
686 }
virtual ossimErrorCode getErrorStatus() const

◆ isNitf()

bool ossimSensorModelFactory::isNitf ( const ossimFilename filename) const
protected

Definition at line 654 of file ossimSensorModelFactory.cpp.

References ossim::StreamFactoryRegistry::instance().

655 {
656  std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
657  createIstream( filename, std::ios_base::in | std::ios_base::binary );
658 
659  if( in )
660  {
661  char nitfFile[4];
662  in->read((char*)nitfFile, 4);
663 
664  return (ossimString(nitfFile, nitfFile+4) == "NITF");
665  }
666 
667  return false;
668 }
static StreamFactoryRegistry * instance()

The documentation for this class was generated from the following files: