Skip to content
Permalink
Browse files

Merge pull request #443 from UniStuttgart-VISUS/resurrect_ellipsoids

Glyphs with 3 axes and a direction
  • Loading branch information...
tobiasrau committed Nov 8, 2019
2 parents 0c12d80 + aca0ff2 commit 017d6e9a54ee8a06db4dad90828b9d0dc3b7d26e
Showing with 6,372 additions and 982 deletions.
  1. +2 −1 configurator/MegaMolConf/Data/Module.cs
  2. +15 −0 configurator/MegaMolConf/Form1.Designer.cs
  3. +47 −6 configurator/MegaMolConf/Form1.cs
  4. +1 −1 configurator/MegaMolConf/Form1.resx
  5. +24 −10 configurator/MegaMolConf/GraphicalModule.cs
  6. +2 −2 configurator/MegaMolConf/Io/ProjectFileLua.cs
  7. +3 −0 configurator/MegaMolConf/MegaMolConf.csproj.input
  8. +11 −1 configurator/MegaMolConf/Properties/Resources.Designer.cs
  9. +3 −0 configurator/MegaMolConf/Properties/Resources.resx
  10. BIN configurator/MegaMolConf/Resources/lines_Text_code_16xMD.png
  11. +21 −13 core/include/mmcore/utility/SSBOBufferArray.h
  12. +5 −58 core/include/mmcore/utility/SSBOStreamer.h
  13. +28 −22 core/src/CoreInstance.cpp
  14. +2 −1 core/src/utility/SDFFont.cpp
  15. +95 −89 core/src/utility/SSBOBufferArray.cpp
  16. +15 −6 core/src/utility/SSBOStreamer.cpp
  17. +6 −2 core/src/view/light/DistantLight.cpp
  18. +13 −5 plugins/compositing_gl/Shaders/comp/lambert_c.glsl
  19. +5 −1 plugins/compositing_gl/src/DrawToScreen.cpp
  20. +32 −21 plugins/compositing_gl/src/LocalLighting.cpp
  21. +13 −2 plugins/compositing_gl/src/LocalLighting.h
  22. +2 −0 plugins/mmstd_datatools/src/table/MMFTDataSource.cpp
  23. +77 −39 plugins/mmstd_datatools/src/table/TableToParticles.cpp
  24. +17 −26 plugins/mmstd_moldyn/Shaders/arrow.btf
  25. +4 −2 plugins/mmstd_moldyn/Shaders/ellipsoid.btf
  26. +50 −0 plugins/mmstd_moldyn/Shaders/glyph.btf
  27. +21 −0 plugins/mmstd_moldyn/Shaders/glyph/box.frag
  28. +87 −0 plugins/mmstd_moldyn/Shaders/glyph/box.vert
  29. +23 −0 plugins/mmstd_moldyn/Shaders/glyph/compute_color.glsl
  30. +66 −0 plugins/mmstd_moldyn/Shaders/glyph/cube_geometry.glsl
  31. +84 −0 plugins/mmstd_moldyn/Shaders/glyph/ellipsoid.frag
  32. +82 −0 plugins/mmstd_moldyn/Shaders/glyph/ellipsoid.vert
  33. +7 −0 plugins/mmstd_moldyn/Shaders/glyph/flags.glsl
  34. +5 −0 plugins/mmstd_moldyn/Shaders/glyph/options.glsl
  35. +23 −0 plugins/mmstd_moldyn/Shaders/glyph/quaternion_to_matrix.glsl
  36. +25 −0 plugins/mmstd_moldyn/Shaders/glyph/ssbo_data.glsl
  37. +17 −0 plugins/mmstd_moldyn/Shaders/glyph/uniforms.glsl
  38. +4 −2 plugins/mmstd_moldyn/src/mmstd_moldyn.cpp
  39. +554 −0 plugins/mmstd_moldyn/src/rendering/GlyphRenderer.cpp
  40. +139 −0 plugins/mmstd_moldyn/src/rendering/GlyphRenderer.h
  41. +3 −3 plugins/mmstd_moldyn/src/rendering/SphereRenderer.cpp
  42. +7 −2 utils/btf-peek/README.md
  43. +4,617 −620 utils/btf-peek/package-lock.json
  44. +11 −4 utils/btf-peek/package.json
  45. +104 −43 utils/btf-peek/src/extension.ts
@@ -27,7 +27,8 @@ public sealed class Module {
|| Name.Equals("TileView3D")
|| Name.Equals("RemoteTileView")
|| Name.Equals("HeadView")
|| Name.Equals("View3D_2");
|| Name.Equals("View3D_2")
|| Name.Equals("CinematicView");
}
}
}

