Commit 1980910c authored by Marc R.'s avatar Marc R.

skew-T: reimplemented label placement

parent 2e0ec1f2
This diff is collapsed.
......@@ -350,12 +350,8 @@ private:
QMap<MSceneViewGLWidget*, bool> sceneViewFullscreenEnabled;
QMap<MSceneViewGLWidget*, QList<MLabel*>> skewTLabels;
float labelSize;
QColor labelColour;
bool labelBBox;
QColor labelBBoxColour;
QList<MLabel*> labelsFullScreen;
QList<MLabel*> labels3D;
QtProperty *geoPositionProperty,
*bottomPressureProperty, *topPressureProperty,
......@@ -481,6 +477,16 @@ private:
*/
QVector2D transformTp2xy(QVector2D tpCoordinate_K_hPa);
/**
Transform a Skew-T diagram's (x, y) coordinate into full-screen clip
space coordinates.
@note There is an equivalent function with the same name in the GLSL
shader; if this function is modified the shader function needs to be
modified as well.
*/
QVector2D transformXY2ClipSpace(QVector2D xyCoordinate);
/**
Computes a view-dependent transformation matrix to transform coordinates
in the diagram's (x, y) space into a scene view's world space.
......@@ -494,7 +500,9 @@ private:
Updates (recomputes) the vertical profiles of the actor variables, e.g.
after the position of the diagram handle has been changed.
*/
void updateVerticalProfiles();
void updateVerticalProfilesAndLabels();
void removeAllSkewTLabels();
};
......
......@@ -491,7 +491,7 @@ shader VS2D(in vec2 vertexCoord : 0, out vec2 worldPos)
// ===
vec2 mapDiagramXYToClipSpace(vec2 diagramXY)
vec2 transformDiagramXYToClipSpace(vec2 diagramXY)
{
//TODO (mr, 10Jan2019) -- replace by matrix multiplication.
float hPad = 0.1;
......@@ -522,7 +522,7 @@ shader VSDiagramContent(in vec2 vertex : 0, out vec2 diagramXY)
if (fullscreen)
{
// Map the diagram's (x,y) coordinates to full screen clip space.
vec2 vertexClipSpace = mapDiagramXYToClipSpace(diagramXY);
vec2 vertexClipSpace = transformDiagramXYToClipSpace(diagramXY);
gl_Position = vec4(vertexClipSpace.x, vertexClipSpace.y, depthOffset, 1.);
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment