Mercurial > hg > orthanc-stone
diff OrthancStone/Sources/Toolbox/OsiriX/CollectionOfAnnotations.h @ 1593:b782f78aed42
rendering osirix annotations
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 23 Oct 2020 17:39:16 +0200 |
parents | bd180f97c734 |
children | 4fb8fdf03314 |
line wrap: on
line diff
--- a/OrthancStone/Sources/Toolbox/OsiriX/CollectionOfAnnotations.h Fri Oct 23 15:15:32 2020 +0200 +++ b/OrthancStone/Sources/Toolbox/OsiriX/CollectionOfAnnotations.h Fri Oct 23 17:39:16 2020 +0200 @@ -23,6 +23,7 @@ #include "Annotation.h" +#include <set> #include <vector> namespace OrthancStone @@ -32,11 +33,19 @@ class CollectionOfAnnotations : public boost::noncopyable { private: + typedef std::map<std::string, std::set<size_t> > SopInstanceUidIndex; + std::vector<Annotation*> annotations_; + SopInstanceUidIndex index_; public: - ~CollectionOfAnnotations(); + ~CollectionOfAnnotations() + { + Clear(); + } + void Clear(); + size_t GetSize() const { return annotations_.size(); @@ -46,8 +55,17 @@ void AddAnnotation(Annotation* annotation); // takes ownership - // Parse an XML from OsiriX - void ParseXml(const std::string& xml); + void LookupSopInstanceUid(std::set<size_t>& target, + const std::string& sopInstanceUid) const; + + // Load an XML from OsiriX + void LoadXml(const char* xml, + size_t size); + + void LoadXml(const std::string& xml) + { + LoadXml(xml.empty() ? NULL : xml.c_str(), xml.size()); + } }; } }