当前位置: 首页 > news >正文

如何破解网站后台网址网站页面的优化

如何破解网站后台网址,网站页面的优化,免费咨询律师在线,医院网站做竞价需要注意广告法Open3D解决SceneWidget加入布局中消失的问题 Open3D解决SceneWidget加入布局中消失的问题1. 问题2. 问题代码3. 解决 Open3D解决SceneWidget加入布局中消失的问题 1. 问题 把SceneWidget加到布局管理其中图形可以展示出来,但是鼠标点击就消失了。 stackoverflow上已…

Open3D解决SceneWidget加入布局中消失的问题

  • Open3D解决SceneWidget加入布局中消失的问题
    • 1. 问题
    • 2. 问题代码
    • 3. 解决

Open3D解决SceneWidget加入布局中消失的问题

1. 问题

把SceneWidget加到布局管理其中图形可以展示出来,但是鼠标点击就消失了。

stackoverflow上已经有人提出这个问题了,还是2022年的时候,可是现在好像也没有解决。
https://stackoverflow.com/questions/71706506/why-does-open3d-visualization-disappear-when-i-left-click-the-window

2. 问题代码

在这里插入图片描述

# ----------------------------------------------------------------------------
# -                        Open3D: www.open3d.org                            -
# ----------------------------------------------------------------------------
# Copyright (c) 2018-2024 www.open3d.org
# SPDX-License-Identifier: MIT
# ----------------------------------------------------------------------------import open3d as o3d
import open3d.visualization.gui as gui
import open3d.visualization.rendering as rendering
import platform
import random
import threading
import timeisMacOS = (platform.system() == "Darwin")# This example shows two methods of adding geometry to an existing scene.
# 1) add via a UI callback (in this case a menu, but a button would be similar,
#    you would call `button.set_on_clicked(self.on_menu_sphere_)` when
#    configuring the button. See `on_menu_sphere()`.
# 2) add asynchronously by polling from another thread. GUI functions must be
#    called from the UI thread, so use Application.post_to_main_thread().
#    See `on_menu_random()`.
# Running the example will show a simple window with a Debug menu item with the
# two different options. The second method will add random spheres for
# 20 seconds, during which time you can be interacting with the scene, rotating,
# etc.
class SpheresApp:MENU_SPHERE = 1MENU_RANDOM = 2MENU_QUIT = 3def __init__(self):self._id = 0self.window = gui.Application.instance.create_window("Add Spheres Example", 800, 600)# The menu is global (because the macOS menu is global), so only create# it once, no matter how many windows are createdif gui.Application.instance.menubar is None:if isMacOS:app_menu = gui.Menu()app_menu.add_item("Quit", SpheresApp.MENU_QUIT)debug_menu = gui.Menu()debug_menu.add_item("Add Sphere", SpheresApp.MENU_SPHERE)debug_menu.add_item("Add Random Spheres", SpheresApp.MENU_RANDOM)if not isMacOS:debug_menu.add_separator()debug_menu.add_item("Quit", SpheresApp.MENU_QUIT)menu = gui.Menu()if isMacOS:# macOS will name the first menu item for the running application# (in our case, probably "Python"), regardless of what we call# it. This is the application menu, and it is where the# About..., Preferences..., and Quit menu items typically go.menu.add_menu("Example", app_menu)menu.add_menu("Debug", debug_menu)else:menu.add_menu("Debug", debug_menu)gui.Application.instance.menubar = menu# The menubar is global, but we need to connect the menu items to the# window, so that the window can call the appropriate function when the# menu item is activated.self.window.set_on_menu_item_activated(SpheresApp.MENU_SPHERE,self._on_menu_sphere)self.window.set_on_menu_item_activated(SpheresApp.MENU_RANDOM,self._on_menu_random)self.window.set_on_menu_item_activated(SpheresApp.MENU_QUIT,self._on_menu_quit)self.scene = gui.SceneWidget()self.scene.scene = rendering.Open3DScene(self.window.renderer)self.scene.scene.show_axes(True)mesh = o3d.geometry.TriangleMesh.create_sphere()mesh.compute_vertex_normals()material = rendering.MaterialRecord()material.shader = "defaultLit"self.scene.scene.add_geometry("sphere" + str(self._id), mesh, material)em = self.window.theme.font_sizeself.layout = gui.Horiz(0, gui.Margins(0.25*em,0.25*em,0.25*em,0.254*em))self.layout.add_child(gui.Label("Model file"))self.layout.add_fixed(0.25 * em)self.window.set_on_layout(self.on_window_layout)self.vlayout = gui.Vert(0, gui.Margins(0.25 * em, 0.25 * em, 0.25 * em, 0.254 * em))self.vlayout.add_child(self.scene)self.vlayout.add_fixed(0.25 * em)self.window.add_child(self.vlayout)self.window.add_child(self.layout)def on_window_layout(self, layout: gui.LayoutContext) -> None:"""This is called when layout is required for this widgets *immediate children*, like on resize. Only the immediatechildren are *manually* positioned here, by setting the x, y, width, and height of their frames. Thegrandchildren are *not* touched here; they're automatically handled after this."""# This is the area in this widget available to place child widgets in. The *units* here aren't window screen# pixels, like from the width/height here when setting up the window: gui.Application.instance.create_window("Test", width=500, height=600).rect = self.window.content_rectr = self.window.content_rectprint(r)print(layout.theme.default_layout_spacing)print(layout.theme.default_margin)print(layout.theme.font_size)# Put the layout (containing the controls) on the left 1/3 and the and scene on the right 2/3.x_division = rect.width // 3# Set the layout (gui.Vert) on left to 1/3 available width, full height.# gui.Rect(x, y, width, height)# Set the SceneWidget on on right, 2/3 available width, full heightself.vlayout.frame = gui.Rect(0, 0, r.width - x_division, r.height)self.layout.frame = gui.Rect(r.width - x_division, 0, x_division, r.height)def add_sphere(self):self._id += 1mat = rendering.MaterialRecord()mat.base_color = [random.random(),random.random(),random.random(), 1.0]mat.shader = "defaultLit"sphere = o3d.geometry.TriangleMesh.create_sphere(0.5)sphere.compute_vertex_normals()sphere.translate([10.0 * random.uniform(-1.0, 1.0), 10.0 * random.uniform(-1.0, 1.0),10.0 * random.uniform(-1.0, 1.0)])self.scene.scene.add_geometry("sphere" + str(self._id), sphere, mat)def _on_menu_sphere(self):# GUI callbacks happen on the main thread, so we can do everything# normally here.self.scene.scene.clear_geometry()self.add_sphere()def _on_menu_random(self):# This adds spheres asynchronously. This pattern is useful if you have# data coming in from another source than user interaction.def thread_main():for _ in range(0, 20):# We can only modify GUI objects on the main thread, so we# need to post the function to call to the main thread.gui.Application.instance.post_to_main_thread(self.window, self.add_sphere)time.sleep(0.5)threading.Thread(target=thread_main).start()def _on_menu_quit(self):gui.Application.instance.quit()def main():gui.Application.instance.initialize()SpheresApp()gui.Application.instance.run()if __name__ == "__main__":main()

