21 : QListWidget(parent),
23 m_LastSelectedReferenceData(NULL),
24 m_ToolGroupsForFiltering(
"default"),
25 m_DisplayOnlyDerivedNodes(true)
31 QListWidget::setSelectionMode(QListWidget::MultiSelection);
32 QListWidget::setDragDropMode(QListWidget::InternalMove);
85 previouslySelectedNodes = selection;
87 if (selection.size() > 0)
127 QListWidget::clear();
132 for (mitk::ToolManager::DataVectorType::const_iterator objectIter = allObjects.begin();
133 objectIter != allObjects.end();
141 std::string name = node->
GetName();
147 QRgb qrgb = qRgb((
int)(rgb[0] * 255.0), (
int)(rgb[1] * 255.0), (
int)(rgb[2] * 255.0));
149 QPixmap pixmap(25, 18);
150 pixmap.fill(QColor(qrgb));
153 QListWidgetItem *newItem =
new QListWidgetItem();
154 QString qname = QString::fromLocal8Bit(name.c_str());
157 newItem->setText(qname);
158 newItem->setIcon(QIcon(pixmap));
160 this->addItem(newItem);
162 m_Node.insert(std::make_pair(newItem, node));
171 QList<QListWidgetItem *> items;
172 for (
int j = 0; j < this->count(); j++)
174 if (this->item(j)->isSelected())
175 items.append(this->item(j));
178 for (
int i = 0; i < items.size(); ++i)
180 QListWidgetItem *item = items.at(i);
183 ItemNodeMapType::iterator it =
m_Node.find(item);
188 result.push_back(node);
198 QListWidgetItem *item = QListWidget::selectedItems().first();
201 ItemNodeMapType::iterator iter =
m_Node.find(item);
227 std::vector<mitk::NodePredicateBase::ConstPointer> m_Predicates;
229 bool rebuildNeeded =
true;
232 m_Predicates.clear();
236 for (mitk::ToolManager::ToolVectorTypeConst::const_iterator iter = allTools.begin(); iter != allTools.end(); ++iter)
244 if (completePredicate.IsNotNull())
246 m_Predicates.push_back(
249 completePredicate = m_Predicates.back();
268 if (onlyDerivedFromOriginal)
273 allObjects = dataStorage->
GetDerivations(sourceNode, completePredicate,
false);
282 if (completePredicate)
284 allObjects = dataStorage->
GetSubset(completePredicate);
288 allObjects = dataStorage->
GetAll();
292 m_Predicates.clear();
293 completePredicate = NULL;
297 for (mitk::DataStorage::SetOfObjects::const_iterator objectIter = allObjects->begin();
298 objectIter != allObjects->end();
302 resultVector.push_back(node);
Data management class that handles 'was created by' relations.
virtual SetOfObjects::ConstPointer GetDerivations(const mitk::DataNode *node, const NodePredicateBase *condition=nullptr, bool onlyDirectDerivations=true) const =0
returns a set of derived objects for a given node.
bool GetName(std::string &nodeName, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="name") const
Convenience access method for accessing the name of an object (instance of StringProperty with proper...
itk::SmartPointer< const Self > ConstPointer
virtual SetOfObjects::ConstPointer GetAll() const =0
returns a set of all data objects that are stored in the data storage
SetOfObjects::ConstPointer GetSubset(const NodePredicateBase *condition) const
returns a set of data objects that meet the given condition(s)
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
Class for nodes of the DataTree.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.