aboutsummaryrefslogtreecommitdiff
path: root/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/PolyTree/_Body.htm
blob: 175df23000eda068f2784c0cbc9fdc3aa7d48313 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<html>

<head>
    
  <script type="text/javascript" src="../../../../../Scripts/jquery.js">
  </script>
    
  <script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
  </script>
    
  <script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
  </script>
    
  <script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
  </script>
    
  <script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
  </script>
    
  <link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
    
  <link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
  

  <title>PolyTree</title>

  <link rel="stylesheet" href="../../../../../Styles/default.css" type="text/css">

  <meta name="Ancestor" content="PolyNode">

    
  <script type="text/javascript" src="../../../../../Scripts/bootstrap.js">
  </script>
  
</head>

<body bgcolor="#FFFFFF">
    
  <!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
    
  <!-- DO NOT EDIT MANUALLY !!! -->
  
  <table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
    <tr>
      <td class="Banner" nowrap=""><a href="../../../../_Body.htm" class="Banner"><img src="../../../../../Images/_Home.gif" align="absmiddle">Home</a>
      </td>
      <td class="Banner" nowrap=""><a href="../../_Body.htm" class="Banner"><img src="../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
      </td>
      <td class="Banner" width="100%" align="right"><img src="../../../../../Images/_Project_Logo.gif" align="absmiddle">
      </td>
    </tr>
  </table>
  <h1>PolyTree</h1>
  <h2>Hierarchy</h2>
  <p class="Hierarchy"></p>
  <p class="Hierarchy">&nbsp;&nbsp;&nbsp;|</p>
  <p class="Hierarchy"><a href="../PolyNode/_Body.htm">PolyNode</a></p>
<br>

  <p class="Body"> <b>PolyTree</b> is intended as a <b>read-only</b> data structure that should only be used to receive <em>solutions</em> from clipping and offsetting operations. It's an alternative to the <a href="../../Types/Paths.htm">Paths</a> data structure which also receives these solutions. PolyTree's two major advantages over the <em>Paths</em> structure are: it properly represents the <b>parent-child relationships</b> of the returned polygons; it differentiates between <b>open</b> and <b>closed</b> paths. However, since PolyTree is a more complex structure than the <em>Paths</em> structure, and since it's more computationally expensive to process (the Execute method being roughly 5-10% slower), <span class="maroon">it should used only be when parent-child polygon relationships are needed, or when open paths are being 'clipped'.</span><br><br> An empty PolyTree object can be passed as the <em>solution</em> parameter in <a href="../Clipper/Methods/Execute.htm"><b>Clipper.Execute</b></a> and in <a href="../ClipperOffset/Methods/Execute.htm"><b>ClipperOffset.Execute</b></a>. Once the clipping or offseting operation is completed, the method returns with the PolyTree structure filled with data representing the solution.<br><br> A <b>PolyTree</b> object is a container for any number of <a href="../PolyNode/_Body.htm"><b>PolyNode</b></a> children, with each contained PolyNode representing a single polygon contour (either an <a href="../../../../Overview/_Body.htm#terminology">outer</a> or <a href="../../../../Overview/_Body.htm#terminology">hole</a> polygon). <span class="maroon">PolyTree itself is a specialized PolyNode whose immediate children represent the top-level <em>outer</em> polygons of the solution. (Its own <a href="../PolyNode/Properties/Contour.htm">Contour</a> property is always empty.)</span> The contained top-level PolyNodes may contain their own PolyNode children representing hole polygons that may also contain children representing nested outer polygons etc. Children of <em>outers</em> will always be <em>holes</em>, and children of <em>holes</em> will always be <em>outers</em>.<br><br> <b>PolyTrees</b> can also contain <b>open</b> paths. Open paths will always be represented by <em>top level</em> PolyNodes. Two functions are provided to quickly separate out <em>open</em> and <em>closed</em> paths from a polytree - <a href="../../Functions/OpenPathsFromPolyTree.htm"><b>OpenPathsFromPolyTree</b></a> and <a href="../../Functions/ClosedPathsFromPolyTree.htm"><b>ClosedPathsFromPolyTree</b></a>. <br><br> <div align="left"> 
      <table cellspacing="2" cellpadding="0" border="0">

        <tr>
	
          <td style="background-color: #FFFFFF;">