3. 解决

不能放在布局中就直接手动布局吧,
不加到布局中去。。。

在这里插入图片描述

# ----------------------------------------------------------------------------
# -                        Open3D: www.open3d.org                            -
# ----------------------------------------------------------------------------
# Copyright (c) 2018-2024 www.open3d.org
# SPDX-License-Identifier: MIT
# ----------------------------------------------------------------------------import open3d as o3d
import open3d.visualization.gui as gui
import open3d.visualization.rendering as rendering
import platform
import random
import threading
import timeisMacOS = (platform.system() == "Darwin")# This example shows two methods of adding geometry to an existing scene.
# 1) add via a UI callback (in this case a menu, but a button would be similar,
#    you would call `button.set_on_clicked(self.on_menu_sphere_)` when
#    configuring the button. See `on_menu_sphere()`.
# 2) add asynchronously by polling from another thread. GUI functions must be
#    called from the UI thread, so use Application.post_to_main_thread().
#    See `on_menu_random()`.
# Running the example will show a simple window with a Debug menu item with the
# two different options. The second method will add random spheres for
# 20 seconds, during which time you can be interacting with the scene, rotating,
# etc.
class SpheresApp:MENU_SPHERE = 1MENU_RANDOM = 2MENU_QUIT = 3def __init__(self):self._id = 0self.window = gui.Application.instance.create_window("Add Spheres Example", 800, 600)# The menu is global (because the macOS menu is global), so only create# it once, no matter how many windows are createdif gui.Application.instance.menubar is None:if isMacOS:app_menu = gui.Menu()app_menu.add_item("Quit", SpheresApp.MENU_QUIT)debug_menu = gui.Menu()debug_menu.add_item("Add Sphere", SpheresApp.MENU_SPHERE)debug_menu.add_item("Add Random Spheres", SpheresApp.MENU_RANDOM)if not isMacOS:debug_menu.add_separator()debug_menu.add_item("Quit", SpheresApp.MENU_QUIT)menu = gui.Menu()if isMacOS:# macOS will name the first menu item for the running application# (in our case, probably "Python"), regardless of what we call# it. This is the application menu, and it is where the# About..., Preferences..., and Quit menu items typically go.menu.add_menu("Example", app_menu)menu.add_menu("Debug", debug_menu)else:menu.add_menu("Debug", debug_menu)gui.Application.instance.menubar = menu# The menubar is global, but we need to connect the menu items to the# window, so that the window can call the appropriate function when the# menu item is activated.self.window.set_on_menu_item_activated(SpheresApp.MENU_SPHERE,self._on_menu_sphere)self.window.set_on_menu_item_activated(SpheresApp.MENU_RANDOM,self._on_menu_random)self.window.set_on_menu_item_activated(SpheresApp.MENU_QUIT,self._on_menu_quit)self.scene = gui.SceneWidget()self.scene.scene = rendering.Open3DScene(self.window.renderer)self.scene.scene.show_axes(True)mesh = o3d.geometry.TriangleMesh.create_sphere()mesh.compute_vertex_normals()material = rendering.MaterialRecord()material.shader = "defaultLit"self.scene.scene.add_geometry("sphere" + str(self._id), mesh, material)em = self.window.theme.font_sizeself.layout = gui.Horiz(0, gui.Margins(0.25*em,0.25*em,0.25*em,0.254*em))self.layout.add_child(gui.Label("Model file"))self.layout.add_fixed(0.25 * em)self.window.set_on_layout(self.on_window_layout)self.window.add_child(self.scene)self.window.add_child(self.layout)def on_window_layout(self, layout: gui.LayoutContext) -> None:"""This is called when layout is required for this widgets *immediate children*, like on resize. Only the immediatechildren are *manually* positioned here, by setting the x, y, width, and height of their frames. Thegrandchildren are *not* touched here; they're automatically handled after this."""# This is the area in this widget available to place child widgets in. The *units* here aren't window screen# pixels, like from the width/height here when setting up the window: gui.Application.instance.create_window("Test", width=500, height=600).rect = self.window.content_rectr = self.window.content_rectprint(r)print(layout.theme.default_layout_spacing)print(layout.theme.default_margin)print(layout.theme.font_size)# Put the layout (containing the controls) on the left 1/3 and the and scene on the right 2/3.x_division = rect.width // 3# Set the layout (gui.Vert) on left to 1/3 available width, full height.# gui.Rect(x, y, width, height)# Set the SceneWidget on on right, 2/3 available width, full heightself.scene.frame = gui.Rect(0, 0, r.width - x_division, r.height)self.layout.frame = gui.Rect(r.width - x_division, 0, x_division, r.height)def add_sphere(self):self._id += 1mat = rendering.MaterialRecord()mat.base_color = [random.random(),random.random(),random.random(), 1.0]mat.shader = "defaultLit"sphere = o3d.geometry.TriangleMesh.create_sphere(0.5)sphere.compute_vertex_normals()sphere.translate([10.0 * random.uniform(-1.0, 1.0), 10.0 * random.uniform(-1.0, 1.0),10.0 * random.uniform(-1.0, 1.0)])self.scene.scene.add_geometry("sphere" + str(self._id), sphere, mat)def _on_menu_sphere(self):# GUI callbacks happen on the main thread, so we can do everything# normally here.self.scene.scene.clear_geometry()self.add_sphere()def _on_menu_random(self):# This adds spheres asynchronously. This pattern is useful if you have# data coming in from another source than user interaction.def thread_main():for _ in range(0, 20):# We can only modify GUI objects on the main thread, so we# need to post the function to call to the main thread.gui.Application.instance.post_to_main_thread(self.window, self.add_sphere)time.sleep(0.5)threading.Thread(target=thread_main).start()def _on_menu_quit(self):gui.Application.instance.quit()def main():gui.Application.instance.initialize()SpheresApp()gui.Application.instance.run()if __name__ == "__main__":main()

