Open MAndersonPE opened 3 weeks ago
@MAndersonPE, this issue relates to the GUI so I am transferring this issue to the GUI repository for consideration.
@MAndersonPE would displaying the storage unit as shown below help? If so there's a simple code fix I can share.
@LRossman, my intention was just to change the drawing order to draw the storage on top. If you have a better solution, feel free to share.
@cbuahin I think you mean to draw the storage polygon on bottom so that its connecting links get drawn on top of it as in my figure (the Delphi graphics engine doesn't support transparency).
Anyway, here are the necessary code changes to umap.pas:
procedure DrawStorages;
DrawForeground
procedure:
....
// Draw subcatchments, links, nodes, rain gages & labels
DrawSubcatchments;
DrawStorages; //<<< new line
DrawLinks;
...
procedure TMap.DrawStorages;
var
J: Integer;
R : TRect;
begin
for J := 0 to Project.Lists[STORAGE].Count - 1 do
begin
R := GetBoundingRect(STORAGE, J);
if IntersectRect(R, R, Window.MapRect) then DrawStoragePolygon(J);
end;
end;
// Draw the node
if ObjType = STORAGE then
begin
// DrawStoragePolygon(Index); //<<<< Comment out or delete this line
DrawStorage(P1.X, P1.Y, Size);
end
@LRossman, I considered the option you have shared but was worried about instances where the storage node polygons obscure junction nodes. I recently worked on a project where I had to deal with this issue.
DrawStorages
Nevermind, think the solution addresses my concern.
Thanks @LRossman - two asks.
Was there an underlying reason Storage nodes create polygons instead of just coordinates? With the draw order, I assume I would be able to connect a link to a junction node within that polygon field.
@MAndersonPE you can create a storage node without a polygon by first left-clicking on its map location and then right-clicking. The new drawing order will allow you to see junctions placed within a storage polygon.
If you have Storage Polygons, there is no visibility control similar to that of subcatchments. I have to edit the vertex to "see" the junction at the corner of the polygon to connect to it. (i.e. the background is not transparent)