Skip to content

Commit

Permalink
fix cmake files
Browse files Browse the repository at this point in the history
  • Loading branch information
ifcquery committed Nov 25, 2023
1 parent 2247452 commit fd16427
Show file tree
Hide file tree
Showing 27 changed files with 841 additions and 592 deletions.
34 changes: 24 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,32 @@ set(IFCPP_CONFIG_DIR "share/IFCPP/cmake")
ADD_SUBDIRECTORY (IfcPlusPlus)

# Install configuration file
INCLUDE(CMakePackageConfigHelpers)
set(config_file_input "${CMAKE_CURRENT_SOURCE_DIR}/cmake/IFCPPConfig.cmake.in")
set(config_file_output "${CMAKE_CURRENT_BINARY_DIR}/cmake/IFCPPConfig.cmake")
#INCLUDE(CMakePackageConfigHelpers)
#set(config_file_input "${CMAKE_CURRENT_SOURCE_DIR}/cmake/IFCPPConfig.cmake.in")
#set(config_file_output "${CMAKE_CURRENT_BINARY_DIR}/cmake/IFCPPConfig.cmake")

CONFIGURE_PACKAGE_CONFIG_FILE(
${config_file_input}
${config_file_output}
INSTALL_DESTINATION ${IFCPP_CONFIG_DIR})
#CONFIGURE_PACKAGE_CONFIG_FILE(
# ${config_file_input}
# ${config_file_output}
# INSTALL_DESTINATION ${IFCPP_CONFIG_DIR})

INSTALL(
FILES ${config_file_output}
DESTINATION ${IFCPP_CONFIG_DIR})
#INSTALL(
# FILES ${config_file_output}
# DESTINATION ${IFCPP_CONFIG_DIR})

#install(
# DIRECTORY src/ifcpp
# DESTINATION include
# FILES_MATCHING PATTERN "*.h"
#)

#install(
# TARGETS IfcPlusPlus
#EXPORT IfcPlusPlus
# RUNTIME DESTINATION bin
# LIBRARY DESTINATION bin
# ARCHIVE DESTINATION bin
#)