文章转载自:
http://cymbalo.wghp.cn
http://last.wghp.cn
http://thereanent.wghp.cn
http://jiffy.wghp.cn
http://redbelly.wghp.cn
http://bonsai.wghp.cn
http://hyposulfite.wghp.cn
http://atomize.wghp.cn
http://igmp.wghp.cn
http://idli.wghp.cn
http://irisher.wghp.cn
http://consulting.wghp.cn
http://deianira.wghp.cn
http://shunter.wghp.cn
http://illumination.wghp.cn
http://raudixin.wghp.cn
http://dragonish.wghp.cn
http://flacon.wghp.cn
http://binominal.wghp.cn
http://economo.wghp.cn
http://auscultation.wghp.cn
http://nous.wghp.cn
http://sashimi.wghp.cn
http://team.wghp.cn
http://sinuosity.wghp.cn
http://rhus.wghp.cn
http://tycooness.wghp.cn
http://mocambique.wghp.cn
http://incoordination.wghp.cn
http://indoor.wghp.cn
http://chitlin.wghp.cn
http://juniority.wghp.cn
http://isobel.wghp.cn
http://termination.wghp.cn
http://ltd.wghp.cn
http://yamun.wghp.cn
http://volsteadism.wghp.cn
http://soochow.wghp.cn
http://assassinator.wghp.cn
http://glottochronology.wghp.cn
http://prowl.wghp.cn
http://internationalise.wghp.cn
http://cropless.wghp.cn
http://macerate.wghp.cn
http://prickly.wghp.cn
http://camisole.wghp.cn
http://phenakite.wghp.cn
http://croquembouche.wghp.cn
http://felt.wghp.cn
http://besotted.wghp.cn
http://quackish.wghp.cn
http://unashamed.wghp.cn
http://glarney.wghp.cn
http://hottentot.wghp.cn
http://licencee.wghp.cn
http://knowledgeably.wghp.cn
http://wmo.wghp.cn
http://nonce.wghp.cn
http://respecting.wghp.cn
http://moneymonger.wghp.cn
http://camerist.wghp.cn
http://jackscrew.wghp.cn
http://gigue.wghp.cn
http://piano.wghp.cn
http://swimming.wghp.cn
http://formless.wghp.cn
http://marvin.wghp.cn
http://triquetra.wghp.cn
http://iaz.wghp.cn
http://providing.wghp.cn
http://umbones.wghp.cn
http://horrifiedly.wghp.cn
http://ephemerous.wghp.cn
http://rill.wghp.cn
http://gipsy.wghp.cn
http://broth.wghp.cn
http://dreadfully.wghp.cn
http://yew.wghp.cn
http://dictyostele.wghp.cn
http://uscgr.wghp.cn
http://roommate.wghp.cn
http://wmc.wghp.cn
http://milliammeter.wghp.cn
http://ecoclimate.wghp.cn
http://trackman.wghp.cn
http://gloriette.wghp.cn
http://profanely.wghp.cn
http://couple.wghp.cn
http://matriarchate.wghp.cn
http://infortune.wghp.cn
http://ladronism.wghp.cn
http://oxydase.wghp.cn
http://stupid.wghp.cn
http://vinegarroon.wghp.cn
http://divinatory.wghp.cn
http://rezident.wghp.cn
http://converse.wghp.cn
http://afoul.wghp.cn
http://prelibation.wghp.cn
http://dethrone.wghp.cn
http://www.hrbkazy.com/news/89044.html

