Materials: External Modules Part 1
Refactored code to support local and external material sources This is the first PR in a series to support external modules. External modules allow materials to be stored in external data sources such as databases or web services. No new functionality is introduced in this PR, rather it is a refactoring of code that will allow for changes to be introduced in future PRs. Minor performance improvements have also been made in the model and material managers. The Python API has been enhanced for many data types to allow for modification within Python.
This commit is contained in:
committed by
Chris Hennes
parent
3c4977a2d4
commit
00c57a9d08
@@ -98,7 +98,7 @@ public:
|
||||
{
|
||||
_name = name;
|
||||
}
|
||||
void setColumnHeader(const QString& header)
|
||||
void setDisplayName(const QString& header)
|
||||
{
|
||||
_displayName = header;
|
||||
}
|
||||
@@ -143,6 +143,8 @@ public:
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
void validate(const ModelProperty& other) const;
|
||||
|
||||
private:
|
||||
QString _name;
|
||||
QString _displayName;
|
||||
@@ -180,12 +182,12 @@ public:
|
||||
{
|
||||
return _library;
|
||||
}
|
||||
const QString getBase() const
|
||||
QString getBase() const
|
||||
{
|
||||
return (_type == ModelType_Physical) ? QStringLiteral("Model")
|
||||
: QStringLiteral("AppearanceModel");
|
||||
}
|
||||
const QString getName() const
|
||||
QString getName() const
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
@@ -193,27 +195,22 @@ public:
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
const QString getDirectory() const
|
||||
{
|
||||
return _directory;
|
||||
}
|
||||
const QString getDirectoryPath() const
|
||||
{
|
||||
return QDir(_directory).absolutePath();
|
||||
}
|
||||
const QString getUUID() const
|
||||
QString getDirectory() const;
|
||||
QString getFilename() const;
|
||||
QString getFilePath() const;
|
||||
QString getUUID() const
|
||||
{
|
||||
return _uuid;
|
||||
}
|
||||
const QString getDescription() const
|
||||
QString getDescription() const
|
||||
{
|
||||
return _description;
|
||||
}
|
||||
const QString getURL() const
|
||||
QString getURL() const
|
||||
{
|
||||
return _url;
|
||||
}
|
||||
const QString getDOI() const
|
||||
QString getDOI() const
|
||||
{
|
||||
return _doi;
|
||||
}
|
||||
@@ -230,10 +227,8 @@ public:
|
||||
{
|
||||
_name = name;
|
||||
}
|
||||
void setDirectory(const QString& directory)
|
||||
{
|
||||
_directory = directory;
|
||||
}
|
||||
void setDirectory(const QString& directory);
|
||||
void setFilename(const QString& filename);
|
||||
void setUUID(const QString& uuid)
|
||||
{
|
||||
_uuid = uuid;
|
||||
@@ -306,11 +301,14 @@ public:
|
||||
return _properties.cend();
|
||||
}
|
||||
|
||||
void validate(const std::shared_ptr<Model>& other) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<ModelLibrary> _library;
|
||||
ModelType _type;
|
||||
QString _name;
|
||||
QString _directory;
|
||||
QString _filename;
|
||||
QString _uuid;
|
||||
QString _description;
|
||||
QString _url;
|
||||
|
||||
Reference in New Issue
Block a user