Some generated files are not rendered by default. Learn more.

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
@@ -36,7 +36,6 @@ public partial class Form1 : Form {
private Point lastMousePos;
private Point mouseDownPos;
private Point connectingTip;
private bool drawConnection;
private Rectangle drawArea;
private bool saveShortcut;

@@ -71,6 +70,9 @@ public partial class Form1 : Form {
internal static GraphicalModule copiedModule { get; private set; }
internal static GraphicalModule eyedropperTarget { get; private set; }
internal static GraphicalConnection selectedConnection { get; private set; }
internal static bool drawConnection { get; private set; }
internal static bool showSlotTips { get; private set; }

internal TabPage SelectedTab {
get {
if (!this.IsDisposed && InvokeRequired) {
@@ -412,6 +414,9 @@ TcpConnectionInformation[] localConns
case (Keys.Control | Keys.C):
btnCopy.PerformClick();
break;
case (Keys.Control | Keys.Shift | Keys.C):
btnLua.PerformClick();
break;
case (Keys.Control | Keys.V):
btnPaste.PerformClick();
break;
@@ -826,12 +831,12 @@ TcpConnectionInformation[] localConns
e.Graphics.ResetTransform();
//e.Graphics.TranslateTransform(-drawArea.Left + tp.HorizontalScroll.Value, -drawArea.Top + tp.VerticalScroll.Value);
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
foreach (GraphicalModule gm in tabModules[tp]) {
gm.Draw(e.Graphics);
}
foreach (GraphicalConnection gc in tabConnections[tp]) {
gc.Draw(e.Graphics);
}
foreach (GraphicalModule gm in tabModules[tp]) {
gm.Draw(e.Graphics);
}
if (drawConnection && (selectedCallee != null || selectedCaller != null)) {
Point p = tp.Controls[0].Controls[0].PointToClient(Cursor.Position);
e.Graphics.DrawLine(Pens.Black, connectingTip, p);
@@ -1007,8 +1012,9 @@ public void UpdateParameters(GraphicalModule gm)
x *= x;
int y = Math.Abs(tmp.Y);
y *= y;
if (Math.Sqrt(x + y) > 4 && e.Button == MouseButtons.Left) {
if (Math.Sqrt(x + y) > 4 && (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right)) {
drawConnection = true;
showSlotTips = (e.Button == MouseButtons.Right);
if (tabViews.SelectedTab != null) {
doTheScrollingShit(e.Location);
}
@@ -1089,6 +1095,7 @@ public void UpdateParameters(GraphicalModule gm)
tabConnections[tp].Add(gc);
somethingSelected = true;
drawConnection = false;
showSlotTips = false;
break;
}
}
@@ -1098,6 +1105,7 @@ public void UpdateParameters(GraphicalModule gm)
}
if (!somethingSelected) {
drawConnection = false;
showSlotTips = false;
}
resizePanel(true);
RefreshCurrent();
@@ -2434,5 +2442,38 @@ public void UpdateParameters(GraphicalModule gm)
}
}

private void ToolStripButton1_Click_1(object sender, EventArgs e) {
if (selectedModule != null) {
if (SelectedTab != null) {
string instName = "::inst";
string modFullName = instName + "::" + selectedModule.Name;
string s = "";
if (tabMainViews[SelectedTab] != null && tabMainViews[SelectedTab].Name == selectedModule.Name) {
s = "mmCreateView(\"" + safeName(SelectedTab.Text) + "\", \"" + selectedModule.Module.Name + "\", \"" + modFullName + "\")\n";
} else {
s = "mmCreateModule(\"" + selectedModule.Module.Name + "\", \"" + modFullName + "\")\n";
}
foreach (var p in selectedModule.Module.ParamSlots) {
if (selectedModule.ParameterValues.ContainsKey(p)) {
s += "mmSetParamValue(\"" + modFullName + "::" + p.Name + "\", \"" +
Io.ProjectFileLua.SafeString(selectedModule.ParameterValues[p]) + "\")\n";
}
}
Clipboard.SetText(s);
}
} else if (selectedConnection != null) {
if (SelectedTab != null) {
string instName = "::inst";
string src = instName + "::" + selectedConnection.src.Name + "::" +
selectedConnection.srcSlot.Name;
string dst = instName + "::" + selectedConnection.dest.Name + "::" +
selectedConnection.destSlot.Name;
string s = "mmCreateCall(\"" + selectedConnection.Call.Name + "\", \"" +
src + "\", \"" + dst +
"\")";
Clipboard.SetText(s);
}
}
}
}
}
@@ -134,7 +134,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAi
CgAAAk1TRnQBSQFMAgEBBAEAAXABAAFwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CgAAAk1TRnQBSQFMAgEBBAEAAZgBAAGYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -3,6 +3,8 @@
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using MegaMolConf.Data;

namespace MegaMolConf {
public class GraphicalModule : INotifyPropertyChanged {
@@ -188,20 +190,16 @@ public static float DpiFactor
new Point(bounds.Width + Position.X - slotWidth,
Position.Y + moduleBorder + x * slotSpacing + slotBorder + slotHeight)
};
//Point[] psScaled = new Point[3] {
// new Point(bounds.Width + Position.X - (int)(slotWidth * slotScale),
// Position.Y + moduleBorder + x * slotSpacing + slotBorder - (int)(slotScale * slotHeight / 2)),
// new Point(bounds.Width + Position.X + (int)(slotWidth * slotScale),
// Position.Y + moduleBorder + x * slotSpacing + slotBorder),
// new Point(bounds.Width + Position.X - (int)(slotWidth * slotScale),
// Position.Y + moduleBorder + x * slotSpacing + slotBorder + (int)(slotScale * slotHeight / 2))
//};

if (Form1.selectedCaller == cr && Form1.selectedModule != null && Name == Form1.selectedModule.Name) {
g.FillPolygon(selectedSlotBrush, ps);
DrawSlotName(g, x, true, cr.Name);
} else if (Form1.selectedCallee != null && Form1.selectedCallee.CompatibleCalls.Intersect(cr.CompatibleCalls).Count() > 0) {
g.FillPolygon(callerBrush, ps);
g.DrawPolygon(compatibleSlotBorder, ps);
} else {
DrawSlotName(g, x, true, cr.Name);
}
else {
g.FillPolygon(callerBrush, ps);
}
}
@@ -217,16 +215,32 @@ public static float DpiFactor
};
if (Form1.selectedCallee == ce && Form1.selectedModule != null && Name == Form1.selectedModule.Name) {
g.FillPolygon(selectedSlotBrush, ps);
} else if (Form1.selectedCaller != null && Form1.selectedCaller.CompatibleCalls.Intersect(ce.CompatibleCalls).Count() > 0) {
DrawSlotName(g, x, false, ce.Name);
}
else if (Form1.selectedCaller != null && Form1.selectedCaller.CompatibleCalls.Intersect(ce.CompatibleCalls).Count() > 0) {
g.FillPolygon(calleeBrush, ps);
g.DrawPolygon(compatibleSlotBorder, ps);
DrawSlotName(g, x, false, ce.Name);
} else {
g.FillPolygon(calleeBrush, ps);
}
}
}
}

