diff --git a/Grinder/Grinder.pro b/Grinder/Grinder.pro index db132fe80dfc924c4af04ad45df6caf609c34391..baf24b715e8c24812964f6d6e50bef3e4df516b9 100644 --- a/Grinder/Grinder.pro +++ b/Grinder/Grinder.pro @@ -172,7 +172,7 @@ SOURCES += \ ui/image/ImageEditorToolList.cpp \ ui/image/draftitems/BoxDraftItemNode.cpp \ ui/image/draftitems/LineDraftItemNode.cpp \ - ui/image/ImageEditorPropertyWidget.cpp \ + ui/image/ImageEditorPropertyWidget.cpp \ ui/properties/editors/PointPropertyEditor.cpp \ ui/properties/editors/SizePropertyEditor.cpp \ ui/widgets/AutoFocusLineEdit.cpp \ @@ -207,13 +207,13 @@ SOURCES += \ ui/widgets/BaseListWidget.cpp \ ui/image/BaseImageTagsListWidget.cpp \ image/ImageTags.cpp \ - image/ImageTagsProperty.cpp \ + image/properties/ImageTagsProperty.cpp \ ui/image/ImageTagsDialog.cpp \ ui/properties/editors/ImageTagsPropertyEditor.cpp \ ui/image/EditableImageTagsListWidget.cpp \ ui/image/ImageTagsListWidget.cpp \ image/ImageTagsAllotment.cpp \ - image/ImageTagsAllotmentProperty.cpp \ + image/properties/ImageTagsAllotmentProperty.cpp \ ui/properties/editors/ImageTagsAllotmentPropertyEditor.cpp \ ui/DragInfo.cpp @@ -402,7 +402,7 @@ HEADERS += \ ui/image/ImageEditorToolList.impl.h \ ui/image/draftitems/BoxDraftItemNode.h \ ui/image/draftitems/LineDraftItemNode.h \ - ui/image/ImageEditorPropertyWidget.h \ + ui/image/ImageEditorPropertyWidget.h \ ui/properties/editors/DualTextPropertyEditor.h \ ui/properties/editors/PointPropertyEditor.h \ ui/properties/editors/DualTextPropertyEditor.impl.h \ @@ -455,13 +455,13 @@ HEADERS += \ ui/image/BaseImageTagsListWidget.h \ pipeline/Block.impl.h \ image/ImageTags.h \ - image/ImageTagsProperty.h \ + image/properties/ImageTagsProperty.h \ ui/image/ImageTagsDialog.h \ ui/properties/editors/ImageTagsPropertyEditor.h \ ui/image/EditableImageTagsListWidget.h \ ui/image/ImageTagsListWidget.h \ image/ImageTagsAllotment.h \ - image/ImageTagsAllotmentProperty.h \ + image/properties/ImageTagsAllotmentProperty.h \ ui/properties/editors/ImageTagsAllotmentPropertyEditor.h \ ui/DragInfo.h diff --git a/Grinder/Version.h b/Grinder/Version.h index 592f0b1d73e364198fe48ecef4443166970e2942..487e9c9d5bf9a2c0463f20e8a4fdab873d0f18b8 100644 --- a/Grinder/Version.h +++ b/Grinder/Version.h @@ -10,14 +10,14 @@ #define GRNDR_INFO_TITLE "Grinder" #define GRNDR_INFO_COPYRIGHT "Copyright (c) WWU Muenster" -#define GRNDR_INFO_DATE "10.05.2018" +#define GRNDR_INFO_DATE "15.05.2018" #define GRNDR_INFO_COMPANY "WWU Muenster" #define GRNDR_INFO_WEBSITE "http://www.uni-muenster.de" #define GRNDR_VERSION_MAJOR 0 -#define GRNDR_VERSION_MINOR 3 +#define GRNDR_VERSION_MINOR 4 #define GRNDR_VERSION_REVISION 0 -#define GRNDR_VERSION_BUILD 160 +#define GRNDR_VERSION_BUILD 161 namespace grndr { diff --git a/Grinder/common/properties/PropertyID.cpp b/Grinder/common/properties/PropertyID.cpp index 8dd58f9ca909867cf49b5278b61d2130edc187ce..eb7981a0554f5b28e6cf80d89a138d56c10c494d 100644 --- a/Grinder/common/properties/PropertyID.cpp +++ b/Grinder/common/properties/PropertyID.cpp @@ -22,6 +22,7 @@ const char* PropertyID::Position = "Position"; const char* PropertyID::EndPosition = "EndPosition"; const char* PropertyID::Size = "Size"; const char* PropertyID::LineWidth = "LineWidth"; +const char* PropertyID::Solid = "Solid"; const char* PropertyID::HasDirection = "HasDirection"; const char* PropertyID::Direction = "Direction"; const char* PropertyID::ImageTagsAllotment = "ImageTagsAllotment"; diff --git a/Grinder/common/properties/PropertyID.h b/Grinder/common/properties/PropertyID.h index fc95e5e8b1edd7a1158401b3a3d28b1255bd9ba7..86e5d3f51564fe724d24ead667450e25c3897990 100644 --- a/Grinder/common/properties/PropertyID.h +++ b/Grinder/common/properties/PropertyID.h @@ -29,6 +29,7 @@ namespace grndr static const char* EndPosition; static const char* Size; static const char* LineWidth; + static const char* Solid; static const char* HasDirection; static const char* Direction; static const char* ImageTagsAllotment; diff --git a/Grinder/controller/ImageEditorController.cpp b/Grinder/controller/ImageEditorController.cpp index 14ec15d5402c7675ffdc818797ad04dd5054e4de..e809f1894df51a66cc6371074cdaf3b9a19535e6 100644 --- a/Grinder/controller/ImageEditorController.cpp +++ b/Grinder/controller/ImageEditorController.cpp @@ -411,10 +411,10 @@ void ImageEditorController::assignImageTags(ImageTagsAllotmentProperty* imageTag void ImageEditorController::assignImageTags(ImageTagsAllotmentProperty* imageTagsAllotment, const std::set<ImageTag*>& imageTags, bool clearFirst) const { if (clearFirst) - imageTagsAllotment->object().unassignAllTags(); + imageTagsAllotment->object().unallotAllTags(); for (auto imageTag : imageTags) - imageTagsAllotment->object().assignTag(imageTag); + imageTagsAllotment->object().allotTag(imageTag); } void ImageEditorController::controllerFunctionCalled() const diff --git a/Grinder/image/DraftItem.h b/Grinder/image/DraftItem.h index bab02d25eda8acd50d7926c339307dc1038eac30..214593e8c36e505f154f471170732acbed013a5d 100644 --- a/Grinder/image/DraftItem.h +++ b/Grinder/image/DraftItem.h @@ -9,7 +9,7 @@ #include "common/properties/PropertyObject.h" #include "DraftItemType.h" #include "DraftItemRendererBase.h" -#include "ImageTagsAllotmentProperty.h" +#include "properties/ImageTagsAllotmentProperty.h" namespace grndr { diff --git a/Grinder/image/DraftItemRenderer.impl.h b/Grinder/image/DraftItemRenderer.impl.h index 088eeba69d2b57a42a16f5ec5143c8cdf2b75836..a876651bb9aaee72e9a0d2fb16a82fb1752554ff 100644 --- a/Grinder/image/DraftItemRenderer.impl.h +++ b/Grinder/image/DraftItemRenderer.impl.h @@ -118,7 +118,7 @@ void DraftItemRenderer<ItemType>::renderImageTags(QPainter* painter, QPoint cent { painter->save(); - if (!_draftItem->imageTagsAllotment()->object().assignedTags().empty()) + if (!_draftItem->imageTagsAllotment()->object().allottedTags().empty()) { painter->setRenderHints(QPainter::Antialiasing|QPainter::TextAntialiasing|QPainter::HighQualityAntialiasing|QPainter::SmoothPixmapTransform); painter->setOpacity(_rendererStyle.imageTagsOpacity); @@ -134,7 +134,7 @@ void DraftItemRenderer<ItemType>::renderImageTags(QPainter* painter, QPoint cent painter->drawLine(centerPos, labelPos); // Draw each image tag - for (const auto& imageTag : _draftItem->imageTagsAllotment()->object().assignedTags()) + for (const auto& imageTag : _draftItem->imageTagsAllotment()->object().allottedTags()) { QRectF fontRect = fontMetrics.boundingRect(imageTag->getName()) + _rendererStyle.imageTagsLabelMargin; fontRect.moveCenter(labelPos); diff --git a/Grinder/image/ImageBuild.cpp b/Grinder/image/ImageBuild.cpp index d2a1dd23e71a81c4c95d7a8e9f07c62bb27df590..ff31fc4ad5f37770c54f66d5fb0dc279e161dcca 100644 --- a/Grinder/image/ImageBuild.cpp +++ b/Grinder/image/ImageBuild.cpp @@ -7,9 +7,9 @@ #include "ImageBuild.h" #include "ImageExceptions.h" #include "pipeline/Block.h" -#include "image/ImageTagsProperty.h" +#include "properties/ImageTagsProperty.h" -const char* ImageBuild::Serialization_Value_ImageReferences = "ImageReference"; // Not called ImageReferences due to backwards compatibility +const char* ImageBuild::Serialization_Value_ImageReferences = "ImageReferences"; ImageBuild::ImageBuild(const Block* block, const std::vector<const ImageReference*>& imageReferences) : _block{block}, _imageReferences{imageReferences}, _layers{this} diff --git a/Grinder/image/ImageBuild.h b/Grinder/image/ImageBuild.h index 9c6616856ba8fc92d5c31609fb9ab955e01948e6..1f043148c0954c17268aedc336dae7fb777c38f5 100644 --- a/Grinder/image/ImageBuild.h +++ b/Grinder/image/ImageBuild.h @@ -10,7 +10,7 @@ #include "common/properties/PropertyObject.h" #include "LayerVector.h" -#include "ImageTagsAllotmentProperty.h" +#include "properties/ImageTagsAllotmentProperty.h" namespace grndr { diff --git a/Grinder/image/ImageTagsAllotment.cpp b/Grinder/image/ImageTagsAllotment.cpp index 5ae818816a07465239a77fb360d251b5cb95546d..517771cc6ac1219ed71392f4f6ce780bd31d625e 100644 --- a/Grinder/image/ImageTagsAllotment.cpp +++ b/Grinder/image/ImageTagsAllotment.cpp @@ -8,16 +8,16 @@ #include "ImageTags.h" #include "image/ImageBuild.h" -const char* ImageTagsAllotment::Serialization_Value_AssignedTags = "AssignedTags"; +const char* ImageTagsAllotment::Serialization_Value_AllottedTags = "AllottedTags"; ImageTagsAllotment& ImageTagsAllotment::operator =(const ImageTagsAllotment& imageTagsAllotment) { - unassignAllTags(); + unallotAllTags(); - // Only copy the assigned tags if both allotments use the same input image tags + // Only copy the alloted tags if both allotments use the same input image tags if (_inputImageTags == imageTagsAllotment._inputImageTags) { - _assignedTags = imageTagsAllotment._assignedTags; + _allottedTags = imageTagsAllotment._allottedTags; emit allotmentChanged(); } @@ -38,52 +38,43 @@ void ImageTagsAllotment::setImageBuild(const ImageBuild* imageBuild) connect(_imageBuild, &ImageBuild::inputImageTagsChanged, this, &ImageTagsAllotment::inputImageTagsChanged); } -void ImageTagsAllotment::assignTag(ImageTag* imageTag) +void ImageTagsAllotment::allotTag(ImageTag* imageTag) { if (_inputImageTags && _inputImageTags->tags().contains(imageTag)) { - _assignedTags.emplace(imageTag); + _allottedTags.emplace(imageTag); emit allotmentChanged(); } } -void ImageTagsAllotment::unassignTag(ImageTag* imageTag) +void ImageTagsAllotment::unallotTag(ImageTag* imageTag) { - _assignedTags.erase(imageTag); + _allottedTags.erase(imageTag); emit allotmentChanged(); } -std::vector<ImageTag*> ImageTagsAllotment::assignedTags() const -{ - std::vector<ImageTag*> imageTags{_assignedTags.cbegin(), _assignedTags.cend()}; - - // Sort the image tags by name - std::sort(imageTags.begin(), imageTags.end(), [](const ImageTag* imageTag1, const ImageTag* imageTag2) { return imageTag1->getName() < imageTag2->getName(); }); - return imageTags; -} - void ImageTagsAllotment::serialize(SerializationContext& ctx) const { - // Store the names of all assigned image tags; since tag names must be unique, this can be used to identify each tag - QStringList assignedTags; + // Store the names of all alloted image tags; since tag names must be unique, this can be used to identify each tag + QStringList allottedTags; - for (const auto& imageTag : _assignedTags) - assignedTags << imageTag->getName(); + for (const auto& imageTag : _allottedTags) + allottedTags << imageTag->getName(); - ctx.settings()[Serialization_Value_AssignedTags] = assignedTags.join(","); + ctx.settings()[Serialization_Value_AllottedTags] = allottedTags.join(","); } void ImageTagsAllotment::deserialize(DeserializationContext& ctx) { - unassignAllTags(); + unallotAllTags(); if (_inputImageTags) { // Search for each tag name in the current input image tags - for (auto tagName : ctx.settings()[Serialization_Value_AssignedTags].toString().split(",")) + for (auto tagName : ctx.settings()[Serialization_Value_AllottedTags].toString().split(",")) { if (auto imageTag = _inputImageTags->tags().selectByName(tagName)) - assignTag(imageTag.get()); + allotTag(imageTag.get()); } } } @@ -96,8 +87,8 @@ void ImageTagsAllotment::setInputImageTags(const ImageTags* imageTags) if (_inputImageTags) disconnect(_inputImageTags, nullptr, this, nullptr); - // The input image tags have changed, so clear any assigned tags - unassignAllTags(); + // The input image tags have changed, so clear any alloted tags + unallotAllTags(); _inputImageTags = imageTags; @@ -111,5 +102,5 @@ void ImageTagsAllotment::setInputImageTags(const ImageTags* imageTags) void ImageTagsAllotment::imageTagRemoved(const std::shared_ptr<ImageTag>& imageTag) { - unassignTag(imageTag.get()); + unallotTag(imageTag.get()); } diff --git a/Grinder/image/ImageTagsAllotment.h b/Grinder/image/ImageTagsAllotment.h index cd11a825836bccc68615998a4dcd95a601b08109..b1fed4d96d9688c4d0e08fcfe1a3f512ef705292 100644 --- a/Grinder/image/ImageTagsAllotment.h +++ b/Grinder/image/ImageTagsAllotment.h @@ -8,13 +8,13 @@ #include <set> +#include "ImageTag.h" #include "common/serialization/SerializationContext.h" #include "common/serialization/DeserializationContext.h" namespace grndr { class ImageBuild; - class ImageTag; class ImageTags; class ImageTagsAllotment : public QObject @@ -22,7 +22,7 @@ namespace grndr Q_OBJECT public: - static const char* Serialization_Value_AssignedTags; + static const char* Serialization_Value_AllottedTags; public: ImageTagsAllotment& operator =(const ImageTagsAllotment& imageTagsAllotment); @@ -34,11 +34,11 @@ namespace grndr const ImageTags* inputImageTags() const { return _inputImageTags; } public: - void assignTag(ImageTag* imageTag); - void unassignTag(ImageTag* imageTag); - void unassignAllTags() { _assignedTags.clear(); emit allotmentChanged(); } + void allotTag(ImageTag* imageTag); + void unallotTag(ImageTag* imageTag); + void unallotAllTags() { _allottedTags.clear(); emit allotmentChanged(); } - std::vector<ImageTag*> assignedTags() const; + auto allottedTags() const { return _allottedTags; } public: void serialize(SerializationContext& ctx) const; @@ -57,11 +57,19 @@ namespace grndr void imageTagModified(const std::shared_ptr<ImageTag>& imageTag) { Q_UNUSED(imageTag); emit allotmentModified(); } void imageTagRemoved(const std::shared_ptr<ImageTag>& imageTag); - private: + private: + struct ImageTagPtrCompare + { + bool operator ()(const ImageTag* lhs, const ImageTag* rhs) const + { + return lhs->getName() < rhs->getName(); + } + }; + const ImageBuild* _imageBuild{nullptr}; const ImageTags* _inputImageTags{nullptr}; - std::set<ImageTag*> _assignedTags; + std::set<ImageTag*, ImageTagPtrCompare> _allottedTags; }; } diff --git a/Grinder/image/draftitems/BoxDraftItem.cpp b/Grinder/image/draftitems/BoxDraftItem.cpp index dde2b2a78992c329a9bd851b6bb8090cff28895a..df1f7427c6a9d169df8411d46dd8104c40b8764e 100644 --- a/Grinder/image/draftitems/BoxDraftItem.cpp +++ b/Grinder/image/draftitems/BoxDraftItem.cpp @@ -31,6 +31,9 @@ void BoxDraftItem::createProperties() lineWidth()->createConstraint<RangeConstraint>(1, 100); lineWidth()->setDescription("The width of the box lines."); + _solidBox = createProperty<BoolProperty>(PropertyID::Solid, "Solid box", false); + solidBox()->setDescription("Fill the entire box."); + // Override some property defaults hasDirection()->setValue(true); } diff --git a/Grinder/image/draftitems/BoxDraftItem.h b/Grinder/image/draftitems/BoxDraftItem.h index ce4f4d0929b0aaa5301bb89dc0b9f3553b32f8c1..da2b24779b48188b67a3c9cc8454215f3ba50438 100644 --- a/Grinder/image/draftitems/BoxDraftItem.h +++ b/Grinder/image/draftitems/BoxDraftItem.h @@ -28,6 +28,8 @@ namespace grndr auto boxSize() const { return dynamic_cast<SizeProperty*>(_boxSize.get()); } auto lineWidth() { return dynamic_cast<UIntProperty*>(_lineWidth.get()); } auto lineWidth() const { return dynamic_cast<UIntProperty*>(_lineWidth.get()); } + auto solidBox() { return dynamic_cast<BoolProperty*>(_solidBox.get()); } + auto solidBox() const { return dynamic_cast<BoolProperty*>(_solidBox.get()); } public: virtual void setDragPropertyValues(QPoint initialPos, QPoint currentPos) override; @@ -39,7 +41,8 @@ namespace grndr private: std::shared_ptr<PropertyBase> _boxSize; - std::shared_ptr<PropertyBase> _lineWidth; + std::shared_ptr<PropertyBase> _lineWidth; + std::shared_ptr<PropertyBase> _solidBox; }; } diff --git a/Grinder/image/draftitems/BoxDraftItemRenderer.cpp b/Grinder/image/draftitems/BoxDraftItemRenderer.cpp index 89166b7d1bb1feba2d630620628a4f7bf0f2fa18..d5d77959d77ce2b7c6f24b0fd65ae44f78ae21e0 100644 --- a/Grinder/image/draftitems/BoxDraftItemRenderer.cpp +++ b/Grinder/image/draftitems/BoxDraftItemRenderer.cpp @@ -27,6 +27,9 @@ void BoxDraftItemRenderer::render(QPainter* painter, RenderMode mode, RenderFlag painter->setPen(createStandardPen(*_draftItem->lineWidth())); painter->drawRect(rect); + if (*_draftItem->solidBox()) + painter->fillRect(rect, *_draftItem->primaryColor()); + // Draw the image tags associated with this item if (flags.testFlag(RenderFlag::Selected) || flags.testFlag(RenderFlag::ShowTags)) renderImageTags(painter, rect.center(), rect); diff --git a/Grinder/image/ImageTagsAllotmentProperty.cpp b/Grinder/image/properties/ImageTagsAllotmentProperty.cpp similarity index 94% rename from Grinder/image/ImageTagsAllotmentProperty.cpp rename to Grinder/image/properties/ImageTagsAllotmentProperty.cpp index 196cf8e4db5271eab2cde1c9f4d4e350f262ebee..15b7638536a43f116d803792563ae4968a0a083f 100644 --- a/Grinder/image/ImageTagsAllotmentProperty.cpp +++ b/Grinder/image/properties/ImageTagsAllotmentProperty.cpp @@ -25,7 +25,7 @@ QString ImageTagsAllotmentProperty::toString() const { QStringList tagNames; - for (const auto& imageTag : _object.assignedTags()) + for (const auto& imageTag : _object.allottedTags()) tagNames << imageTag->getName(); if (!tagNames.isEmpty()) diff --git a/Grinder/image/ImageTagsAllotmentProperty.h b/Grinder/image/properties/ImageTagsAllotmentProperty.h similarity index 100% rename from Grinder/image/ImageTagsAllotmentProperty.h rename to Grinder/image/properties/ImageTagsAllotmentProperty.h diff --git a/Grinder/image/ImageTagsProperty.cpp b/Grinder/image/properties/ImageTagsProperty.cpp similarity index 100% rename from Grinder/image/ImageTagsProperty.cpp rename to Grinder/image/properties/ImageTagsProperty.cpp diff --git a/Grinder/image/ImageTagsProperty.h b/Grinder/image/properties/ImageTagsProperty.h similarity index 100% rename from Grinder/image/ImageTagsProperty.h rename to Grinder/image/properties/ImageTagsProperty.h diff --git a/Grinder/pipeline/blocks/ImageTagsBlock.h b/Grinder/pipeline/blocks/ImageTagsBlock.h index 67975b1b72e362dc059fd64847b880262749767c..bbea7a224c75308ffbb16adcba82cdb4bf9dd597 100644 --- a/Grinder/pipeline/blocks/ImageTagsBlock.h +++ b/Grinder/pipeline/blocks/ImageTagsBlock.h @@ -7,7 +7,7 @@ #define IMAGETAGSBLOCK_H #include "pipeline/Block.h" -#include "image/ImageTagsProperty.h" +#include "image/properties/ImageTagsProperty.h" namespace grndr { diff --git a/Grinder/ui/image/DraftItemNode.cpp b/Grinder/ui/image/DraftItemNode.cpp index a9d74614db263f791d6cbe011db32ce830b04188..963878e2d5621c30ae83a51bc795c726a922723b 100644 --- a/Grinder/ui/image/DraftItemNode.cpp +++ b/Grinder/ui/image/DraftItemNode.cpp @@ -107,7 +107,7 @@ void DraftItemNode::updateNode() // Set the item's tool tip to show all assigned image tags QStringList imageTags; - for (const auto& imageTag : draftItem->imageTagsAllotment()->object().assignedTags()) + for (const auto& imageTag : draftItem->imageTagsAllotment()->object().allottedTags()) imageTags << imageTag->getName(); setToolTip(QString{"<b>Tags:</b> %1"}.arg(!imageTags.isEmpty() ? imageTags.join(", ") : "None")); diff --git a/Grinder/ui/image/ImageTagsListWidget.cpp b/Grinder/ui/image/ImageTagsListWidget.cpp index 2ec4af61dfcb15f6f1f418e86173910c0df23d74..652f03eb471eb2d9e99690fae3ea04ee8bb40b0e 100644 --- a/Grinder/ui/image/ImageTagsListWidget.cpp +++ b/Grinder/ui/image/ImageTagsListWidget.cpp @@ -6,7 +6,7 @@ #include "Grinder.h" #include "ImageTagsListWidget.h" #include "pipeline/Block.h" -#include "image/ImageTagsProperty.h" +#include "image/properties/ImageTagsProperty.h" #include "controller/ImageEditorController.h" #include "ui/image/ImageEditor.h" #include "res/Resources.h" diff --git a/Grinder/ui/image/tools/BoxDraftItemTool.cpp b/Grinder/ui/image/tools/BoxDraftItemTool.cpp index 5a0c3efd7af8bb981068a1b14adce44480726b74..991a60281ea332cd1d760dbf519133daddde6a60 100644 --- a/Grinder/ui/image/tools/BoxDraftItemTool.cpp +++ b/Grinder/ui/image/tools/BoxDraftItemTool.cpp @@ -26,6 +26,9 @@ void BoxDraftItemTool::createProperties() lineWidth()->createConstraint<RangeConstraint>(1, 100); lineWidth()->setDescription("The width of the box lines."); + _solidBox = createProperty<BoolProperty>(PropertyID::Solid, "Solid box", false); + solidBox()->setDescription("Fill the entire box."); + // Override some property defaults hasDirection()->setValue(true); } diff --git a/Grinder/ui/image/tools/BoxDraftItemTool.h b/Grinder/ui/image/tools/BoxDraftItemTool.h index 38b528734204be9ba5554ea85a9c32d97901ae9b..0ef142abf9be2e23d098be045ffd5192ded00538 100644 --- a/Grinder/ui/image/tools/BoxDraftItemTool.h +++ b/Grinder/ui/image/tools/BoxDraftItemTool.h @@ -26,6 +26,8 @@ namespace grndr auto boxSize() const { return dynamic_cast<SizeProperty*>(_boxSize.get()); } auto lineWidth() { return dynamic_cast<UIntProperty*>(_lineWidth.get()); } auto lineWidth() const { return dynamic_cast<UIntProperty*>(_lineWidth.get()); } + auto solidBox() { return dynamic_cast<BoolProperty*>(_solidBox.get()); } + auto solidBox() const { return dynamic_cast<BoolProperty*>(_solidBox.get()); } protected: virtual void createProperties() override; @@ -33,6 +35,7 @@ namespace grndr private: std::shared_ptr<PropertyBase> _boxSize; std::shared_ptr<PropertyBase> _lineWidth; + std::shared_ptr<PropertyBase> _solidBox; }; } diff --git a/Grinder/ui/image/tools/DraftItemTool.h b/Grinder/ui/image/tools/DraftItemTool.h index c276d13a1d9ff71879540c26ec11df2012bede36..72caeae98b56aeddd0df03895fbd4fafee6c5234 100644 --- a/Grinder/ui/image/tools/DraftItemTool.h +++ b/Grinder/ui/image/tools/DraftItemTool.h @@ -8,7 +8,7 @@ #include "ui/image/ImageEditorTool.h" #include "image/DraftItemType.h" -#include "image/ImageTagsAllotmentProperty.h" +#include "image/properties/ImageTagsAllotmentProperty.h" namespace grndr { diff --git a/Grinder/ui/properties/editors/ImageTagsAllotmentPropertyEditor.cpp b/Grinder/ui/properties/editors/ImageTagsAllotmentPropertyEditor.cpp index 500485ead9252c08ef6d123ffd2c7377dd0d95e7..33d98acbc45d2569f729f42833895b830a6d178d 100644 --- a/Grinder/ui/properties/editors/ImageTagsAllotmentPropertyEditor.cpp +++ b/Grinder/ui/properties/editors/ImageTagsAllotmentPropertyEditor.cpp @@ -22,15 +22,16 @@ void ImageTagsAllotmentPropertyEditor::invokeDialog() if (auto imageTags = _property->object().inputImageTags()) { bool accepted = false; - auto selectedTags = dlg.exec<ImageTag, ImageTagsListItem>(imageTags->tags(), _property->object().assignedTags(), &accepted); + std::vector<ImageTag*> allottedTags{_property->object().allottedTags().cbegin(), _property->object().allottedTags().cend()}; + auto selectedTags = dlg.exec<ImageTag, ImageTagsListItem>(imageTags->tags(), allottedTags, &accepted); if (accepted) { // Assign all selected image tags - _property->object().unassignAllTags(); + _property->object().unallotAllTags(); for (auto imageTag : selectedTags) - _property->object().assignTag(imageTag); + _property->object().allotTag(imageTag); // The associated image tags have been modified, so notify the property _property->objectModified(); diff --git a/Grinder/ui/properties/editors/ImageTagsAllotmentPropertyEditor.h b/Grinder/ui/properties/editors/ImageTagsAllotmentPropertyEditor.h index e2fc48c70c78268b7aee50e6cb706e6806a72216..b5e791504367cd507460265028b185d11846bd93 100644 --- a/Grinder/ui/properties/editors/ImageTagsAllotmentPropertyEditor.h +++ b/Grinder/ui/properties/editors/ImageTagsAllotmentPropertyEditor.h @@ -7,7 +7,7 @@ #define IMAGETAGSALLOTMENTPROPERTYEDITOR_H #include "DialogPropertyEditor.h" -#include "image/ImageTagsAllotmentProperty.h" +#include "image/properties/ImageTagsAllotmentProperty.h" namespace grndr { diff --git a/Grinder/ui/properties/editors/ImageTagsPropertyEditor.h b/Grinder/ui/properties/editors/ImageTagsPropertyEditor.h index c228cd4044ca22a491908f29839d035ce3792a2e..2cc7d4e7aae0f719d0b5b0c2bf7067099186645d 100644 --- a/Grinder/ui/properties/editors/ImageTagsPropertyEditor.h +++ b/Grinder/ui/properties/editors/ImageTagsPropertyEditor.h @@ -7,7 +7,7 @@ #define IMAGETAGSPROPERTYEDITOR_H #include "DialogPropertyEditor.h" -#include "image/ImageTagsProperty.h" +#include "image/properties/ImageTagsProperty.h" namespace grndr {