-
Notifications
You must be signed in to change notification settings - Fork 324
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
4fcf3fc
commit 1f76651
Showing
7 changed files
with
145 additions
and
3 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
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
|
||
set(CGRAPH_FUNCTIONAL_LIST | ||
test-functional-01 | ||
test-functional-02 | ||
) | ||
|
||
foreach(func ${CGRAPH_FUNCTIONAL_LIST}) | ||
|
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,40 @@ | ||
/*************************** | ||
@Author: Chunel | ||
@Contact: [email protected] | ||
@File: test-functional-01.cpp | ||
@Time: 2023/12/27 23:16 | ||
@Desc: | ||
***************************/ | ||
|
||
#include "../_Materials/TestGNodes.h" | ||
|
||
using namespace CGraph; | ||
|
||
void test_functional_01() { | ||
GPipelinePtr pipeline = GPipelineFactory::create(); | ||
CStatus status; | ||
GElementPtr a, b, c, d, e, f, g, h, i, j = nullptr; | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&a, {}); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&b, {}); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&c, {a}); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&d, {b}); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&e, {b, c}); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&f, {c}); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&g, {d, e, f}); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&h, {f}); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&i, {g, h}); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&j, {h}); | ||
|
||
status = pipeline->process(1000000); | ||
if (status.isErr()) { | ||
std::cout << status.getInfo() << std::endl; | ||
} | ||
|
||
GPipelineFactory::remove(pipeline); | ||
} | ||
|
||
|
||
int main() { | ||
test_functional_01(); | ||
return 0; | ||
} |
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,63 @@ | ||
/*************************** | ||
@Author: Chunel | ||
@Contact: [email protected] | ||
@File: test-functional-02.cpp | ||
@Time: 2023/12/27 23:30 | ||
@Desc: | ||
***************************/ | ||
|
||
|
||
#include "../_Materials/TestGNodes.h" | ||
|
||
using namespace CGraph; | ||
|
||
void test_functional_02() { | ||
GPipelinePtr pipeline = GPipelineFactory::create(); | ||
CStatus status; | ||
GElementPtr a,b,c,d,e,f,g,h,i,j,k,l,m,n = nullptr; | ||
GElementPtr region1, region2, cluster1, cluster2 = nullptr; | ||
|
||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&a, {}, "a"); | ||
|
||
b = pipeline->createGNode<TestMaterialAdd1GNode>(GNodeInfo({}, "b")); | ||
c = pipeline->createGNode<TestMaterialAdd1GNode>(GNodeInfo({}, "c")); | ||
|
||
d = pipeline->createGNode<TestMaterialAdd1GNode>(GNodeInfo({}, "d")); | ||
e = pipeline->createGNode<TestMaterialAdd1GNode>(GNodeInfo("e", 3)); | ||
f = pipeline->createGNode<TestMaterialAdd1GNode>(GNodeInfo("f")); | ||
cluster1 = pipeline->createGGroup<GCluster>({e, f}, {d}, "cluster1"); | ||
|
||
g = pipeline->createGNode<TestMaterialAdd1GNode>(GNodeInfo({d}, "g")); | ||
region2 = pipeline->createGGroup<GRegion>({d, cluster1, g}, {}, "region2", 2); | ||
|
||
region1 = pipeline->createGGroup<GRegion>({b, c, region2}); | ||
|
||
i = pipeline->createGNode<TestMaterialAdd1GNode>(GNodeInfo("i")); | ||
j = pipeline->createGNode<TestMaterialAdd1GNode>(GNodeInfo("j")); | ||
k = pipeline->createGNode<TestMaterialAdd1GNode>(GNodeInfo("k")); | ||
cluster2 = pipeline->createGGroup<GCluster>({i, j, k}, {a, region1}, "cluster2"); | ||
|
||
status += pipeline->registerGElement<GRegion>(®ion1, {}, "region1", 3); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&h, {region1}, "h"); | ||
status += pipeline->registerGElement<GCluster>(&cluster2, {a, region1}, "cluster2"); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&l, {a}, "l"); | ||
|
||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&m, {h, cluster2}, "m"); | ||
status += pipeline->registerGElement<TestMaterialAdd1GNode>(&n, {l, cluster2}, "n"); | ||
|
||
{ | ||
UTimeCounter counter; | ||
status = pipeline->process(10000); | ||
} | ||
|
||
if (status.isErr()) { | ||
std::cout << status.getInfo() << std::endl; | ||
} | ||
GPipelineFactory::remove(pipeline); | ||
} | ||
|
||
|
||
int main() { | ||
test_functional_02(); | ||
return 0; | ||
} |
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