private void DrawSlotName(Graphics g, int x, bool addBounds, string displayName) {
if (Form1.drawConnection && Form1.showSlotTips) {
//if (Form1.drawConnection) {
int xbase = Position.X + slotWidth;
if (addBounds) xbase += bounds.Width;
int ybase = Position.Y + moduleBorder + x * slotSpacing + slotBorder;
SizeF slotbounds = g.MeasureString(displayName, moduleNameFont);
ybase -= (int) slotbounds.Height / 4;
g.FillRectangle(selectedSlotBrush, xbase, ybase, slotbounds.Width, slotbounds.Height);
g.DrawString(displayName, moduleNameFont, moduleNameBrush, xbase, ybase);
}
}

private Data.Module myModule;
private bool boundsCalculated;

@@ -17,7 +17,7 @@ class ProjectFileLua : ProjectFile {
/// <summary>
/// Escapes paths for Lua
/// </summary>
private string safeString(string p) {
internal static string SafeString(string p) {
return p.Replace(@"\", @"\\").Replace("\"", "\\\"");
}

@@ -49,7 +49,7 @@ class ProjectFileLua : ProjectFile {
//if (!m.ConfPos.IsEmpty) w.Write(" confpos=\"" + m.ConfPos.ToString() + "\"");
if (m.Params != null) {
foreach (Param p in m.Params) {
w.WriteLine("mmSetParamValue(\"" + modFullName + "::" + p.Name + "\", \"" + safeString(p.Value) + "\")");
w.WriteLine("mmSetParamValue(\"" + modFullName + "::" + p.Name + "\", \"" + SafeString(p.Value) + "\")");
}
}
}
@@ -483,6 +483,9 @@
<None Include="${CONFIGURATOR_SOURCE}\Resources\StatusAnnotations_Complete_and_ok_32xLG_color.png">
<Link>Resources\StatusAnnotations_Complete_and_ok_32xLG_color.png</Link>
</None>
<None Include="${CONFIGURATOR_SOURCE}\Resources\lines_Text_code_16xMD.png">
<Link>Resources\lines_Text_code_16xMD.png</Link>
</None>
<None Include="${CONFIGURATOR_SOURCE}\Resources\mmconfig.rc">
<Link>Resources\mmconfig.rc</Link>
<SubType>Designer</SubType>

Some generated files are not rendered by default. Learn more.

@@ -208,4 +208,7 @@
<data name="Process_16x" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Process_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="lines_Text_code_16xMD" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\lines_Text_code_16xMD.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file not shown.

0 comments on commit 017d6e9

Please sign in to comment.
You can’t perform that action at this time.