Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
yade-dev
trunk
Commits
e9c2c94c
Commit
e9c2c94c
authored
Sep 29, 2019
by
Janek Kozicki
Committed by
yade@dig
Oct 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract duplicate CGAL 'using … = ' directives into single file lib/base/AliasCGAL.hpp
parent
f061a2ee
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
85 additions
and
91 deletions
+85
-91
core/EnergyTracker.hpp
core/EnergyTracker.hpp
+1
-1
core/Scene.cpp
core/Scene.cpp
+1
-1
gui/qt4/_GLViewer.cpp
gui/qt4/_GLViewer.cpp
+1
-1
gui/qt5/_GLViewer.cpp
gui/qt5/_GLViewer.cpp
+1
-1
lib/base/AliasCGAL.hpp
lib/base/AliasCGAL.hpp
+56
-0
lib/base/AliasNamespaces.hpp
lib/base/AliasNamespaces.hpp
+0
-0
lib/serialization/Serializable.hpp
lib/serialization/Serializable.hpp
+1
-1
lib/triangulation/RegularTriangulation.h
lib/triangulation/RegularTriangulation.h
+1
-0
pkg/common/Gl1_PotentialBlock.hpp
pkg/common/Gl1_PotentialBlock.hpp
+2
-39
pkg/common/MatchMaker.hpp
pkg/common/MatchMaker.hpp
+1
-1
pkg/dem/BubbleMat.hpp
pkg/dem/BubbleMat.hpp
+1
-1
pkg/dem/ConcretePM.hpp
pkg/dem/ConcretePM.hpp
+1
-1
pkg/dem/DelaunayInterpolation.hpp
pkg/dem/DelaunayInterpolation.hpp
+3
-0
pkg/dem/ElectrostaticMat.hpp
pkg/dem/ElectrostaticMat.hpp
+1
-1
pkg/dem/Lubrication.hpp
pkg/dem/Lubrication.hpp
+1
-1
pkg/dem/MortarMat.hpp
pkg/dem/MortarMat.hpp
+1
-1
pkg/dem/Polyhedra.hpp
pkg/dem/Polyhedra.hpp
+1
-33
pkg/dem/Polyhedra_support.cpp
pkg/dem/Polyhedra_support.cpp
+3
-0
pkg/dem/Shop.hpp
pkg/dem/Shop.hpp
+1
-1
pkg/dem/SpherePack.cpp
pkg/dem/SpherePack.cpp
+1
-1
pkg/lbm/HydrodynamicsLawLBM.cpp
pkg/lbm/HydrodynamicsLawLBM.cpp
+1
-1
py/_log.cpp
py/_log.cpp
+1
-1
py/_polyhedra_utils.cpp
py/_polyhedra_utils.cpp
+1
-1
py/_utils.hpp
py/_utils.hpp
+1
-1
py/pack/_packPredicates.cpp
py/pack/_packPredicates.cpp
+1
-1
py/wrapper/yadeWrapper.cpp
py/wrapper/yadeWrapper.cpp
+1
-1
No files found.
core/EnergyTracker.hpp
View file @
e9c2c94c
#pragma once
#include<lib/base/openmp-accu.hpp>
#include<lib/serialization/Serializable.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
core/Scene.cpp
View file @
e9c2c94c
...
...
@@ -17,7 +17,7 @@
#include <core/BodyContainer.hpp>
#include <core/InteractionContainer.hpp>
#include <core/TimeStepper.hpp>
#include <lib/base/Namespaces.hpp>
#include <lib/base/
Alias
Namespaces.hpp>
#include <pwd.h>
#include <unistd.h>
...
...
gui/qt4/_GLViewer.cpp
View file @
e9c2c94c
...
...
@@ -2,7 +2,7 @@
#include"OpenGLManager.hpp"
#include<pkg/common/OpenGLRenderer.hpp>
#include<lib/pyutil/doc_opts.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
#include<QApplication>
#include<QCloseEvent>
...
...
gui/qt5/_GLViewer.cpp
View file @
e9c2c94c
...
...
@@ -2,7 +2,7 @@
#include"OpenGLManager.hpp"
#include<pkg/common/OpenGLRenderer.hpp>
#include<lib/pyutil/doc_opts.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
#include<QApplication>
#include<QCloseEvent>
...
...
lib/base/AliasCGAL.hpp
0 → 100644
View file @
e9c2c94c
/*************************************************************************
* 2019 Janek Kozicki *
* *
* This program is free software; it is licensed under the terms of the *
* GNU General Public License v2 or later. See file LICENSE for details. *
*************************************************************************/
#pragma once
// This file is to collect all CGAL aliases inside yade sub-namespace
#ifdef YADE_CGAL
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_triangle_primitive.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Tetrahedron_3.h>
#include <CGAL/Triangulation_data_structure_3.h>
#include <CGAL/convex_hull_3.h>
#include <CGAL/linear_least_squares_fitting_3.h>
#include <CGAL/squared_distance_3.h>
namespace
yade
{
// CGAL definitions - does not work with another kernel!! Why??? / Answer: because to use exact kernal yade must link with mpfr / Janek.
// These are taken from files pkg/dem/Polyhedra.hpp and /pkg/dem/Gl1_PotentialBlock.hpp
// let's call this CGP for CGal Polyhedrons namespace. It uses inexact kernel. Later when mpfr support is added we can have similar
// aliases in other namespace for exact kernel. Or maybe later rename namespace into struct, so that this can be used as template argument.
// We will see how this will need to evelove.
// namespace CGP {
using
K
=
CGAL
::
Exact_predicates_inexact_constructions_kernel
;
using
Polyhedron
=
CGAL
::
Polyhedron_3
<
K
>
;
using
Mesh
=
CGAL
::
Surface_mesh
<
K
::
Point_3
>
;
using
Triangulation
=
CGAL
::
Delaunay_triangulation_3
<
K
>
;
using
CGALpoint
=
K
::
Point_3
;
using
CGALtriangle
=
K
::
Triangle_3
;
using
CGALvector
=
K
::
Vector_3
;
using
Transformation
=
CGAL
::
Aff_transformation_3
<
K
>
;
using
Segment
=
K
::
Segment_3
;
using
Triangle
=
CGAL
::
Triangle_3
<
K
>
;
using
Plane
=
CGAL
::
Plane_3
<
K
>
;
using
Line
=
CGAL
::
Line_3
<
K
>
;
using
CGAL_ORIGIN
=
CGAL
::
Origin
;
using
CGAL_AABB_tree
=
CGAL
::
AABB_tree
<
CGAL
::
AABB_traits
<
K
,
CGAL
::
AABB_triangle_primitive
<
K
,
std
::
vector
<
Triangle
>::
iterator
>>>
;
// }
// It would be perhaps useful to collect here similar stuff frmo other files.
}
#endif
lib/base/Namespaces.hpp
→
lib/base/
Alias
Namespaces.hpp
View file @
e9c2c94c
File moved
lib/serialization/Serializable.hpp
View file @
e9c2c94c
...
...
@@ -12,7 +12,7 @@
#include <boost/type_traits/integral_constant.hpp>
#include <lib/base/Namespaces.hpp>
#include <lib/base/
Alias
Namespaces.hpp>
#include <lib/base/Math.hpp>
#include <lib/factory/Factorable.hpp>
#include <lib/pyutil/raw_constructor.hpp>
...
...
lib/triangulation/RegularTriangulation.h
View file @
e9c2c94c
...
...
@@ -41,6 +41,7 @@ inline void revertEdge (unsigned &i,unsigned &j){
else
{
j
=
facetVertices
[
i
][
1
];
i
=
facetVertices
[
i
][
0
];}
}
// FIXME - consider moving these into lib/base/AliasCGAL.hpp
namespace
CGT
{
//Robust kernel
typedef
CGAL
::
Exact_predicates_inexact_constructions_kernel
K
;
...
...
pkg/common/Gl1_PotentialBlock.hpp
View file @
e9c2c94c
...
...
@@ -71,22 +71,6 @@
#include <pkg/common/Dispatching.hpp>
#include <pkg/common/ElastMat.hpp>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_data_structure_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/convex_hull_3.h>
#include <CGAL/Tetrahedron_3.h>
#include <CGAL/linear_least_squares_fitting_3.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_triangle_primitive.h>
#include <CGAL/squared_distance_3.h>
#ifdef YADE_OPENGL
#include<pkg/common/GLDrawFunctors.hpp>
#include<lib/opengl/OpenGLWrapper.hpp>
...
...
@@ -95,35 +79,14 @@
#include<pkg/dem/Shop.hpp>
#endif
#include <lib/base/AliasCGAL.hpp>
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
namespace
yade
{
// Cannot have #include directive inside.
/* NEW SCRIPT USING FACETS*/
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
//CGAL definitions - does not work with another kernel!! Why???
// FIXME - this should be collected in single place. It's in three different places already!
using
K
=
CGAL
::
Exact_predicates_inexact_constructions_kernel
;
using
Polyhedron
=
CGAL
::
Polyhedron_3
<
K
>
;
using
Mesh
=
CGAL
::
Surface_mesh
<
K
::
Point_3
>
;
using
Triangulation
=
CGAL
::
Delaunay_triangulation_3
<
K
>
;
using
CGALpoint
=
K
::
Point_3
;
using
CGALtriangle
=
K
::
Triangle_3
;
using
CGALvector
=
K
::
Vector_3
;
using
Transformation
=
CGAL
::
Aff_transformation_3
<
K
>
;
using
Segment
=
K
::
Segment_3
;
using
Triangle
=
CGAL
::
Triangle_3
<
K
>
;
using
Plane
=
CGAL
::
Plane_3
<
K
>
;
using
Line
=
CGAL
::
Line_3
<
K
>
;
using
CGAL_ORIGIN
=
CGAL
::
Origin
;
using
CGAL_AABB_tree
=
CGAL
::
AABB_tree
<
CGAL
::
AABB_traits
<
K
,
CGAL
::
AABB_triangle_primitive
<
K
,
std
::
vector
<
Triangle
>::
iterator
>>>
;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
...
...
pkg/common/MatchMaker.hpp
View file @
e9c2c94c
...
...
@@ -2,7 +2,7 @@
#pragma once
#include <lib/serialization/Serializable.hpp>
#include <boost/unordered_map.hpp>
#include <lib/base/Namespaces.hpp>
#include <lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
pkg/dem/BubbleMat.hpp
View file @
e9c2c94c
...
...
@@ -4,7 +4,7 @@
#include<core/IPhys.hpp>
#include<pkg/dem/ScGeom.hpp>
#include<pkg/common/Dispatching.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
pkg/dem/ConcretePM.hpp
View file @
e9c2c94c
...
...
@@ -54,7 +54,7 @@ There are other classes, which are not strictly necessary:
#include<pkg/dem/DemXDofGeom.hpp>
#include<pkg/dem/ScGeom.hpp>
#include<pkg/dem/FrictPhys.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
#ifdef YADE_OPENGL
#include<pkg/common/GLDrawFunctors.hpp>
...
...
pkg/dem/DelaunayInterpolation.hpp
View file @
e9c2c94c
...
...
@@ -110,6 +110,8 @@ getIncidentVtxWeights(const Dt& dt,
namespace
yade
{
// Cannot have #include directive inside.
// FIXME - consider moving these (maybe with Triangulation_vertex_base_with_id_3 ?) into lib/base/AliasCGAL.hpp, preferably put them inside another namespace
//namespace CGsomeName{
typedef
CGAL
::
Exact_predicates_inexact_constructions_kernel
K
;
typedef
CGAL
::
Delaunay_triangulation_3
<
K
>::
Geom_traits
Traits
;
typedef
CGAL
::
Triangulation_vertex_base_with_id_3
<
Traits
>
Vb
;
...
...
@@ -117,6 +119,7 @@ typedef CGAL::Triangulation_cell_base_3<Traits> Cb;
typedef
CGAL
::
Triangulation_data_structure_3
<
Vb
,
Cb
>
Tds
;
typedef
CGAL
::
Delaunay_triangulation_3
<
Traits
,
Tds
>
DT
;
typedef
std
::
vector
<
std
::
pair
<
DT
::
Vertex_handle
,
K
::
FT
>
>
Vertex_weight_vector
;
//}
template
<
class
Dt
,
class
DataOwner
>
typename
DataOwner
::
Data
interpolate1
(
const
Dt
&
dt
,
const
typename
Dt
::
Geom_traits
::
Point_3
&
Q
,
DataOwner
&
owner
,
const
std
::
vector
<
typename
DataOwner
::
Data
>&
rawData
,
bool
reset
)
...
...
pkg/dem/ElectrostaticMat.hpp
View file @
e9c2c94c
...
...
@@ -12,7 +12,7 @@
#include<pkg/dem/FrictPhys.hpp>
#include<pkg/dem/ElasticContactLaw.hpp>
#include<pkg/dem/Lubrication.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
pkg/dem/Lubrication.hpp
View file @
e9c2c94c
...
...
@@ -13,7 +13,7 @@
#include<pkg/dem/ElasticContactLaw.hpp>
#include<pkg/dem/ViscoelasticPM.hpp>
#include<pkg/dem/PDFEngine.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
pkg/dem/MortarMat.hpp
View file @
e9c2c94c
...
...
@@ -10,7 +10,7 @@
#include<pkg/dem/DemXDofGeom.hpp>
#include<pkg/dem/ScGeom.hpp>
#include<pkg/dem/FrictPhys.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
pkg/dem/Polyhedra.hpp
View file @
e9c2c94c
...
...
@@ -22,19 +22,6 @@
#include <pkg/common/Dispatching.hpp>
#include <pkg/common/ElastMat.hpp>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_data_structure_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/convex_hull_3.h>
#include <CGAL/Tetrahedron_3.h>
#include <CGAL/linear_least_squares_fitting_3.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/AABB_triangle_primitive.h>
#include <CGAL/squared_distance_3.h>
#ifdef YADE_OPENGL
#include<pkg/common/GLDrawFunctors.hpp>
#include<lib/opengl/OpenGLWrapper.hpp>
...
...
@@ -43,29 +30,10 @@
#include<pkg/dem/Shop.hpp>
#endif
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
#include <lib/base/AliasCGAL.hpp>
namespace
yade
{
// Cannot have #include directive inside.
// FIXME - these 'using' directives are polluting namespace, better to put them inside another namespace
//namespace CGpoly {
//CGAL definitions - does not work with another kernel!! Why???
using
K
=
CGAL
::
Exact_predicates_inexact_constructions_kernel
;
using
Polyhedron
=
CGAL
::
Polyhedron_3
<
K
>
;
using
Triangulation
=
CGAL
::
Delaunay_triangulation_3
<
K
>
;
using
CGALpoint
=
K
::
Point_3
;
using
CGALtriangle
=
K
::
Triangle_3
;
using
CGALvector
=
K
::
Vector_3
;
using
Transformation
=
CGAL
::
Aff_transformation_3
<
K
>
;
using
Segment
=
K
::
Segment_3
;
using
Triangle
=
CGAL
::
Triangle_3
<
K
>
;
using
Plane
=
CGAL
::
Plane_3
<
K
>
;
using
Line
=
CGAL
::
Line_3
<
K
>
;
using
CGAL_ORIGIN
=
CGAL
::
Origin
;
using
CGAL_AABB_tree
=
CGAL
::
AABB_tree
<
CGAL
::
AABB_traits
<
K
,
CGAL
::
AABB_triangle_primitive
<
K
,
std
::
vector
<
Triangle
>::
iterator
>>>
;
//}
//**********************************************************************************
class
Polyhedra
:
public
Shape
{
public:
...
...
pkg/dem/Polyhedra_support.cpp
View file @
e9c2c94c
...
...
@@ -9,6 +9,9 @@
#include "Polyhedra.hpp"
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
namespace
yade
{
// Cannot have #include directive inside.
CREATE_CPP_LOCAL_LOGGER
(
"Polyhedra_support.cpp"
);
...
...
pkg/dem/Shop.hpp
View file @
e9c2c94c
...
...
@@ -9,7 +9,7 @@
#include "core/Body.hpp"
#include<boost/function.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
pkg/dem/SpherePack.cpp
View file @
e9c2c94c
...
...
@@ -12,7 +12,7 @@
#include <boost/random/variate_generator.hpp>
#include<core/Timing.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
pkg/lbm/HydrodynamicsLawLBM.cpp
View file @
e9c2c94c
...
...
@@ -30,7 +30,7 @@
#include<pkg/common/Sphere.hpp>
#include<pkg/dem/CohesiveFrictionalContactLaw.hpp>
#include<boost/filesystem.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
py/_log.cpp
View file @
e9c2c94c
...
...
@@ -12,7 +12,7 @@
#include<core/Omega.hpp>
#include<lib/pyutil/doc_opts.hpp>
#include<lib/base/Logging.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
#include<string>
namespace
yade
{
// Cannot have #include directive inside.
...
...
py/_polyhedra_utils.cpp
View file @
e9c2c94c
...
...
@@ -10,7 +10,7 @@
#include <pkg/common/Sphere.hpp>
#include <pkg/common/ElastMat.hpp>
#include <lib/pyutil/doc_opts.hpp>
#include <lib/base/Namespaces.hpp>
#include <lib/base/
Alias
Namespaces.hpp>
#include <cmath>
#include <numpy/ndarraytypes.h>
...
...
py/_utils.hpp
View file @
e9c2c94c
...
...
@@ -12,7 +12,7 @@
#include<lib/computational-geometry/Hull2d.hpp>
#include<lib/pyutil/doc_opts.hpp>
#include<pkg/dem/ViscoelasticPM.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
#ifdef YADE_MPI
#include <mpi.h>
#endif
...
...
py/pack/_packPredicates.cpp
View file @
e9c2c94c
...
...
@@ -2,7 +2,7 @@
#include<lib/base/Logging.hpp>
#include<lib/base/Math.hpp>
#include<lib/pyutil/doc_opts.hpp>
#include<lib/base/Namespaces.hpp>
#include<lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
py/wrapper/yadeWrapper.cpp
View file @
e9c2c94c
...
...
@@ -42,7 +42,7 @@
#include <csignal>
#include <pkg/common/KinematicEngines.hpp>
#include <lib/base/Namespaces.hpp>
#include <lib/base/
Alias
Namespaces.hpp>
namespace
yade
{
// Cannot have #include directive inside.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment