36 #define G_CODE "GWcsRegistry::code(int&)"
37 #define G_NAME "GWcsRegistry::name(int&)"
44 #define G_DEBUG_REGISTRY 0
63 std::cout <<
"GWcsRegistry(void): ";
64 for (
int i = 0; i <
size(); ++i) {
65 std::cout <<
"\"" <<
codes()[i] <<
"\" ";
67 std::cout << std::endl;
87 std::cout <<
"GWcsRegistry(const GWcs*): ";
88 std::cout <<
"add \"" << wcs->
code() <<
"\" to registry." << std::endl;
92 std::string* new_codes =
new std::string[
size()+1];
93 std::string* new_names =
new std::string[
size()+1];
94 const GWcs** new_projections =
new const GWcs*[
size()+1];
97 for (
int i = 0; i <
size(); ++i) {
98 new_codes[i] =
codes()[i];
99 new_names[i] =
names()[i];
106 new_projections[
size()] = wcs;
109 codes().assign(new_codes);
110 names().assign(new_names);
118 std::cout <<
"GWcsRegistry(const GWcs*): ";
119 for (
int i = 0; i <
size(); ++i) {
120 std::cout <<
"\"" <<
codes()[i] <<
"\" ";
122 std::cout << std::endl;
176 if (
this != ®istry) {
212 GWcs* projection = NULL;
215 for (
int i = 0; i <
size(); ++i) {
239 #if defined(G_RANGE_CHECK)
240 if (index < 0 || index >=
size()) {
247 return (
codes()[index]);
263 #if defined(G_RANGE_CHECK)
264 if (index < 0 || index >=
size()) {
271 return (
names()[index]);
290 result.append(
"=== GWcsRegistry ===");
298 for (
int i = 0; i <
size(); ++i) {
300 result.append(
names()[i]);
std::string name(const int &index) const
Returns projection name.
void free_members(void)
Delete class members.
Interface definition for the WCS registry class.
std::string print(const GChatter &chatter=NORMAL) const
Print registry information.
GWcsRegistry(void)
Void constructor.
virtual ~GWcsRegistry(void)
Destructor.
virtual std::string code(void) const =0
World Coordinate Projection registry class interface definition.
GWcs * alloc(const std::string &code) const
Allocate World Coordinate System of given code.
void copy_members(const GWcsRegistry ®istry)
Copy class members.
static GRegistryPointer< std::string > & codes()
void init_members(void)
Initialise class members.
Abstract world coordinate system base class.
static GRegistryPointer< std::string > & names()
Exception handler interface definition.
GWcsRegistry & operator=(const GWcsRegistry ®istry)
Assignment operator.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string code(const int &index) const
Returns projection code.
virtual std::string name(void) const =0
int size(void) const
Return number of registered models.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
static GRegistryPointer< const GWcs * > & projections()