Hi, the following code should work:
mitk::PaintbrushTool* paintBrushTool = dynamic_cast<mitk::PaintbrushTool*>( m_Controls->m_ManualToolSelectionBox->GetToolManager()->GetToolById(12)); paintBrushTool->SetSize(10); Best Andreas From: Hortense KIRISLI [mailto:[email protected]] Sent: Montag, 23. September 2013 09:58 To: Fetzer, Andreas; [email protected] Subject: RE: How to set an initial value of paint brush? Hi Andreas, Thank you for your answer. I am not in favor if "hard" change of the brush size value, as I am working within a project with multiple partners and thus have different MITK repositories. I would rather change it dynamically. In my *.cpp plugin code, when doing initializations, I do activate the paint brush: m_Controls->m_ManualToolSelectionBox->GetToolManager()->ActivateTool(12); I would like then to set the size, using something like: mitk::PaintbrushTool* paintBrushTool = m_Controls->m_ManualToolSelectionBox->???? paintBrushTool->SetSize(20); But I don't understand what should be put instead of the ???. Best, Hortense ---- Hortense KIRISLI, PhD Marie Curie Experienced Researcher for the SUMMER project AQUILAB Parc Eurasanté - Lille Métropole Bâtiment Hermès 250 rue Salvador Allende 59120 Loos Les Lille - France Tel. +33 3 69 61 51 65 www.aquilab.com<http://www.aquilab.com> [cid:[email protected]] ---- De : Fetzer, Andreas [mailto:[email protected]] Envoyé : lundi 23 septembre 2013 08:49 À : Hortense KIRISLI; [email protected] Objet : RE: How to set an initial value of paint brush? Hi Hortense, I assume you are talking about the paintbrush size? One way would be to simply change the value in the mitkPaintbrushTool.cpp You can either directly change the m_Size variable or call SetSize(int) when the tool is activated. If you want to change it dynamically you can listens to the ActiveToolChanged event of the toolmanager e.g. in you plugin. You can check whether the painttool is active and then set the brush size accordingly. Regards Andreas From: Hortense KIRISLI [mailto:[email protected]] Sent: Freitag, 20. September 2013 17:54 To: [email protected]<mailto:[email protected]> Subject: [mitk-users] How to set an initial value of paint brush? Hi all, In a plugin, I have a QmitkToolSelectionBox, with paint tool enabled (and some others). What I would like to do is to set the default value of the brush; it is now set to 1 and is too small. Instead of always changing it before drawing, I would like to set it by default to some higher value. It might be trivial, but I am having some issue figuring out how to do that, so any help is welcome :) Wishing a great weekend to everyone! Best, Hortense ---- Hortense KIRISLI, PhD Marie Curie Experienced Researcher for the SUMMER project AQUILAB Parc Eurasanté - Lille Métropole Bâtiment Hermès 250 rue Salvador Allende 59120 Loos Les Lille - France Tel. +33 3 69 61 51 65 www.aquilab.com<http://www.aquilab.com> [cid:[email protected]] ----
<<inline: image001.jpg>>
------------------------------------------------------------------------------ LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
