MCPcopy Create free account
hub / github.com/SHAILAB-IPEC/OpenFly-Platform / rectangle

Method rectangle

envs/gs/SIBR_viewers/src/core/view/ImagesGrid.cpp:273–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271 }
272
273 void DrawUtilities::rectangle(const Vector3f & color, const Vector2f & tl, const Vector2f & br, bool fill, float alpha, const Viewport & vp)
274 {
275 auto rectangleMesh = std::make_shared<Mesh>();
276
277 rectangleMesh->vertices({
278 { tl.x(), tl.y() , 0 },
279 { tl.x(), br.y() , 0 },
280 { br.x(), br.y() , 0 },
281 { br.x(), tl.y() , 0 }
282 });
283
284 if (fill) {
285 rectangleMesh->triangles({
286 { 0,1,2 },
287 { 0,2,3 }
288 });
289
290 baseRendering(*rectangleMesh, Mesh::FillRenderMode, color, { 0,0 }, { 1,1 }, alpha, vp);
291 }
292
293 rectangleMesh->triangles({
294 { 0,0,1 },{ 1,1,2 },{ 2,2,3 },{ 3,3,0 }
295 });
296
297 baseRendering(*rectangleMesh, Mesh::LineRenderMode, color, { 0,0 }, { 1,1 }, 1.0f, vp);
298 }
299
300 void DrawUtilities::rectanglePixels(const Vector3f & color, const Vector2f & center, const Vector2f & diagonalPixs, bool fill, float alpha, const Viewport & vp)
301 {

Callers 3

displayZoomMethod · 0.45
highlightPixelMethod · 0.45
highlightImageMethod · 0.45

Calls 2

verticesMethod · 0.60
trianglesMethod · 0.60

Tested by

no test coverage detected