49 #ifndef OPENMESHAPPS_VIEWERWIDGET_HH
50 #define OPENMESHAPPS_VIEWERWIDGET_HH
56 #include <QMessageBox>
57 #include <QFileDialog>
58 #include <OpenMesh/Tools/Utils/getopt.h>
60 #include <OpenMesh/Apps/QtViewer/MeshViewerWidgetT.hh>
61 #include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
91 void open_mesh_gui(QString fname)
95 if ( fname.isEmpty() || !open_mesh(fname.toLocal8Bit(), _options) )
97 QString msg =
"Cannot read mesh from file:\n '";
100 QMessageBox::critical( NULL, windowTitle(), msg);
103 std::cout <<
"Loaded mesh in ~" << t.
as_string() << std::endl;
105 void open_texture_gui(QString fname)
107 if ( fname.isEmpty() || !open_texture( fname.toLocal8Bit() ) )
109 QString msg =
"Cannot load texture image from file:\n '";
111 msg +=
"'\n\nPossible reasons:\n";
112 msg +=
"- Mesh file didn't provide texture coordinates\n";
113 msg +=
"- Texture file does not exist\n";
114 msg +=
"- Texture file is not accessible.\n";
115 QMessageBox::warning( NULL, windowTitle(), msg );
120 void query_open_mesh_file() {
121 QString fileName = QFileDialog::getOpenFileName(
this,
122 tr(
"Open mesh file"),
124 tr(
"OBJ Files (*.obj);;"
125 "OFF Files (*.off);;"
126 "STL Files (*.stl);;"
128 if (!fileName.isEmpty())
129 open_mesh_gui(fileName);
131 void query_open_texture_file() {
132 QString fileName = QFileDialog::getOpenFileName(
this,
133 tr(
"Open texture file"),
135 tr(
"PNG Files (*.png);;"
136 "BMP Files (*.bmp);;"
137 "GIF Files (*.gif);;"
138 "JPEG Files (*.jpg);;"
139 "TIFF Files (*.tif);;"
141 if (!fileName.isEmpty())
142 open_texture_gui(fileName);
void stop(void)
Stop measurement.
Set options for reader/writer modules.
std::string as_string(Format format=Automatic)
Add storage for previous halfedge (halfedges). The bit is set by default in the DefaultTraits.
void start(void)
Start measurement.
MeshViewerWidget(QWidget *parent=0)
default constructor
#define HalfedgeAttributes(_i)
Macro for defining the halfedge attributes. See Specifying your MyMesh.