question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding a logo-widget

See original GitHub issue

Is there an easy way in vedo to add a logo-widget? Something in line with addIcon, but then creating a static image instead of one that rotates?

logo_rep = vtk.vtkLogoRepresentation()
logo_rep.SetImage(self._colorbar.GetInput())
logo_rep.SetPosition([0.1, 0.5])
logo_rep.SetImageProperty(logo_rep.GetImageProperty())

logowidget = vtk.vtkLogoWidget()
logowidget.SetInteractor(self.screen.interactor)
logowidget.SetRepresentation(logo_rep)
logowidget.On()
logowidget.Render()

plotter.widgets.append(logowidget)

if not, would a PR with addLogo be welcome?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
RubendeBruincommented, Oct 2, 2021

I also can not disable user control of the widget. According to the docs SelectableOff() and ResizableOff() should stop user interaction, but I’m still able to move and resize it.

Alternatively an Actor2D with vtkImageMapper can be used, but also here I do not get how to resize the image. Also positioning is in screen coordinates (pixels) rather than view coordinates. Even though the documentation states that is view coordinates…

import vtk
from vedo import *

s = Sphere()
logpic = Picture("https://user-images.githubusercontent.com/32848391/110343974-530a4e00-802d-11eb-88c0-129753028ff9.png")
# logpic = Picture("https://upload.wikimedia.org/wikipedia/commons/thumb/7/76/Visualization_Toolkit_logo.svg/1200px-Visualization_Toolkit_logo.svg.png")

plotter = Plotter()

imagemapper = vtk.vtkImageMapper()
imagemapper.SetInputData(logpic._data)
imagemapper.SetColorWindow(255)
imagemapper.SetColorLevel(127.5)


image = vtk.vtkActor2D()
image.SetMapper(imagemapper)
image.SetWidth(20)  # does not seem to do anything
image.SetHeight(0.01)  # does not seem to do anything
# image.SetDisplayPosition(200,200)  # position in screen coordinates, not view coordinates
image.SetPosition(100,100)  # same same

plotter.add(image)

plotter.show(s, axes=1)

will ask on the vtk forum before continuing.

(In my case I wanted to have my image in a fixed size on the bottom left, which fortunately is a case that works 😃 )

0reactions
marcomusycommented, Oct 2, 2021

yes… very confusing! 😦 moreover the actor2d aspect ratio is not maintained when resizing the window manually

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add your logo to FeedWind widget
Learn how to add your brand logo to customize your FeedWind widget. Currently available only for paying users.
Read more >
Site Logo Widget (Pro) - Elementor
The Site Logo widget is a dynamic widget that displays the Site Logo. Although the logo can only be replaced or deleted in...
Read more >
How to create a Logo Showcase widget for website (2022)
How to add Logo Showcase to a website ; 1. Customize the widget. Use diverse options to get a perfect for your use-case...
Read more >
How to Use Logo Grid Widget on your Elementor Site - YouTube
0:40 Required plugins to get started ; 0:55 Adding the widget to the editing panel ; 1:05 Adding logos from the media gallery...
Read more >
Free Logo Grid Widget for Elementor - YouTube
Logo Grid is an excellent solution for displaying logos of your clients, partners, sponsors, or even affiliates on your Elementor website.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found