fw4spl
IBuilder.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "fwActivities/IBuilder.hpp"
8 
9 #include <fwData/Vector.hpp>
10 
11 namespace fwActivities
12 {
13 
14 //------------------------------------------------------------------------------
15 
16 ::fwData::Vector::sptr IBuilder::getType( const ::fwData::Vector::csptr& currentSelection,
17  const std::string& type ) const
18 {
19  SLM_ASSERT("currentSelection not instanced", currentSelection);
20 
21  ::fwData::Vector::sptr subSelection = ::fwData::Vector::New();
22  for(::fwData::Vector::value_type obj : *currentSelection)
23  {
24  OSLM_ASSERT("Object not instanced in selection", obj);
25  if(obj->isA(type))
26  {
27  subSelection->getContainer().push_back(obj);
28  }
29  }
30  return subSelection;
31 }
32 
33 //------------------------------------------------------------------------------
34 
35 } // namespace fwActivities
#define OSLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:310
ContainerType::value_type value_type
#define SLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:308
Namespace containing activities data and builder.