SlideShare a Scribd company logo
OpenCascade: (7.1.0)
Visualization
王聖川
2017/8/24
Introduction
• Components: presentation (顯示) and selection (選取).
• Application Interactive Services (AIS): 管理OCCT顯示技術
核心 (interactive objects, for presentation and selection).
提供GUI與OCCT核心功能之間的連結.
Presentation
• 顯示需要3項要素:
• Presentable object (AIS_InteractiveObject class). 提供電腦圖
學需要的顯示資訊. StdPrs and Prs3d packages.
• Viewer. Zoom, translate or rotate with view.
• Interactive context (AIS_InteractiveContext). High-level API,
控制整個顯示流程.
• Packages:
• AIS, PrsMgr (low-level to be implemented).
• StdPrs (顯示points, curves, shapes…), Prs3d (顯示wireframe,
shading, hidden line removal).
• V3d (3d viewer), Graphic3d (graphics structure), Visual3d,
DsgPrs.
Selection
• OCCT提供3種選取功能: point, rectangle, polyline.
• Sensitive entity: 被選取物件中定義可選取元素.
• Selectable object: 代表被選取物件, 含sensitive entities與
selection modes.
• Modes: 0 (AIS_Shape), 1 (vertices), 2 (edges), 3 (wires), 4 (faces), 5
(shells), 6 (constituent solids).
Selection Manager
• Selection Manager: High-level manager, 管理所有顯示物件
的選取流程.
• Viewer selector: viewer對應的selection功能管理實作.
• Selection Struct: BVH (Bounding Volume Hierarchy)資料結構.
Selectable objects with sensitive entities.
Selection Algorithm
• Selection Frustums.
• 3 level BVH (Bounding Volume Hierarchy) traversal.
• 由BVH中的entities與frustums做重疊判斷,決定哪些entities被選取到.
Selection Packages
• SelectBasics: base classes (entity, owner, …)
• Select3D: standard sensitive entities (box, circle, curve,
face, ...).
• SelectMgr: 管理完整的選取功能流程.
• 指定selection mode啟動與關閉; selection mode對應的運算
interface (ComputeSelection() API); selection filter; 維護更新BVH
資料結構.
• StdSelect: SelectMgr對應之功能實現classes.
• _BRepOwner, _BRepSelectionTool (AIS topological shape 對應功
能實作).
• _ViewerSelector3d.
• _FaceFilter, _EdgeFilter.
Select Highlighting
• Highlighting:
• 舊做法, 每個entity owner需準備對應的Prd3d_Presentation object.
會消耗較多記憶體, 並影響繪圖效能.
• 新改良方案, 由interactive object自己實現highlighting.
SelectMgr_SelectableObject::HilightSelected(). (如何實現優化? 需
要再確認)
• SelectMgr_EntityOwner::IsAutoHilight() return true: 使用舊
highlighting顯示機制.
Application Interactive Service
• 負責管理顯示與選取功能.
• Interactive Context: 管理繪圖功能與選取功能.
• Neutral Point (預設初始狀態), Local Contexts (新暫存狀態).
• Interactive Object: 在viewer中被顯示和可被選取的代表物
件.
Interactive Object
• Presentations: 一個object可以擁有多個presentations物
件(顯示內容),透過
PrsMgr_PresentableObject::Compute() API建構.
• 支援Hidden Line Removal顯示模式.
• Presentation modes: Datum, Relation, Object, None.
• Selection: AIS_InteractiveObject::ComputeSelection()
API, 定義sensitive entities.
• Graphic attributes (AIS_Drawer): color, width,
material, …
• Hierarchy: scene graph概念, children指繼承
transformations.
• Instancing: (不是實現 OpenGL instancing rendering..)
AIS_ConnectiveInteractive代表個別object,
AIS_MultiConnectedInteractive代表一群instance
objects的集合.
Interactive Context
• 管理共用繪圖屬性, modes for presentations and
selections, 管理local context.
• Neutral Point: Interactive Context的預設初始狀態.
• Local Context: 新建立的暫存狀態, local contexts以stack的
方式被存取管理.
• AIS_InteractiveContext::OpenLocalContext() API開啟新建立的local
context. 並管理新context自己的顯示與選取模式等.
• Local context被關閉後, 所有該context產生的暫存interactive
objects都會一起被移除.
Context Presentation API
• Display(), Erase(), EraseMode(), ClearPrs(), Redisplay(),
Remove(), EraseAll(), Hilight(), HilightWithColor().
• API使用建議:
• Display() and Erase() in Neutral Point環境, Local Context管理自己
的選取功能.
• Neutral Point環境中, 建議指啟用預設selection mode 0.
• Erase() 改變物件的visible flag!
• Remove() 移除物件. 官方建議如果物件的Compute()步驟花的時間很
小, 可以使用Remove()取代Erase()!? (?黑人問號
Selection in Context
• 設定Filters: 過濾選取對象.
• StdSelect_EdgeFilter, StdSelect_FaceFilter, StdSelect_ShapeTypeFilter,
AIS_TypeFilter, AIS_SignatureFilter, …
• Selection API:
• MoveTo() 指定滑鼠選取座標.
• Select() 存取被偵測到物件, 設定為被選取狀態.
• ShiftSelect() 如果前一次被偵測物件尚未被設定為被選取, 將它們加入
selected objects.
• Neutral Point中, 被選取物件稱為current objects; Local context中, 被
選取物件稱為selected objects. AIS_InteractiveContext提供Iterator功
能去走訪每個被選取物件.
• AIS_InteractiveContext::KeepTemporary(),
SetSelectedCurrent(), 將物件轉移(保留)至Neutral Point.
Recommendations on Context
• 何種情境?
• 對所有物件做統一操作 (Neutral Point?).
• 對某些指定物件, 或特定單一物件做操作 (open a local context).
• 操作Local Context步驟:
• 設定新的local context選項參數.
• 載入(Load)指定物件, 正確設定它們的對應選取模式(activate selection
modes).
• Activate Standard modes if necessary.
• 建立需要的filters.
• 做選取操作 (detect/select/recover desired entities).
• 完成操作後關閉指定的context.
Standard Interactive Objects
• None (unknown type).
• Datum (construction geometric element).
• AIS_Point, AIS_Line, AIS_Circle, AIS_Trihedron, …
• Object (topological shape or connection between
shapes).
• AIS_Shape, AIS_Triangulation, AIS_ConnectedInteractive,
AIS_TexturedShape, MeshVS_Mesh, …
• Relation (constraints on interactive shape and reference
geometry).
• AIS_ConcentricRelation, AIS_FixRelation, AIS_IDenticRelation,
AIS_ParallelRelation, …
• Dimensions
• AIS_AngleDimension, AIS_Chamf3dDimension,
AIS_DiameterDimension, AIS_DimensionOwner, …
MeshVS_Mesh
• Mesh Visualization Service component. 儲存幾何網格資料.
• 透過MeshVS_PrsBuilder class建構網格物件.
• Read STL file:
MeshVS_Mesh Development
• MeshVS package.
• Access mesh data source, for application data model.
• Create multiple MeshVS_PrsBuilder objects (standard and
cusom ones).
• Each _PrsBuilder for presentations in certain display modes
respectively (wireframe, shading, shrink, …).
• MeshVS_Mesh derived from AIS_InteractiveObject. Has
selection highlighting mechanism (highlighter object).
• MeshVS_Mesh::AddBuilder() with TreatAsHilighter = true.
• MeshVS_Draw control visual attributes (color, shrink
coefficients).
3D Presentation
• 功能簡介:
• anti-aliasing (反鋸齒).
• primitive group, light (打光), structure (scene graph概念).
• view (鏡頭視角), viewer (manage views), view mapping (投影), z-
buffer (hidden surface removal).
• Graphic primitive: markers, polygons (holes), polylines,
text.
• Primitive array (support vertex buffer object, VBO).
• Materials (材質設定).
• Textures (貼圖).
GLSL Shader
• Support GLSL shaders. 目前支援vertex and fragment
shader.
V3d Package
• 3D viewer管理者角色.
• Viewer參數設定.
• 投影設定 (perspective, orthographic).
• 打光設定 (point, directional, spot, headlight lights).
• Clipping planes.
• 實體化物件: views, planes, light sources, graphic structures, picks.
• View frustum culling. 繪圖時排除視線範圍外的物件.
Stereographic
• 立體顯示功能. (已經不流行了 XD
Ray Tracing
• 實現real time ray tracing (透過 GLSL shaders)!
• 支援Features:
• Hard shadows.
• Refractions, reflections, transparency, texturing.
• 支援non-polygon objects (lines, text, …).
• 2-level BVH optimization.
• TKMath/BVH package提供BVH演算法.
Presentation Features
• 畫面截圖儲存至圖檔. 支援向量式影像格式 (vector image
export).
• 3D畫面列印.
• Z-layer, depth arranging functionality. 依照不同的Z-layer可
設定各自的depth buffer參數. 還可以設定各自的rendering
precision (single/double precision).
• Clipping planes.
Example: Create a 3D Scene
• Create attributes.
• Create a 3D viewer, and corresponding view.
• Create an interactive context.
• Create interactive objects, and calculate their primitivies.
• Display interactive objects.

More Related Content

PDF
2 cacul vectoriel des forces
PDF
8 poutres
PDF
Indexation image
PPTX
Langage vhdl
PDF
null.pdf
PDF
Introduction à la Logique Formelle (Part 1)
PDF
Chapitre 4 récursivité
PDF
Cours series fourier
2 cacul vectoriel des forces
8 poutres
Indexation image
Langage vhdl
null.pdf
Introduction à la Logique Formelle (Part 1)
Chapitre 4 récursivité
Cours series fourier

What's hot (20)

PDF
Cours4 Systèmes linéaires asservis: Analyse de la stabilité
PPTX
La Soutenace
PPT
Ch4 circuitscombinatoires
PDF
Cours7 Correction des systèmes linéaires continus asservis (2)
PDF
Ch42 reponses
PDF
PDF
TP2_correction.pdf
PDF
Merise exercices-mcd_corriges
PDF
Cours hydraulique tc3
DOCX
PPT
systeme automatises de production
PDF
Exercices corriges nombres_complexes
PDF
SAMPLE REVIT DRAWINGS-SUNIT K DHINGRA-COMPLETE - EASTWOODS
PPT
MODELE BIZNESOWE NA RYNKU PORTÓW LOTNICZYCH...
PDF
Chapitre 6 hachage statique
PPTX
Securité des réseaux mobiles de nouvelle génération ngn
PDF
Td triphasé
PDF
Chapitre 2 problème de plus court chemin
DOCX
METHODE CBR
Cours4 Systèmes linéaires asservis: Analyse de la stabilité
La Soutenace
Ch4 circuitscombinatoires
Cours7 Correction des systèmes linéaires continus asservis (2)
Ch42 reponses
TP2_correction.pdf
Merise exercices-mcd_corriges
Cours hydraulique tc3
systeme automatises de production
Exercices corriges nombres_complexes
SAMPLE REVIT DRAWINGS-SUNIT K DHINGRA-COMPLETE - EASTWOODS
MODELE BIZNESOWE NA RYNKU PORTÓW LOTNICZYCH...
Chapitre 6 hachage statique
Securité des réseaux mobiles de nouvelle génération ngn
Td triphasé
Chapitre 2 problème de plus court chemin
METHODE CBR
Ad

More from River Wang (20)

PPTX
FairyGUISDK_UIPackage_Analysis.pptx
PPTX
20220529_UniTask_Intro.pptx
PPTX
zenject extenject-intro
PPTX
Unity optimize mobile game performance
PPTX
DoozyUI_基礎介紹教學
PPTX
Gamedev: Multi-threaded animate model
PDF
桌面應用工具軟體開發方案評估 (Based on Unity engine)
PPTX
OGRE v2.1 manual - Technical Overview
PPTX
OGRE v2.1 manual - Changes: Objects, Scene & Nodes
PPTX
OGRE v1.10 manual - The Core Objects
PPTX
OpenCascade Technology Overview: Modeling Data
PPTX
OpenCascade Technology Overview: OCAF
DOCX
[breakdown] Shadow of the Colossus. (Chinese translation中譯)
PPTX
OpenCascade Technology Overview: Foundation Classes
DOCX
2017 graphics-01: 電腦圖學繪圖流程
PPTX
2017 unity5.5 manual_navigation
PPTX
2017 unity5.5 manual_physics
PPTX
2017 unity5.5 manual_animation
DOCX
Shader forge設定說明文件
DOCX
矩陣 轉換
FairyGUISDK_UIPackage_Analysis.pptx
20220529_UniTask_Intro.pptx
zenject extenject-intro
Unity optimize mobile game performance
DoozyUI_基礎介紹教學
Gamedev: Multi-threaded animate model
桌面應用工具軟體開發方案評估 (Based on Unity engine)
OGRE v2.1 manual - Technical Overview
OGRE v2.1 manual - Changes: Objects, Scene & Nodes
OGRE v1.10 manual - The Core Objects
OpenCascade Technology Overview: Modeling Data
OpenCascade Technology Overview: OCAF
[breakdown] Shadow of the Colossus. (Chinese translation中譯)
OpenCascade Technology Overview: Foundation Classes
2017 graphics-01: 電腦圖學繪圖流程
2017 unity5.5 manual_navigation
2017 unity5.5 manual_physics
2017 unity5.5 manual_animation
Shader forge設定說明文件
矩陣 轉換
Ad

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
assetexplorer- product-overview - presentation
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Transform Your Business with a Software ERP System
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
ai tools demonstartion for schools and inter college
PDF
System and Network Administration Chapter 2
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPT
Introduction Database Management System for Course Database
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Odoo Companies in India – Driving Business Transformation.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Wondershare Filmora 15 Crack With Activation Key [2025
Upgrade and Innovation Strategies for SAP ERP Customers
Understanding Forklifts - TECH EHS Solution
Navsoft: AI-Powered Business Solutions & Custom Software Development
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Operating system designcfffgfgggggggvggggggggg
assetexplorer- product-overview - presentation
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Reimagine Home Health with the Power of Agentic AI​
Transform Your Business with a Software ERP System
PTS Company Brochure 2025 (1).pdf.......
ai tools demonstartion for schools and inter college
System and Network Administration Chapter 2
Design an Analysis of Algorithms I-SECS-1021-03
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Introduction Database Management System for Course Database
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

OpenCascade Technology Overview: Visualization

  • 2. Introduction • Components: presentation (顯示) and selection (選取). • Application Interactive Services (AIS): 管理OCCT顯示技術 核心 (interactive objects, for presentation and selection). 提供GUI與OCCT核心功能之間的連結.
  • 3. Presentation • 顯示需要3項要素: • Presentable object (AIS_InteractiveObject class). 提供電腦圖 學需要的顯示資訊. StdPrs and Prs3d packages. • Viewer. Zoom, translate or rotate with view. • Interactive context (AIS_InteractiveContext). High-level API, 控制整個顯示流程. • Packages: • AIS, PrsMgr (low-level to be implemented). • StdPrs (顯示points, curves, shapes…), Prs3d (顯示wireframe, shading, hidden line removal). • V3d (3d viewer), Graphic3d (graphics structure), Visual3d, DsgPrs.
  • 4. Selection • OCCT提供3種選取功能: point, rectangle, polyline. • Sensitive entity: 被選取物件中定義可選取元素. • Selectable object: 代表被選取物件, 含sensitive entities與 selection modes. • Modes: 0 (AIS_Shape), 1 (vertices), 2 (edges), 3 (wires), 4 (faces), 5 (shells), 6 (constituent solids).
  • 5. Selection Manager • Selection Manager: High-level manager, 管理所有顯示物件 的選取流程. • Viewer selector: viewer對應的selection功能管理實作. • Selection Struct: BVH (Bounding Volume Hierarchy)資料結構. Selectable objects with sensitive entities.
  • 6. Selection Algorithm • Selection Frustums. • 3 level BVH (Bounding Volume Hierarchy) traversal. • 由BVH中的entities與frustums做重疊判斷,決定哪些entities被選取到.
  • 7. Selection Packages • SelectBasics: base classes (entity, owner, …) • Select3D: standard sensitive entities (box, circle, curve, face, ...). • SelectMgr: 管理完整的選取功能流程. • 指定selection mode啟動與關閉; selection mode對應的運算 interface (ComputeSelection() API); selection filter; 維護更新BVH 資料結構. • StdSelect: SelectMgr對應之功能實現classes. • _BRepOwner, _BRepSelectionTool (AIS topological shape 對應功 能實作). • _ViewerSelector3d. • _FaceFilter, _EdgeFilter.
  • 8. Select Highlighting • Highlighting: • 舊做法, 每個entity owner需準備對應的Prd3d_Presentation object. 會消耗較多記憶體, 並影響繪圖效能. • 新改良方案, 由interactive object自己實現highlighting. SelectMgr_SelectableObject::HilightSelected(). (如何實現優化? 需 要再確認) • SelectMgr_EntityOwner::IsAutoHilight() return true: 使用舊 highlighting顯示機制.
  • 9. Application Interactive Service • 負責管理顯示與選取功能. • Interactive Context: 管理繪圖功能與選取功能. • Neutral Point (預設初始狀態), Local Contexts (新暫存狀態). • Interactive Object: 在viewer中被顯示和可被選取的代表物 件.
  • 10. Interactive Object • Presentations: 一個object可以擁有多個presentations物 件(顯示內容),透過 PrsMgr_PresentableObject::Compute() API建構. • 支援Hidden Line Removal顯示模式. • Presentation modes: Datum, Relation, Object, None. • Selection: AIS_InteractiveObject::ComputeSelection() API, 定義sensitive entities. • Graphic attributes (AIS_Drawer): color, width, material, … • Hierarchy: scene graph概念, children指繼承 transformations. • Instancing: (不是實現 OpenGL instancing rendering..) AIS_ConnectiveInteractive代表個別object, AIS_MultiConnectedInteractive代表一群instance objects的集合.
  • 11. Interactive Context • 管理共用繪圖屬性, modes for presentations and selections, 管理local context. • Neutral Point: Interactive Context的預設初始狀態. • Local Context: 新建立的暫存狀態, local contexts以stack的 方式被存取管理. • AIS_InteractiveContext::OpenLocalContext() API開啟新建立的local context. 並管理新context自己的顯示與選取模式等. • Local context被關閉後, 所有該context產生的暫存interactive objects都會一起被移除.
  • 12. Context Presentation API • Display(), Erase(), EraseMode(), ClearPrs(), Redisplay(), Remove(), EraseAll(), Hilight(), HilightWithColor(). • API使用建議: • Display() and Erase() in Neutral Point環境, Local Context管理自己 的選取功能. • Neutral Point環境中, 建議指啟用預設selection mode 0. • Erase() 改變物件的visible flag! • Remove() 移除物件. 官方建議如果物件的Compute()步驟花的時間很 小, 可以使用Remove()取代Erase()!? (?黑人問號
  • 13. Selection in Context • 設定Filters: 過濾選取對象. • StdSelect_EdgeFilter, StdSelect_FaceFilter, StdSelect_ShapeTypeFilter, AIS_TypeFilter, AIS_SignatureFilter, … • Selection API: • MoveTo() 指定滑鼠選取座標. • Select() 存取被偵測到物件, 設定為被選取狀態. • ShiftSelect() 如果前一次被偵測物件尚未被設定為被選取, 將它們加入 selected objects. • Neutral Point中, 被選取物件稱為current objects; Local context中, 被 選取物件稱為selected objects. AIS_InteractiveContext提供Iterator功 能去走訪每個被選取物件. • AIS_InteractiveContext::KeepTemporary(), SetSelectedCurrent(), 將物件轉移(保留)至Neutral Point.
  • 14. Recommendations on Context • 何種情境? • 對所有物件做統一操作 (Neutral Point?). • 對某些指定物件, 或特定單一物件做操作 (open a local context). • 操作Local Context步驟: • 設定新的local context選項參數. • 載入(Load)指定物件, 正確設定它們的對應選取模式(activate selection modes). • Activate Standard modes if necessary. • 建立需要的filters. • 做選取操作 (detect/select/recover desired entities). • 完成操作後關閉指定的context.
  • 15. Standard Interactive Objects • None (unknown type). • Datum (construction geometric element). • AIS_Point, AIS_Line, AIS_Circle, AIS_Trihedron, … • Object (topological shape or connection between shapes). • AIS_Shape, AIS_Triangulation, AIS_ConnectedInteractive, AIS_TexturedShape, MeshVS_Mesh, … • Relation (constraints on interactive shape and reference geometry). • AIS_ConcentricRelation, AIS_FixRelation, AIS_IDenticRelation, AIS_ParallelRelation, … • Dimensions • AIS_AngleDimension, AIS_Chamf3dDimension, AIS_DiameterDimension, AIS_DimensionOwner, …
  • 16. MeshVS_Mesh • Mesh Visualization Service component. 儲存幾何網格資料. • 透過MeshVS_PrsBuilder class建構網格物件. • Read STL file:
  • 17. MeshVS_Mesh Development • MeshVS package. • Access mesh data source, for application data model. • Create multiple MeshVS_PrsBuilder objects (standard and cusom ones). • Each _PrsBuilder for presentations in certain display modes respectively (wireframe, shading, shrink, …). • MeshVS_Mesh derived from AIS_InteractiveObject. Has selection highlighting mechanism (highlighter object). • MeshVS_Mesh::AddBuilder() with TreatAsHilighter = true. • MeshVS_Draw control visual attributes (color, shrink coefficients).
  • 18. 3D Presentation • 功能簡介: • anti-aliasing (反鋸齒). • primitive group, light (打光), structure (scene graph概念). • view (鏡頭視角), viewer (manage views), view mapping (投影), z- buffer (hidden surface removal). • Graphic primitive: markers, polygons (holes), polylines, text. • Primitive array (support vertex buffer object, VBO). • Materials (材質設定). • Textures (貼圖).
  • 19. GLSL Shader • Support GLSL shaders. 目前支援vertex and fragment shader.
  • 20. V3d Package • 3D viewer管理者角色. • Viewer參數設定. • 投影設定 (perspective, orthographic). • 打光設定 (point, directional, spot, headlight lights). • Clipping planes. • 實體化物件: views, planes, light sources, graphic structures, picks. • View frustum culling. 繪圖時排除視線範圍外的物件.
  • 22. Ray Tracing • 實現real time ray tracing (透過 GLSL shaders)! • 支援Features: • Hard shadows. • Refractions, reflections, transparency, texturing. • 支援non-polygon objects (lines, text, …). • 2-level BVH optimization. • TKMath/BVH package提供BVH演算法.
  • 23. Presentation Features • 畫面截圖儲存至圖檔. 支援向量式影像格式 (vector image export). • 3D畫面列印. • Z-layer, depth arranging functionality. 依照不同的Z-layer可 設定各自的depth buffer參數. 還可以設定各自的rendering precision (single/double precision). • Clipping planes.
  • 24. Example: Create a 3D Scene • Create attributes. • Create a 3D viewer, and corresponding view. • Create an interactive context. • Create interactive objects, and calculate their primitivies. • Display interactive objects.