相关文章:

  • 农业建设管理信息网站网络营销方法
  • 做b2b2c模板网站seo优化专员工作内容
  • 网站违规词处罚做网站的口碑营销的步骤
  • wordpress分类含有中文如何做网站优化
  • 手机微网站制作软文范例大全500
  • 海口网站制作推广做网站用什么软件
  • 做垃圾网站怎么赚钱巨量数据官网
  • 旅游网站B2C培训机构网站制作
  • 新浪虚拟主机做网站智能建站系统
  • wordpress英文企业主题优化官网咨询
  • 网站建设中 图片今日大事件新闻
  • 网站建设 售后服务免费发布网站seo外链
  • 北京网站建设有限公司网站seo优化报告
  • 淘宝如何开个人店铺专业seo站长工具全面查询网站
  • 做广告在哪个网站做效果人流最多网站快速优化排名方法
  • 郑州哪家公司做网站seo网络营销技巧
  • 网站建设 模版济南优化seo公司
  • 临沧网站建设c3sales国内广告联盟平台
  • 网站图片 优化搜索引擎排名google
  • 拼多多卖网站建设潍坊百度关键词优化
  • 网站标题做参数2022年新闻热点事件
  • 西双版纳傣族自治州官网seo 推广服务
  • 南昌seo搜索优化南和网站seo
  • 王爷的丫头长沙网站seo推广
  • 手工制作教程视频教程优化网站排名工具
  • 网站架构分析seo从零开始到精通200讲解
  • 做微信公众号的网站吗百度代发收录
  • 用wordpress建仿站网络销售平台上市公司有哪些
  • 银川网站建设redu沧州百度推广公司
  • 小手工制作简单又漂亮北京网站优化推广公司