Go to the documentation of this file.
15 #ifndef _SCL_SECURE_NO_WARNINGS
16 #define _SCL_SECURE_NO_WARNINGS
22 #include <QStringList>
25 #ifndef Q_MOC_RUN // MT : very important to avoid the error : ' Parse error at
43 #endif // FEVV_USE_CGAL
44 #ifdef FEVV_USE_OPENMESH
46 #endif // FEVV_USE_OPENMESH
49 #endif // FEVV_USE_AIF
60 #if(FEVV_USE_QT5) // see at the end of .cpp for QT4
61 Q_PLUGIN_METADATA(IID
"BooleanOperationsPlugin")
89 std::cerr <<
"BaseWindow is null or not initialized." << std::endl;
94 template<
typename HalfedgeGraph >
97 Eigen::Matrix4d &matrix_A,
98 HalfedgeGraph *mesh_B,
100 Eigen::Matrix4d &matrix_B)
102 std::cout <<
"Asking to apply BooleanOperations filter ! " << std::endl;
105 auto pm_A =
get(boost::vertex_point, *mesh_A);
107 auto pm_B =
get(boost::vertex_point, *mesh_B);
117 HalfedgeGraph *output_mesh =
new HalfedgeGraph;
135 auto gui_props_A =
get(m_gpm_A, 0);
138 put(m_gpm_A, 0, gui_props_A);
143 auto gui_props_B =
get(m_gpm_B, 0);
146 put(m_gpm_B, 0, gui_props_B);
156 put(m_gpm_output, 0, gui_props_output);
163 catch(
const std::exception &e)
165 std::cout << e.what() << std::endl;
169 template<
typename HalfedgeGraph >
183 QMessageBox::information(
184 0,
"",
QObject::tr(
"An error occurred during Boolean "
185 "Operation filter processing."));
190 std::vector< FEVV::PMapsContainer * > pmaps_bags =
192 if(mixed_meshes.
size() >= 2)
195 if( mixed_meshes[0].second == mixed_meshes[1].second )
200 if(dial1.exec() == QDialog::Accepted)
206 auto mA =
static_cast< HalfedgeGraph *
>(mixed_meshes[0].first);
207 auto pmaps_bagA = pmaps_bags[0];
210 auto mB =
static_cast< HalfedgeGraph *
>(mixed_meshes[1].first);
211 auto pmaps_bagB = pmaps_bags[1];
215 process(mA, pmaps_bagA, matrix44_A, mB, pmaps_bagB, matrix44_B);
243 QMessageBox::information(0,
246 "can not be applied on meshes "
247 "with different datastructures."));
252 QMessageBox::information(0,
256 "with the same datastructure."));
269 #ifdef FEVV_USE_OPENMESH
270 #if 0 //TODO-elo-note compiling error in Cartesian_converter.h with OM
275 applyHG< MeshOpenMesh >(_adapter, _mesh, pmaps_bag);
281 void apply(BaseAdapterVisu *_adapter,
285 applyHG< MeshLCC >(_adapter, _mesh, pmaps_bag);
288 void apply(BaseAdapterVisu *_adapter,
292 applyHG< MeshSurface >(_adapter, _mesh, pmaps_bag);
295 void apply(BaseAdapterVisu *_adapter,
299 applyHG< MeshPolyhedron >(_adapter, _mesh, pmaps_bag);
307 void apply(BaseAdapterVisu *_adapter,
311 applyHG<MeshAIF>(_adapter, _mesh, pmaps_bag);
319 return QStringList() <<
"BooleanOperationsPlugin";
virtual bool isInit() const
void activate_time_mode()
void * m_output_mesh_void
void remove_property_map(PropertyT p, PMapsContainer &pmaps)
void put_property_map(PropertyT p, const MeshT &, PMapsContainer &pmaps, const typename PMap_traits< PropertyT, MeshT >::pmap_type &pmap)
PMap_traits< PropertyT, MeshT >::pmap_type get_property_map(PropertyT p, const MeshT &, const PMapsContainer &pmaps)
~BooleanOperationsPlugin()=default
CGAL::Linear_cell_complex_for_combinatorial_map< 2, 3, CGALLCCTraits, CGALItem > MeshLCC
void getParameters(std::string &operation)
void setParameters(const std::string &operation)
double tr(double &n)
Truncate a number to 1/1000 (only if BOOLEAN_OPERATIONS_DEBUG is enable)
void boolean_union(HalfedgeGraph &gA, HalfedgeGraph &gB, HalfedgeGraph &g_out, const GeometryTraits &)
Computes the union of two polyhedra.
This class is intended to provide some standard message boxes to all plugins.
void homogeneous_transform(const HalfedgeGraph &g, PointMap &pm, const Eigen::Matrix4d &mat, const GeometryTraits >)
Calculate the homogeneous transformation of the vertices coordinates using the provided 4x4 homogeneo...
virtual Viewer * getViewer()
Functions to retrieve the name of the datastructure according to the mesh type.
CGAL::Surface_mesh< CGALPoint > MeshSurface
void resetTransformMatrix(unsigned int position)
void process(HalfedgeGraph *mesh_A, FEVV::PMapsContainer *pmaps_bag_A, Eigen::Matrix4d &matrix_A, HalfedgeGraph *mesh_B, FEVV::PMapsContainer *pmaps_bag_B, Eigen::Matrix4d &matrix_B)
SimpleWindow is a specialization of QMainWindow. This class the Main Window.
std::map< std::string, boost::any > PMapsContainer
void draw_or_redraw_mesh(HalfedgeGraph *_g, PMapsContainer *_pmaps, bool _redraw=false, bool _recomputeNT_if_redraw=false, std::string _mesh_filename=std::string(""), bool _recreateOSGobj_if_redraw=true, float _step=0.)
void applyHG(BaseAdapterVisu *_adapter, HalfedgeGraph *, FEVV::PMapsContainer *)
FEVV::PCLPointCloudPointMap::value_type get(const FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key)
Specialization of get(point_map, key) for PCLPointCloud.
SimpleViewer is a specialization of osgViewer::CompositeViewer. This class is a widget where we are a...
MixedMeshesVector getMeshes()
void onModificationParam(std::string _pluginName, BasePlugin *_plugin)
Interfaces for plugins These interfaces will be used for different plugins.
FEVV::PMapsContainer * output_pmaps_bag
bool Generic_plugin(const QString &) override
void boolean_inter(HalfedgeGraph &gA, HalfedgeGraph &gB, HalfedgeGraph &g_out, const GeometryTraits &)
Computes the intersection of two polyhedra.
std::vector< PMapsContainer * > get_properties_maps()
BooleanOperationsPlugin()=default
Eigen::Matrix4d getTransformMatrixEigen(unsigned int position)
OpenMesh::PolyMesh_ArrayKernelT< MyTraits > MeshOpenMesh
void put(FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key, const FEVV::PCLPointCloudPointMap::value_type &value)
Specialization of put(point_map, key, value) for PCLPointCloud.
void addParameters(BaseWindow *_window) override
virtual void apply(BaseAdapterVisu *, void *, FEVV::PMapsContainer *) override
void boolean_minus(HalfedgeGraph &gA, HalfedgeGraph &gB, HalfedgeGraph &g_out, const GeometryTraits &)
Computes the subtraction of two polyhedra.
QStringList Generic_plugins() const override
CGAL::Polyhedron_3< CGALKernel, CGAL::Polyhedron_items_with_id_3 > MeshPolyhedron
PMap_traits< PropertyT, MeshT >::pmap_type make_property_map(PropertyT, const MeshT &m)
FEVV::DataStructures::AIF::AIFMesh MeshAIF