<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; margin: 0px; line-height: auto;">Hello, </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; margin: 0px; line-height: auto;">At the moment I have some code that reads like this:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; margin: 0px; line-height: auto;"><div id="bloop_customfont" style="margin: 0px;"> m_H->SetNumberOfValues(nPoints);</div><div id="bloop_customfont" style="margin: 0px;"> m_G->SetNumberOfValues(nPoints);</div><div id="bloop_customfont" style="margin: 0px;"> m_C->SetNumberOfValues(nPoints);</div><div id="bloop_customfont" style="margin: 0px;"> m_SI->SetNumberOfValues(nPoints);</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;"> for ( auto p : this->IterateOver<Point>() ) {</div><div id="bloop_customfont" style="margin: 0px;"> auto curvatures = p.HG();</div><div id="bloop_customfont" style="margin: 0px;"> m_H->SetValue(p.Id(), curvatures.H);</div><div id="bloop_customfont" style="margin: 0px;"> m_G->SetValue(p.Id(), curvatures.G);</div><div id="bloop_customfont" style="margin: 0px;"> m_C->SetValue(p.Id(), curvatures.C);</div><div id="bloop_customfont" style="margin: 0px;"> m_SI->SetValue(p.Id(), curvatures.SI);</div><div id="bloop_customfont" style="margin: 0px;"> }</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;"> m_polyPtr->GetPointData()->AddArray(m_H);</div><div id="bloop_customfont" style="margin: 0px;"> m_polyPtr->GetPointData()->AddArray(m_G);</div><div id="bloop_customfont" style="margin: 0px;"> m_polyPtr->GetPointData()->AddArray(m_C);</div><div id="bloop_customfont" style="margin: 0px;"> m_polyPtr->GetPointData()->AddArray(m_SI);</div><div><br></div><div>Where m_polyPtr is a vtkPolyData* and the return type of p.HG() is:</div><div><div> </div><div> struct Curvatures</div><div> {</div><div> double G; /**< Gauss Curvature */</div><div> double H; /**< Mean Curvature */</div><div> double C; /**< Curvedness */</div><div> double SI; /**< Shape Index */</div><div> };</div></div><div><br></div><div>Now I’m facing a problem where I need to add fields to the structure “Curvatures” and so I need to change code in three different classes. </div><div>Is there a way to create a vtkArray whose (templated?) valueType is `Curvatures` such that I can just modify that struct to allow more fields to be stored and set in a “more abstract way” and that can be appended to the `PointData` of the vtkPolyData in a transparent way?</div><div><br></div><div>Any suggestion is appreciated! </div><div><br></div><div>:)</div><div><br></div></div></div></div><br><div class="bloop_sign" id="bloop_sign_1538297062278425088">
<title></title>
<pre> _
-. .´ |∞∞∞∞
', ; |∞∞∞∞∞∞
˜˜ |∞∞∞∞∞∞∞∞∞ RdB
,., |∞∞∞∞∞∞
.' '. |∞∞∞∞
-' `’
https://rdb.is
</pre>
</div></body></html>