Hi, I made the segmetation algorithm, that i implemented outside vtk and I would like make vtkPolyDataAlgorithm from it. <div>My class uses class variables to store intermediate results, such as labels for points , also relative depth that depends on input and others.</div>
<div><div><br></div><div>I want store intermediate results, because I want structure code (as I have outside vtk) and I would like give user the possibility continue in segmentation.</div></div><div>But I do not know how to use those variables in vtk way and restore state of those variables to constructor state if the input change.</div>
<div><br></div><div>Lot of vtk algorithms that I saw, have all logic inside RequestData and they do not store nor pointer to input, nor intermediate results (except for example vtkOBBDicer that uses KdTree that is deleted at the end of RequestData immediately). Class variables are mostly use as &#39;algorithm characteristic&#39; and they are independent from input. </div>
<div><br></div><div>What is correct implementation of vtk algorithm with internal state dependent to input ?</div><div>When I should clear data ? How I can detect that input changed (I store pointer to input and compared it, but it is vtk way ?).</div>
<div>What could be correct way to update input dependent variables when input change ?</div><div><br></div><div>Is there any class that could serve as inspiration ?</div><div>Thanks in advance. </div><div>Jana</div>