Hi Horst,
I just checked the behaviour with a small test application. It turns out
that calling Modified() on the VTK polydata instance and requesting a
render window update is enough:
vtkPolyData* pd = this->m_Surface->GetVtkPolyData();
for (int i = 0; i < pd->GetNumberOfPoints(); i += 2)
{
double* pt = pd->GetPoint(i);
pt[0] *= 1.2;
pt[1] *= 1.2;
pt[2] *= 1.2;
std::cout << "Changing point " << i << " to " << pt[0] << ", " << pt[1] <<
", " << pt[2] << "]\n";
pd->GetPoints()->SetPoint(i, pt);
}
pd->Modified();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
Best,
Sascha
On 01/24/2013 09:35 AM, Fetzer, Andreas wrote:
> Hi Horst,
>
> you don't have to create a new surface. Rendering updates in MITK can be
> invoked via:
>
> mitk::RenderingManager::GetInstance()->RequestUpdateAll();
>
> All you have to do is to update the data which is held by the DataNode (or in
> your case the PolyData).
>
> Regards
> Andreas
>
> On 24.01.2013, at 09:19, <[email protected]> wrote:
>
>> Hi,
>>
>> after modifying the data of a surface node, I looked for a possibility
>> to update the mapper to render the manipulated data. When using pure VTK
>> this is possible with the following statements:
>>
>> pMapper->Modified();
>> pMapper->Update();
>>
>> But I can't find something similar in MITK. Isn't there really no
>> mechanism to update the mapper of a node? Is it really necessary to
>> create a new surface object like this?
>>
>> // get surface data
>> mitk::Surface* pSurface =
>> dynamic_cast<mitk::Surface*>(pNode->GetData());
>> vtkPolyData* pData = pSurface->GetVtkPolyData();
>> vtkPoints* pPoints = pData->GetPoints();
>>
>> // manipulate data
>>
>> // create new surface to render manipulated data
>> mitk::Surface::Pointer pNewSurface = mitk::Surface::New();
>> pNewSurface->SetVtkPolyData(pData);
>> pNode->SetData(pNewSurface);
>>
>> Thanks.
>> Horst
>>
>> ------------------------------------------------------------------------------
>> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
>> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>> MVPs and experts. ON SALE this month only -- learn more at:
>> http://p.sf.net/sfu/learnnow-d2d
>> _______________________________________________
>> mitk-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnnow-d2d
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users