File indexing completed on 2024-04-14 03:43:22

0001 /*
0002     SPDX-FileCopyrightText: 2014 Akarsh Simha <akarsh.simha@kdemail.net>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef NAMERESOLVER_H
0008 #define NAMERESOLVER_H
0009 
0010 #include "skyobject.h"
0011 
0012 // Forward declarations
0013 class QString;
0014 class CatalogObject;
0015 
0016 /**
0017  * @namespace NameResolver
0018  *
0019  * @short Uses name resolver services to get coordinates and
0020  * information about deep-sky objects, given their names
0021  *
0022  * This class uses the CDS Sesame name resolver (and potentially other
0023  * resolvers) to resolve the names of deep-sky objects, and obtain
0024  * coordinates, fluxes, alternate designations, and possibly other
0025  * data.
0026  *
0027  * @author Akarsh Simha <akarsh.simha@kdemail.net>
0028  */
0029 
0030 namespace NameResolver
0031 {
0032 /**
0033  * @short Resolve the name of the given DSO and extract data from
0034  * various sources
0035  */
0036 std::pair<bool, CatalogObject> resolveName(const QString &name);
0037 
0038 namespace NameResolverInternals
0039 {
0040 /**
0041  * @short Resolve the name and obtain basic data using CDS Sesame service
0042  *
0043  * @param data the structure to fill with the obtained data
0044  * @param name the name (identifier) to resolve
0045  * @return Success value and the object
0046  */
0047 std::pair<bool, CatalogObject> sesameResolver(const QString &name);
0048 
0049 /*
0050  * @short Retrieve additional data from SIMBAD
0051  *
0052  * If the object was resolved by SIMBAD, obtain additional data
0053  * that is not available through CDS Sesame, such as the major and
0054  * minor axes and position angle of the object.
0055  *
0056  * @param data the structure containing data from Sesame, to be
0057  * filled with additional data
0058  * @return Success value
0059  */
0060 //        bool getDataFromSimbad( CatalogObject &data );
0061 
0062 /**
0063  * @short Interprets object type returned by Sesame
0064  *
0065  * This method reads the object type string returned by Sesame
0066  * / other resolvers and attempts to convert it into a
0067  * SkyObject type.
0068  *
0069  * @param typeString An abbreviated string containing the type of the object
0070  * @param caseSensitive Should we make a case-sensitive check?
0071  *
0072  * @return a SkyObject::TYPE.
0073  */
0074 SkyObject::TYPE interpretObjectType(const QString &typeString, bool caseSensitive = true);
0075 } // namespace NameResolverInternals
0076 }; // namespace NameResolver
0077 
0078 #endif