Skip to content

Conversation

@MinyazevR
Copy link
Member

@MinyazevR MinyazevR commented Jan 1, 2026

Implement new mode to edit regions, that can be enabled by the dedicated button (a corresponding option in settings must be turned on, ATM). A brief demonstration:
demo.webm

  1. In this mode, one can resize and move regions on the scene. This mode does not work (intentionally) when the world configuration is read only ("an exercise"). If a custom region was initially visible, it will remain visible regardless of the mode, but it will not be editable outside the region editing mode.
  2. In this mode, ellipses and rectangles have a context menu:
    2.1 Convert to region. An ellipse or rectangle drawn by the user is converted into an region of the corresponding shape, and the figure itself disappears from the scene:
    covert_to_region.webm
    2.2 Bind to region. In this case, a dependent (accompanying) region of the same shape is created for the selected shape, and the ellipse or rectangle itself does not disappear from the scene. This functionality is useful in typical cases where a rectangle or ellipse is placed exactly over a region that is later used in constrains to check if some object is inside or outside of the corresponding original shape.
    bind_to_region.webm

3.1 The first type of region is serialized into a familiar format, becoming an independent region:

<region id="war_zone" type="rectangle" height="4000" width="4000" x="-150" y="-2000" visible="false" color="#0000ff" filled="true"/>
			<region id="start_zone" type="ellipse" height="300" width="300" x="-150" y="-150" visible="true" color="#00ff00" filled="true"/>

3.2. The second type of regions is serialized into a simpler construct, that is designed to be user-friendly. It is only necessary to specify boundItem="id" attribute, where id is the name of an existing ellipse or rectangle in the same WorldModel.xml:

<colorFields>
    <rectangle fill-style="solid" stroke="#ffff0000" id="rectangle1" begin="313:-148" end="2:156" stroke-width="6" fill="#ffff0000" 
         stroke-style="solid"/>
    </colorFields>
    <regions>
        <region id="region1" filled="true" text="my bound region" textX="0" textY="0" visible="false" type="bound" 
            boundItem="rectangle1"/>
     </regions>

@MinyazevR MinyazevR force-pushed the MinyazevR-editor-mode branch from 92cb865 to 8ecddbe Compare January 1, 2026 15:49
@MinyazevR MinyazevR marked this pull request as draft January 1, 2026 15:49
@MinyazevR MinyazevR changed the title Experimental support for the region editing mode Support for the region editing mode Jan 5, 2026
@MinyazevR MinyazevR force-pushed the MinyazevR-editor-mode branch from f025d55 to 26117af Compare January 5, 2026 15:38
@MinyazevR MinyazevR force-pushed the MinyazevR-editor-mode branch 2 times, most recently from e17aa35 to e3178e0 Compare January 5, 2026 16:57
@MinyazevR MinyazevR force-pushed the MinyazevR-editor-mode branch from e3178e0 to 9d5dd1f Compare January 5, 2026 16:59
@MinyazevR MinyazevR marked this pull request as ready for review January 5, 2026 17:00
@MinyazevR MinyazevR marked this pull request as draft January 5, 2026 17:08
@MinyazevR MinyazevR marked this pull request as ready for review January 5, 2026 17:26
@MinyazevR MinyazevR marked this pull request as draft January 5, 2026 17:30
@MinyazevR MinyazevR force-pushed the MinyazevR-editor-mode branch 3 times, most recently from 5396095 to 579658c Compare January 6, 2026 12:58
@MinyazevR MinyazevR force-pushed the MinyazevR-editor-mode branch from 579658c to 3b2975a Compare January 6, 2026 13:05
@MinyazevR MinyazevR force-pushed the MinyazevR-editor-mode branch from 71c752a to e4d1074 Compare January 6, 2026 16:04
@MinyazevR MinyazevR marked this pull request as ready for review January 6, 2026 16:07
@iakov iakov added this to the 2025.5 milestone Jan 6, 2026
@iakov iakov merged commit 9da6109 into trikset:master Jan 6, 2026
23 checks passed
@iakov iakov self-requested a review January 6, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants