5 #include <GroveKDTreeRaycaster.h>
8 #include <FastSAHKDTreeFactory.h>
13 namespace HeliosTests{
31 std::vector<std::shared_ptr<GroveKDTreeRaycaster>>
trees;
44 for(std::vector<Primitive *> &triangles :
primitives){
111 size_t i, j, iMax, m;
115 for(j = 0 ; j < 3 ; ++j){
116 for(i = 0, iMax = 0 ; i < m ; ++i){
117 if(
trees[i] !=
kdg[i])
return false;
118 if(i > iMax) iMax = i;
121 if(iMax!=m-1 || m!=
trees.size())
return false;
124 for(j=0 ; j < 3 ; ++j){
132 if(i!=m)
return false;
135 for(j=0 ; j < 3 ; ++j){
137 for(std::shared_ptr<GroveKDTreeRaycaster> gkdt :
kdg){
138 if(
trees[i] != gkdt)
return false;
142 if(i!=m)
return false;
179 std::vector<Primitive *> triangles1;
203 std::vector<Primitive *> triangles2;
227 std::vector<Primitive *> triangles3;
251 std::vector<Primitive *> triangles4;
276 std::shared_ptr<LightKDTreeNode> tree1(
279 trees.push_back(std::make_shared<GroveKDTreeRaycaster>(tree1));
280 std::shared_ptr<LightKDTreeNode> tree2(
283 trees.push_back(std::make_shared<GroveKDTreeRaycaster>(tree2));
284 std::shared_ptr<LightKDTreeNode> tree3(
287 trees.push_back(std::make_shared<GroveKDTreeRaycaster>(tree3));
288 std::shared_ptr<LightKDTreeNode> tree4(
291 trees.push_back(std::make_shared<GroveKDTreeRaycaster>(tree4));
294 for(std::shared_ptr<GroveKDTreeRaycaster> gkdtrc :
trees){
virtual std::vector< BasicDynGroveSubject< Tree, Subject > * > const & getSubjects() const
Obtain a read-only reference to vector of subjects.
Definition: BasicDynGrove.h:93
void addTree(std::shared_ptr< Tree > tree) override
std::shared_ptr< Tree > nextTreeShared() override
size_t getNumTrees() const override
std::shared_ptr< Tree > getTreeShared(size_t const index) const override
void toZeroTree() override
bool hasNextTree() const override
Implementation of a dynamic object which supports dynamic motions (extended rigid motions)
Definition: DynMovingObject.h:39
Class providing building methods for k-dimensional trees with a fast strategy to approximate Surface ...
Definition: FastSAHKDTreeFactory.h:42
BaseTest class.
Definition: BaseTest.h:20
Test for grove of trees.
Definition: GroveTest.h:20
void buildPrimitives()
Build the primitives that will be used to define trees.
Definition: GroveTest.h:177
void buildGrove()
Build the grove of trees to be tested.
Definition: GroveTest.h:293
std::vector< std::shared_ptr< GroveKDTreeRaycaster > > trees
Trees defining.
Definition: GroveTest.h:31
void buildTrees()
Build the trees that will be contained in the grove.
Definition: GroveTest.h:274
bool run() override
Definition: GroveTest.h:93
std::vector< std::vector< Primitive * > > primitives
Primitives for each tree.
Definition: GroveTest.h:35
bool testObserving()
Test observer pattern mechanics are working as expected.
Definition: GroveTest.h:148
KDGrove kdg
The K-Dimensional Grove for testing purposes.
Definition: GroveTest.h:27
bool testLoops()
Test the for, while and for-each loops of the grove.
Definition: GroveTest.h:109
Grove of KDTrees. It supports both static and dynamic KDTrees, handling each accordingly.
Definition: KDGrove.h:20
void removeSubject(KDGroveSubject *subject)
Workaround to redirect calls from KDGrove::removeSubject(KDGroveSubject *) to BasicDynGrove::removeSu...
Definition: KDGrove.h:66
void addSubject(KDGroveSubject *subject, std::shared_ptr< GroveKDTreeRaycaster > tree)
Workaround to redirect calls from KDGrove::addSubject(KDGroveSubject *, shared_ptr<GroveKDTreeRaycast...
Definition: KDGrove.h:50
virtual KDTreeNodeRoot * makeFromPrimitives(vector< Primitive * > const &primitives, bool const computeStats=false, bool const reportStats=false)
Safe wrapper from makeFromPrimitivesUnsafe which handles a copy to make from primitives by default....
Definition: KDTreeFactory.h:111
Abstract class defining the common behavior for all primitives.
Definition: Primitive.h:24
Class representing triangle primitive.
Definition: Triangle.h:13
Class representing a vertex.
Definition: Vertex.h:14