-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef90cab
commit dc23efb
Showing
5 changed files
with
175 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/**************************************************************************** | ||
** Copyright (c) 2024, Fougue Ltd. <https://www.fougue.pro> | ||
** All rights reserved. | ||
** See license at https://github.com/fougue/mayo/blob/master/LICENSE.txt | ||
****************************************************************************/ | ||
|
||
#include "../base/text_id.h" | ||
|
||
namespace Mayo::IO { | ||
|
||
struct AssimpI18N { | ||
MAYO_DECLARE_TEXT_ID_FUNCTIONS(Mayo::IO::AssimpI18N) | ||
}; | ||
|
||
} // namespace Mayo::IO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/**************************************************************************** | ||
** Copyright (c) 2024, Fougue Ltd. <https://www.fougue.pro> | ||
** All rights reserved. | ||
** See license at https://github.com/fougue/mayo/blob/master/LICENSE.txt | ||
****************************************************************************/ | ||
|
||
#include "io_assimp_task_progress.h" | ||
|
||
#include "../base/task_progress.h" | ||
|
||
namespace Mayo::IO { | ||
|
||
AssimpTaskProgress::AssimpTaskProgress(TaskProgress* progress) | ||
: m_progress(progress) | ||
{ | ||
} | ||
|
||
bool AssimpTaskProgress::Update(float percent) | ||
{ | ||
if (TaskProgress::isAbortRequested(m_progress)) | ||
return false; | ||
|
||
if (percent > 0) | ||
m_progress->setValue(percent * 100); | ||
|
||
return true; | ||
} | ||
|
||
} // namespace Mayo::IO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/**************************************************************************** | ||
** Copyright (c) 2024, Fougue Ltd. <https://www.fougue.pro> | ||
** All rights reserved. | ||
** See license at https://github.com/fougue/mayo/blob/master/LICENSE.txt | ||
****************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <assimp/ProgressHandler.hpp> | ||
namespace Mayo { class TaskProgress; } | ||
|
||
namespace Mayo::IO { | ||
|
||
// Provides assimp progress handler over Mayo::TaskProgress object | ||
class AssimpTaskProgress : public Assimp::ProgressHandler { | ||
public: | ||
AssimpTaskProgress(TaskProgress* progress); | ||
|
||
bool Update(float percent = -1.f) override; | ||
|
||
private: | ||
TaskProgress* m_progress = nullptr; | ||
}; | ||
|
||
} // namespace Mayo::IO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters