OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimCustomEditorWindowRegistry.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks)
6 // Description:
7 //
8 //*************************************************************************
9 // $Id: ossimCustomEditorWindowRegistry.cpp 17108 2010-04-15 21:08:06Z dburken $
11 #include <ossim/base/ossimString.h>
14 
15 RTTI_DEF(ossimCustomEditorWindowRegistry, "ossimCustomEditorWindowRegistry");
16 
18 {
19  theInstance = 0;
20 }
21 
23 {
24  if(!theInstance)
25  {
27  }
28 
29  return theInstance;
30 }
31 
33 {
34  bool result = false;
35  if(factory)
36  {
37  theFactoryList.push_back(factory);
38  result = true;
39  }
40 
41  return result;
42 }
43 
45  void* parent)const
46 {
47  ossimCustomEditorWindow* result = 0;
48  int i = 0;
49 
50  for(i = 0; (i < (int)theFactoryList.size())&&(!result); ++i)
51  {
52  result = theFactoryList[i]->createCustomEditor(obj, parent);
53  }
54 
55  return result;
56 }
58  void* parent)const
59 {
60  ossimCustomEditorWindow* result = 0;
61  int i = 0;
62 
63  for(i = 0; (i < (int)theFactoryList.size())&&(!result); ++i)
64  {
65  result = theFactoryList[i]->createCustomEditor(classType, parent);
66  }
67 
68  return result;
69 }
70 
72 {
73  ossimObject* result = 0;
74  unsigned long index = 0;
75 
76  while((index < theFactoryList.size()) &&(!result))
77  {
78  result = theFactoryList[index]->createObject(typeName);
79  ++index;
80  }
81  return result;
82 }
83 
85  const char* prefix)const
86 {
87  ossimObject* result = 0;
88  unsigned long index = 0;
89 
90  while((index < theFactoryList.size()) &&(!result))
91  {
92  result = theFactoryList[index]->createObject(kwl,
93  prefix);
94  ++index;
95  }
96 
97  return result;
98 }
99 
101  void* parent)const
102 {
103  void* result = 0;
104  unsigned long index = 0;
105 
106  while((index < theFactoryList.size()) &&(!result))
107  {
108  result = theFactoryList[index]->createPopupEditor(obj,
109  parent);
110  ++index;
111  }
112 
113  return result;
114 }
115 
117  void* parent)const
118 {
119  void* result = 0;
120  unsigned long index = 0;
121 
122  while((index < theFactoryList.size()) &&(!result))
123  {
124  result = theFactoryList[index]->createPanelEditor(obj,
125  parent);
126  ++index;
127  }
128 
129  return result;
130 }
131 
132 void ossimCustomEditorWindowRegistry::getTypeNameList(std::vector<ossimString>& typeList)const
133 {
134  std::vector<ossimCustomEditorWindowFactoryBase*>::const_iterator iter = theFactoryList.begin();
135  std::vector<ossimString> result;
136 
137  while(iter != theFactoryList.end())
138  {
139  result.clear();
140  (*iter)->getTypeNameList(result);
141 
142  typeList.insert(typeList.end(),
143  result.begin(),
144  result.end());
145  ++iter;
146  }
147 }
148 
149 extern "C"
150 {
152  {
154  }
155 }
RTTI_DEF(ossimCustomEditorWindowRegistry, "ossimCustomEditorWindowRegistry")
Represents serializable keyword/value map.
virtual void getTypeNameList(std::vector< ossimString > &typeList) const
bool registerFactory(ossimCustomEditorWindowFactoryBase *factory)
std::vector< ossimCustomEditorWindowFactoryBase * > theFactoryList
static ossimCustomEditorWindowRegistry * theInstance
virtual ossimCustomEditorWindow * createCustomEditor(ossimObject *obj, void *parent=NULL) const
void * ossimCustomEditorWindowRegistryGetInstance()
virtual ossimObject * createObject(const ossimString &typeName) const
static ossimCustomEditorWindowRegistry * instance()
virtual void * createPopupEditor(ossimObject *obj, void *parent=NULL) const
virtual void * createPanelEditor(ossimObject *obj, void *parent=NULL) const