#ifndef OAEMFIEDL_IFIELDMAPLOADER_HXX #define OAEMFIEDL_IFIELDMAPLOADER_HXX #include #include namespace COMET{ class IFieldMapLoader; class IFieldMapList; } /// Loads fieldmaps from command line arguments for convenience in executables /** This class defines an interface to load in an arbitrary number of field maps * into the global map. This interface should be used for all executables that * deal with the electromagnetic field, like plotting or combining fields. */ class COMET::IFieldMapLoader{ public: IFieldMapLoader(); virtual ~IFieldMapLoader(){} /// Process the argument and carry out the change to the argument /// IFieldMapList. /// \param argument the input argument letter from getopt /// \param optArgument the option that accompanies the argument /// \param fieldList the field list that the option will effect /// \return 0=pass,1=fail,2=bad fieldlist, 3=arg not found, 4=bad option int ProcessArgument(const char& argument, const char* optArgument, IFieldMapList* fieldList); /// Return the opt string for all input options std::string GetOptString() { return "f:R:t:r:s:";}; /// Print the usage message for all options relating to field input std::string UsageMessage(); /// Process an input string into an output TRotation bool StringToRotation(TRotation& rotation, std::stringstream& input); /// Initialise the argument fieldmap list and the global COMETField /// mananger bool InitAllFields(IFieldMapList* fieldList); /// Write the fieldList and the description of the global field to the /// current file bool WriteAllFields(IFieldMapList* fieldList); }; #endif // OAEMFIEDL_IFIELDMAPLOADER_HXX