USGS

Isis 3.0 Object Programmers' Reference

Home

SpectralDefinitionFactory.cpp
Go to the documentation of this file.
1 
25 #include "FileName.h"
26 #include "SpectralDefinition1D.h"
27 #include "SpectralDefinition2D.h"
28 
29 namespace Isis {
30  SpectralDefinition* SpectralDefinitionFactory::NewSpectralDefinition(FileName smileDefFilename){
31  //csvs will be output definitions, others will (hopefully) be input defs
32  //TODO: make "smarter" (actually open file & read extension)
33  if (smileDefFilename.extension() == "csv"){
34  return new SpectralDefinition1D(smileDefFilename);
35  }
36  else {
37  return new SpectralDefinition2D(smileDefFilename);
38  }
39  }
40 }