PeriDyno 1.0.0
Loading...
Searching...
No Matches
OutputModule.cpp
Go to the documentation of this file.
2
3namespace dyno
4{
6 : Module()
7 {
8 this->varStride()->setRange(1, 1024);
9
10 auto path = this->varOutputPath()->getValue();
11 path.set_as_path(true);
12 this->varOutputPath()->setValue(path);
13
14 this->inFrameNumber()->tagOptional(true);
15 }
16
20
22 {
23 uint startFrame = this->varStartFrame()->getValue();
24 uint endFrame = this->varEndFrame()->getValue();
25
26 uint frame = this->inFrameNumber()->getValue();
27
28 uint stride = this->varStride()->getValue();
29
30 if (frame >= startFrame && frame <= endFrame)
31 {
32 if ((frame - startFrame) % stride == 0)
33 {
34 //OutputFile
35 this->output();
36 }
37 }
38 }
39
41 {
42 uint num = this->inFrameNumber()->getValue();
43 uint stride = this->varStride()->getValue();
44
45 uint index = num;
46
47 if (this->varReordering()->getValue()){
48 index = num / stride;
49 }
50
51 std::string prefix = this->varPrefix()->getValue();
52
53 auto path = this->varOutputPath()->getValue().path();
54
55 std::stringstream ss; ss << index;
56
57 //TODO: check whether the path already contains "\\" or "/" at the end
58 std::string filename = path.string() + "\\" + prefix + ss.str();
59
60 return filename;
61 }
62}
Module(std::string name="default")
Definition Module.cpp:7
std::string constructFileName()
~OutputModule() override
void updateImpl() final
virtual void output()
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
unsigned int uint
Definition VkProgram.h:14