Skip to content

Commit

Permalink
imgui scale getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Botsch committed Sep 27, 2019
1 parent dadd0f3 commit ace532d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pmp/algorithms/SurfaceParameterization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <cmath>
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <cmath>

//=============================================================================

Expand Down Expand Up @@ -281,7 +282,8 @@ void SurfaceParameterization::lscm()
dvec3 c = (dvec3)pos[mesh_.to_vertex(hc)];

// calculate local coordinate system
dvec3 z = cross(c - b, a - b);
//dvec3 z = cross(c - b, a - b);
dvec3 z = normalize(cross(normalize(c-b), normalize(a-b)));
dvec3 x = normalize(b - a);
dvec3 y = normalize(cross(z, x));

Expand All @@ -291,10 +293,13 @@ void SurfaceParameterization::lscm()
dvec2 c2d(dot(c - a, x), dot(c - a, y));

// calculate double triangle area
z = cross(c - b, a - b);
double area = norm(z);
if (area)
area = 1.0 / area;

area = 1.0;

// calculate W_j,Ti (index by corner a,b,c and real/imaginary)
double w_ar = c2d[0] - b2d[0];
double w_br = a2d[0] - c2d[0];
Expand Down
3 changes: 3 additions & 0 deletions src/pmp/visualization/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ class Window
//! highDPI scaling
float high_dpi_scaling() const { return scaling_; }

//! imgui scaling
float imgui_scaling() const { return imgui_scale_; }

//! get position of mouse cursor
void cursor_pos(double& x, double& y) const;

Expand Down

0 comments on commit ace532d

Please sign in to comment.