OpenGL support through GLEW. Only active if compiled with SLIC3R_GUI=1.

This commit is contained in:
bubnikv 2016-09-14 16:31:26 +02:00
parent 266e1c4be1
commit 2a5095a1ea
8 changed files with 58 additions and 12 deletions

View file

@ -67,6 +67,9 @@
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
# endif
# ifdef NOGDI
# undef NOGDI
# endif
#include <windows.h>
# undef WIN32_LEAN_AND_MEAN
#endif

View file

@ -30,6 +30,8 @@
** THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef SLIC3R_GUI
#include <GL/glew.h>
#if defined(_WIN32)
@ -18605,3 +18607,5 @@ GLboolean glxewIsSupported (const char* name)
}
#endif /* _WIN32 */
#endif /* SLIC3R_GUI */

View file

@ -2,7 +2,9 @@
#include <vector>
#include <float.h>
#ifdef SLIC3R_GUI
#include <wx/image.h>
#endif /* SLIC3R_GUI */
#include "libslic3r.h"
#include "EdgeGrid.hpp"
@ -551,7 +553,8 @@ void EdgeGrid::Grid::calculate_sdf()
}
}
#if 1
#if 0
//#ifdef SLIC3R_GUI
{
wxImage img(ncols, nrows);
unsigned char *data = img.GetData();
@ -609,7 +612,7 @@ void EdgeGrid::Grid::calculate_sdf()
}
img.SaveFile("out\\signed_df.png", wxBITMAP_TYPE_PNG);
}
#endif
#endif /* SLIC3R_GUI */
// 2) Propagate the signum.
#define PROPAGATE_SIGNUM_SINGLE_STEP(DELTA) do { \
@ -681,7 +684,8 @@ void EdgeGrid::Grid::calculate_sdf()
}
}
#if 1
#if 0
//#ifdef SLIC3R_GUI
{
wxImage img(ncols, nrows);
unsigned char *data = img.GetData();
@ -733,9 +737,10 @@ void EdgeGrid::Grid::calculate_sdf()
}
img.SaveFile("out\\signed_df-signs.png", wxBITMAP_TYPE_PNG);
}
#endif
#endif /* SLIC3R_GUI */
#if 1
#if 0
//#ifdef SLIC3R_GUI
{
wxImage img(ncols, nrows);
unsigned char *data = img.GetData();
@ -761,7 +766,7 @@ void EdgeGrid::Grid::calculate_sdf()
}
img.SaveFile("out\\signed_df2.png", wxBITMAP_TYPE_PNG);
}
#endif
#endif /* SLIC3R_GUI */
}
float EdgeGrid::Grid::signed_distance_bilinear(const Point &pt) const
@ -932,6 +937,7 @@ bool EdgeGrid::Grid::signed_distance(const Point &pt, coord_t search_radius, coo
return true;
}
#ifdef SLIC3R_GUI
void EdgeGrid::save_png(const EdgeGrid::Grid &grid, const BoundingBox &bbox, coord_t resolution, const char *path)
{
unsigned int w = (bbox.max.x - bbox.min.x + resolution - 1) / resolution;
@ -1022,5 +1028,6 @@ void EdgeGrid::save_png(const EdgeGrid::Grid &grid, const BoundingBox &bbox, coo
img.SaveFile(path, wxBITMAP_TYPE_PNG);
}
#endif /* SLIC3R_GUI */
} // namespace Slic3r

View file

@ -72,8 +72,10 @@ protected:
std::vector<float> m_signed_distance_field;
};
#ifdef SLIC3R_GUI
// Debugging utility. Save the signed distance field.
extern void save_png(const Grid &grid, const BoundingBox &bbox, coord_t resolution, const char *path);
#endif /* SLIC3R_GUI */
} // namespace EdgeGrid
} // namespace Slic3r

View file

@ -235,7 +235,9 @@ Print::invalidate_state_by_config_options(const std::vector<t_config_option_key>
|| *opt_key == "use_relative_e_distances"
|| *opt_key == "vibration_limit"
|| *opt_key == "wipe"
|| *opt_key == "z_offset") {
|| *opt_key == "z_offset"
|| *opt_key == "max_volumetric_extrusion_rate_slope_negative"
|| *opt_key == "max_volumetric_extrusion_rate_slope_positive") {
// these options only affect G-code export, so nothing to invalidate
} else if (*opt_key == "first_layer_extrusion_width") {
osteps.insert(posPerimeters);