A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
box-line-intersection-test.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8#ifndef BOX_LINE_INTERSECTION_TEST_H
9#define BOX_LINE_INTERSECTION_TEST_H
10
11#include <ns3/box.h>
12#include <ns3/test.h>
13#include <ns3/vector.h>
14
15using namespace ns3;
16
17/**
18 * \brief Test suite for
19 *
20 * \sa ns3::BoxLineIntersectionTestSuite
21 */
23{
24 public:
25 /**
26 * Constructor
27 */
29};
30
31/**
32 * \brief TestCase to check the box line intersection
33 */
35{
36 public:
37 /**
38 * \brief Create BoxLineIntersectionTestCase
39 * \param indexPos1 Index of the first position to generate
40 * \param indexPos2 Index of the second position to generate
41 * \param box The 3D box
42 * \param intersect The expected result of the test. True for intersection,
43 * false otherwise
44 */
45 BoxLineIntersectionTestCase(uint16_t indexPos1, uint16_t indexPos2, Box box, bool intersect);
46 /**
47 * \brief Builds the test name string based on provided parameter values
48 * \param indexPos1 Index of the first position to generate
49 * \param indexPos2 Index of the second position to generate
50 * \param box The 3D box
51 * \param intersect The expected result of the test. True for intersection,
52 * false otherwise
53 *
54 * \return The name string
55 */
56 std::string BuildNameString(uint16_t indexPos1, uint16_t indexPos2, Box box, bool intersect);
57 /**
58 * Destructor
59 */
61
62 private:
63 /**
64 * \brief Setup the simulation according to the configuration set by the
65 * class constructor, run it, and verify the result.
66 */
67 void DoRun() override;
68 /**
69 * \brief Create the position as per the given index
70 *
71 * \param index The index of the position to be created
72 * \param boxHeight The height if the box. It is used to place the position
73 * above the height of the box
74 * \returns The ns-3 3D Vector specifying the position
75 */
76 Vector CreatePosition(uint16_t index, double boxHeight);
77
78 uint16_t m_indexPos1{0}; //!< First position index
79 uint16_t m_indexPos2{0}; //!< Second position index
80 Box m_box; //!< The box to check the intersection with
81 bool m_intersect{false}; /**< Flag to indicate the intersection.
82 * True, for intersection, false otherwise.
83 */
84};
85
86#endif /* BOX_LINE_INTERSECTION_TEST_H */
TestCase to check the box line intersection.
uint16_t m_indexPos2
Second position index.
BoxLineIntersectionTestCase(uint16_t indexPos1, uint16_t indexPos2, Box box, bool intersect)
Create BoxLineIntersectionTestCase.
uint16_t m_indexPos1
First position index.
void DoRun() override
Setup the simulation according to the configuration set by the class constructor, run it,...
std::string BuildNameString(uint16_t indexPos1, uint16_t indexPos2, Box box, bool intersect)
Builds the test name string based on provided parameter values.
bool m_intersect
Flag to indicate the intersection.
Vector CreatePosition(uint16_t index, double boxHeight)
Create the position as per the given index.
~BoxLineIntersectionTestCase() override
Destructor.
Box m_box
The box to check the intersection with.
a 3d box
Definition box.h:24
encapsulates test code
Definition test.h:1050
A suite of tests to run.
Definition test.h:1267
Every class exported by the ns3 library is enclosed in the ns3 namespace.