USEPA / SWMM-GUI

Source Code for the Stormwater Management Model Graphical User Interface
4 stars 1 forks source link

GUI: Storage Polygons fill style control #20

Open MAndersonPE opened 3 weeks ago

MAndersonPE commented 3 weeks ago

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)

image

cbuahin commented 3 weeks ago

@MAndersonPE, this issue relates to the GUI so I am transferring this issue to the GUI repository for consideration.

LRossman commented 3 weeks ago

@MAndersonPE would displaying the storage unit as shown below help? Storage2 If so there's a simple code fix I can share.

cbuahin commented 3 weeks ago

@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.

LRossman commented 3 weeks ago

@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:

  1. Add the following declaration to the TMap class.
    procedure DrawStorages;
  2. Modify the following code segment in the DrawForegroundprocedure:
    ....
    // Draw subcatchments, links, nodes, rain gages & labels
    DrawSubcatchments;
    DrawStorages;             //<<< new line
    DrawLinks;
    ...
  3. Add the new DrawStorages procedure:
    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;
  4. Modify the DrawObject procedure as follows:
    // Draw the node
    if ObjType = STORAGE then
    begin
    //     DrawStoragePolygon(Index);    //<<<< Comment out or delete this line
     DrawStorage(P1.X, P1.Y, Size);
    end
cbuahin commented 3 weeks ago

@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.

cbuahin commented 3 weeks ago

DrawStorages

Nevermind, think the solution addresses my concern.

MAndersonPE commented 3 weeks ago

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.

LRossman commented 3 weeks ago

@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. storage