MEPP2 Project
boolean_operations.hpp
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as
6 // published by the Free Software Foundation; either version 3 of
7 // the License, or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 
12 #pragma once
13 
14 #include "boolops_polyhedra.hpp"
15 
16 namespace FEVV {
17 namespace Filters {
18 
19 //--------------------- UNION -------------------------
20 
43 template< typename HalfedgeGraph,
44  typename GeometryTraits = FEVV::Geometry_traits< HalfedgeGraph > >
45 void
46 boolean_union(HalfedgeGraph &gA,
47  HalfedgeGraph &gB,
48  HalfedgeGraph &g_out,
49  const GeometryTraits &/*gt*/)
50 {
51  BoolPolyhedra< HalfedgeGraph >(gA, gB, g_out, UNION);
52 }
53 
76 template< typename HalfedgeGraph,
77  typename GeometryTraits = FEVV::Geometry_traits< HalfedgeGraph > >
78 void
79 boolean_union(HalfedgeGraph &gA,
80  HalfedgeGraph &gB,
81  HalfedgeGraph &g_out)
82 {
83  GeometryTraits gt(gA);
84  boolean_union< HalfedgeGraph, GeometryTraits >(gA, gB, g_out, gt);
85 }
86 
87 
88 //--------------------- INTERSECTION -------------------------
89 
112 template< typename HalfedgeGraph,
113  typename GeometryTraits = FEVV::Geometry_traits< HalfedgeGraph > >
114 void
115 boolean_inter(HalfedgeGraph &gA,
116  HalfedgeGraph &gB,
117  HalfedgeGraph &g_out,
118  const GeometryTraits &/*gt*/)
119 {
120  BoolPolyhedra< HalfedgeGraph >(gA, gB, g_out, INTER);
121 }
122 
145 template< typename HalfedgeGraph,
146  typename GeometryTraits = FEVV::Geometry_traits< HalfedgeGraph > >
147 void
148 boolean_inter(HalfedgeGraph &gA,
149  HalfedgeGraph &gB,
150  HalfedgeGraph &g_out)
151 {
152  GeometryTraits gt(gA);
153  boolean_inter< HalfedgeGraph, GeometryTraits >(gA, gB, g_out, gt);
154 }
155 
156 
157 //--------------------- SUBTRACTION -------------------------
158 
181 template< typename HalfedgeGraph,
182  typename GeometryTraits = FEVV::Geometry_traits< HalfedgeGraph > >
183 void
184 boolean_minus(HalfedgeGraph &gA,
185  HalfedgeGraph &gB,
186  HalfedgeGraph &g_out,
187  const GeometryTraits &/*gt*/)
188 {
189  BoolPolyhedra< HalfedgeGraph >(gA, gB, g_out, MINUS);
190 }
191 
214 template< typename HalfedgeGraph,
215  typename GeometryTraits = FEVV::Geometry_traits< HalfedgeGraph > >
216 void
217 boolean_minus(HalfedgeGraph &gA,
218  HalfedgeGraph &gB,
219  HalfedgeGraph &g_out)
220 {
221  GeometryTraits gt(gA);
222  boolean_minus< HalfedgeGraph, GeometryTraits >(gA, gB, g_out, gt);
223 }
224 
225 
226 } // namespace Filters
227 } // namespace FEVV
228 
FEVV::Filters::boolean_union
void boolean_union(HalfedgeGraph &gA, HalfedgeGraph &gB, HalfedgeGraph &g_out, const GeometryTraits &)
Computes the union of two polyhedra.
Definition: boolean_operations.hpp:46
FEVV::Geometry_traits< HalfedgeGraph >
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::Filters::boolean_inter
void boolean_inter(HalfedgeGraph &gA, HalfedgeGraph &gB, HalfedgeGraph &g_out, const GeometryTraits &)
Computes the intersection of two polyhedra.
Definition: boolean_operations.hpp:115
MINUS
@ MINUS
Definition: boolops_definitions.hpp:55
boolops_polyhedra.hpp
FEVV::Filters::boolean_minus
void boolean_minus(HalfedgeGraph &gA, HalfedgeGraph &gB, HalfedgeGraph &g_out, const GeometryTraits &)
Computes the subtraction of two polyhedra.
Definition: boolean_operations.hpp:184
INTER
@ INTER
Definition: boolops_definitions.hpp:55
UNION
@ UNION
Definition: boolops_definitions.hpp:55
BoolPolyhedra
The class that compute a Boolean operation.
Definition: boolops_polyhedra.hpp:134