<html><head><base href="x-msg://93/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey Sebastian,<div><br></div><div>For assignment you should use pointdata.AddArray(), and you can do that as many times as you want, no matter how many components your array has (scalars, vectors, ...). Then when you want to make a certain array the default attribute you can use SetActiveScalars(), SetActiveTCoords(), etc.</div><div><br></div><div>For coloring by a certain scalar, I think you use the mapper.SelectColorArray() method. Here's a snippet from a clipping routine (in Python, sorry):</div><div><br></div><div><div><div>selectMapper = vtk.vtkPolyDataMapper()</div><div>selectMapper.SetInputConnection(clipper.GetOutputPort())</div><div>selectMapper.SetScalarModeToUsePointFieldData()</div><div>selectMapper.SetColorModeToMapScalars()</div><div>selectMapper.ScalarVisibilityOn()</div><div>selectMapper.SetScalarRange(rt.GetOutputDataObject(0).GetPointData().GetArray('RTData').GetRange())</div><div>selectMapper.SelectColorArray('RTData')</div><div><br></div></div></div><div>(Note that the pointdata.GetScalars() method grabs the "Active" attribute. If the one you want isn't the Active one, grab by name with GetArray() as above.) </div><div><br></div><div>-Eric</div><div><br></div><div><div>
<span class="Apple-style-span" style="font-size: 12px; "><div>------------------------------------------------------</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><span class="Apple-style-span" style="font-size: medium;"><br></span></div></span>
</div>
<br><div><div>On Feb 26, 2010, at 3:56 AM, Sebastian Gatzka wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div bgcolor="white" lang="DE" link="blue" vlink="purple"><div class="Section1"><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; color: black; "><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Hello World.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; color: black; "><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; color: black; "><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">How can I assign different field values like scalars and vectors to a (structured) grid?<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; color: black; "><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Looks to me that only the last data set with ->SetScalar() or ->SetVector() is considered.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; color: black; "><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; color: black; "><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">I want to use different fields for different cuts, contours etc.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; color: black; "><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">How do I tell these actors/mappers which one of the fields should be considered?<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; color: black; "><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 12pt; font-family: 'Times New Roman', serif; color: black; "><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Sebastian<o:p></o:p></span></div></div>_______________________________________________<br>Powered by<span class="Apple-converted-space"> </span><a href="http://www.kitware.com" style="color: blue; text-decoration: underline; ">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<a href="http://www.kitware.com/opensource/opensource.html" style="color: blue; text-decoration: underline; ">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at:<span class="Apple-converted-space"> </span><a href="http://www.vtk.org/Wiki/VTK_FAQ" style="color: blue; text-decoration: underline; ">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" style="color: blue; text-decoration: underline; ">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></div></span></blockquote></div><br></div></body></html>