ResourceSpawner.hh
Resource used to update the ResourceModel.
Definition: ResourceSpawner.hh:38
std::string ownerPath
The name of the owner if the user has Fuel resources chosen, and the name of the local path if the us...
Definition: ResourceSpawner.hh:79
This library is part of the Gazebo project.
STL class.
std::string searchKeyword
The currently entered keyword that the user wants to search, empty if there is currently no search qu...
Definition: ResourceSpawner.hh:70
void UpdateResourceModel(int index, Resource &_resource)
Updates the resource at the provided index with the values in the passed in resource.
bool isDownloaded
Bool to indicate if this model has been downloaded or not, will always be false with local models as ...
Definition: ResourceSpawner.hh:61
std::vector< Resource > LocalResources(const std::string &_path)
Returns the local resources as a vector located under the passed in path.
void OnDownloadFuelResource(const QString &_path, const QString &_name, const QString &_owner, int index)
Callback when a request is made to download a fuel resource.
void OnPathClicked(const QString &_path)
Callback when a resource path is selected, will clear the currently loaded resources and load the one...
STL class.
void OnSearchEntered(const QString &_searchKeyword)
Callback when a search request is made.
bool isFuel
True if the user is currently observing fuel resources and false if the user is currently observing l...
Definition: ResourceSpawner.hh:84
std::string sortMethod
The currently chosen method of sorting, which includes "A - Z", "Z - A", "Most Recent",...
Definition: ResourceSpawner.hh:75
Q_INVOKABLE void UpdateOwnerListModel(ignition::gazebo::Resource _resource)
Called form a download thread to update the GUI's list of resources.
void AddPath(const std::string &_path)
Add a path. param[in] _path The path to be added.
Provides a model by which the resource spawner qml plugin pulls and updates from.
Definition: ResourceSpawner.hh:89
void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override
Q_INVOKABLE void RemoveOwner(const QString &_owner)
Remove owner from the list of owners whose resources would be fetched from Fuel.
void SetThumbnail(const std::string &_thumbnailPath, Resource &_resource)
Finds a thumbnail on the provided thumbnail path and sets the model's thumbnail path attribute to it,...
void AddPath(const std::string &_path)
Adds a path to the path list model.
Data used by the DisplayData() function to filter and sort the resources to be displayed.
Definition: ResourceSpawner.hh:66
bool isFuel
Bool to indicate if this model is fuel or not.
Definition: ResourceSpawner.hh:56
void RemovePath(const std::string &_path)
Remove a path. param[in] _path The path to be removed.
Resource LocalResource(const std::string &_path)
Returns the resource corresponding to the model.config file.
void FilterResources(std::vector< Resource > &_resources)
Filters the vector of resources by the previously entered search keyword.
void SortResources(std::vector< Resource > &_resources)
Sorts the vector of resources by the previously entered sort method. The sorting types as a string,...
Provides interface for communicating to backend for generation of local models.
Definition: ResourceSpawner.hh:158
std::vector< Resource > FuelResources(const std::string &_owner)
Returns the fuel resources as a vector belonging to the passed in owner.
Q_INVOKABLE bool AddOwner(const QString &_owner)
Add owner to the list of owners whose resources would be fetched from Fuel.
void DisplayResources()
Displays the resources to the qml grid abiding by all search and sort criteria.
void Resources(std::vector< Resource > &_resources)
Populates the passed in _resources vector with the currently selected group of resources.
void sizeChanged()
Signal used with the totalCount property.
QHash< int, QByteArray > roleNames() const override
Provides a model by which the resource spawner qml plugin pulls and updates from.
Definition: ResourceSpawner.hh:113
void OnSortChosen(const QString &_sortType)
Callback when a sort request is made.
int totalCount
Property used to display the total number of resources associated with an owner.
Definition: ResourceSpawner.hh:119
void OnOwnerClicked(const QString &_owner)
Callback when a fuel owner is selected, will clear the currently loaded resources and load the ones b...
void AddResource(const Resource &_resource)
Add a resource to the grid view. param[in] _resource The local resource to be added.
Q_INVOKABLE bool IsDefaultOwner(const QString &_owner) const
Determine if owner is the default owner.
std::string thumbnailPath
The absolute path to the thumbnail of the local model, will be empty if no thumbnail is found.
Definition: ResourceSpawner.hh:52
void AddResources(std::vector< Resource > &_resources)
Add a vector of resources to the grid view. param[in] _resource The vector of local resources to be a...
std::string sdfPath
The absolute path to the sdf corresponding to the local model.
Definition: ResourceSpawner.hh:48
void resourceSpawnerError(const QString &_errorMsg)
Signal emitted when an error is encountered regarding an owner.
QHash< int, QByteArray > roleNames() const override
void OnResourceSpawn(const QString &_sdfPath)
Callback when a resource is selected.
std::string name
The name of the resource.
Definition: ResourceSpawner.hh:41
std::string owner
The owner of the resource, if the resource is local, owner will be empty.
Definition: ResourceSpawner.hh:45