aboutsummaryrefslogtreecommitdiff
path: root/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/AddPath.htm
blob: de8c944b7aca5c87a20ac7f3a8000cbdaade7a25 (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
<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>AddPath</title>

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

    
  <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" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperBase</a>
      </td>
      <td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
      </td>
    </tr>
  </table>
  <h1>ClipperBase.AddPath</h1>


  <p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> AddPath(<b>const</b> path: <a href="../../../Types/Path.htm">TPath</a>; polyType: <a href="../../../Types/PolyType.htm">TPolyType</a>; Closed: Boolean): Boolean;</p>

  <p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>bool</b> AddPath(<b>const</b> <a href="../../../Types/Path.htm">Path</a> &amp;pg, <a href="../../../Types/PolyType.htm">PolyType</a> polyType, <b>bool</b> closed);</p>

  <p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public virtual bool</b> AddPath(<a href="../../../Types/Path.htm">Path</a> pg, <a href="../../../Types/PolyType.htm">PolyType</a> polyType, <b>bool</b> closed);</p>
<br>


  <p class="Body"> <img src="../../../../../../Images/line_clipping.png" alt="" border="0" align="right"> Any number of subject and clip paths can be added to a clipping task, either individually via the AddPath() method, or as groups via the AddPaths() method, or even using both methods.<br><br> 'Subject' paths may be either <em>open</em> (lines) or <em>closed</em> (polygons) or even a mixture of both, but <span class="maroon"><b>'clipping' paths must always be <em>closed</em></b></span>. Clipper allows polygons to clip both lines and other polygons, but doesn't allow lines to clip either lines or polygons.<br><br> With closed paths, <a href="../../../Functions/Orientation.htm">orientation</a> should conform with the <a href="../../../Types/PolyFillType.htm">filling rule</a> that will be passed via Clippper's <a href="../../Clipper/Methods/Execute.htm">Execute</a> method.<br><br> </p>



  <p class="Body"><b>Path Coordinate range</b>:<br> Path coordinates must be between &plusmn; 0x3FFFFFFFFFFFFFFF (&plusmn; <b>4.6e+18</b>), otherwise a range error will be thrown when attempting to add the path to the Clipper object. If coordinates can be kept between &plusmn; 0x3FFFFFFF (&plusmn; <b>1.0e+9</b>), a modest increase in performance (approx. 15-20%) over the larger range can be achieved by avoiding large integer math. If the preprocessor directive <a href="../../../PreProcessor/Defines.htm"><b>use_int32</b></a> is defined (allowing a further increase in performance of 20-30%), then the maximum range is restricted to &plusmn; 32,767. <br><br></p>


  <p class="Body"> <b>Return Value:</b><br> The function will return false if the path is invalid for clipping. A path is invalid for clipping when: 
    <ul>
  
      <li>it has less than 2 vertices</li>
	
      <li>it has 2 vertices but is not an open path</li>
	
      <li>the vertices are all co-linear and it is not an open path</li>

    </ul> </p>

<br>




  <h2 id="Auto-SeeAlso">See Also</h2>
  <p class="Body"><a href="../../../../../Overview/Example.htm">Example</a>, <a href="../../Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="AddPaths.htm">AddPaths</a>, <a href="../../../Functions/Orientation.htm">Orientation</a>, <a href="../../../PreProcessor/Defines.htm">Defines</a>, <a href="../../../Types/Path.htm">Path</a>, <a href="../../../Types/PolyFillType.htm">PolyFillType</a>, <a href="../../../Types/PolyType.htm">PolyType</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>