A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
15
using namespace
ns3
;
16
17
/**
18
* \brief Test suite for
19
*
20
* \sa ns3::BoxLineIntersectionTestSuite
21
*/
22
class
BoxLineIntersectionTestSuite
:
public
TestSuite
23
{
24
public
:
25
/**
26
* Constructor
27
*/
28
BoxLineIntersectionTestSuite
();
29
};
30
31
/**
32
* \brief TestCase to check the box line intersection
33
*/
34
class
BoxLineIntersectionTestCase
:
public
TestCase
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
*/
60
~BoxLineIntersectionTestCase
()
override
;
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 */
BoxLineIntersectionTestCase
TestCase to check the box line intersection.
Definition
box-line-intersection-test.h:35
BoxLineIntersectionTestCase::m_indexPos2
uint16_t m_indexPos2
Second position index.
Definition
box-line-intersection-test.h:79
BoxLineIntersectionTestCase::BoxLineIntersectionTestCase
BoxLineIntersectionTestCase(uint16_t indexPos1, uint16_t indexPos2, Box box, bool intersect)
Create BoxLineIntersectionTestCase.
Definition
box-line-intersection-test.cc:64
BoxLineIntersectionTestCase::m_indexPos1
uint16_t m_indexPos1
First position index.
Definition
box-line-intersection-test.h:78
BoxLineIntersectionTestCase::DoRun
void DoRun() override
Setup the simulation according to the configuration set by the class constructor, run it,...
Definition
box-line-intersection-test.cc:96
BoxLineIntersectionTestCase::BuildNameString
std::string BuildNameString(uint16_t indexPos1, uint16_t indexPos2, Box box, bool intersect)
Builds the test name string based on provided parameter values.
Definition
box-line-intersection-test.cc:81
BoxLineIntersectionTestCase::m_intersect
bool m_intersect
Flag to indicate the intersection.
Definition
box-line-intersection-test.h:81
BoxLineIntersectionTestCase::CreatePosition
Vector CreatePosition(uint16_t index, double boxHeight)
Create the position as per the given index.
Definition
box-line-intersection-test.cc:110
BoxLineIntersectionTestCase::~BoxLineIntersectionTestCase
~BoxLineIntersectionTestCase() override
Destructor.
Definition
box-line-intersection-test.cc:76
BoxLineIntersectionTestCase::m_box
Box m_box
The box to check the intersection with.
Definition
box-line-intersection-test.h:80
BoxLineIntersectionTestSuite
Test suite for.
Definition
box-line-intersection-test.h:23
BoxLineIntersectionTestSuite::BoxLineIntersectionTestSuite
BoxLineIntersectionTestSuite()
Constructor.
Definition
box-line-intersection-test.cc:22
ns3::Box
a 3d box
Definition
box.h:24
ns3::TestCase
encapsulates test code
Definition
test.h:1050
ns3::TestSuite
A suite of tests to run.
Definition
test.h:1267
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mobility
test
box-line-intersection-test.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0