comparison OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.cpp @ 1819:fe402c678d18

improved color theme for annotations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 26 May 2021 13:08:15 +0200
parents 385c268e8b56
children 36430d73e36c
comparison
equal deleted inserted replaced
1818:101e7e0079d5 1819:fe402c678d18
45 45
46 static const char* const VALUE_ANGLE = "angle"; 46 static const char* const VALUE_ANGLE = "angle";
47 static const char* const VALUE_CIRCLE = "circle"; 47 static const char* const VALUE_CIRCLE = "circle";
48 static const char* const VALUE_SEGMENT = "segment"; 48 static const char* const VALUE_SEGMENT = "segment";
49 49
50 #if 0
51 static OrthancStone::Color COLOR_PRIMITIVES(192, 192, 192);
52 static OrthancStone::Color COLOR_HOVER(0, 255, 0);
53 static OrthancStone::Color COLOR_TEXT(255, 0, 0);
54 #else
55 static OrthancStone::Color COLOR_PRIMITIVES(0x40, 0x82, 0xad);
56 static OrthancStone::Color COLOR_HOVER(0x40, 0xad, 0x79);
57 static OrthancStone::Color COLOR_TEXT(0x4e, 0xde, 0x99);
58 #endif
59
50 60
51 namespace OrthancStone 61 namespace OrthancStone
52 { 62 {
53 class AnnotationsSceneLayer::GeometricPrimitive : public boost::noncopyable 63 class AnnotationsSceneLayer::GeometricPrimitive : public boost::noncopyable
54 { 64 {
63 public: 73 public:
64 GeometricPrimitive(Annotation& parentAnnotation, 74 GeometricPrimitive(Annotation& parentAnnotation,
65 int depth) : 75 int depth) :
66 modified_(true), 76 modified_(true),
67 parentAnnotation_(parentAnnotation), 77 parentAnnotation_(parentAnnotation),
68 color_(192, 192, 192), 78 color_(COLOR_PRIMITIVES),
69 hoverColor_(0, 255, 0), 79 hoverColor_(COLOR_HOVER),
70 isHover_(false), 80 isHover_(false),
71 depth_(depth) 81 depth_(depth)
72 { 82 {
73 } 83 }
74 84
779 handle1_(AddTypedPrimitive<Handle>(new Handle(*this, p1))), 789 handle1_(AddTypedPrimitive<Handle>(new Handle(*this, p1))),
780 handle2_(AddTypedPrimitive<Handle>(new Handle(*this, p2))), 790 handle2_(AddTypedPrimitive<Handle>(new Handle(*this, p2))),
781 segment_(AddTypedPrimitive<Segment>(new Segment(*this, p1, p2))), 791 segment_(AddTypedPrimitive<Segment>(new Segment(*this, p1, p2))),
782 label_(AddTypedPrimitive<Text>(new Text(that, *this))) 792 label_(AddTypedPrimitive<Text>(new Text(that, *this)))
783 { 793 {
784 label_.SetColor(Color(255, 0, 0)); 794 label_.SetColor(COLOR_TEXT);
785 UpdateLabel(); 795 UpdateLabel();
786 } 796 }
787 797
788 Handle& GetHandle1() const 798 Handle& GetHandle1() const
789 { 799 {
898 segment1_(AddTypedPrimitive<Segment>(new Segment(*this, start, middle))), 908 segment1_(AddTypedPrimitive<Segment>(new Segment(*this, start, middle))),
899 segment2_(AddTypedPrimitive<Segment>(new Segment(*this, middle, end))), 909 segment2_(AddTypedPrimitive<Segment>(new Segment(*this, middle, end))),
900 arc_(AddTypedPrimitive<Arc>(new Arc(*this, start, middle, end))), 910 arc_(AddTypedPrimitive<Arc>(new Arc(*this, start, middle, end))),
901 label_(AddTypedPrimitive<Text>(new Text(that, *this))) 911 label_(AddTypedPrimitive<Text>(new Text(that, *this)))
902 { 912 {
903 label_.SetColor(Color(255, 0, 0)); 913 label_.SetColor(COLOR_TEXT);
904 UpdateLabel(); 914 UpdateLabel();
905 } 915 }
906 916
907 Handle& GetEndHandle() const 917 Handle& GetEndHandle() const
908 { 918 {
1044 handle2_(AddTypedPrimitive<Handle>(new Handle(*this, p2))), 1054 handle2_(AddTypedPrimitive<Handle>(new Handle(*this, p2))),
1045 segment_(AddTypedPrimitive<Segment>(new Segment(*this, p1, p2))), 1055 segment_(AddTypedPrimitive<Segment>(new Segment(*this, p1, p2))),
1046 circle_(AddTypedPrimitive<Circle>(new Circle(*this, p1, p2))), 1056 circle_(AddTypedPrimitive<Circle>(new Circle(*this, p1, p2))),
1047 label_(AddTypedPrimitive<Text>(new Text(that, *this))) 1057 label_(AddTypedPrimitive<Text>(new Text(that, *this)))
1048 { 1058 {
1049 label_.SetColor(Color(255, 0, 0)); 1059 label_.SetColor(COLOR_TEXT);
1050 UpdateLabel(); 1060 UpdateLabel();
1051 } 1061 }
1052 1062
1053 Handle& GetHandle2() const 1063 Handle& GetHandle2() const
1054 { 1064 {