From ed1a23fcba938de5f60f758a15aa07f124b400c6 Mon Sep 17 00:00:00 2001 From: "C5ISR\\Michael.P.Spinelli" Date: Wed, 4 Feb 2026 10:46:03 -0500 Subject: [PATCH 1/2] fixed bug where SECRenderer.RenderAsMilStdSymbol() would return null for some symbols with altitude values. Did not impact RenderSymbol or RenderSymbol2D() --- core/JavaLineArray/pom.xml | 2 +- core/JavaRenderer/pom.xml | 2 +- core/JavaRendererServer/pom.xml | 2 +- core/JavaRendererUtils/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 2 +- renderer/RendererPluginInterface/pom.xml | 2 +- renderer/mil-sym-renderer/pom.xml | 2 +- renderer/mil-sym-renderer/pomJava7.xml | 2 +- renderer/mil-sym-renderer/pomJava8.xml | 2 +- .../src/main/java/sec/web/renderer/SECRenderer.java | 6 +++--- renderer/pom.xml | 2 +- samples/pom.xml | 2 +- samples/rendering-sample-1/pom.xml | 2 +- service/mil-sym-service/pom.xml | 2 +- service/pom.xml | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/core/JavaLineArray/pom.xml b/core/JavaLineArray/pom.xml index 58642340..f3d6c29e 100644 --- a/core/JavaLineArray/pom.xml +++ b/core/JavaLineArray/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 ../.. diff --git a/core/JavaRenderer/pom.xml b/core/JavaRenderer/pom.xml index cffa3dda..dfc8dbc6 100644 --- a/core/JavaRenderer/pom.xml +++ b/core/JavaRenderer/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 ../.. diff --git a/core/JavaRendererServer/pom.xml b/core/JavaRendererServer/pom.xml index c45065e2..ce134c87 100644 --- a/core/JavaRendererServer/pom.xml +++ b/core/JavaRendererServer/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 ../.. diff --git a/core/JavaRendererUtils/pom.xml b/core/JavaRendererUtils/pom.xml index 493a2734..c4b197ca 100644 --- a/core/JavaRendererUtils/pom.xml +++ b/core/JavaRendererUtils/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 ../.. diff --git a/core/pom.xml b/core/pom.xml index 059cc184..c991dcfb 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 .. diff --git a/pom.xml b/pom.xml index 2225ee96..088edd5c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 pom mil-sym-java diff --git a/renderer/RendererPluginInterface/pom.xml b/renderer/RendererPluginInterface/pom.xml index 68c7460d..b3eafe27 100644 --- a/renderer/RendererPluginInterface/pom.xml +++ b/renderer/RendererPluginInterface/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 ../.. diff --git a/renderer/mil-sym-renderer/pom.xml b/renderer/mil-sym-renderer/pom.xml index d6c05c29..82f2190b 100644 --- a/renderer/mil-sym-renderer/pom.xml +++ b/renderer/mil-sym-renderer/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 ../.. diff --git a/renderer/mil-sym-renderer/pomJava7.xml b/renderer/mil-sym-renderer/pomJava7.xml index 599404d9..9e634be3 100644 --- a/renderer/mil-sym-renderer/pomJava7.xml +++ b/renderer/mil-sym-renderer/pomJava7.xml @@ -7,7 +7,7 @@ sec.web.renderer mil-sym-renderer jar - 0.1.44 + 0.1.45 mil-sym-renderer http://maven.apache.org diff --git a/renderer/mil-sym-renderer/pomJava8.xml b/renderer/mil-sym-renderer/pomJava8.xml index 9f3a43af..8a309879 100644 --- a/renderer/mil-sym-renderer/pomJava8.xml +++ b/renderer/mil-sym-renderer/pomJava8.xml @@ -7,7 +7,7 @@ sec.web.renderer mil-sym-renderer jar - 0.1.44 + 0.1.45 mil-sym-renderer http://maven.apache.org diff --git a/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/SECRenderer.java b/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/SECRenderer.java index 5de2b60e..32ae61c5 100644 --- a/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/SECRenderer.java +++ b/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/SECRenderer.java @@ -1187,11 +1187,11 @@ public MilStdSymbol RenderMultiPointAsMilStdSymbol(String id, String name, Strin MilStdSymbol mSymbol = null; try { - if (JavaRendererUtilities.is3dSymbol(symbolCode, modifiers)==false) - { + //if (JavaRendererUtilities.is3dSymbol(symbolCode, modifiers)==false) + //{ mSymbol = MultiPointHandler.RenderSymbolAsMilStdSymbol(id, name, description, symbolCode, controlPoints, scale, bbox, modifiers, symStd); - } + //} } catch (Exception ea) { mSymbol=null; diff --git a/renderer/pom.xml b/renderer/pom.xml index 54b3d17f..bc49aba7 100644 --- a/renderer/pom.xml +++ b/renderer/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 .. diff --git a/samples/pom.xml b/samples/pom.xml index a441cde7..52cc9c2a 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 .. diff --git a/samples/rendering-sample-1/pom.xml b/samples/rendering-sample-1/pom.xml index e2a345a5..708e3f5c 100644 --- a/samples/rendering-sample-1/pom.xml +++ b/samples/rendering-sample-1/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 ../.. diff --git a/service/mil-sym-service/pom.xml b/service/mil-sym-service/pom.xml index 3f34678b..0c50f93d 100644 --- a/service/mil-sym-service/pom.xml +++ b/service/mil-sym-service/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 ../.. diff --git a/service/pom.xml b/service/pom.xml index b1ec7686..2368bc9b 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -4,7 +4,7 @@ io.github.missioncommand mil-sym-java - 0.1.44 + 0.1.45 .. From b5c91f6a03032d6dcc4593566b6ad715d9d64082 Mon Sep 17 00:00:00 2001 From: "C5ISR\\Michael.P.Spinelli" Date: Wed, 11 Feb 2026 14:44:37 -0500 Subject: [PATCH 2/2] -added get/setAutoAdjustScale to RendererSettings -updated shouldClipSymbol in MultiPointHandler --- .../C2SD/Utilities/RendererSettings.java | 15 +++ .../sec/web/renderer/MultiPointHandler.java | 124 ++++++++++++------ 2 files changed, 97 insertions(+), 42 deletions(-) diff --git a/core/JavaRendererUtils/src/main/java/ArmyC2/C2SD/Utilities/RendererSettings.java b/core/JavaRendererUtils/src/main/java/ArmyC2/C2SD/Utilities/RendererSettings.java index a33b6248..fb9f5f4b 100644 --- a/core/JavaRendererUtils/src/main/java/ArmyC2/C2SD/Utilities/RendererSettings.java +++ b/core/JavaRendererUtils/src/main/java/ArmyC2/C2SD/Utilities/RendererSettings.java @@ -143,6 +143,8 @@ public class RendererSettings { private boolean _TwoLabelOnly = true; private double _overscanScale = 1.0; + + private boolean _autoAdjustScale = true; //acevedo - 12/8/17 - allow the setting of affiliation colors. private Color _friendlyUnitFillColor = AffiliationColors.FriendlyUnitFillColor; @@ -811,6 +813,19 @@ public void setOverscanScale(double overscanScale) { public double getOverscanScale() { return this._overscanScale; } + + /** + * Will attempt to adjust the scale if it doesn't seem to make sense with the passed in bbox. + * If you wish to have absolute control over the scale, set to false. + * @param autoAdjustScale default true + */ + public void setAutoAdjustScale(boolean autoAdjustScale) { + this._autoAdjustScale = autoAdjustScale; + } + + public boolean getAutoAdjustScale() { + return this._autoAdjustScale; + } /** * get the preferred fill affiliation color for units. diff --git a/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/MultiPointHandler.java b/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/MultiPointHandler.java index 82dd7a53..59fa59bd 100644 --- a/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/MultiPointHandler.java +++ b/renderer/mil-sym-renderer/src/main/java/sec/web/renderer/MultiPointHandler.java @@ -406,10 +406,25 @@ private static boolean crossesIDL(ArrayList geoCoords) { * @param symbolID * @return */ - public static Boolean ShouldClipSymbol(String symbolID) { + public static Boolean ShouldClipSymbol(String symbolID) + { + return ShouldClipSymbol(symbolID, false, false); + } + + /** + * Checks if a symbol is one with decorated lines which puts a strain on + * google earth when rendering like FLOT. These complicated lines should be + * clipped when possible. + * + * @param symbolID + * @param useDashArray default true, some symbols don't need to be clipped if using dash array MilStdAttribute + * @param useFillPattern default true, some symbols don't need to be clipped if using fill pattern MilStdAttribute + * @return + */ + public static Boolean ShouldClipSymbol(String symbolID, boolean useDashArray, boolean useFillPattern) { String affiliation = SymbolUtilities.getStatus(symbolID); - if (symbolID.substring(0, 1).equals("G") && affiliation.equals("A")) { + if (symbolID.substring(0, 1).equals("G") && affiliation.equals("A") && !useDashArray) { //SymbolDef sd = SymbolDefTable.getInstance().getSymbolDef(symbolID); //if(sd.getDrawCategory()==SymbolDef.DRAW_CATEGORY_LINE || // sd.getDrawCategory()==SymbolDef.DRAW_CATEGORY_POLYGON) @@ -422,14 +437,14 @@ public static Boolean ShouldClipSymbol(String symbolID) { return true; } + boolean shouldClip = false; String id = SymbolUtilities.getBasicSymbolID(symbolID); - if (id.equals("G*T*F-----****X") - || id.equals("G*F*LCC---****X") ||//CFL + if ( + id.equals("G*F*LCC---****X") ||//CFL id.equals("G*G*GLB---****X") || id.equals("G*G*GLF---****X") || id.equals("G*G*GLC---****X") || id.equals("G*G*GAF---****X") - || id.equals("G*G*AAW---****X") || id.equals("G*G*DABP--****X") || id.equals("G*G*OLP---****X") || id.equals("G*G*PY----****X") @@ -441,7 +456,6 @@ public static Boolean ShouldClipSymbol(String symbolID) { || id.equals("G*G*ALS---****X") || id.equals("G*G*SLB---****X") || id.equals("G*G*SLH---****X") - || id.equals("G*G*GAY---****X") || id.equals("G*M*OFA---****X") || id.equals("G*M*OGB---****X") || id.equals("G*M*OGL---****X") @@ -452,8 +466,7 @@ public static Boolean ShouldClipSymbol(String symbolID) { || id.equals("G*M*OADC--****X") || id.equals("G*M*OAR---****X") || id.equals("G*M*OAW---****X") - || id.equals("G*M*OEF---****X") || //Obstacles Effect Fix - id.equals("G*M*OMC---****X") + || id.equals("G*M*OEF---****X") //Obstacles Effect Fix || id.equals("G*M*OWU---****X") || id.equals("G*M*OWS---****X") || id.equals("G*M*OWD---****X") @@ -469,15 +482,6 @@ public static Boolean ShouldClipSymbol(String symbolID) { id.equals("G*M*BCE---****X") || //Ford Easy id.equals("G*M*SL----****X") || id.equals("G*M*SP----****X") - || id.equals("G*M*NR----****X") - || id.equals("G*M*NB----****X") - || id.equals("G*M*NC----****X") - || id.equals("G*F*ACNI--****X") - || id.equals("G*F*ACNR--****X") - || id.equals("G*F*ACNC--****X") - || id.equals("G*F*AKBC--****X") - || id.equals("G*F*AKBI--****X") - || id.equals("G*F*AKBR--****X") || id.equals("G*F*AKPC--****X") || id.equals("G*F*AKPI--****X") || id.equals("G*F*AKPR--****X") @@ -492,17 +496,45 @@ public static Boolean ShouldClipSymbol(String symbolID) { || id.equals("G*S*LRW---****X") || id.equals("G*T*Q-----****X") || id.equals("G*T*E-----****X") - || id.equals("G*T*F-----****X") || //Tasks Fix - id.equals("G*T*K-----****X") || //counterattack. - id.equals("G*T*KF----****X") || //counterattack by fire. - id.equals("G*G*PA----****X") || //AoA for Feint - id.equals("G*M*ORP---****X") - || id.equals("G*M*ORS---****X") - || id.equals("G*T*A-----****X")) { - return true; - } else { - return false; + || id.equals("G*T*F-----****X") || //Tasks Fix + id.equals("G*G*PA----****X") //AoA for Feint + ) + { + shouldClip = true;//decorated lines + } + else if(!useFillPattern) + { + if(id.equals("G*G*GAY---****X") //limited access area + || id.equals("G*G*AAW---****X")//weapons free zone + || id.equals("G*M*NB----****X")//bio area + || id.equals("G*M*NC----****X")//chem area + || id.equals("G*M*NR----****X")//radioactive area + || id.equals("G*F*AKBC--****X")//kill box blue circular + || id.equals("G*F*AKBI--****X")//kb irr + || id.equals("G*F*AKBR--****X")//kb rect + || id.equals("G*F*ACNI--****X")//NFA + || id.equals("G*F*ACNR--****X")//NFA rectnagular + || id.equals("G*F*ACNC--****X")//NFA circular + ) + { + shouldClip = true;//not using fill pattern so clip to not draw more lines than we have to + } + } + else if (!useDashArray) + { + if(id.equals("G*M*OMC---****X") //mine cluster + || id.equals("G*T*K-----****X") //counterattack. + || id.equals("G*T*KF----****X") //counterattack by fire. + || id.equals("G*M*ORP---****X") //blown bridges planned + || id.equals("G*M*ORS---****X") //blown bridges explosive + || id.equals("G*T*A-----****X") //follow and assume + ) + { + shouldClip = true;//not using dash array so clip to not draw more lines than we have to + } } + + return shouldClip; } /** @@ -516,6 +548,8 @@ public static Boolean ShouldClipSymbol(String symbolID) { */ private static double getReasonableScale(String bbox, double origScale) { double scale = origScale; + if(!RendererSettings.getInstance().getAutoAdjustScale()) + return origScale; try { String[] bounds = bbox.split(","); double left = Double.valueOf(bounds[0]).doubleValue(); @@ -826,13 +860,8 @@ public static String RenderSymbol(String id, //if(normalize) //NormalizeGECoordsToGEExtents(0,360,geoCoords2); - //disable clipping unless it spans IDL - if (ShouldClipSymbol(symbolCode) == false) { - if (crossesIDL(geoCoords) == false) { - rect = null; - bboxCoords = null; - } - } + + tgl.set_SymbolId(symbolCode);// "GFGPSLA---****X" AMBUSH symbol code tgl.set_Pixels(null); @@ -857,6 +886,15 @@ public static String RenderSymbol(String id, } else { mSymbol.setFillColor(null); } + + + //disable clipping unless it spans IDL + if (ShouldClipSymbol(symbolCode, mSymbol.getUseDashArray(), mSymbol.getUsePatternFill()) == false) { + if (crossesIDL(geoCoords) == false) { + rect = null; + bboxCoords = null; + } + } //check for required points & parameters String symbolIsValid = canRenderMultiPoint(mSymbol); @@ -1481,13 +1519,7 @@ public static MilStdSymbol RenderSymbolAsMilStdSymbol(String id, //if(normalize) //NormalizeGECoordsToGEExtents(0,360,geoCoords2); - //disable clipping unless it spans IDL - if (ShouldClipSymbol(symbolCode) == false) { - if (crossesIDL(geoCoords) == false) { - rect = null; - bboxCoords = null; - } - } + tgl.set_SymbolId(symbolCode);// "GFGPSLA---****X" AMBUSH symbol code tgl.set_Pixels(null); @@ -1510,6 +1542,14 @@ public static MilStdSymbol RenderSymbolAsMilStdSymbol(String id, Color fc = mSymbol.getFillColor(); fillColor = Integer.toHexString(fc.getRGB()); } + + //disable clipping unless it spans IDL + if (ShouldClipSymbol(symbolCode,mSymbol.getUseDashArray(),mSymbol.getUsePatternFill()) == false) { + if (crossesIDL(geoCoords) == false) { + rect = null; + bboxCoords = null; + } + } //get pixel values in case we need to do a fill. if (mSymbol.getModifierMap().containsKey(SYMBOL_FILL_IDS) @@ -1821,7 +1861,7 @@ public static String RenderSymbol2D(String id, // { // ((PointConversion)ipc).set_normalize(false); // } - if (ShouldClipSymbol(symbolCode) || crossesIDL(geoCoords)) { + if (ShouldClipSymbol(symbolCode,mSymbol.getUseDashArray(),mSymbol.getUsePatternFill()) || crossesIDL(geoCoords)) { temp = ipc.GeoToPixels(new Point2D.Double(left, top)); leftX = (int) temp.getX(); topY = (int) temp.getY();