PeriDyno 1.0.0
Loading...
Searching...
No Matches
QFieldWidget.cpp
Go to the documentation of this file.
1#include "QFieldWidget.h"
2
3#include "Module.h"
4#include "Node.h"
5#include "Field.h"
6#include "SceneGraphFactory.h"
7
8#include <QVBoxLayout>
9
10#include <memory>
11
12
13namespace dyno
14{
16 {
17 mField = field;
18
19 if (mField != nullptr)
20 {
21 callback = std::make_shared<FCallBackFunc>(std::bind(&QFieldWidget::syncValueFromField, this));
22 mField->attach(callback);
23 }
24 }
25
30
32 {
33 if (mField != nullptr) {
34 mField->detach(callback);
35 }
36 }
37
39 {
40 auto node = dynamic_cast<Node*>(mField->parent());
41 if (node != nullptr) {
42 node->updateGraphicsContext();
43 }
44
45 emit fieldChanged();
46 }
47
48
49
50}
51
std::shared_ptr< FCallBackFunc > callback
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25