Combining several CLIPs in GraphRepCombining several CLIPs in GraphRepRE: Combining several CLIPs in GraphRepSabin Popescuhttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=913862014-03-20T12:50:35Z2014-03-20T12:01:45ZDear Arianna,<br />This is a very interesting application scenario.<br />I think the best solution would be to combine one CLIP_RECT and two CLIP_ELLIPSE statements in your GraphRep using the keyword <strong>combine-mode:</strong> with the value <strong>or</strong>.<br /><br />Below is a solution that I would suggest for this case.<br />The solution involves defining a table, so the result can be flexibly combined with other graphical elements like for example additional icons, minimum width or height and so on.<br />In the central part of the table, we combine three CLIP_ statements, as described above, we draw a rectangle (or gradient rectangle, as it results from your image) over this clipped area and then we draw a borded around it.<br /><div class="code"><span class="code-lines"> 1</span>GRAPHREP sizing:asymmetrical<br /><span class="code-lines"> 2</span>SHADOW on<br /><span class="code-lines"> 3</span><br /><span class="code-lines"> 4</span>#definition of colors<br /><span class="code-lines"> 5</span>SET colBrd: (rgbval("$1646B6"))<br /><span class="code-lines"> 6</span>SET colFFm: (rgbval("white"))<br /><span class="code-lines"> 7</span>SET colFTo: (rgbval("$2655C4"))<br /><span class="code-lines"> 8</span><br /><span class="code-lines"> 9</span>#definition of the table<br /><span class="code-lines">10</span>TABLE x: -1.5cm y: -0.6cm w: 3.0cm h: 1.2cm cols:3 rows:3<br /><span class="code-lines">11</span> w1: 0.25cm w2: 100% w3: 0.25cm<br /><span class="code-lines">12</span> h1: 0.10cm h2: 100% h3:0.10cm<br /><span class="code-lines">13</span>STRETCH off<br /><span class="code-lines">14</span><br /><span class="code-lines">15</span>SET tabw: (tabx2 - tabx1)<br /><span class="code-lines">16</span> tabh: (taby2 - taby1)<br /><span class="code-lines">17</span><br /><span class="code-lines">18</span>#set "CLIP_" area<br /><span class="code-lines">19</span>CLIP_RECT x: (tabx1) y: (taby1) w: (tabw) h: (tabh)<br /><span class="code-lines">20</span>CLIP_ELLIPSE x: (tabx1) y: (taby1 + tabh*0.5) rx: (tabh*0.5) ry: (tabh*0.5) combine-mode: or<br /><span class="code-lines">21</span>CLIP_ELLIPSE x: (tabx1 + tabw) y: (taby1 + tabh*0.5) rx: (tabh*0.5) ry: (tabh*0.5) combine-mode: or<br /><span class="code-lines">22</span><br /><span class="code-lines">23</span>#draw a gradient rectangle<br /><span class="code-lines">24</span>GRADIENT_RECT x: (tabx1 - tabh*0.5) y: (taby1) <br /><span class="code-lines">25</span> w: (tabw + tabh) h: (tabh)<br /><span class="code-lines">26</span> style: downdiag<br /><span class="code-lines">27</span> color1: (colFFm) color2: (colFTo)<br /><span class="code-lines">28</span><br /><span class="code-lines">29</span>#finish drawing in the "CLIP_" area<br /><span class="code-lines">30</span>CLIP_OFF <br /><span class="code-lines">31</span><br /><span class="code-lines">32</span>#draw the border around the shape<br /><span class="code-lines">33</span>PEN w: 0.04cm color: (colBrd)<br /><span class="code-lines">34</span><br /><span class="code-lines">35</span>LINE x1: (tabx1) y1: (taby1) x2: (tabx1 + tabw) y2: (taby1)<br /><span class="code-lines">36</span>LINE x1: (tabx1) y1: (taby1 + tabh) x2: (tabx1 + tabw) y2: (taby1 + tabh)<br /><span class="code-lines">37</span><br /><span class="code-lines">38</span>ARC x: (tabx1) y: (taby1 + tabh*0.5) rx: (tabh*0.5) ry: (tabh*0.5)<br /><span class="code-lines">39</span> x1: (tabx1) y1: (taby1)<br /><span class="code-lines">40</span> x2: (tabx1) y2: (taby1 + tabh)<br /><span class="code-lines">41</span><br /><span class="code-lines">42</span>ARC x: (tabx1 + tabw) y: (taby1 + tabh*0.5) rx: (tabh*0.5) ry: (tabh*0.5)<br /><span class="code-lines">43</span> x1: (tabx1 + tabw) y1: (taby1 + tabh)<br /><span class="code-lines">44</span> x2: (tabx1 + tabw) y2: (taby1)<br /><span class="code-lines">45</span><br /><span class="code-lines">46</span>#continue with other elements that are to be drawn (icons, text, attribute values, etc.)<br /><span class="code-lines">47</span>...<br /></div><br />The attached file coordinates.png contains a sketch with the defined coordinates.<br />The attached file samples.png shows how this graphrep behaves in the modelling area.Sabin Popescu2014-03-20T12:01:45ZCombining several CLIPs in GraphRepArianna Pierfranceschihttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=913392014-03-27T11:35:05Z2014-03-20T11:19:18Z<span style="font-family: arial,helvetica,sans-serif">I would like to create a resizeable shape, that is a composition of a rectangle and two half-circles. <br />More precisely, top and bottom parts should be linear as in a rectangle and the right and left sides being regular arcs looking like the two halfs of a circle. <br />I've tried using CLIP_ROUNDRECT but it doesn't allow me to keep the arcs as half of a circle and the CLIP_ELLIPSE doesn't allow me to keep the upper and downer parts linear. See the image below.<br />I was wondering if it was possible to create a composition of clippings, as a CLIP_RECTANGLE + a CLIP_ELLIPSE to have as result a shape like the second one of the image.</span>Arianna Pierfranceschi2014-03-20T11:19:18Z