Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/AngleMeasureTool.cpp @ 804:61ba4b504e9a
PolylineSceneLayer now has one color per chain
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 28 May 2019 15:58:21 +0200 |
parents | 66ac7a2d1e3a |
children | e42b491f1fb2 |
comparison
equal
deleted
inserted
replaced
802:f38c1fc08655 | 804:61ba4b504e9a |
---|---|
98 | 98 |
99 { | 99 { |
100 // Fill the polyline layer with the measurement lines | 100 // Fill the polyline layer with the measurement lines |
101 PolylineSceneLayer* polylineLayer = layerHolder_->GetPolylineLayer(0); | 101 PolylineSceneLayer* polylineLayer = layerHolder_->GetPolylineLayer(0); |
102 polylineLayer->ClearAllChains(); | 102 polylineLayer->ClearAllChains(); |
103 polylineLayer->SetColor(0, 183, 17); | 103 |
104 | 104 const Color color(0, 183, 17); |
105 | 105 |
106 // sides | 106 // sides |
107 { | 107 { |
108 { | 108 { |
109 PolylineSceneLayer::Chain chain; | 109 PolylineSceneLayer::Chain chain; |
110 chain.push_back(side1End_); | 110 chain.push_back(side1End_); |
111 chain.push_back(center_); | 111 chain.push_back(center_); |
112 polylineLayer->AddChain(chain, false); | 112 polylineLayer->AddChain(chain, false, color); |
113 } | 113 } |
114 { | 114 { |
115 PolylineSceneLayer::Chain chain; | 115 PolylineSceneLayer::Chain chain; |
116 chain.push_back(side2End_); | 116 chain.push_back(side2End_); |
117 chain.push_back(center_); | 117 chain.push_back(center_); |
118 polylineLayer->AddChain(chain, false); | 118 polylineLayer->AddChain(chain, false, color); |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 // Create the handles | 122 // Create the handles |
123 { | 123 { |
124 { | 124 { |
125 PolylineSceneLayer::Chain chain; | 125 PolylineSceneLayer::Chain chain; |
126 //TODO: take DPI into account | 126 //TODO: take DPI into account |
127 AddSquare(chain, GetScene(), side1End_, | 127 AddSquare(chain, GetScene(), side1End_, |
128 GetController()->GetHandleSideLengthS()); | 128 GetController()->GetHandleSideLengthS()); |
129 polylineLayer->AddChain(chain, true); | 129 polylineLayer->AddChain(chain, true, color); |
130 } | 130 } |
131 { | 131 { |
132 PolylineSceneLayer::Chain chain; | 132 PolylineSceneLayer::Chain chain; |
133 //TODO: take DPI into account | 133 //TODO: take DPI into account |
134 AddSquare(chain, GetScene(), side2End_, | 134 AddSquare(chain, GetScene(), side2End_, |
135 GetController()->GetHandleSideLengthS()); | 135 GetController()->GetHandleSideLengthS()); |
136 polylineLayer->AddChain(chain, true); | 136 polylineLayer->AddChain(chain, true, color); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 // Create the arc | 140 // Create the arc |
141 { | 141 { |
142 PolylineSceneLayer::Chain chain; | 142 PolylineSceneLayer::Chain chain; |
143 | 143 |
144 AddShortestArc(chain, side1End_, center_, side2End_, | 144 AddShortestArc(chain, side1End_, center_, side2End_, |
145 controller->GetAngleToolArcRadiusS()); | 145 controller->GetAngleToolArcRadiusS()); |
146 polylineLayer->AddChain(chain, false); | 146 polylineLayer->AddChain(chain, false, color); |
147 } | 147 } |
148 } | 148 } |
149 { | 149 { |
150 // Set the text layer | 150 // Set the text layer |
151 | 151 |