MEPP2 Project
BasePluginQt.h
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 General Public License as published
6 // by the Free Software Foundation; either version 3 of the License,
7 // 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 #pragma once
12 
13 
14 #ifndef Q_MOC_RUN
16 #endif
17 
19 
20 #include <QMessageBox>
21 
22 
23 namespace FEVV {
24 
29 class BasePluginQt : public BasePlugin
30 {
31 public:
32 
33  // the apply(..., MeshT*, ...) functions below must be overridden
34  // in derived class if the plugin supports the MeshT mesh type
35 
36 #ifdef FEVV_USE_CGAL
37  virtual void apply(BaseAdapterVisu * /*_adapter*/,
38  MeshPolyhedron * /*_mesh*/,
39  FEVV::PMapsContainer * /*pmaps_bag*/) override
40  {
41  QMessageBox::warning(
42  0, "", QObject::tr("This filter is not compatible with Polyhedron_3!"));
43  }
44 
45 
46  virtual void apply(BaseAdapterVisu * /*_adapter*/,
47  MeshSurface * /*_mesh*/,
48  FEVV::PMapsContainer * /*pmaps_bag*/) override
49  {
50  QMessageBox::warning(
51  0, "", QObject::tr("This filter is not compatible with Surface_mesh!"));
52  }
53 
54 
55  virtual void apply(BaseAdapterVisu * /*_adapter*/,
56  MeshLCC * /*_mesh*/,
57  FEVV::PMapsContainer * /*pmaps_bag*/) override
58  {
59  QMessageBox::warning(
60  0, "", QObject::tr("This filter is not compatible with LCC!"));
61  }
62 
63 
64  virtual void apply(BaseAdapterVisu * /*_adapter*/,
65  CGALPointSet * /*_mesh*/,
66  FEVV::PMapsContainer * /*pmaps_bag*/) override
67  {
68  QMessageBox::warning(
69  0, "", QObject::tr("This filter is not compatible with CGALPointSet!"));
70  }
71 #endif
72 
73 
74 #ifdef FEVV_USE_OPENMESH
75  virtual void apply(BaseAdapterVisu * /*_adapter*/,
76  MeshOpenMesh * /*_mesh*/,
77  FEVV::PMapsContainer * /*pmaps_bag*/) override
78  {
79  QMessageBox::warning(
80  0, "", QObject::tr("This filter is not compatible with OpenMesh!"));
81  }
82 #endif
83 
84 
85 #ifdef FEVV_USE_AIF
86  virtual void apply(BaseAdapterVisu * /*_adapter*/,
87  MeshAIF * /*_mesh*/,
88  FEVV::PMapsContainer * /*pmaps_bag*/) override
89  {
90  QMessageBox::warning(
91  0, "", QObject::tr("This filter is not compatible with AIF!"));
92  }
93 #endif
94 
95 
96 #ifdef FEVV_USE_PCL
97  virtual void apply(BaseAdapterVisu * /*_adapter*/,
98  PCLPointCloud * /*_mesh*/,
99  FEVV::PMapsContainer * /*pmaps_bag*/) override
100  {
101  QMessageBox::warning(
102  0, "", QObject::tr("This filter is not compatible with PCLPointCloud!"));
103  }
104 #endif
105 
106 
107  // case where the plugin is applied when no mesh is opened
108  virtual void apply(BaseAdapterVisu * /*_adapter*/,
109  void * /*_mesh_void*/,
110  FEVV::PMapsContainer * /*pmaps_bag*/) override
111  {
112  QMessageBox::warning(
113  0, "", QObject::tr("To apply this filter, please first <b>open a mesh</b>!"));
114  }
115 
116 
117 };
118 
119 
120 } // namespace FEVV
121 
FEVV::CGALPointSet
CGAL::Point_set_3< CGALPointSetPoint > CGALPointSet
Definition: DataStructures_cgal_point_set.h:71
ChooseDatastructureMsgBox.hpp
FEVV::MeshLCC
CGAL::Linear_cell_complex_for_combinatorial_map< 2, 3, CGALLCCTraits, CGALItem > MeshLCC
Definition: DataStructures_cgal_linear_cell_complex.h:43
tr
double tr(double &n)
Truncate a number to 1/1000 (only if BOOLEAN_OPERATIONS_DEBUG is enable)
Definition: boolops_definitions.hpp:127
FEVV::BasePluginQt
This class is intended to provide some standard message boxes to all plugins.
Definition: BasePluginQt.h:30
FEVV::PCLPointCloud
pcl::PointCloud< PCLEnrichedPoint > PCLPointCloud
Definition: DataStructures_pcl_point_cloud.h:28
BasePlugin.h
FEVV::MeshSurface
CGAL::Surface_mesh< CGALPoint > MeshSurface
Definition: DataStructures_cgal_surface_mesh.h:23
FEVV::BaseAdapterVisu
Definition: BaseAdapterVisu.h:27
FEVV::PMapsContainer
std::map< std::string, boost::any > PMapsContainer
Definition: properties.h:99
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::MeshOpenMesh
OpenMesh::PolyMesh_ArrayKernelT< MyTraits > MeshOpenMesh
Definition: DataStructures_openmesh.h:51
FEVV::DataStructures::AIF::AIFMesh
This class represents an AIF structure. AIF structure can deal with both manifold and non-manifold su...
Definition: AIFMesh.hpp:47
FEVV::BasePlugin
Definition: BasePlugin.h:38
FEVV::BasePluginQt::apply
virtual void apply(BaseAdapterVisu *, void *, FEVV::PMapsContainer *) override
Definition: BasePluginQt.h:108
FEVV::MeshPolyhedron
CGAL::Polyhedron_3< CGALKernel, CGAL::Polyhedron_items_with_id_3 > MeshPolyhedron
Definition: DataStructures_cgal_polyhedron_3.h:33