IF(BUILD_CONSOLE_APPLICATION)
ADD_SUBDIRECTORY (examples/CreateIfcWallAndWriteFile)
Expand Down
12 changes: 6 additions & 6 deletions IfcPlusPlus/src/external/Carve/src/include/carve/aabb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ struct aabb {

std::pair<double, double> rangeInDirection( const carve::geom::vector<ndim>& v) const;

vector_t min() const;
vector_t mid() const;
vector_t max() const;
vector_t minPoint() const; // renamed from min() to minPoint() because it can create compiler problems in projects where min is defined as a macro
vector_t midPoint() const;
vector_t maxPoint() const;

double min(size_t dim) const;
double mid(size_t dim) const;
double max(size_t dim) const;
double minCoordinateInDimension(size_t dim) const;
double midCoordinateInDimension(size_t dim) const;
double maxDimension(size_t dim) const;

double volume() const;

Expand Down
32 changes: 16 additions & 16 deletions IfcPlusPlus/src/external/Carve/src/include/carve/aabb_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ namespace carve {
vector_t min, max;
aabb<ndim> a = get_aabb<ndim, value_type>()(*begin);
++begin;
min = a.min();
max = a.max();
min = a.minPoint();
max = a.maxPoint();
while( begin != end ) {
a = get_aabb<ndim, value_type>()(*begin);
++begin;
assign_op(min, min, a.min(), carve::util::min_functor());
assign_op(max, max, a.max(), carve::util::max_functor());
assign_op(min, min, a.minPoint(), carve::util::min_functor());
assign_op(max, max, a.maxPoint(), carve::util::max_functor());
}

pos = (min + max) / 2.0;
Expand Down Expand Up @@ -96,13 +96,13 @@ namespace carve {

vector_t min, max;
aabb<ndim> a = *begin++;
min = a.min();
max = a.max();
min = a.minPoint();
max = a.maxPoint();
while( begin != end ) {
aabb<ndim> a = *begin;
++begin;
assign_op(min, min, a.min(), carve::util::min_functor());
assign_op(max, max, a.max(), carve::util::max_functor());
assign_op(min, min, a.minPoint(), carve::util::min_functor());
assign_op(max, max, a.maxPoint(), carve::util::max_functor());
}

pos = (min + max) / 2.0;
Expand Down Expand Up @@ -165,8 +165,8 @@ namespace carve {
void aabb<ndim>::unionAABB(const aabb<ndim>& a) {
vector_t vmin, vmax;

assign_op(vmin, min(), a.min(), carve::util::min_functor());
assign_op(vmax, max(), a.max(), carve::util::max_functor());
assign_op(vmin, minPoint(), a.minPoint(), carve::util::min_functor());
assign_op(vmax, maxPoint(), a.maxPoint(), carve::util::max_functor());
pos = (vmin + vmax) / 2.0;
assign_op(extent, vmax - pos, pos - vmin, carve::util::max_functor());
}
Expand Down Expand Up @@ -252,34 +252,34 @@ namespace carve {
}

template <unsigned ndim>
typename aabb<ndim>::vector_t aabb<ndim>::min() const {
typename aabb<ndim>::vector_t aabb<ndim>::minPoint() const {
return pos - extent;
}

template <unsigned ndim>
typename aabb<ndim>::vector_t aabb<ndim>::mid() const {
typename aabb<ndim>::vector_t aabb<ndim>::midPoint() const {
return pos;
}

template <unsigned ndim>
typename aabb<ndim>::vector_t aabb<ndim>::max() const {
typename aabb<ndim>::vector_t aabb<ndim>::maxPoint() const {
return pos + extent;
}

template <unsigned ndim>
double aabb<ndim>::min(size_t dim) const
double aabb<ndim>::minCoordinateInDimension(size_t dim) const
{
return pos.v[dim] - extent.v[dim];
}

template <unsigned ndim>
double aabb<ndim>::mid(size_t dim) const
double aabb<ndim>::midCoordinateInDimension(size_t dim) const
{
return pos.v[dim];
}

template <unsigned ndim>
double aabb<ndim>::max(size_t dim) const
double aabb<ndim>::maxDimension(size_t dim) const
{
return pos.v[dim] + extent.v[dim];
}
Expand Down
4 changes: 2 additions & 2 deletions IfcPlusPlus/src/external/Carve/src/include/carve/kd_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ class kd_node {
}

if (splitpos.pos == std::numeric_limits<double>::max()) {
carve::geom::vector<ndim> min = aabb.min();
carve::geom::vector<ndim> max = aabb.max();
carve::geom::vector<ndim> min = aabb.minPoint();
carve::geom::vector<ndim> max = aabb.maxPoint();
splitpos.pos = aabb.pos.v[splitpos.axis];
}

Expand Down
19 changes: 6 additions & 13 deletions IfcPlusPlus/src/external/Carve/src/include/carve/mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,8 @@ namespace carve {
}

void invert() {
// We invert the direction of the edges of the face in this
// way so that the edge rev pointers (if any) are still
// correct. It is expected that invert() will be called on
// every other face in the mesh, too, otherwise everything
// will get messed up.
// We invert the direction of the edges of the face in this way so that the edge rev pointers (if any) are still
// correct. It is expected that invert() will be called on every other face in the mesh, too, otherwise everything will get messed up.

{
// advance vertices.
Expand Down Expand Up @@ -496,10 +493,8 @@ namespace carve {

typedef std::pair<const vertex_t*, const vertex_t*> vpair_t;
typedef std::list<edge_t*> edgelist_t;
typedef std::unordered_map<vpair_t, edgelist_t, carve::mesh::hash_vertex_pair>
edge_map_t;
typedef std::unordered_map<const vertex_t*, std::set<const vertex_t*> >
edge_graph_t;
typedef std::unordered_map<vpair_t, edgelist_t, carve::mesh::hash_vertex_pair> edge_map_t;
typedef std::unordered_map<const vertex_t*, std::set<const vertex_t*> > edge_graph_t;

MeshOptions opts;

Expand Down Expand Up @@ -542,8 +537,7 @@ namespace carve {
carve::geom::vector<3> edge_dir;
carve::geom::vector<3> base_dir;

Cmp(const carve::geom::vector<3>& _edge_dir,
const carve::geom::vector<3>& _base_dir)
Cmp(const carve::geom::vector<3>& _edge_dir, const carve::geom::vector<3>& _base_dir)
: edge_dir(_edge_dir), base_dir(_base_dir) {}
bool operator()(const EdgeOrderData& a, const EdgeOrderData& b) const;
};
Expand Down Expand Up @@ -715,8 +709,7 @@ namespace carve {
};

// A MeshSet manages vertex storage, and a collection of meshes.
// It should be easy to turn a vertex pointer into its index in
// its MeshSet vertex_storage.
// It should be easy to turn a vertex pointer into its index in its MeshSet vertex_storage.
template <unsigned int ndim>
class MeshSet {
MeshSet();
Expand Down
Loading

0 comments on commit fd16427

Please sign in to comment.