<img src="../../../../../Images/polytree.png" alt="" border="0">
	
          </td>
	
          <td style="background-color: #FFFFFF;">

            <pre style="font-family: Verdana, Arial, Helvetica, sans-serif;">

    <b>polytree:</b> 
    Contour = <b>()</b>
    ChildCount = <b>1</b>
    Childs[0]: 
        Contour = ((10,10),(100,10),(100,100),(10,100))
        IsHole = <b>False</b>
        ChildCount = <b>1</b>
        Childs[0]: 
            Contour = ((20,20),(20,90),(90,90),(90,20))
            IsHole = <b>True</b>
            ChildCount = <b>2</b>
            Childs[0]: 
                Contour = ((30,30),(50,30),(50,50),(30,50))
                IsHole = <b>False</b>
                ChildCount = <b>0</b>
            Childs[1]: 
                Contour = ((60,60),(80,60),(80,80),(60,80))
                IsHole = <b>False</b>
                ChildCount = <b>0</b>

            </pre>
	
          </td>

        </tr>

      </table> </div> </p>

  <h2 id="Auto-Reference">Reference</h2>
  <table>
    <tr><th>Fields
      </th><th>Methods
      </th><th>Properties
      </th>
    </tr>
    <tr>
      <td colspan="2" class="White">In PolyTree:
      </td>
    </tr>
    <tr>
      <td>
      </td>
      <td><a href="Methods/Clear.htm">Clear</a>
      </td>
      <td><a href="Properties/Total.htm">Total</a>
      </td>
    </tr>
    <tr>
      <td>
      </td>
      <td><a href="Methods/GetFirst.htm">GetFirst</a>
      </td>
      <td>
      </td>
    </tr>
    <tr>
      <td colspan="2" class="White">In PolyNode:
      </td>
    </tr>
    <tr>
      <td>
      </td>
      <td><a href="../PolyNode/Methods/GetNext.htm">GetNext</a>
      </td>
      <td><a href="../PolyNode/Properties/ChildCount.htm">ChildCount</a>
      </td>
    </tr>
    <tr>
      <td>
      </td>
      <td>
      </td>
      <td><a href="../PolyNode/Properties/Childs.htm">Childs</a>
      </td>
    </tr>
    <tr>
      <td>
      </td>
      <td>
      </td>
      <td><a href="../PolyNode/Properties/Contour.htm">Contour</a>
      </td>
    </tr>
    <tr>
      <td>
      </td>
      <td>
      </td>
      <td><a href="../PolyNode/Properties/IsHole.htm">IsHole</a>
      </td>
    </tr>
    <tr>
      <td>
      </td>
      <td>
      </td>
      <td><a href="../PolyNode/Properties/IsOpen.htm">IsOpen</a>
      </td>
    </tr>
    <tr>
      <td>
      </td>
      <td>
      </td>
      <td><a href="../PolyNode/Properties/Parent.htm">Parent</a>
      </td>
    </tr>
  </table>
  <h2 id="Auto-SeeAlso">See Also</h2>
  <p class="Body"><a href="../../../../Overview/_Body.htm">Overview</a>, <a href="../Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="../ClipperOffset/Methods/Execute.htm">ClipperOffset.Execute</a>, <a href="../PolyNode/_Body.htm">PolyNode</a>, <a href="../../Functions/ClosedPathsFromPolyTree.htm">ClosedPathsFromPolyTree</a>, <a href="../../Functions/OpenPathsFromPolyTree.htm">OpenPathsFromPolyTree</a>, <a href="../../Types/Paths.htm">Paths</a></p>
    
  <p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
  
</body>

</html>