Hi Nils,

surfaces can't handle RotationOperations. You have to execute the operation on 
the surface's geometry, since geometry hold the information about orientation 
and position of DataTypes in space:

surface->GetGeometry()->ExecuteOperation(op);

For further information about geometries you can take a look at the following 
page:

http://docs.mitk.org/nightly-qt4/GeometryOverviewPage.html

Regards
Andreas


Andreas Fetzer

Dipl.-Inform. Med. Andreas Fetzer
Deutsches Krebsforschungszentrum  (German Cancer Research Center)
Div. Medical & Biological Informatics (E130)  Phone: (+49) 6221-42 2329
Im Neuenheimer Feld 280                               Fax: (+49) 6221-42 2345
D-69120 Heidelberg                                        eMail: 
[email protected]<mailto:[email protected]>

On 20.12.2011, at 15:43, Ritter, Nils wrote:

Hello mitk-users,

I try to rotate some objects that are stored in the data storage but I can’t 
get it to work.
Here is some code:

mitk::Surface::Pointer surface = dynamic_cast<mitk::Surface*>(node->GetData());
mitk::Point3D newCenter;
newCenter[0] = 0.0; newCenter[1] = 0.0; newCenter[2] = 0.0;
mitk::Vector3D rotationAxis;
rotationAxis[0] = 0.0; rotationAxis[1] = 20.0; rotationAxis[2] = 0.0;
mitk::RotationOperation *op = new mitk::RotationOperation(mitk::OpROTATE, 
newCenter, rotationAxis, 90.0);
surface->ExecuteOperation(op);
delete op;
surface->Update();
node->Modified();

mitk::RenderingManager::GetInstance()->RequestUpdateAll();

>From what I can tell (from what I read in older mitk_users questions) this 
>should rotate the object 90 degrees around the y-axis. I also tried to set a 
>vtkMatrix4x4 with SetIndexToWorldTransformByVtkMatrix with weird results.

Could someone point me in the direction to get to rotation working?

Thanks in advance.

-Nils



--
Nils Ritter
Research Associate | Working Group – TIMMS

Universität Leipzig | Faculty of Medicine
Innovation Center Computer Assisted Surgery (ICCAS)
Semmelweisstr. 14
D - 04103 Leipzig
Germany

phone  +49 (0) 341 97 – 12016
fax         +49 (0) 341 97 – 12009
[email protected]<mailto:[email protected]>
www.iccas.de/iccas/people/personal_pages/ritter.html<http://www.iccas.de/iccas/people/personal_pages/ritter.html>

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. 
appdeveloper.intel.com/join<http://appdeveloper.intel.com/join>
http://p.sf.net/sfu/intel-appdev_______________________________________________
mitk-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/mitk-users


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to