OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossim2dTo2dTransformFactory.cpp
Go to the documentation of this file.
1 //**************************************************************************************************
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Description: Implementation of ossim2dTo2dTransformFactory.
8 //
9 //**************************************************************************************************
10 // $Id$
17 #include <ossim/base/ossimRefPtr.h>
18 
21 {
22  if(!m_instance)
23  {
25  }
26  return m_instance;
27 }
28 
30 {
31  ossim2dTo2dTransform* result = 0;
33  {
34  result = new ossim2dBilinearTransform();
35  }
37  {
38  result = new ossim2dTo2dShiftTransform();
39  }
41  {
42  result = new ossim2dTo2dIdentityTransform();
43  }
44 
45  return result;
46 }
47 
49  const char* prefix)const
50 {
51  ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
53  if(result.valid()&&!result->loadState(kwl, prefix))
54  {
55  result = 0;
56  }
57 
58  return result.release();
59 }
60 
61 void ossim2dTo2dTransformFactory::getTypeNameList(std::vector<ossimString>& typeList)const
62 {
63  typeList.push_back(STATIC_TYPE_NAME(ossim2dBilinearTransform));
64  typeList.push_back(STATIC_TYPE_NAME(ossim2dTo2dShiftTransform));
66 }
This is the identity transform and just passes the input to the output.
virtual ossim2dTo2dTransform * createTransform(const ossimString &name) const
Take a transform type name.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
static ossim2dTo2dTransformFactory * m_instance
static const char * TYPE_KW
#define STATIC_TYPE_NAME(T)
Definition: ossimRtti.h:325
static ossim2dTo2dTransformFactory * instance()
T * release()
Definition: ossimRefPtr.h:93
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
ossim2dBilinearTransform allows one to specify a set of input points and output points and will fit a...