Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5108: Add tests to check if layer information is preserved between m…
…ap saving and loading Refactor tests to reduce code duplication.
- Loading branch information
1 parent
ade784b
commit fad0701
Showing
4 changed files
with
194 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
|
||
#include "ibrush.h" | ||
#include "math/Plane3.h" | ||
|
||
namespace test | ||
{ | ||
|
||
namespace algorithm | ||
{ | ||
|
||
// Creates a cubic brush with dimensions 64x64x64 at the given origin | ||
scene::INodePtr createCubicBrush(const scene::INodePtr& parent, | ||
const Vector3& origin = Vector3(0,0,0), | ||
const std::string& material = "_default") | ||
{ | ||
auto brushNode = GlobalBrushCreator().createBrush(); | ||
parent->addChildNode(brushNode); | ||
|
||
auto& brush = *Node_getIBrush(brushNode); | ||
|
||
auto translation = Matrix4::getTranslation(origin); | ||
brush.addFace(Plane3(+1, 0, 0, 64).transform(translation)); | ||
brush.addFace(Plane3(-1, 0, 0, 64).transform(translation)); | ||
brush.addFace(Plane3(0, +1, 0, 64).transform(translation)); | ||
brush.addFace(Plane3(0, -1, 0, 64).transform(translation)); | ||
brush.addFace(Plane3(0, 0, +1, 64).transform(translation)); | ||
brush.addFace(Plane3(0, 0, -1, 64).transform(translation)); | ||
|
||
brush.setShader(material); | ||
|
||
brush.evaluateBRep(); | ||
|
||
return brushNode; | ||
} | ||
|
||
} | ||
|
||
} |
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