mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-22 23:14:10 +02:00
ModelUploader only has static methods accessible
This commit is contained in:
parent
f317b54017
commit
da636ca918
4 changed files with 45 additions and 26 deletions
|
@ -3626,16 +3626,6 @@ void Application::setMenuShortcutsEnabled(bool enabled) {
|
||||||
setShortcutsEnabled(_window->menuBar(), enabled);
|
setShortcutsEnabled(_window->menuBar(), enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::uploadModel(ModelType modelType) {
|
|
||||||
ModelUploader* uploader = new ModelUploader(modelType);
|
|
||||||
QThread* thread = new QThread();
|
|
||||||
thread->connect(uploader, SIGNAL(destroyed()), SLOT(quit()));
|
|
||||||
thread->connect(thread, SIGNAL(finished()), SLOT(deleteLater()));
|
|
||||||
uploader->connect(thread, SIGNAL(started()), SLOT(send()));
|
|
||||||
|
|
||||||
thread->start();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::updateWindowTitle(){
|
void Application::updateWindowTitle(){
|
||||||
|
|
||||||
QString buildVersion = " (build " + applicationVersion() + ")";
|
QString buildVersion = " (build " + applicationVersion() + ")";
|
||||||
|
@ -4191,19 +4181,19 @@ void Application::toggleRunningScriptsWidget() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::uploadHead() {
|
void Application::uploadHead() {
|
||||||
uploadModel(HEAD_MODEL);
|
ModelUploader::uploadHead();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::uploadSkeleton() {
|
void Application::uploadSkeleton() {
|
||||||
uploadModel(SKELETON_MODEL);
|
ModelUploader::uploadSkeleton();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::uploadAttachment() {
|
void Application::uploadAttachment() {
|
||||||
uploadModel(ATTACHMENT_MODEL);
|
ModelUploader::uploadAttachment();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::uploadEntity() {
|
void Application::uploadEntity() {
|
||||||
uploadModel(ENTITY_MODEL);
|
ModelUploader::uploadEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::openUrl(const QUrl& url) {
|
void Application::openUrl(const QUrl& url) {
|
||||||
|
|
|
@ -460,8 +460,6 @@ private:
|
||||||
|
|
||||||
void setMenuShortcutsEnabled(bool enabled);
|
void setMenuShortcutsEnabled(bool enabled);
|
||||||
|
|
||||||
void uploadModel(ModelType modelType);
|
|
||||||
|
|
||||||
static void attachNewHeadToNode(Node *newNode);
|
static void attachNewHeadToNode(Node *newNode);
|
||||||
static void* networkReceive(void* args); // network receive thread
|
static void* networkReceive(void* args); // network receive thread
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,32 @@ static const int MAX_CHECK = 30;
|
||||||
static const int QCOMPRESS_HEADER_POSITION = 0;
|
static const int QCOMPRESS_HEADER_POSITION = 0;
|
||||||
static const int QCOMPRESS_HEADER_SIZE = 4;
|
static const int QCOMPRESS_HEADER_SIZE = 4;
|
||||||
|
|
||||||
|
void ModelUploader::uploadModel(ModelType modelType) {
|
||||||
|
ModelUploader* uploader = new ModelUploader(modelType);
|
||||||
|
QThread* thread = new QThread();
|
||||||
|
thread->connect(uploader, SIGNAL(destroyed()), SLOT(quit()));
|
||||||
|
thread->connect(thread, SIGNAL(finished()), SLOT(deleteLater()));
|
||||||
|
uploader->connect(thread, SIGNAL(started()), SLOT(send()));
|
||||||
|
|
||||||
|
thread->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModelUploader::uploadHead() {
|
||||||
|
uploadModel(HEAD_MODEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModelUploader::uploadSkeleton() {
|
||||||
|
uploadModel(SKELETON_MODEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModelUploader::uploadAttachment() {
|
||||||
|
uploadModel(ATTACHMENT_MODEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModelUploader::uploadEntity() {
|
||||||
|
uploadModel(ENTITY_MODEL);
|
||||||
|
}
|
||||||
|
|
||||||
ModelUploader::ModelUploader(ModelType modelType) :
|
ModelUploader::ModelUploader(ModelType modelType) :
|
||||||
_lodCount(-1),
|
_lodCount(-1),
|
||||||
_texturesCount(-1),
|
_texturesCount(-1),
|
||||||
|
|
|
@ -33,13 +33,15 @@ class ModelUploader : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ModelUploader(ModelType type);
|
static void uploadModel(ModelType modelType);
|
||||||
~ModelUploader();
|
|
||||||
|
|
||||||
public slots:
|
static void uploadHead();
|
||||||
void send();
|
static void uploadSkeleton();
|
||||||
|
static void uploadAttachment();
|
||||||
|
static void uploadEntity();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void send();
|
||||||
void checkJSON(QNetworkReply& requestReply);
|
void checkJSON(QNetworkReply& requestReply);
|
||||||
void uploadUpdate(qint64 bytesSent, qint64 bytesTotal);
|
void uploadUpdate(qint64 bytesSent, qint64 bytesTotal);
|
||||||
void uploadSuccess(QNetworkReply& requestReply);
|
void uploadSuccess(QNetworkReply& requestReply);
|
||||||
|
@ -48,6 +50,15 @@ private slots:
|
||||||
void processCheck();
|
void processCheck();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
ModelUploader(ModelType type);
|
||||||
|
~ModelUploader();
|
||||||
|
|
||||||
|
void populateBasicMapping(QVariantHash& mapping, QString filename, FBXGeometry geometry);
|
||||||
|
bool zip();
|
||||||
|
bool addTextures(const QString& texdir, const FBXGeometry& geometry);
|
||||||
|
bool addPart(const QString& path, const QString& name, bool isTexture = false);
|
||||||
|
bool addPart(const QFile& file, const QByteArray& contents, const QString& name, bool isTexture = false);
|
||||||
|
|
||||||
QString _url;
|
QString _url;
|
||||||
QString _textureBase;
|
QString _textureBase;
|
||||||
QSet<QByteArray> _textureFilenames;
|
QSet<QByteArray> _textureFilenames;
|
||||||
|
@ -64,12 +75,6 @@ private:
|
||||||
|
|
||||||
QDialog* _progressDialog;
|
QDialog* _progressDialog;
|
||||||
QProgressBar* _progressBar;
|
QProgressBar* _progressBar;
|
||||||
|
|
||||||
void populateBasicMapping(QVariantHash& mapping, QString filename, FBXGeometry geometry);
|
|
||||||
bool zip();
|
|
||||||
bool addTextures(const QString& texdir, const FBXGeometry& geometry);
|
|
||||||
bool addPart(const QString& path, const QString& name, bool isTexture = false);
|
|
||||||
bool addPart(const QFile& file, const QByteArray& contents, const QString& name, bool isTexture = false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A dialog that allows customization of various model properties.
|
/// A dialog that allows customization of various model properties.
|
||||||
|
|
Loading…
Reference in a new issue