OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimH5PluginInit.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: See top level LICENSE.txt file
4 //
5 // Author: David Burken
6 //
7 // Copied from Mingjie Su's ossimHdfPluginInit.
8 //
9 // Description: OSSIM HDF plugin initialization
10 // code.
11 //
12 //----------------------------------------------------------------------------
13 // $Id$
14 
21 
23 #include "ossimH5ReaderFactory.h"
24 #include "ossimH5Options.h"
25 #include "ossimH5InfoFactory.h"
27 
28 static void setDescription(ossimString& description)
29 {
30  description = "HDF5 reader plugin\n\n";
32 
33  description = description + "Datasets enabled for rendering:\n\n";
34  ossim_uint32 idx = 0;
35  for(idx = 0;idx < renderableDatasets.size();++idx)
36  {
37  description = description + renderableDatasets[idx] + "\n";
38  }
39 
40 }
41 
42 extern "C"
43 {
46  std::vector<ossimString> theObjList;
47 
48  const char* getDescription()
49  {
50  return theDescription.c_str();
51  }
52 
54  {
55  return (int)theObjList.size();
56  }
57 
58  const char* getClassName(int idx)
59  {
60  if(idx < (int)theObjList.size())
61  {
62  return theObjList[0].c_str();
63  }
64  return (const char*)0;
65  }
66 
67  /* Note symbols need to be exported on windoze... */
69  ossimSharedObjectInfo** info)
70  {
75 
76  *info = &myInfo;
77 
78 
79  /* Register the readers... */
81  registerFactory(ossimH5ReaderFactory::instance());
82 
83  /* Register hdf info factoy... */
85  registerFactory(ossimH5InfoFactory::instance());
86 
87  /* Register hdf projection factoy... */
89  registerFactoryToFront(ossimHdf5ProjectionFactory::instance());
90 
91  setDescription(theDescription);
92  }
93 
94  /* Note symbols need to be exported on windoze... */
96  {
98  unregisterFactory(ossimH5ReaderFactory::instance());
99 
101  unregisterFactory(ossimH5InfoFactory::instance());
102 
104  unregisterFactory(ossimHdf5ProjectionFactory::instance());
105  }
106 }
ossimSharedObjectInfo myInfo
static ossimHdf5ProjectionFactory * instance()
ossimSharedLibraryGetNumberOfClassNamesPtr getNumberOfClassNames
std::vector< std::string > StringListType
Definition: ossimH5Options.h:8
static ossimH5Options * instance()
static ossimH5ReaderFactory * instance()
static method to return instance (the only one) of this class.
int getNumberOfClassNames()
OSSIM_PLUGINS_DLL void ossimSharedLibraryFinalize()
unsigned int ossim_uint32
OSSIM_PLUGINS_DLL void ossimSharedLibraryInitialize(ossimSharedObjectInfo **info)
ossimSharedLibraryGetDescriptionPtr getDescription
#define OSSIM_PLUGINS_DLL
ossimSharedLibraryGetClassNamesPtr getClassName
static ossimProjectionFactoryRegistry * instance()
static ossimInfoFactoryRegistry * instance()
instance method
const char * getClassName(int idx)
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
ossimString theDescription
static ossimImageHandlerRegistry * instance()
std::vector< ossimString > theObjList
static ossimH5InfoFactory * instance()
const StringListType & getRenderableDataset() const
const char * getDescription()