-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #453 from lhy11009/distance_to_feature_plane
interface for the distance to a feature's plane
- Loading branch information
Showing
11 changed files
with
277 additions
and
0 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
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,64 @@ | ||
/* | ||
Copyright (C) 2018 - 2022 by the authors of the World Builder code. | ||
This file is part of the World Builder. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published | ||
by the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef WORLD_BUILDER_OBJECTSS_DISTANCE_FROM_SURFACE_H | ||
#define WORLD_BUILDER_OBJECTSS_DISTANCE_FROM_SURFACE_H | ||
|
||
namespace WorldBuilder | ||
{ | ||
namespace Objects | ||
{ | ||
class PlaneDistances | ||
{ | ||
public: | ||
|
||
/** | ||
* Constructor to create an PlaneDistances object from the distance | ||
* from and along the surface of plane | ||
*/ | ||
PlaneDistances(const double distance_from_surface_, const double distance_along_surface_) | ||
: | ||
distance_from_surface(distance_from_surface_), | ||
distance_along_surface(distance_along_surface_) | ||
{} | ||
|
||
/** | ||
* Function to get the distance from the surface | ||
*/ | ||
double get_distance_from_surface(); | ||
|
||
/** | ||
* Function to get the distance along the surface | ||
*/ | ||
double get_distance_along_surface(); | ||
|
||
private: | ||
/** | ||
* the distance from the surface of the plane | ||
*/ | ||
double distance_from_surface; | ||
/** | ||
* the distance along the surface of the plane | ||
*/ | ||
double distance_along_surface; | ||
}; | ||
} | ||
} | ||
|
||
#endif |
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
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,36 @@ | ||
/* | ||
Copyright (C) 2018 - 2022 by the authors of the World Builder code. | ||
This file is part of the World Builder. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published | ||
by the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "world_builder/objects/distance_from_surface.h" | ||
|
||
namespace WorldBuilder | ||
{ | ||
namespace Objects | ||
{ | ||
double PlaneDistances::get_distance_from_surface() | ||
{ | ||
return this->distance_from_surface; | ||
} | ||
|
||
double PlaneDistances::get_distance_along_surface() | ||
{ | ||
return this->distance_along_surface; | ||
} | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
...sts/approved/unit_test_world_builder.WorldBuilder_Features__Distance_to_Feature_Plane.txt
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,10 @@ | ||
Test | ||
|
||
|
||
[0] = 7141.78 | ||
[1] = 70.7107 | ||
[2] = 618.443 | ||
[3] = 13.5623 | ||
[4] = inf | ||
[5] = inf | ||
|
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