ResourceSpawner.hh
Go to the documentation of this file.
Provides a model by which the resource spawner qml plugin pulls and updates from.
Definition: ResourceSpawner.hh:90
void AddPath(const std::string &_path)
Add a path. param[in] _path The path to be added.
QHash< int, QByteArray > roleNames() const override
void RemovePath(const std::string &_path)
Remove a path. param[in] _path The path to be removed.
Provides a model by which the resource spawner qml plugin pulls and updates from.
Definition: ResourceSpawner.hh:114
void sizeChanged()
Signal used with the totalCount property.
void UpdateResourceModel(int index, Resource &_resource)
Updates the resource at the provided index with the values in the passed in resource.
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...
int totalCount
Property used to display the total number of resources associated with an owner.
Definition: ResourceSpawner.hh:119
QHash< int, QByteArray > roleNames() const override
void AddResource(const Resource &_resource)
Add a resource to the grid view. param[in] _resource The local resource to be added.
Provides interface for communicating to backend for generation of local models.
Definition: ResourceSpawner.hh:159
std::vector< Resource > FuelResources(const std::string &_owner)
Returns the fuel resources as a vector belonging to the passed in owner.
void OnSortChosen(const QString &_sortType)
Callback when a sort request is made.
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.
Q_INVOKABLE bool IsDefaultOwner(const QString &_owner) const
Determine if owner is the default owner.
Q_INVOKABLE void RemoveOwner(const QString &_owner)
Remove owner from the list of owners whose resources would be fetched from Fuel.
void Resources(std::vector< Resource > &_resources)
Populates the passed in _resources vector with the currently selected group of resources.
void SortResources(std::vector< Resource > &_resources)
Sorts the vector of resources by the previously entered sort method. The sorting types as a string,...
Q_INVOKABLE void UpdateOwnerListModel(ignition::gazebo::Resource _resource)
Called form a download thread to update the GUI's list of resources.
void OnResourceSpawn(const QString &_sdfPath)
Callback when a resource is selected.
Q_INVOKABLE bool AddOwner(const QString &_owner)
Add owner to the list of owners whose resources would be fetched from Fuel.
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 DisplayResources()
Displays the resources to the qml grid abiding by all search and sort criteria.
void OnPathClicked(const QString &_path)
Callback when a resource path is selected, will clear the currently loaded resources and load the one...
void resourceSpawnerError(const QString &_errorMsg)
Signal emitted when an error is encountered regarding an owner.
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 OnSearchEntered(const QString &_searchKeyword)
Callback when a search request is made.
std::vector< Resource > LocalResources(const std::string &_path)
Returns the local resources as a vector located under the passed in path.
void OnOwnerClicked(const QString &_owner)
Callback when a fuel owner is selected, will clear the currently loaded resources and load the ones b...
void LoadConfig(const tinyxml2::XMLElement *_pluginElem) override
Definition: config.hh:56
STL namespace.
Data used by the DisplayData() function to filter and sort the resources to be displayed.
Definition: ResourceSpawner.hh:67
std::string sortMethod
The currently chosen method of sorting, which includes "A - Z", "Z - A", "Most Recent",...
Definition: ResourceSpawner.hh:75
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
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 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
Resource used to update the ResourceModel.
Definition: ResourceSpawner.hh:39
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
std::string sdfPath
The absolute path to the sdf corresponding to the local model.
Definition: ResourceSpawner.hh:48
bool isFuel
Bool to indicate if this model is fuel or not.
Definition: ResourceSpawner.hh:56
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
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