Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to type alias for RayTracer and double-down namespace. #786

Merged
merged 3 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Next version

**Changed:**

* RayTracer type alias and double-down includes. (#786)
* reformat all files using clang-format (#679)
* change housekeeping to test format against clang-format (#679)
* now install dagmc header when building and installing static libs (#717)
Expand Down
9 changes: 4 additions & 5 deletions src/dagmc/DagMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
#include <sstream>
#include <string>

#ifdef DOUBLE_DOWN
#include "double_down/RTI.hpp"
#endif

#include "util.hpp"
#ifndef M_PI /* windows */
#define M_PI 3.14159265358979323846
#endif

#ifdef DOUBLE_DOWN
#include "double_down/MOABRay.h"
#include "double_down/RTI.hpp"
#endif

#define MB_OBB_TREE_TAG_NAME "OBB_TREE"
#define FACETING_TOL_TAG_NAME "FACETING_TOL"
static const int null_delimiter_length = 1;
Expand Down
4 changes: 3 additions & 1 deletion src/dagmc/DagMC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ struct DagmcVolData {
std::string comp_name;
};

namespace double_down {
class RayTracingInterface;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to forward declare this in a namespace to avoid moving the include here? Not sure if that works, but it would be good to avoid includes in headers if possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure can! Good call.

}

namespace moab {

Expand Down Expand Up @@ -477,7 +479,7 @@ class DagMC {
std::shared_ptr<GeomTopoTool> GTT;
// type alias for ray tracing engine
#ifdef DOUBLE_DOWN
using RayTracer = RayTracingInterface;
using RayTracer = double_down::RayTracingInterface;
#else
using RayTracer = GeomQueryTool;
#endif
Expand Down