Go to the documentation of this file.
14 #ifndef _SCL_SECURE_NO_WARNINGS
15 #define _SCL_SECURE_NO_WARNINGS
21 #include <QStringList>
24 #ifndef Q_MOC_RUN // MT : very important to avoid the error : ' Parse error at
39 #endif // FEVV_USE_CGAL
40 #ifdef FEVV_USE_OPENMESH
42 #endif // FEVV_USE_OPENMESH
45 #endif // FEVV_USE_AIF
56 #if(FEVV_USE_QT5) // see at the end of .cpp for QT4
57 Q_PLUGIN_METADATA(IID
"ProgressiveDecompressionPlugin")
81 std::cerr <<
"BaseWindow is null or not initialized." << std::endl;
86 template<
typename HalfedgeGraph >
89 std::cout <<
"Asking to ProgressiveDecompression mesh ! " << std::endl;
92 using VertexColorMap =
94 HalfedgeGraph >::pmap_type;
98 std::cout <<
"use existing vertex-color map" << std::endl;
103 std::cout <<
"create vertex-color map" << std::endl;
110 using VertexNormalMap =
112 HalfedgeGraph >::pmap_type;
113 VertexNormalMap v_nm;
116 std::cout <<
"use existing vertex-normal map" << std::endl;
121 std::cout <<
"create vertex-normal map" << std::endl;
131 std::cout <<
"using edge color property map" << std::endl;
137 std::cout <<
"create vertex-color map" << std::endl;
144 auto pm =
get(boost::vertex_point, _mesh);
156 catch (std::exception& e) {
163 pmaps_bag = clean_pmaps_bag;
165 std::string message(
"Progressive decompression completed.\n\n");
166 message.append(result);
167 QMessageBox::information(0,
"", QString::fromStdString(message));
170 template<
typename HalfedgeGraph >
176 if(dialog.exec() == QDialog::Accepted)
183 HalfedgeGraph* mesh =
new HalfedgeGraph();
204 #if FEVV_USE_OPENMESH
207 apply(_adapter,
static_cast<void *
>(
nullptr),
nullptr);
215 apply(_adapter,
static_cast<void *
>(
nullptr),
nullptr);
220 apply(_adapter,
static_cast<void *
>(
nullptr),
nullptr);
225 apply(_adapter,
static_cast<void *
>(
nullptr),
nullptr);
230 #if 0 // halfedge iteration is not compatible with AIF yet (halfedge_iterator type cannot be exported)
233 apply(_adapter,
static_cast<void *
>(
nullptr),
nullptr);
245 if (mesh_type ==
"NONE")
250 if (mesh_type ==
"POLYHEDRON")
252 applyHG< MeshPolyhedron >(_adapter);
254 else if (mesh_type ==
"SURFACEMESH")
256 applyHG< MeshSurface >(_adapter);
258 else if (mesh_type ==
"LCC")
260 applyHG< MeshLCC >(_adapter);
264 #ifdef FEVV_USE_OPENMESH
265 if (mesh_type ==
"OPENMESH")
267 applyHG< MeshOpenMesh >(_adapter);
272 if (mesh_type ==
"AIF")
274 QMessageBox::information(
278 "Progressive Decompression filter is not yet compatible with AIF!"));
285 return QStringList() <<
"ProgressiveDecompressionPlugin";
virtual bool isInit() const
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)
void apply(BaseAdapterVisu *_adapter, void *, FEVV::PMapsContainer *) override
CGAL::Linear_cell_complex_for_combinatorial_map< 2, 3, CGALLCCTraits, CGALItem > MeshLCC
double tr(double &n)
Truncate a number to 1/1000 (only if BOOLEAN_OPERATIONS_DEBUG is enable)
bool has_map(const PMapsContainer &pmaps, const std::string &map_name)
(refer to Property Maps API)
This class is intended to provide some standard message boxes to all plugins.
virtual Viewer * getViewer()
~ProgressiveDecompressionPlugin()=default
void getParameters(std::string &filepath)
void addParameters(BaseWindow *_window) override
CGAL::Surface_mesh< CGALPoint > MeshSurface
std::string mesh_binary_path
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.)
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...
void applyHG(BaseAdapterVisu *_adapter)
void onModificationParam(std::string _pluginName, BasePlugin *_plugin)
Interfaces for plugins These interfaces will be used for different plugins.
QStringList Generic_plugins() const override
ProgressiveDecompressionPlugin()=default
bool Generic_plugin(const QString &) override
void process(HalfedgeGraph &_mesh, FEVV::PMapsContainer &pmaps_bag)
OpenMesh::PolyMesh_ArrayKernelT< MyTraits > MeshOpenMesh
void progressive_decompression_filter(HalfedgeGraph &g, PointMap &pm, VertexColorMap &v_cm, const GeometryTraits &, draco::DecoderBuffer &buffer, bool dequantize=true, unsigned int nb_max_batches=10000)
Takes a buffer as an input, will decode the compression settings, the coarse mesh and refine the mesh...
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
std::string chooseDatastructureMsgBox(void)