Hi Daniel,

Thanks for your reply!

Best regards
Bryn



Daniel Maleike wrote:
> On 06/02/2010 04:55 PM, Bryn Lloyd wrote:
>> Is there a way that I can (re-)use the ToolManager in my own plugin to 
>> store a different set or subset of tools?
>>
>>
>> I see the list of tools is populated by this line:
>>
>> std::list<itk::LightObject::Pointer> thingsThatClaimToBeATool = 
>> itk::ObjectFactoryBase::CreateAllInstance("mitkTool");
>>
> 
> 
> Hi Bryn,
> 
> sorry I missed your post. I hope this answer is not too late for you:
> 
> What you could do is this:
> 
> - create your tools similar to the ones in Modules/MitkExt/Interaction
> - use the same macros to create and register ITK factories that know
>   how to instantiate your new tools
> - in your application, define the set of used tools by using
>   QmitkToolSelectionBox::SetDisplayedToolGroups(...), e.g. as in
> 
> 
> Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp,
> l. 619:
> 
> m_Controls->m_ManualToolSelectionBox->SetDisplayedToolGroups("Add
> Subtract Paint Wipe 'Region Growing' Correction Fill Erase");
> 
> This will restrict the set of tools that are displayed by the button group.
> 
> The advantage of using a factory instead of writing up the tools
> manually can be seen in the lines following line 619 in the segmentation
> view. A number of closed source tools are mentioned there. If they are
> compiled in, they'll appear, if not, it doesn't break your application.
> 
> If you inspect the code that is used to restrict the visible tools,
> you'll notice that you could also define "group" names for your tools,
> e.g. you could define all your tools to be in the "BrynLloyd" group and
> display only this group -- this way you do not need to mention each tool
> specifically.
> 
> Regards,
> Daniel Maleike
> 
> 


-- 
-------------------------------------------------
Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7, ETF C110
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 26668
Fax: +41 44 63 21199
-------------------------------------------------

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to