<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-NZ>Hi all, <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ>I use vtkDelaunay2D to make a constrained
triangulation mesh from a set of points &nbsp;and a set of polylines (see
attached image). I need to mark the mesh into different regions, such as using
red to render the triangles of a region inside a contour, and using blue to
render the triangles of a region between two contours. <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ>My question is how to divide the mesh into
regions by the constrained polylines?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ>Here is part of my code:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-indent:36.0pt;text-autospace:none'><span
lang=EN-NZ style='font-size:10.0pt;font-family:"Courier New";color:blue'>this</span><span
lang=EN-NZ style='font-size:10.0pt;font-family:"Courier New"'>-&gt;terrainRawData-&gt;InsertNextCell(VTK_POLY_LINE,
cellIdList); // the cellIdList represents a polyline<o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:36.0pt;text-autospace:none'><span
lang=EN-NZ style='font-size:10.0pt;font-family:"Courier New";color:blue'>this</span><span
lang=EN-NZ style='font-size:10.0pt;font-family:"Courier New"'>-&gt;terrainRawData-&gt;SetPoints(<span
style='color:blue'>this</span>-&gt;terrainPts);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-NZ
style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-indent:36.0pt;text-autospace:none'><span
lang=EN-NZ style='font-size:10.0pt;font-family:"Courier New"'>vtkSmartPointer&lt;vtkPolyData&gt;
aPolyData = vtkSmartPointer&lt;vtkPolyData&gt;::New();<o:p></o:p></span></p>

<p class=MsoNormal style='text-indent:36.0pt;text-autospace:none'><span
lang=EN-NZ style='font-size:10.0pt;font-family:"Courier New"'>aPolyData-&gt;SetPoints(<span
style='color:blue'>this</span>-&gt;terrainPts);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-NZ
style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-indent:36.0pt;text-autospace:none'><span
lang=EN-NZ style='font-size:10.0pt;font-family:"Courier New"'>vtkSmartPointer&lt;vtkDelaunay2D&gt;
delaunay2D = vtkSmartPointer&lt;vtkDelaunay2D&gt;::New();<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-NZ
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
delaunay2D-&gt;SetInput( aPolyData );<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-NZ
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
delaunay2D-&gt;SetSource( <span style='color:blue'>this</span>-&gt;terrainRawData
);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span lang=EN-NZ
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
delaunay2D-&gt;Update();<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style='color:blue'>this</span>-&gt;terrainTri =
delaunay2D-&gt;GetOutput();</span><span lang=EN-NZ><o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ>Thank you very much, <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-NZ>Jing<o:p></o:p></span></p>

</div>

</body>

</html>