-
Notifications
You must be signed in to change notification settings - Fork 3
/
qquickvtkrenderitem.cpp
38 lines (34 loc) · 1.16 KB
/
qquickvtkrenderitem.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "qquickvtkrenderitem.h"
void MyQQuickVTKRenderItem::sync()
{
// std::cout<<"Syncing"<<std::endl;
/**
* @brief deal with command before render
*/
CommandModel *command;
while (!qtvtkItem->isCommandsQueueEmpty())
{
qtvtkItem->lockCommandsQueueMutex();
command = qtvtkItem->getCommandsQueueFront();
if ( !command->isReady() )
{
qtvtkItem->unlockCommandsQueueMutex();
break;
}
// if( command->typeis() !=2 && commandTranslate->getTrans().model != nullptr && m_selectedModel != nullptr && commandTranslate->getTrans().model != m_selectedModel){
// qtvtkItem->commandsQueuePop();
// std::cout<<"Model Not qeual"<<command->typeis() <<std::endl;
// qtvtkItem->unlockCommandsQueueMutex();
// continue;
// }
qtvtkItem->commandsQueuePop();
qtvtkItem->unlockCommandsQueueMutex();
command->execute();
}
while(!CommandQueue.empty()){
std::function<void()> task = std::move( this->CommandQueue.front() );
this->CommandQueue.pop();
task();
}
QQuickVTKRenderItem::sync();
}