1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

...

37 Commits

Author SHA1 Message Date
nds
3684b9ba45 0032073: Visualization - implement interface to change myToFlipOutput of OpenGl_View 2021-01-22 17:54:59 +03:00
nds
b032a91b2b 0032060: Modeling Algorithms - HLR presentation does not display expected edges 2021-01-22 17:49:36 +03:00
nds
87e7c67105 0032077: Visualization - setting custom default frame buffer object for OpenGl context 2021-01-22 17:47:30 +03:00
sshutina
4fd4c96c2f 0032068: Inspectors - Last command don't have the time value 2021-01-19 19:17:54 +03:00
sshutina
cb3bf16180 0031959: Inspectors - Statistics by name 2021-01-14 09:41:08 +03:00
mpv
d511b727e3 0031921: Application Framework - reading OCAF data from several threads is not possible
Make myLastFoundChild field of TDF_LabelNode that can be changed during accessing to different sub-labels in different threads as atomic (only for newer versions of compilers which support this "atomic").

Added definition of Standard_ATOMIC macro to the Standard_Macro.hxx

(cherry picked from commit e80a307718)
2021-01-14 00:07:18 +03:00
age
724fe4d711 0031987: Visualization - Slow rectangular selection on models with big number of sensitives
(cherry picked from commit 726a195668)
2021-01-14 00:06:30 +03:00
age
d79a0af187 0030737: Visualization - implementing new selection schemes in context
Improved AIS_SelectionScheme_ReplaceExtra scheme (now is a part of AIS_SelectionScheme_Replace)
Replaced AIS_NListOfEntityOwner with AIS_NArray1OfEntityOwner
Fixed bug with incorrect highlighting in xor mode (select several times the same objects)
Fixed selections filters
Cherry picked a new highlighting logic from 75cf82505b
2020-12-22 14:52:46 +03:00
nds
b157d88ccb 0030737: Visualization - implementing new selection schemes in context
AIS_SelectionScheme_ReplaceExtra introduce
2020-12-22 13:45:15 +03:00
nds
318bf93ea9 0030737: Visualization - implementing new selection schemes in context
AIS_SelectionScheme enumeration is defined to set which selection behaviour is used in Select of context
AIS_InteractiveContext is corrected to use single Select method instead of combination of Select/ShiftSelect methods with a selection scheme parameter.
Upgrade: Select() -> SelectDetected/Rectangle/Polygon(AIS_SelectionScheme_Replace), ShiftSelect -> SelectDetected/Rectangle/Polygon(AIS_SelectionScheme_XOR)
2020-12-22 13:45:02 +03:00
age
8fa465a463 Revert "0030737: Visualization - implementing new selection schemes in context"
This reverts commit 502194e4fc.
2020-12-22 13:43:01 +03:00
nds
b34d24534d 0031350: Inspectors - property view in DFBrowser for DumpJson
(cherry picked from commit 19b5d8465313c119c9d2f344041e67883226ec61)
2020-11-19 10:03:40 +03:00
nds
dee527369c 0031945: Foundation Classes - unique names of alerts of message report in DumpJson 2020-11-19 10:03:27 +03:00
nds
1bd8dfa582 0031944: Foundation Classes - mutex for message level
(cherry picked from commit 0f07a04a85dedd375a5383f3cb0031c0a6d6b329)
2020-11-19 10:03:18 +03:00
nds
a463065302 0031362: Inspectors - MessageView plugin for message alerts
- OSD_Timer in message alert,
- DumpJson correction,
- Selection owner should be dumped in selector. Sensitive entities might be used in the same owner, that leads to lots of the same dump in the result stream.

(cherry picked from commit e8bde810616e61cbe925981176681f2840234fa4)
2020-11-19 10:02:34 +03:00
age
50013cf4a3 0031757: Visualization - Prebuild BVH for Select3D_SensitiveEntity in separate threads 2020-09-17 11:43:55 +03:00
age
808868370b 0031716: Visualization, Select3D_SensitiveSet::matches() - avoid building BVH in case of full overlapping by the volume 2020-09-17 11:43:55 +03:00
kgv
e91225a089 0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with Graphic3d_TOSM_UNLIT shading model
Prs3d_ShadingAspect::SetTransparency() now sets transparency also to interior color.
AIS_RubberBand now uses Graphic3d_TOSM_UNLIT.

(cherry picked from commit cc07d3180c48e31308d71c3f3b0108e1026fd4ca)
2020-07-23 00:45:47 +03:00
nds
9804a28dd2 0031678: Visualization - text color becomes lighter than in 7.3.0
(cherry picked from commit 1855383438db33933106aa5848ac00569731a407)
2020-07-21 18:24:20 +03:00
nds
b51929ad8f 0029451: Information Message Alert to debug an algorithm or object functionality 2020-06-21 12:42:42 +03:00
nds
b96cd2e422 0031579: Visualization - OpenGl_CappingAlgo performance on some clipping planes
(cherry picked from commit 61d75276ea924e0fd22de0a2a927bce1d554de99)
2020-06-03 11:09:52 +03:00
nds
0fcf0a687b 0029451: Information Message Alert to debug an algorithm or object functionality 2020-05-26 19:14:16 +03:00
snn
3613704c7a 0030988: Add possibility to attach multiple files to notes
- Swap child/father in RemoveFromGroup method of NotesTool.

(cherry picked from commit 7c0ec2e214)
2020-05-16 12:11:33 +03:00
nds
8ec5b8fd57 0029451: Information Message Alert to debug an algorithm or object functionality 2020-05-16 12:10:08 +03:00
nds
b4a5214bd2 0031326: Foundation Classes - Init from Json for base OCCT classes
(cherry picked from commit 39f197676cb85d2b84ad0ff15266eed118cbbaff)
(cherry picked from commit 4a5e30db5bbdfc7a77a03d1e55e8a3bee5d79d2d)
2020-05-15 21:52:15 +03:00
sshutina
9358c97d65 0031354: Visualization - Dump improvement for V3d, Graphic3d, Aspect
(cherry picked from commit 0a9f129d67748f59a40e7758d271e87ae4d535de)

# Conflicts:
#	src/Graphic3d/Graphic3d_CView.cxx
#	src/Graphic3d/Graphic3d_WorldViewProjState.hxx
#	src/SelectMgr/SelectMgr_TriangularFrustumSet.cxx
#	src/SelectMgr/SelectMgr_TriangularFrustumSet.hxx
2020-05-15 21:51:35 +03:00
nds
ada40fab8f 0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using
(cherry picked from commit 707e554dba56681d110b164cb4ea8b47723e7007)
2020-05-15 21:47:43 +03:00
nds
974ff986e1 0031221: Visualization - selection filter in context
(cherry picked from commit 0ef1e0394c44f7cb1753634f53e6ef0e8cda86ad)

# Conflicts:
#	src/AIS/AIS_InteractiveContext_1.cxx
(cherry picked from commit 53bbb3d99268d9aa89affe051ff82b51539a9946)
2020-05-15 21:47:30 +03:00
nds
35536f899d 0031197: Visualization - SetTransformPersistence for highlight, select presentations
(cherry picked from commit df3644aa35)
(cherry picked from commit 33ffefa2f7)
(cherry picked from commit 59433e7b4e49362dc1741dc00178ccec64c6cc5d)
2020-05-15 21:46:31 +03:00
nds
1a716308ea 0030791: Visualization - possibility to display materials by different hatching style for clipping
(cherry picked from commit ab39c2510fa4c9a568deb226cca37fe22c3162c4)

# Conflicts:
#	src/ViewerTest/ViewerTest_ViewerCommands.cxx
2020-05-15 21:46:09 +03:00
nds
8758ba290f 0030537: Visualization - wrapping text in font text formatter
Font_TextFormatter inherits Standard_Transient, now it is given as a handle in functions.
Graphic3d_Text - extended with Font_TextFormatter to be able to have it filled out of text render. If it is not defined here, the default text formatter of context is used.
OpenGl_Context - has default Font_TextFormatter for rendering OpenGl_Text.
2020-05-15 21:42:53 +03:00
nds
86ba800ae8 0030737: Visualization - implementing new selection schemes in context
(cherry picked from commit 8ac88685123f50caef2b53010da626b4682d9bd4)
2020-05-15 21:41:29 +03:00
snn
0a63642bc5 0030988: Add possibility to attach multiple files to notes
Implemented

(cherry picked from commit 9640291ff0)

# Conflicts:
#	src/XCAFDoc/XCAFDoc_AssemblyItemId.cxx
#	src/XCAFDoc/XCAFDoc_NoteBinData.cxx
#	src/XCAFDoc/XCAFDoc_NoteComment.cxx
#	src/XCAFDoc/XCAFDoc_NotesTool.cxx
#	src/XmlMXCAFDoc/XmlMXCAFDoc.cxx
(cherry picked from commit c5d24136ed56ae680dae4f544399a94998ee0962)
2020-05-15 21:37:14 +03:00
snn
57caa76519 0030392: XCAFDoc_GraphNode doesn't copy backward links
(cherry picked from commit 6131065fae)
(cherry picked from commit 713624228050b8f7db4d8b2e22c7edfd8c832471)
(cherry picked from commit b7fb7db6ae)
(cherry picked from commit 68be9e7b9c)
(cherry picked from commit 6bc54a6b6fc335b802959d612f0ed4edbb5d5c33)
2020-05-15 21:36:30 +03:00
nds
c7b1056827 refs 474:Possibility to create and play animations 2020-05-15 21:35:46 +03:00
nds
a7d082c424 refs #355: Add possibility to hide clipping plane
(cherry picked from commit ca1f82f6c6860a2e1995d7d9a66ce8c152e9d3cc)
(cherry picked from commit 61f39b4dc7)
(cherry picked from commit 7b08ab936a5f6091651fc0311c5c255bd0dc9cb0)

# Conflicts:
#	src/XCAFDoc/XCAFDoc.hxx
(cherry picked from commit 72e4a10556)
(cherry picked from commit 37d575793d)
(cherry picked from commit 6964d28a314f847255d1d1cb015dcbd68b3ec1aa)
2020-05-15 21:33:50 +03:00
nds
e6a3685503 XCAFDoc/View fixes to store in the view: image, parts transparency, notes, notes positions 2020-05-15 21:32:25 +03:00
428 changed files with 18787 additions and 2863 deletions

View File

@@ -1,4 +1,4 @@
TModelingData TKShapeView
TModelingData TKShapeView TKMessageModel TKMessageView
TVisualization TKView TKVInspector
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
TTool TKTInspector TKToolsDraw TInspectorEXE

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 11 KiB

BIN
data/images/hatch_1_.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

BIN
data/images/hatch_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 B

BIN
data/images/hatch_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

BIN
data/images/hatch_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

BIN
data/images/hatch_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

BIN
data/images/hatch_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

BIN
data/images/hatch_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

BIN
data/images/hatch_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#3D3ACF"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#3D3ACF"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#DDDDDD"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#DDDDDD"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#3D3ACF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#3D3ACF"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#3D3ACF"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#3D3ACF"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#3D3ACF"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#3D3ACF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#DDDDDD"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#DDDDDD"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#DDDDDD"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#DDDDDD"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#DDDDDD"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#3D3ACF"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#DDDDDD"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#DDDDDD"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#DDDDDD"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#3D3ACF"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#DDDDDD"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#3D3ACF"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#3D3ACF"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#3D3ACF"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#DDDDDD"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,27 @@
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="188" height="90" fill="white"/>
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#DDDDDD"/>
<path d="M152 8H134V26H142V16H152V8Z" fill="#3D3ACF"/>
<path d="M152 36H134V54H142V44H152V36Z" fill="#DDDDDD"/>
<path d="M152 64H134V82H142V72H152V64Z" fill="#3D3ACF"/>
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#DDDDDD"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -830,10 +830,8 @@ myContext->MoveTo (thePixelX, thePixelY, myView, true);
Dynamic detection and selection are put into effect in a straightforward way. There are only a few conventions and functions to be familiar with:
* *AIS_InteractiveContext::MoveTo* -- passes mouse position to Interactive Context selectors.
* *AIS_InteractiveContext::Select* -- stores what has been detected at the last *MoveTo*. Replaces the previously selected object. Empties the stack if nothing has been detected at the last move.
* *AIS_InteractiveContext::ShiftSelect* -- if the object detected at the last move was not already selected, it is added to the list of the selected objects. If not, it is withdrawn. Nothing happens if you click on an empty area.
* *AIS_InteractiveContext::Select* -- selects everything found in the surrounding area.
* *AIS_InteractiveContext::ShiftSelect* -- selects what was not previously in the list of selected, deselects those already present.
* *AIS_InteractiveContext::SelectDetected* -- stores what has been detected at the last *MoveTo*. Changes the previously selected object. Depending on the selection scheme, the selection is enriched, replaced or other.
* *AIS_InteractiveContext::SelectPoint/SelectRectangle/SelectPolygon* -- Applies selection to point, rectangular or surrounding area. Changes the previously selected object. Depending on the selection scheme, the selection is enriched, replaced or other.
Highlighting of detected and selected entities is automatically managed by the Interactive Context. The Highlight colors are those dealt with above. You can nonetheless disconnect this automatic mode if you want to manage this part yourself:
~~~~~
@@ -870,6 +868,17 @@ for (myAISCtx->InitSelected(); myAISCtx->MoreSelected(); myAISCtx->NextSelected(
}
~~~~~
@subsubsection occt_visu_3_4_7 Selection schemes
Select* methods of AIS_InteractiveContext accept some selection scheme as parameter. The table below describes available selection schemes.
| Type | Reaction on click | | Type | Reaction on click |
| :----- | :----- | :----- | :----- | :----- |
| AIS_SelectionScheme_Replace | @figure{visualization_selection_scheme_replace.svg, ""} | | AIS_SelectionScheme_XOR | @figure{visualization_selection_scheme_XOR.svg, ""} |
| AIS_SelectionScheme_Add | @figure{visualization_selection_scheme_add.svg, ""} | | AIS_SelectionScheme_Clear | @figure{visualization_selection_scheme_clear.svg, ""} |
| AIS_SelectionScheme_Remove | @figure{visualization_selection_scheme_remove.svg, ""} | | AIS_SelectionScheme_ReplaceExtra | @figure{visualization_selection_scheme_replaceExtra.svg, ""} |
@subsection occt_visu_3_5 Standard Interactive Object Classes
Interactive Objects are selectable and viewable objects connecting graphic representation and the underlying reference geometry.
@@ -1410,7 +1419,7 @@ aView->Update();
@subsubsection occt_visu_4_4_5 Perspective Projection
**Field of view (FOVy)** -- defines the field of camera view by y axis in degrees (45<EFBFBD> is default).
**Field of view (FOVy)** -- defines the field of camera view by y axis in degrees (45° is default).
@figure{camera_perspective.png,"Perspective frustum",420}
@@ -1432,7 +1441,7 @@ There are two types of IOD:
* _Graphic3d_Camera::IODType_Absolute_ : Intraocular distance is defined as an absolute value.
* _Graphic3d_Camera::IODType_Relative_ : Intraocular distance is defined relative to the camera focal length (as its coefficient).
**Field of view (FOV)** -- defines the field of camera view by y axis in degrees (45<EFBFBD> is default).
**Field of view (FOV)** -- defines the field of camera view by y axis in degrees (45° is default).
**ZFocus** -- defines the distance to the point of stereographic focus.

View File

@@ -245,7 +245,10 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1),
Graphic3d_Vec2i (theX2, theY2),
myView());
myAISContext()->UpdateCurrentViewer();
}
}
@@ -256,7 +259,8 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (Standard_True);
myAISContext()->SelectDetected();
myAISContext()->UpdateCurrentViewer();
}
}
@@ -278,7 +282,11 @@ public:
{
if ((!myAISContext().IsNull()) && (!myView().IsNull()))
{
myAISContext()->ShiftSelect (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1),
Graphic3d_Vec2i (theX2, theY2),
myView(),
AIS_SelectionScheme_XOR);
myAISContext()->UpdateCurrentViewer();
}
}
@@ -289,7 +297,8 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->ShiftSelect (Standard_True);
myAISContext()->SelectDetected (AIS_SelectionScheme_XOR);
myAISContext()->UpdateCurrentViewer();
}
}

View File

@@ -262,7 +262,10 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1),
Graphic3d_Vec2i (theX2, theY2),
myView());
myAISContext()->UpdateCurrentViewer();
}
}
@@ -273,7 +276,8 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->Select (Standard_True);
myAISContext()->SelectDetected();
myAISContext()->UpdateCurrentViewer();
}
}
@@ -295,7 +299,11 @@ public:
{
if (!myAISContext().IsNull() && !myView().IsNull())
{
myAISContext()->ShiftSelect (theX1, theY1, theX2, theY2, myView(), Standard_True);
myAISContext()->SelectRectangle (Graphic3d_Vec2i (theX1, theY1),
Graphic3d_Vec2i (theX2, theY2),
myView(),
AIS_SelectionScheme_XOR);
myAISContext()->UpdateCurrentViewer();
}
}
@@ -306,7 +314,8 @@ public:
{
if (!myAISContext().IsNull())
{
myAISContext()->ShiftSelect (Standard_True);
myAISContext()->SelectDetected (AIS_SelectionScheme_XOR);
myAISContext()->UpdateCurrentViewer();
}
}

View File

@@ -244,7 +244,8 @@ void CGeometryDoc::InputEvent2D(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Handle(V3d_View)& /*aView*/)
{
myAISContext2D->Select(Standard_True);
myAISContext2D->SelectDetected();
myAISContext2D->UpdateCurrentViewer();
}
//-----------------------------------------------------------------------------------------
@@ -352,7 +353,8 @@ void CGeometryDoc::InputEvent (const Standard_Integer /*theMouseX*/,
const Standard_Integer /*theMouseY*/,
const Handle(V3d_View)& /*theView*/)
{
myAISContext->Select (Standard_True);
myAISContext->SelectDetected();
myAISContext2D->UpdateCurrentViewer();
}
//-----------------------------------------------------------------------------------------

View File

@@ -4816,7 +4816,9 @@ void CModelingDoc::InputEvent(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Handle(V3d_View)& /*aView*/)
{
myAISContext->Select (Standard_True);
myAISContext->SelectDetected();
myAISContext->UpdateCurrentViewer();
if (myState == SELECT_EDGE_PLATE_TGTES_1) {
myAISContext->InitSelected();
if (myAISContext->MoreSelected()) {

View File

@@ -506,7 +506,7 @@ void CViewer3dDoc::InputEvent(const Standard_Integer /*x*/,
Quantity_Color CSFColor;
COLORREF MSColor;
myAISContext->Select (Standard_True);
myAISContext->SelectDetected();
// Change the color of a selected face in a user cylinder
if (myState == FACE_COLOR)

View File

@@ -328,7 +328,9 @@ void CHLRView3D::DragEvent(const Standard_Integer x ,
}
if (TheState == 0)
GetDocument()->GetAISContext()->Select(theButtonDownX,theButtonDownY,x,y,myView);
GetDocument()->GetAISContext()->SelectRectangle(Graphic3d_Vec2i (theButtonDownX,theButtonDownY),
Graphic3d_Vec2i (x,y),
myView);
}
//-----------------------------------------------------------------------------------------
@@ -337,7 +339,7 @@ void CHLRView3D::DragEvent(const Standard_Integer x ,
void CHLRView3D::InputEvent(const Standard_Integer x ,
const Standard_Integer y )
{
GetDocument()->GetAISContext()->Select();
GetDocument()->GetAISContext()->SelectDetected();
}
//-----------------------------------------------------------------------------------------
@@ -375,7 +377,10 @@ void CHLRView3D::MultiDragEvent(const Standard_Integer x ,
}
if (TheState == 0)
GetDocument()->GetAISContext()->ShiftSelect(theButtonDownX,theButtonDownY,x,y,myView);
GetDocument()->GetAISContext()->SelectRectangle(Graphic3d_Vec2i (theButtonDownX,theButtonDownY),
Graphic3d_Vec2i (x,y),
myView,
AIS_SelectionScheme_XOR);
}
@@ -385,6 +390,6 @@ void CHLRView3D::MultiDragEvent(const Standard_Integer x ,
void CHLRView3D::MultiInputEvent(const Standard_Integer x ,
const Standard_Integer y )
{
GetDocument()->GetAISContext()->ShiftSelect();
GetDocument()->GetAISContext()->SelectDetected(AIS_SelectionScheme_XOR);
}

View File

@@ -111,9 +111,10 @@ void OCC_3dBaseDoc::DragEvent (const Standard_Integer theMouseX,
}
case 1:
{
myAISContext->Select (aStartDragX, aStartDragY,
theMouseX, theMouseY,
theView, Standard_True);
myAISContext->SelectRectangle (Graphic3d_Vec2i (aStartDragX, aStartDragY),
Graphic3d_Vec2i (theMouseX, theMouseY),
theView);
myAISContext->UpdateCurrentViewer();
break;
}
};
@@ -127,7 +128,8 @@ void OCC_3dBaseDoc::InputEvent (const Standard_Integer theMouseX,
const Handle(V3d_View)& theView)
{
myAISContext->MoveTo (theMouseX, theMouseY, theView, Standard_False);
myAISContext->Select (Standard_True);
myAISContext->SelectDetected();
myAISContext->UpdateCurrentViewer();
}
//-----------------------------------------------------------------------------------------
@@ -175,9 +177,10 @@ void OCC_3dBaseDoc::ShiftDragEvent (const Standard_Integer theMouseX,
if (theState == 0)
{
// button up
myAISContext->ShiftSelect (aStartDragX, aStartDragY,
theMouseX, theMouseY,
theView, Standard_True);
myAISContext->SelectRectangle (Graphic3d_Vec2i (aStartDragX, aStartDragY),
Graphic3d_Vec2i (theMouseX, theMouseY),
theView, AIS_SelectionScheme_XOR);
myAISContext->UpdateCurrentViewer();
}
}
@@ -188,7 +191,8 @@ void OCC_3dBaseDoc::ShiftInputEvent (const Standard_Integer /*theMouseX*/,
const Standard_Integer /*theMouseY*/,
const Handle(V3d_View)& /*theView*/)
{
myAISContext->ShiftSelect (Standard_True);
myAISContext->SelectDetected (AIS_SelectionScheme_XOR);
myAISContext->UpdateCurrentViewer();
}
//-----------------------------------------------------------------------------------------

View File

@@ -637,6 +637,11 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
{
aShadedGroup = thePrs->NewGroup();
aShadedGroup->SetClosed (isClosed);
if (isClosed)
{
if (aDrawer->HasOwnFillCappingAspect())
aShadedGroup->SetGroupPrimitivesAspect (aDrawer->FillCappingAspect());
}
}
aShadedGroup->SetPrimitivesAspect (aDrawer->ShadingAspect()->Aspect());
aShadedGroup->AddPrimitiveArray (aTriangles);

View File

@@ -39,6 +39,8 @@
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_PresentableObject.hxx>
#include <Quantity_Color.hxx>
#include <SelectMgr_AndFilter.hxx>
#include <SelectMgr_DisabledObjectsFilter.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
@@ -128,7 +130,7 @@ myMainVwr(MainViewer),
myMainSel(new StdSelect_ViewerSelector3d()),
myToHilightSelected(Standard_True),
mySelection(new AIS_Selection()),
myFilters(new SelectMgr_OrFilter()),
myFilters(new SelectMgr_AndFilter()),
myDefaultDrawer(new Prs3d_Drawer()),
myCurDetected(0),
myCurHighlighted(0),
@@ -136,6 +138,8 @@ myPickingStrategy (SelectMgr_PickingStrategy_FirstAcceptable),
myAutoHilight(Standard_True),
myIsAutoActivateSelMode(Standard_True)
{
myFilters->Add (new SelectMgr_DisabledObjectsFilter());
mgrSelector = new SelectMgr_SelectionManager (myMainSel);
myStyles[Prs3d_TypeOfHighlight_None] = myDefaultDrawer;
@@ -2405,6 +2409,15 @@ void AIS_InteractiveContext::SetTransformPersistence (const Handle(AIS_Interacti
const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
theObject->SetTransformPersistence (theTrsfPers);
UpdateOnTransformPersistence (theObject);
}
//=======================================================================
//function : UpdateOnTransformPersistence
//purpose :
//=======================================================================
void AIS_InteractiveContext::UpdateOnTransformPersistence (const Handle(AIS_InteractiveObject)& theObject)
{
if (!myObjects.IsBound (theObject))
{
return;

View File

@@ -25,10 +25,12 @@
#include <AIS_ListOfInteractive.hxx>
#include <AIS_Selection.hxx>
#include <AIS_SelectionModesConcurrency.hxx>
#include <AIS_SelectionScheme.hxx>
#include <AIS_StatusOfDetection.hxx>
#include <AIS_StatusOfPick.hxx>
#include <AIS_TypeOfIso.hxx>
#include <Aspect_TypeOfFacingModel.hxx>
#include <Graphic3d_Vec2.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_TypeOfHighlight.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
@@ -46,7 +48,7 @@
class SelectMgr_SelectionManager;
class V3d_Viewer;
class SelectMgr_OrFilter;
class SelectMgr_AndFilter;
class V3d_View;
class TopLoc_Location;
class TCollection_ExtendedString;
@@ -344,6 +346,11 @@ public: //! @name object local transformation management
Standard_EXPORT void SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObject,
const Handle(Graphic3d_TransformPers)& theTrsfPers);
//! Updates displayed interactive object by checking and recomputing its flagged as "to be recomputed" presentation and selection structures.
//! This method does not force any recomputation on its own.
//! The method recomputes selections even if they are loaded without activation in particular selector.
Standard_EXPORT void UpdateOnTransformPersistence (const Handle(AIS_InteractiveObject)& theIObj);
Standard_DEPRECATED("This method is deprecated - SetTransformPersistence() taking Graphic3d_TransformPers should be called instead")
void SetTransformPersistence (const Handle(AIS_InteractiveObject)& theObj,
const Graphic3d_TransModeFlags& theFlag,
@@ -470,8 +477,49 @@ public: //! @name Selection management
return AddSelect (theObject->GlobalSelOwner());
}
//! Selects objects within the bounding rectangle.
//! Viewer should be explicitly redrawn after selection.
//! @param thePntMin [in] rectangle lower point (in pixels)
//! @param thePntMax [in] rectangle upper point (in pixels)
//! @param theView [in] active view where rectangle is defined
//! @param theSelScheme [in] selection scheme
//! @return picking status
//! @sa StdSelect_ViewerSelector3d::AllowOverlapDetection()
Standard_EXPORT AIS_StatusOfPick SelectRectangle (const Graphic3d_Vec2i& thePntMin,
const Graphic3d_Vec2i& thePntMax,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Select everything found in the polygon defined by bounding polyline.
//! Viewer should be explicitly redrawn after selection.
//! @param thePolyline [in] polyline defining polygon bounds (in pixels)
//! @param theView [in] active view where polyline is defined
//! @param theSelScheme [in] selection scheme
//! @return picking status
Standard_EXPORT AIS_StatusOfPick SelectPolygon (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Selects the topmost object picked by the point in the view,
//! Viewer should be explicitly redrawn after selection.
//! @param thePnt [in] point pixel coordinates within the view
//! @param theView [in] active view where point is defined
//! @param theSelScheme [in] selection scheme
//! @return picking status
Standard_EXPORT AIS_StatusOfPick SelectPoint (const Graphic3d_Vec2i& thePnt,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Select and hilights the previous detected via AIS_InteractiveContext::MoveTo() method;
//! unhilights the previous picked.
//! Viewer should be explicitly redrawn after selection.
//! @param theSelScheme [in] selection scheme
//! @return picking status
Standard_EXPORT AIS_StatusOfPick SelectDetected (const AIS_SelectionScheme theSelScheme = AIS_SelectionScheme_Replace);
//! Selects everything found in the bounding rectangle defined by the pixel minima and maxima, XPMin, YPMin, XPMax, and YPMax in the view.
//! The objects detected are passed to the main viewer, which is then updated.
Standard_DEPRECATED("This method is deprecated - SelectRectangle() taking AIS_SelectionScheme_Replace should be called instead")
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
@@ -480,27 +528,32 @@ public: //! @name Selection management
const Standard_Boolean theToUpdateViewer);
//! polyline selection; clears the previous picked list
Standard_DEPRECATED("This method is deprecated - SelectPolygon() taking AIS_SelectionScheme_Replace should be called instead")
Standard_EXPORT AIS_StatusOfPick Select (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer);
//! Stores and hilights the previous detected; Unhilights the previous picked.
//! @sa MoveTo().
Standard_DEPRECATED("This method is deprecated - SelectDetected() taking AIS_SelectionScheme_Replace should be called instead")
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Boolean theToUpdateViewer);
//! Adds the last detected to the list of previous picked.
//! If the last detected was already declared as picked, removes it from the Picked List.
//! @sa MoveTo().
Standard_DEPRECATED("This method is deprecated - SelectDetected() taking AIS_SelectionScheme_XOR should be called instead")
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Boolean theToUpdateViewer);
//! Adds the last detected to the list of previous picked.
//! If the last detected was already declared as picked, removes it from the Picked List.
Standard_DEPRECATED("This method is deprecated - SelectPolygon() taking AIS_SelectionScheme_XOR should be called instead")
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer);
//! Rectangle of selection; adds new detected entities into the picked list,
//! removes the detected entities that were already stored.
Standard_DEPRECATED("This method is deprecated - SelectRectangle() taking AIS_SelectionScheme_XOR should be called instead")
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
@@ -511,6 +564,13 @@ public: //! @name Selection management
//! Returns bounding box of selected objects.
Standard_EXPORT Bnd_Box BoundingBoxOfSelection() const;
//! Sets list of owner selected/deselected using specified selection scheme.
//! @param theOwners owners to change selection state
//! @param theSelScheme selection scheme
//! @return picking status
Standard_EXPORT AIS_StatusOfPick Select (const AIS_NArray1OfEntityOwner& theOwners,
const AIS_SelectionScheme theSelScheme);
//! Fits the view correspondingly to the bounds of selected objects.
//! Infinite objects are ignored if infinite state of AIS_InteractiveObject is set to true.
Standard_EXPORT void FitSelected (const Handle(V3d_View)& theView,
@@ -736,13 +796,20 @@ public: //! @name management of active Selection Modes
public: //! @name Selection Filters management
//! Returns the list of filters active in a local context.
Standard_EXPORT const SelectMgr_ListOfFilter& Filters() const;
//! Allows you to set the filter.
Standard_EXPORT void SetFilter (const Handle(SelectMgr_Filter)& theFilter);
//! Allows you to add the filter.
//! Returns the filter. Use with global is in false to get the filter, that is set with SetFilter.
//! If global filter is true, it returns whole filter used in the context (with an internal default filter)
Standard_EXPORT Handle(SelectMgr_Filter) Filter (const Standard_Boolean isGlobalFilter = Standard_False) const;
//! Returns the list of filters active in a local context.
Standard_EXPORT SelectMgr_ListOfFilter Filters() const;
//! Allows you to add the filter. Default filter here is Or filter.
Standard_EXPORT void AddFilter (const Handle(SelectMgr_Filter)& theFilter);
//! Removes a filter from context.
//! Removes a filter from context. Default filter here is Or filter
Standard_EXPORT void RemoveFilter (const Handle(SelectMgr_Filter)& theFilter);
//! Remove all filters from context.
@@ -1361,7 +1428,7 @@ protected: //! @name internal fields
Handle(SelectMgr_EntityOwner) myLastPicked;
Standard_Boolean myToHilightSelected;
Handle(AIS_Selection) mySelection;
Handle(SelectMgr_OrFilter) myFilters;
Handle(SelectMgr_AndFilter) myFilters;
Handle(Prs3d_Drawer) myDefaultDrawer;
Handle(Prs3d_Drawer) myStyles[Prs3d_TypeOfHighlight_NB];
TColStd_SequenceOfInteger myDetectedSeq;

View File

@@ -31,8 +31,11 @@
#include <Prs3d_Presentation.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectMgr_AndFilter.hxx>
#include <SelectMgr_DisabledObjectsFilter.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_FilterReaction.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_Selection.hxx>
#include <SelectMgr_SelectionManager.hxx>
@@ -123,7 +126,12 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
return;
}
const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, theDispMode);
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (theObj);
if (!aStatusPtr)
{
return;
}
const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, (*aStatusPtr)->DisplayMode());
const Handle(SelectMgr_EntityOwner)& aGlobOwner = theObj->GlobalSelOwner();
if (aGlobOwner.IsNull())
@@ -172,20 +180,16 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
{
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
const Handle(AIS_InteractiveObject) anInteractive = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
Handle(AIS_GlobalStatus) aStatus;
if (!myObjects.Find (anInteractive, aStatus))
{
continue;
}
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anInteractive);
if (anOwner->IsAutoHilight())
{
anOwner->Unhilight (myMainPM);
if (theIsToHilightSubIntensity)
{
if (aStatus->IsSubIntensityOn())
if (aStatusPtr && (*aStatusPtr)->IsSubIntensityOn())
{
const Standard_Integer aHiMode = getHilightMode (anInteractive, aStatus->HilightStyle(), aStatus->DisplayMode());
const Standard_Integer aHiMode = getHilightMode (anInteractive, (*aStatusPtr)->HilightStyle(), (*aStatusPtr)->DisplayMode());
highlightWithSubintensity (anOwner, aHiMode);
}
}
@@ -194,10 +198,11 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
{
anObjToClear.Add (anInteractive);
}
if (anOwner == anInteractive->GlobalSelOwner())
if (aStatusPtr && anOwner == anInteractive->GlobalSelOwner())
{
aStatus->SetHilightStatus (Standard_False);
(*aStatusPtr)->SetHilightStatus (Standard_False);
}
(*aStatusPtr)->SetHilightStyle (Handle(Prs3d_Drawer)());
}
for (NCollection_IndexedMap<Handle(AIS_InteractiveObject)>::Iterator anIter (anObjToClear); anIter.More(); anIter.Next())
{
@@ -335,7 +340,8 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
Standard_Boolean toUpdateViewer = Standard_False;
myFilters->SetDisabledObjects (theView->View()->HiddenObjects());
Handle(SelectMgr_DisabledObjectsFilter) anObjectsFilter = Handle(SelectMgr_DisabledObjectsFilter)::DownCast (myFilters->StoredFilters().First());
anObjectsFilter->SetDisabledObjects (theView->View()->HiddenObjects());
myMainSel->Pick (theXPix, theYPix, theView);
// filling of myAISDetectedSeq sequence storing information about detected AIS objects
@@ -347,7 +353,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
{
Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aDetIter);
if (anOwner.IsNull()
|| !myFilters->IsOk (anOwner))
|| !myFilters->IsOk (anOwner, SelectMgr_FilterReaction_Highlight))
{
if (myPickingStrategy == SelectMgr_PickingStrategy_OnlyTopmost)
{
@@ -482,95 +488,100 @@ AIS_StatusOfPick AIS_InteractiveContext::AddSelect (const Handle(SelectMgr_Entit
}
//=======================================================================
//function : Select
//purpose :
//function : SelectRectangle
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const Standard_Boolean toUpdateViewer)
AIS_StatusOfPick AIS_InteractiveContext::SelectRectangle (const Graphic3d_Vec2i& thePntMin,
const Graphic3d_Vec2i& thePntMax,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme)
{
if (theView->Viewer() != myMainVwr)
{
throw Standard_ProgramError ("AIS_InteractiveContext::Select() - invalid argument");
throw Standard_ProgramError ("AIS_InteractiveContext::SelectRectangle() - invalid argument");
}
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
myLastActiveView = theView.get();
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
const Handle(SelectMgr_EntityOwner)& aCurOwner = myMainSel->Picked (aPickIter);
if (aCurOwner.IsNull() || !aCurOwner->HasSelectable() || !myFilters->IsOk (aCurOwner))
continue;
myMainSel->Pick (thePntMin.x(), thePntMin.y(), thePntMax.x(), thePntMax.y(), theView);
mySelection->Select (aCurOwner);
AIS_NArray1OfEntityOwner aPickedOwners;
if (myMainSel->NbPicked() > 0)
{
aPickedOwners.Resize (1, myMainSel->NbPicked(), Standard_False);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.ChangeValue (aPickIter) = myMainSel->Picked (aPickIter);
}
}
if (myAutoHilight)
{
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
//function : Select
//purpose : Selection by polyline
//function : SelectPolygon
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean toUpdateViewer)
AIS_StatusOfPick AIS_InteractiveContext::SelectPolygon (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme)
{
if (theView->Viewer() != myMainVwr)
{
throw Standard_ProgramError ("AIS_InteractiveContext::Select() - invalid argument");
throw Standard_ProgramError ("AIS_InteractiveContext::SelectPolygon() - invalid argument");
}
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
myLastActiveView = theView.get();
myMainSel->Pick (thePolyline, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
const Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aPickIter);
if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
continue;
mySelection->Select (anOwner);
AIS_NArray1OfEntityOwner aPickedOwners;
if (myMainSel->NbPicked() > 0)
{
aPickedOwners.Resize (1, myMainSel->NbPicked(), Standard_False);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.ChangeValue (aPickIter) = myMainSel->Picked (aPickIter);
}
}
if (myAutoHilight)
{
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
//function : Select
//purpose :
//function : SelectPoint
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdateViewer)
AIS_StatusOfPick AIS_InteractiveContext::SelectPoint (const Graphic3d_Vec2i& thePnt,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme)
{
if (!myLastPicked.IsNull())
if (theView->Viewer() != myMainVwr)
{
throw Standard_ProgramError ("AIS_InteractiveContext::SelectPoint() - invalid argument");
}
myLastActiveView = theView.get();
myMainSel->Pick (thePnt.x(), thePnt.y(), theView);
AIS_NArray1OfEntityOwner aPickedOwners;
if (myMainSel->NbPicked() > 0)
{
aPickedOwners.Resize (1, myMainSel->NbPicked(), Standard_False);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.ChangeValue (aPickIter) = myMainSel->Picked (aPickIter);
}
}
return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
//function : SelectDetected
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::SelectDetected (const AIS_SelectionScheme theSelScheme)
{
if (theSelScheme == AIS_SelectionScheme_Replace && !myLastPicked.IsNull())
{
Graphic3d_Vec2i aMousePos (-1, -1);
if (myMainSel->GetManager().GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Point)
@@ -582,54 +593,76 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdate
{
return AIS_SOP_NothingSelected;
}
if (myAutoHilight)
{
clearDynamicHighlight();
}
if (!myLastPicked->IsSelected()
|| myLastPicked->IsForcedHilight()
|| NbSelected() > 1)
{
SetSelected (myLastPicked, Standard_False);
if(toUpdateViewer)
{
UpdateCurrentViewer();
}
}
}
else
AIS_NArray1OfEntityOwner aPickedOwners(1, 1);
aPickedOwners.ChangeValue (1) = myLastPicked;
return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer)
{
AIS_StatusOfPick aStatus = SelectRectangle (Graphic3d_Vec2i (theXPMin, theYPMin),
Graphic3d_Vec2i (theXPMax, theYPMax),
theView);
if (theToUpdateViewer)
{
ClearSelected (toUpdateViewer);
UpdateCurrentViewer();
}
return aStatus;
}
Standard_Integer aSelNum = NbSelected();
//=======================================================================
//function : Select
//purpose : Selection by polyline
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer)
{
AIS_StatusOfPick aStatus = SelectPolygon (thePolyline, theView);
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
return aStatus;
}
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean theToUpdateViewer)
{
AIS_StatusOfPick aStatus = SelectDetected();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
return aStatus;
}
//=======================================================================
//function : ShiftSelect
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Boolean toUpdateViewer)
AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Boolean theToUpdateViewer)
{
if (myAutoHilight)
AIS_StatusOfPick aStatus = SelectDetected (AIS_SelectionScheme_XOR);
if (theToUpdateViewer)
{
clearDynamicHighlight();
UpdateCurrentViewer();
}
if (!myLastPicked.IsNull())
{
AddOrRemoveSelected (myLastPicked, toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
return aStatus;
}
//=======================================================================
@@ -641,39 +674,17 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Integer the
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const Standard_Boolean toUpdateViewer)
const Standard_Boolean theToUpdateViewer)
{
if (theView->Viewer() != myMainVwr)
AIS_StatusOfPick aStatus = SelectRectangle (Graphic3d_Vec2i (theXPMin, theYPMin),
Graphic3d_Vec2i (theXPMax, theYPMax),
theView,
AIS_SelectionScheme_XOR);
if (theToUpdateViewer)
{
throw Standard_ProgramError ("AIS_InteractiveContext::ShiftSelect() - invalid argument");
UpdateCurrentViewer();
}
myLastActiveView = theView.get();
if (myAutoHilight)
{
UnhilightSelected (Standard_False);
}
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
const Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aPickIter);
if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
continue;
mySelection->Select (anOwner);
}
if (myAutoHilight)
{
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
return aStatus;
}
//=======================================================================
@@ -682,31 +693,78 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Integer the
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean toUpdateViewer)
const Standard_Boolean theToUpdateViewer)
{
if (theView->Viewer() != myMainVwr)
AIS_StatusOfPick aStatus = SelectPolygon (thePolyline, theView, AIS_SelectionScheme_XOR);
if (theToUpdateViewer)
{
throw Standard_ProgramError ("AIS_InteractiveContext::ShiftSelect() - invalid argument");
UpdateCurrentViewer();
}
return aStatus;
}
myLastActiveView = theView.get();
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_NArray1OfEntityOwner& theOwners,
const AIS_SelectionScheme theSelScheme)
{
NCollection_IndexedMap<Handle(SelectMgr_EntityOwner)> aSelOwnerMap (myAutoHilight ? mySelection->Objects().Size() : 0);
if (myAutoHilight)
{
UnhilightSelected (Standard_False);
}
myMainSel->Pick (thePolyline, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
const Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aPickIter);
if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
continue;
clearDynamicHighlight();
mySelection->Select (anOwner);
// collect currently selected owners
for (AIS_NListOfEntityOwner::Iterator anOwnerIter (mySelection->Objects()); anOwnerIter.More(); anOwnerIter.Next())
{
aSelOwnerMap.Add (anOwnerIter.Value());
}
}
mySelection->SelectOwners (theOwners, theSelScheme, myFilters);
if (myAutoHilight)
{
HilightSelected (toUpdateViewer);
// collect lists of owners to unhighlight (unselected) and to highlight (selected)
AIS_NListOfEntityOwner anOwnersToUnhighlight, anOwnersToHighlight;
for (AIS_NListOfEntityOwner::Iterator anOwnerIter (mySelection->Objects()); anOwnerIter.More(); anOwnerIter.Next())
{
// add newly selected owners
const Handle(SelectMgr_EntityOwner)& anOwner = anOwnerIter.Value();
if (!aSelOwnerMap.RemoveKey (anOwner))
{
// newly selected owner
anOwnersToHighlight.Append (anOwner);
}
else
{
// already selected owner
if (!anOwner->IsAutoHilight()
&& theSelScheme != AIS_SelectionScheme_XOR
&& theSelScheme != AIS_SelectionScheme_Add)
{
// hack to perform AIS_InteractiveObject::ClearSelected() before highlighting
anOwnersToUnhighlight.Append (anOwner);
anOwnersToHighlight.Append (anOwner);
}
else if (anOwner->IsForcedHilight()
|| !anOwner->IsAutoHilight())
{
anOwnersToHighlight.Append (anOwner);
}
}
}
for (NCollection_IndexedMap<Handle(SelectMgr_EntityOwner)>::Iterator anOwnerIter (aSelOwnerMap); anOwnerIter.More(); anOwnerIter.Next())
{
// owners removed from selection
const Handle(SelectMgr_EntityOwner)& anOwner = anOwnerIter.Value();
anOwnersToUnhighlight.Append (anOwner);
}
unhighlightOwners (anOwnersToUnhighlight);
highlightOwners (anOwnersToHighlight);
}
Standard_Integer aSelNum = NbSelected();
@@ -746,11 +804,13 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
continue;
const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anObj, anOwner);
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind(anObj);
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
if (!aStatusPtr)
continue;
if (anOwner == anObj->GlobalSelOwner())
{
aState->SetHilightStatus (Standard_True);
aState->SetHilightStyle (anObjSelStyle);
(*aStatusPtr)->SetHilightStatus (Standard_True);
(*aStatusPtr)->SetHilightStyle (anObjSelStyle);
}
if (!anOwner->IsAutoHilight())
{
@@ -768,7 +828,7 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
}
else
{
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, aState->DisplayMode());
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, (*aStatusPtr)->DisplayMode());
anOwner->HilightWithColor (myMainPM, anObjSelStyle, aHiMode);
}
}
@@ -860,7 +920,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner)& aSelOwner = aSelIter.Value();
if (!myFilters->IsOk (aSelOwner))
if (!myFilters->IsOk (aSelOwner, SelectMgr_FilterReaction_Select))
{
continue;
}
@@ -872,7 +932,9 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
}
if (aSelOwner == aSelectable->GlobalSelOwner())
{
myObjects.ChangeFind (aSelectable)->SetHilightStatus (Standard_False);
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (aSelectable);
if (aStatusPtr)
(*aStatusPtr)->SetHilightStatus (Standard_False);
}
}
@@ -906,7 +968,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& theOwner,
const Standard_Boolean theToUpdateViewer)
{
if (theOwner.IsNull() || !theOwner->HasSelectable() || !myFilters->IsOk (theOwner))
if (theOwner.IsNull() || !theOwner->HasSelectable() || !myFilters->IsOk (theOwner, SelectMgr_FilterReaction_Select))
return;
const Handle(AIS_InteractiveObject) anObject = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
@@ -982,7 +1044,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
if (theOwner.IsNull() || !theOwner->HasSelectable())
return;
if (!myFilters->IsOk(theOwner) && !theOwner->IsSelected())
if (!myFilters->IsOk(theOwner, SelectMgr_FilterReaction_Select) && !theOwner->IsSelected())
return;
mySelection->Select (theOwner);
@@ -990,7 +1052,13 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
if (myAutoHilight)
{
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
if (!myObjects.IsBound(anObj)) // e.g. AIS_ViewCubeFlat is not displayed
return;
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
if (!aStatusPtr)
return;
if (theOwner->IsSelected())
{
highlightSelected (theOwner);
@@ -1001,7 +1069,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
anOwners.Append (theOwner);
unhighlightOwners (anOwners);
aStatus->SetHilightStyle (Handle(Prs3d_Drawer)());
(*aStatusPtr)->SetHilightStyle (Handle(Prs3d_Drawer)());
}
}

View File

@@ -30,6 +30,7 @@
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_AndFilter.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Transient.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
@@ -264,22 +265,74 @@ void AIS_InteractiveContext::SubIntensityOff (const Handle(AIS_InteractiveObject
}
}
//=======================================================================
//function : SetFilter
//purpose :
//=======================================================================
void AIS_InteractiveContext::SetFilter (const Handle(SelectMgr_Filter)& theFilter)
{
Handle(SelectMgr_Filter) aDefFilter = myFilters->StoredFilters().First();
if (myFilters->StoredFilters().Size() < 2)
{
myFilters->Clear();
myFilters->Add (aDefFilter);
}
myFilters->Add (theFilter);
}
//=======================================================================
//function : Filter
//purpose :
//=======================================================================
Handle(SelectMgr_Filter) AIS_InteractiveContext::Filter (const Standard_Boolean isGlobalFilter) const
{
if (isGlobalFilter)
return myFilters;
if (myFilters->StoredFilters().Size() < 2)
return NULL;
SelectMgr_ListIteratorOfListOfFilter anIterator (myFilters->StoredFilters());
anIterator.Next();
return anIterator.Value();
}
//=======================================================================
//function : AddFilter
//purpose :
//=======================================================================
void AIS_InteractiveContext::AddFilter(const Handle(SelectMgr_Filter)& aFilter)
void AIS_InteractiveContext::AddFilter(const Handle(SelectMgr_Filter)& theFilter)
{
myFilters->Add(aFilter);
Handle(SelectMgr_Filter) aFilter = Filter();
if (aFilter.IsNull())
SetFilter (new SelectMgr_OrFilter());
Handle (SelectMgr_CompositionFilter) aCompositeFilter = Handle(SelectMgr_CompositionFilter)::DownCast (aFilter);
if (aCompositeFilter.IsNull())
return;
if (aCompositeFilter->IsIn (theFilter))
return;
aCompositeFilter->Add (theFilter);
}
//=======================================================================
//function : RemoveFilter
//purpose :
//=======================================================================
void AIS_InteractiveContext::RemoveFilter(const Handle(SelectMgr_Filter)& aFilter)
void AIS_InteractiveContext::RemoveFilter(const Handle(SelectMgr_Filter)& theFilter)
{
myFilters->Remove(aFilter);
Handle(SelectMgr_Filter) aFilter = Filter();
if (aFilter.IsNull())
return;
Handle (SelectMgr_CompositionFilter) aCompositeFilter = Handle(SelectMgr_CompositionFilter)::DownCast (aFilter);
if (aCompositeFilter.IsNull())
return;
aCompositeFilter->Remove (theFilter);
}
//=======================================================================
@@ -289,16 +342,24 @@ void AIS_InteractiveContext::RemoveFilter(const Handle(SelectMgr_Filter)& aFilte
void AIS_InteractiveContext::RemoveFilters()
{
myFilters->Clear();
SetFilter (NULL);
}
//=======================================================================
//function : Filters
//purpose :
//=======================================================================
const SelectMgr_ListOfFilter& AIS_InteractiveContext::Filters() const
SelectMgr_ListOfFilter AIS_InteractiveContext::Filters() const
{
return myFilters->StoredFilters();
Handle(SelectMgr_Filter) aFilter = Filter();
if (aFilter.IsNull())
return SelectMgr_ListOfFilter();
Handle (SelectMgr_CompositionFilter) aCompositeFilter = Handle(SelectMgr_CompositionFilter)::DownCast (aFilter);
if (aCompositeFilter.IsNull())
return SelectMgr_ListOfFilter();
return aCompositeFilter->StoredFilters();
}
//=======================================================================

View File

@@ -23,7 +23,7 @@
#include <Quantity_Color.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_AndFilter.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Transient.hxx>
#include <TCollection_AsciiString.hxx>

View File

@@ -18,6 +18,7 @@
#include <AIS_InteractiveContext.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectFillCapping.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
@@ -83,6 +84,17 @@ void AIS_InteractiveObject::SetContext (const Handle(AIS_InteractiveContext)& th
}
}
//-----------------------------------------------------------------------------
void AIS_InteractiveObject::SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
SelectMgr_SelectableObject::SetTransformPersistence (theTrsfPers);
if (!GetContext().IsNull())
{
GetContext()->UpdateOnTransformPersistence (this);
}
}
//=======================================================================
//function : HasPresentation
//purpose :

View File

@@ -108,6 +108,11 @@ public:
//! Returns the context pointer to the interactive context.
Standard_EXPORT Handle(AIS_InteractiveContext) GetContext() const;
//! Sets up Transform Persistence defining a special Local Coordinate system where this object should be located.
//! Updates the presentation in context if it is not NULL
//! @sa Graphic3d_TransformPers class description
Standard_EXPORT virtual void SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers);
//! Returns TRUE when this object has a presentation in the current DisplayMode()
Standard_EXPORT Standard_Boolean HasPresentation() const;

View File

@@ -0,0 +1,24 @@
// Created on: 2003-05-04
// Created by: Alexander Grigoriev (a-grigoriev@opencascade.com)
// Copyright (c) 2003-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_NArray1Transient_HeaderFile
#define _AIS_NArray1Transient_HeaderFile
#include <SelectMgr_EntityOwner.hxx>
#include <NCollection_Array1.hxx>
typedef NCollection_Array1<Handle(SelectMgr_EntityOwner)> AIS_NArray1OfEntityOwner;
#endif

View File

@@ -44,6 +44,7 @@ AIS_RubberBand::AIS_RubberBand()
myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
myDrawer->ShadingAspect()->SetTransparency (1.0);
@@ -66,6 +67,7 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theWidth));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
myDrawer->ShadingAspect()->SetTransparency (1.0);
@@ -91,6 +93,7 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
myDrawer->ShadingAspect()->SetColor (theFillColor);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
myDrawer->ShadingAspect()->SetTransparency (theTransparency);

View File

@@ -15,6 +15,8 @@
#include <AIS_Selection.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_SelectionScheme.hxx>
#include <SelectMgr_Filter.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Selection, Standard_Transient)
@@ -130,3 +132,132 @@ AIS_SelectStatus AIS_Selection::AddSelect (const Handle(SelectMgr_EntityOwner)&
theObject->SetSelected (Standard_True);
return AIS_SS_Added;
}
//=======================================================================
//function : SelectOwners
//purpose :
//=======================================================================
void AIS_Selection::SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwners,
const AIS_SelectionScheme theSelScheme,
const Handle(SelectMgr_Filter)& theFilter)
{
switch (theSelScheme)
{
case AIS_SelectionScheme_UNKNOWN:
{
return;
}
case AIS_SelectionScheme_ReplaceExtra:
{
// If picked owners is equivalent to the selected then just clear selected
// Else go to AIS_SelectionScheme_Replace
if (thePickedOwners.Size() == myresult.Size())
{
Standard_Boolean isTheSame = Standard_True;
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
if (!myResultMap.IsBound (aSelIter.Value()))
{
isTheSame = Standard_False;
break;
}
}
if (isTheSame)
{
Clear();
return;
}
}
}
case AIS_SelectionScheme_Replace:
{
Clear();
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
appendOwner (aSelIter.Value(), theFilter);
}
return;
}
case AIS_SelectionScheme_Add:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
appendOwner (aSelIter.Value(), theFilter);
}
return;
}
case AIS_SelectionScheme_Remove:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
if (myResultMap.IsBound (aSelIter.Value()))
{
Select (aSelIter.Value());
}
}
return;
}
case AIS_SelectionScheme_XOR:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner)& anOwner = aSelIter.Value();
if (anOwner.IsNull()
|| !anOwner->HasSelectable()
|| !theFilter->IsOk (anOwner, SelectMgr_FilterReaction_Select))
{
continue;
}
Select (anOwner);
}
return;
}
case AIS_SelectionScheme_Clear:
{
Clear();
return;
}
}
}
//=======================================================================
//function : appendOwner
//purpose :
//=======================================================================
AIS_SelectStatus AIS_Selection::appendOwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(SelectMgr_Filter)& theFilter)
{
if (theOwner.IsNull()
|| !theOwner->HasSelectable()
|| !theFilter->IsOk (theOwner, SelectMgr_FilterReaction_Select))
{
return AIS_SS_NotDone;
}
return AddSelect (theOwner);
}
//=======================================================================
//function : XOROwner
//purpose :
//=======================================================================
AIS_SelectStatus AIS_Selection::XOROwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const AIS_NListOfEntityOwner& thePreviousSelected,
const Handle(SelectMgr_Filter)& theFilter)
{
if (theOwner.IsNull() || !theOwner->HasSelectable() || !theFilter->IsOk (theOwner, SelectMgr_FilterReaction_Select))
return AIS_SS_NotDone;
if (thePreviousSelected.Contains (theOwner)) // was selected, should not be now
{
if (theOwner->IsSelected())
return Select (theOwner); // deselect
}
else
{
return AddSelect (theOwner); // was not selected, should be now
}
return AIS_SS_NotDone;
}

View File

@@ -18,10 +18,14 @@
#define _AIS_Selection_HeaderFile
#include <AIS_NListOfEntityOwner.hxx>
#include <AIS_NArray1OfEntityOwner.hxx>
#include <AIS_SelectionScheme.hxx>
#include <AIS_SelectStatus.hxx>
#include <Standard.hxx>
#include <Standard_Type.hxx>
class SelectMgr_Filter;
//! Class holding the list of selected owners.
class AIS_Selection : public Standard_Transient
{
@@ -75,7 +79,33 @@ public:
//! Return selected object at iterator position.
const Handle(SelectMgr_EntityOwner)& Value() const { return myIterator.Value(); }
private:
//! Select or deselect owners depending on the selection scheme.
//! @param theOwners [in] elements to change selection state
//! @param theSelScheme [in] selection scheme, defines how owner is selected
//! @param theFilter [in] context filter to skip not acceptable owners
Standard_EXPORT virtual void SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwners,
const AIS_SelectionScheme theSelScheme,
const Handle(SelectMgr_Filter)& theFilter);
protected:
//! Append the owner into the current selection if filter is Ok.
//! @param theOwner [in] element to change selection state
//! @param theFilter [in] context filter to skip not acceptable owners
//! @return result of selection
Standard_EXPORT virtual AIS_SelectStatus appendOwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(SelectMgr_Filter)& theFilter);
//! XOR the owner to the current selection if filter is Ok.
//! \param theOwner element to change selection state
//! \param thePreviousSelected previous selected objects
//! \param theFilter context filter to skip not acceptable owners
//! \return result of selection
Standard_EXPORT virtual AIS_SelectStatus XOROwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const AIS_NListOfEntityOwner& thePreviousSelected,
const Handle(SelectMgr_Filter)& theFilter);
protected:
AIS_NListOfEntityOwner myresult;
AIS_NListOfEntityOwner::Iterator myIterator;

View File

@@ -0,0 +1,30 @@
// Copyright (c) 2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_SelectionScheme_HeaderFile
#define _AIS_SelectionScheme_HeaderFile
//! Sets selection schemes for interactive contexts.
enum AIS_SelectionScheme
{
AIS_SelectionScheme_UNKNOWN = -1, //!< undefined scheme
AIS_SelectionScheme_Replace = 0, //!< clears current selection and select detected objects
AIS_SelectionScheme_Add, //!< adds detected object to current selection
AIS_SelectionScheme_Remove, //!< removes detected object from the current selection
AIS_SelectionScheme_XOR, //!< performs XOR for detected objects, other selected not touched
AIS_SelectionScheme_Clear, //!< clears current selection
AIS_SelectionScheme_ReplaceExtra, //!< replace with one difference: if result of replace is an empty,
//!< and current selection contains detected element, it will be selected
};
#endif // _AIS_SelectionScheme_HeaderFile

View File

@@ -176,10 +176,7 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
try
{
OCC_CATCH_SIGNALS
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer,
myDrawer->ShadingAspect()->Aspect()->ToMapTexture()
&& !myDrawer->ShadingAspect()->Aspect()->TextureMap().IsNull(),
myUVOrigin, myUVRepeat, myUVScale);
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer, myDrawer->FillCappingAspect());
}
catch (Standard_Failure const& anException)
{

View File

@@ -110,7 +110,7 @@ AIS_ViewController::AIS_ViewController()
myAnchorPointPrs2->SetZLayer (Graphic3d_ZLayerId_Topmost);
myAnchorPointPrs2->SetMutable (true);
myRubberBand = new AIS_RubberBand (Quantity_NOC_LIGHTBLUE, Aspect_TOL_SOLID, Quantity_NOC_LIGHTBLUE, 0.4, 1.0);
myRubberBand = new AIS_RubberBand (Quantity_NOC_LIGHTBLUE, Aspect_TOL_SOLID, Quantity_NOC_LIGHTBLUE4, 0.5, 1.0);
myRubberBand->SetZLayer (Graphic3d_ZLayerId_TopOSD);
myRubberBand->SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_2d, Aspect_TOTP_LEFT_UPPER));
myRubberBand->SetDisplayMode (0);
@@ -2377,14 +2377,7 @@ void AIS_ViewController::handleSelectionPick (const Handle(AIS_InteractiveContex
ResetPreviousMoveTo();
}
if (myGL.Selection.IsXOR)
{
theCtx->ShiftSelect (false);
}
else
{
theCtx->Select (false);
}
theCtx->SelectDetected (myGL.Selection.IsXOR ? AIS_SelectionScheme_XOR : AIS_SelectionScheme_Replace);
// selection affects all Views
theView->Viewer()->Invalidate();
@@ -2486,18 +2479,10 @@ void AIS_ViewController::handleSelectionPoly (const Handle(AIS_InteractiveContex
else
{
theCtx->MainSelector()->AllowOverlapDetection (aPnt1.y() != Min (aPnt1.y(), aPnt2.y()));
if (myGL.Selection.IsXOR)
{
theCtx->ShiftSelect (Min (aPnt1.x(), aPnt2.x()), Min (aPnt1.y(), aPnt2.y()),
Max (aPnt1.x(), aPnt2.x()), Max (aPnt1.y(), aPnt2.y()),
theView, false);
}
else
{
theCtx->Select (Min (aPnt1.x(), aPnt2.x()), Min (aPnt1.y(), aPnt2.y()),
Max (aPnt1.x(), aPnt2.x()), Max (aPnt1.y(), aPnt2.y()),
theView, false);
}
theCtx->SelectRectangle (Graphic3d_Vec2i (Min (aPnt1.x(), aPnt2.x()), Min (aPnt1.y(), aPnt2.y())),
Graphic3d_Vec2i (Max (aPnt1.x(), aPnt2.x()), Max (aPnt1.y(), aPnt2.y())),
theView,
myGL.Selection.IsXOR ? AIS_SelectionScheme_XOR : AIS_SelectionScheme_Replace);
theCtx->MainSelector()->AllowOverlapDetection (false);
}
}
@@ -2512,14 +2497,8 @@ void AIS_ViewController::handleSelectionPoly (const Handle(AIS_InteractiveContex
aPolyIter.ChangeValue() = gp_Pnt2d (aNewPnt.x(), -aNewPnt.y());
}
if (myGL.Selection.IsXOR)
{
theCtx->ShiftSelect (aPolyline, theView, false);
}
else
{
theCtx->Select (aPolyline, theView, false);
}
theCtx->SelectPolygon (aPolyline, theView,
myGL.Selection.IsXOR ? AIS_SelectionScheme_XOR : AIS_SelectionScheme_Replace);
theCtx->MainSelector()->AllowOverlapDetection (false);
}
}

View File

@@ -73,6 +73,7 @@ AIS_MultipleConnectedInteractive.hxx
AIS_MultipleConnectedInteractive.lxx
AIS_NavigationMode.hxx
AIS_NListOfEntityOwner.hxx
AIS_NArray1OfEntityOwner.hxx
AIS_Plane.cxx
AIS_Plane.hxx
AIS_PlaneTrihedron.cxx
@@ -88,6 +89,7 @@ AIS_Selection.cxx
AIS_Selection.hxx
AIS_SelectStatus.hxx
AIS_SelectionModesConcurrency.hxx
AIS_SelectionScheme.hxx
AIS_SequenceOfInteractive.hxx
AIS_Shape.cxx
AIS_Shape.hxx

View File

@@ -23,6 +23,7 @@
#include <Aspect_Background.hxx>
#include <Quantity_Color.hxx>
#include <Standard_Dump.hxx>
//-Aliases
//-Global data definitions
@@ -56,3 +57,12 @@ Quantity_Color Aspect_Background::Color () const {
return (MyColor);
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Aspect_Background::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor)
}

View File

@@ -46,6 +46,9 @@ public:
//! Returns the colour of the window background <me>.
Standard_EXPORT Quantity_Color Color() const;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;

View File

@@ -140,3 +140,20 @@ void Aspect_CircularGrid::Init () {
myAlpha = M_PI / Standard_Real(myDivisionNumber);
myA1 = Cos(myAlpha); myB1=Sin(myAlpha);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_CircularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRadiusStep)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDivisionNumber)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlpha)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myA1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myB1)
}

View File

@@ -55,6 +55,9 @@ public:
Standard_EXPORT Standard_Integer DivisionNumber() const;
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -18,6 +18,8 @@
#include <Aspect_GenId.hxx>
#include <Aspect_IdentDefinitionError.hxx>
#include <Standard_Dump.hxx>
// =======================================================================
// function : Aspect_GenId
// purpose :
@@ -114,3 +116,21 @@ Standard_Boolean Aspect_GenId::Next (Standard_Integer& theId)
theId = myLowerBound + myLength - myFreeCount - 1;
return Standard_True;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Aspect_GenId::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFreeCount)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLength)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLowerBound)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUpperBound)
for (TColStd_ListOfInteger::Iterator anIter (myFreeIds); anIter.More(); anIter.Next())
{
Standard_Integer aFreeId = anIter.Value();
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aFreeId)
}
}

View File

@@ -72,6 +72,9 @@ public:
//! Returns the upper identifier in range.
Standard_Integer Upper() const { return myUpperBound; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:

View File

@@ -55,3 +55,15 @@ Aspect_GradientFillMethod Aspect_GradientBackground::BgGradientFillMethod( ) con
{
return MyGradientMethod;
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Aspect_GradientBackground::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Background)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyColor2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyGradientMethod)
}

View File

@@ -51,6 +51,9 @@ public:
//! Returns the current gradient background fill mode.
Standard_EXPORT Aspect_GradientFillMethod BgGradientFillMethod() const;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;

View File

@@ -104,3 +104,22 @@ void Aspect_Grid::SetDrawMode (const Aspect_GridDrawMode theDrawMode)
myDrawMode = theDrawMode;
UpdateDisplay();
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_Grid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRotationAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXOrigin)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYOrigin)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTenthColor)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDrawMode)
}

View File

@@ -96,6 +96,9 @@ public:
Standard_EXPORT virtual Standard_Boolean IsDisplayed() const = 0;
Standard_EXPORT virtual void Init() = 0;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:

View File

@@ -155,3 +155,25 @@ Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha,
const Standard_Real beta) const {
return (Abs( Sin(alpha) * Cos(beta + M_PI / 2.) - Cos(alpha) * Sin(beta + M_PI / 2.)) != 0) ;
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_RectangularGrid::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Aspect_Grid)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myXStep)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myYStep)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFirstAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySecondAngle)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c1)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, a2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, b2)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, c2)
}

View File

@@ -67,6 +67,9 @@ public:
Standard_EXPORT Standard_Real SecondAngle() const;
Standard_EXPORT virtual void Init() Standard_OVERRIDE;
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -92,3 +92,18 @@ void Aspect_Window::SetBackground (const Quantity_Color& theFirstColor,
{
MyGradientBackground.SetColors (theFirstColor, theSecondColor, theFillMethod);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Aspect_Window::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyBackground)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MyGradientBackground)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyBackgroundFillMethod)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, MyIsVirtual)
}

View File

@@ -114,6 +114,9 @@ public:
//! on platforms implementing thread-unsafe connections to display.
//! NULL can be passed instead otherwise.
virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)

View File

@@ -201,6 +201,51 @@ public:
}
}
//! Inits the content of me into the stream
Standard_Boolean InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
{
Standard_Integer aPos = theStreamPos;
Standard_Integer anIsInited = 0;
OCCT_INIT_FIELD_VALUE_INTEGER (theSStream, aPos, anIsInited);
myIsInited = anIsInited != 0;
int n = Min (N, 3);
if (n == 1)
{
Standard_Real aValue;
OCCT_INIT_FIELD_VALUE_REAL (theSStream, aPos, aValue);
myMinPoint[0] = (T)aValue;
}
if (n == 2)
{
Standard_Real aValue1, aValue2;
OCCT_INIT_VECTOR_CLASS (theSStream, "MinPoint", aPos, n, &aValue1, &aValue2);
myMinPoint[0] = (T)aValue1;
myMinPoint[1] = (T)aValue2;
OCCT_INIT_VECTOR_CLASS (theSStream, "MaxPoint", aPos, n, &aValue1, &aValue2);
myMaxPoint[0] = (T)aValue1;
myMaxPoint[1] = (T)aValue2;
}
if (n == 3)
{
Standard_Real aValue1, aValue2, aValue3;
OCCT_INIT_VECTOR_CLASS (theSStream, "MinPoint", aPos, n, &aValue1, &aValue2, &aValue3);
myMinPoint[0] = (T)aValue1;
myMinPoint[1] = (T)aValue2;
myMinPoint[2] = (T)aValue3;
OCCT_INIT_VECTOR_CLASS (theSStream, "MaxPoint", aPos, n, &aValue1, &aValue2, &aValue3);
myMaxPoint[0] = (T)aValue1;
myMaxPoint[1] = (T)aValue2;
myMaxPoint[2] = (T)aValue3;
}
theStreamPos = aPos;
return Standard_True;
}
public:
//! Checks if the Box is out of the other box.

View File

@@ -35,8 +35,6 @@
#include <BinMXCAFDoc_MaterialToolDriver.hxx>
#include <BinMXCAFDoc_NoteDriver.hxx>
#include <BinMXCAFDoc_NoteBalloonDriver.hxx>
#include <BinMXCAFDoc_NoteBinDataDriver.hxx>
#include <BinMXCAFDoc_NoteCommentDriver.hxx>
#include <BinMXCAFDoc_NotesToolDriver.hxx>
#include <BinMXCAFDoc_ShapeToolDriver.hxx>
#include <BinMXCAFDoc_ViewDriver.hxx>
@@ -81,8 +79,7 @@ void BinMXCAFDoc::AddDrivers(const Handle(BinMDF_ADriverTable)& theDriverTable,
theDriverTable->AddDriver( new BinMXCAFDoc_MaterialDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_VisMaterialDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_NoteBalloonDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_NoteBinDataDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_NoteCommentDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_NoteDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_ViewDriver (theMsgDrv));
theDriverTable->AddDriver( new BinMXCAFDoc_ColorToolDriver (theMsgDrv));

View File

@@ -42,6 +42,9 @@ class BinMXCAFDoc_DimTolToolDriver;
class BinMXCAFDoc_MaterialToolDriver;
class BinMXCAFDoc_ViewDriver;
class BinMXCAFDoc_ViewToolDriver;
class BinMXCAFDoc_AnimationDriver;
class BinMXCAFDoc_AnimationToolDriver;
@@ -89,6 +92,9 @@ friend class BinMXCAFDoc_DimTolToolDriver;
friend class BinMXCAFDoc_MaterialToolDriver;
friend class BinMXCAFDoc_ViewDriver;
friend class BinMXCAFDoc_ViewToolDriver;
friend class BinMXCAFDoc_AnimationDriver;
friend class BinMXCAFDoc_AnimationToolDriver;
};

View File

@@ -0,0 +1,112 @@
// Created on: 2017-10-02
// Created by: Elena MOZOKHINA
// Copyright (c) 2016 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinMXCAFDoc_AnimationDriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TDF_Attribute.hxx>
#include <XCAFDoc_Animation.hxx>
# include <TColStd_HArray1OfByte.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationDriver,BinMDF_ADriver)
static Standard_Boolean getByteArray(const BinObjMgt_Persistent& theSource, Handle(TColStd_HArray1OfByte)& theArray)
{
Standard_Integer aFirstInd, aLastInd;
if (!(theSource >> aFirstInd >> aLastInd))
return Standard_False;
if (aLastInd < aFirstInd)
return Standard_False;
theArray.reset(new TColStd_HArray1OfByte(aFirstInd, aLastInd - aFirstInd + 1));
theSource.GetByteArray(&theArray->ChangeFirst(), aLastInd - aFirstInd + 1);
return Standard_True;
}
static void putByteArray(BinObjMgt_Persistent& theTarget, const Handle(TColStd_HArray1OfByte)& theArray)
{
if (theArray.IsNull())
return;
const Standard_Integer aFirstInd = theArray->Lower();
const Standard_Integer aLastInd = theArray->Upper();
if (aLastInd < aFirstInd)
return;
theTarget << aFirstInd << aLastInd;
theTarget.PutByteArray(&theArray->ChangeFirst(), aLastInd - aFirstInd + 1);
}
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
BinMXCAFDoc_AnimationDriver::BinMXCAFDoc_AnimationDriver
(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Animation)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_AnimationDriver::NewEmpty() const
{
return new XCAFDoc_Animation();
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_AnimationDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Animation) anAtt = Handle(XCAFDoc_Animation)::DownCast(theTarget);
Standard_Real aDensity;
TCollection_AsciiString aName;
if (!(theSource >> aName))
return Standard_False;
Handle(TColStd_HArray1OfByte) anImage, anAnimation;
if (!getByteArray(theSource, anImage) || anImage.IsNull())
return Standard_False;
if (!getByteArray(theSource, anAnimation) || anAnimation.IsNull())
return Standard_False;
anAtt->Set(new TCollection_HAsciiString(aName), anImage, anAnimation);
return Standard_True;
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void BinMXCAFDoc_AnimationDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
{
Handle(XCAFDoc_Animation) anAtt = Handle(XCAFDoc_Animation)::DownCast(theSource);
Handle(TCollection_HAsciiString) aName = anAtt->GetName();
if (!aName.IsNull())
theTarget << aName->String();
putByteArray(theTarget, anAtt->GetImage());
putByteArray(theTarget, anAtt->GetAnimation());
}

View File

@@ -0,0 +1,72 @@
// Created on: 2017-10-02
// Created by: Elena MOZOKHINA
// Copyright (c) 2016 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMXCAFDoc_AnimationDriver_HeaderFile
#define _BinMXCAFDoc_AnimationDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <Standard_Boolean.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
class Message_Messenger;
class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMXCAFDoc_AnimationDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_AnimationDriver, BinMDF_ADriver)
class BinMXCAFDoc_AnimationDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMXCAFDoc_AnimationDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& theSource, BinObjMgt_Persistent& theTarget, BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationDriver,BinMDF_ADriver)
protected:
private:
};
#endif // _BinMXCAFDoc_AnimationDriver_HeaderFile

View File

@@ -0,0 +1,65 @@
// Created on: 2017-10-02
// Created by: Elena MOZOKHINA
// Copyright (c) 2016 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinMXCAFDoc_AnimationToolDriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDF_Attribute.hxx>
#include <XCAFDoc_AnimationTool.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_AnimationToolDriver::BinMXCAFDoc_AnimationToolDriver
(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_AnimationTool)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_AnimationToolDriver::NewEmpty() const
{
return new XCAFDoc_AnimationTool();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_AnimationToolDriver::Paste
(const BinObjMgt_Persistent& /*theSource*/,
const Handle(TDF_Attribute)& /*theTarget*/,
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_AnimationToolDriver::Paste
(const Handle(TDF_Attribute)& /*theSource*/,
BinObjMgt_Persistent& /*theTarget*/,
BinObjMgt_SRelocationTable& /*theRelocTable*/) const {
}

View File

@@ -0,0 +1,50 @@
// Created on: 2017-10-02
// Created by: Elena MOZOKHINA
// Copyright (c) 2016 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMXCAFDoc_AnimationToolDriver_HeaderFile
#define _BinMXCAFDoc_AnimationToolDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <Standard_Boolean.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
class Message_Messenger;
class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMXCAFDoc_AnimationToolDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver)
class BinMXCAFDoc_AnimationToolDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMXCAFDoc_AnimationToolDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Paste(const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT virtual void Paste(const Handle(TDF_Attribute)& theSource, BinObjMgt_Persistent& theTarget, BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver)
};
#endif // _BinMXCAFDoc_AnimationToolDriver_HeaderFile

View File

@@ -20,14 +20,14 @@
#include <BinMXCAFDoc_NoteBalloonDriver.hxx>
#include <XCAFDoc_NoteBalloon.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteCommentDriver)
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteDriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteBalloonDriver::BinMXCAFDoc_NoteBalloonDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMXCAFDoc_NoteCommentDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteBalloon)->Name())
: BinMXCAFDoc_NoteDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteBalloon)->Name())
{
}
@@ -40,13 +40,52 @@ Handle(TDF_Attribute) BinMXCAFDoc_NoteBalloonDriver::NewEmpty() const
return new XCAFDoc_NoteBalloon();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_NoteBalloonDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const
{
if (!BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable))
return Standard_False;
Handle(XCAFDoc_NoteBalloon) aNote = Handle(XCAFDoc_NoteBalloon)::DownCast(theTarget);
if (aNote.IsNull())
return Standard_False;
TCollection_ExtendedString aComment;
if (!(theSource >> aComment))
return Standard_False;
aNote->Set(aComment);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_NoteBalloonDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const
{
BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
Handle(XCAFDoc_NoteBalloon) aNote = Handle(XCAFDoc_NoteBalloon)::DownCast(theSource);
if (!aNote.IsNull())
theTarget << aNote->Get();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteBalloonDriver::BinMXCAFDoc_NoteBalloonDriver(const Handle(Message_Messenger)& theMsgDriver,
Standard_CString theName)
: BinMXCAFDoc_NoteCommentDriver(theMsgDriver, theName)
: BinMXCAFDoc_NoteDriver(theMsgDriver, theName)
{
}

View File

@@ -16,20 +16,28 @@
#ifndef _BinMXCAFDoc_NoteBalloonDriver_HeaderFile
#define _BinMXCAFDoc_NoteBalloonDriver_HeaderFile
#include <BinMXCAFDoc_NoteCommentDriver.hxx>
#include <BinMXCAFDoc_NoteDriver.hxx>
class BinMXCAFDoc_NoteBalloonDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteCommentDriver)
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteDriver)
class BinMXCAFDoc_NoteBalloonDriver : public BinMXCAFDoc_NoteCommentDriver
class BinMXCAFDoc_NoteBalloonDriver : public BinMXCAFDoc_NoteDriver
{
public:
Standard_EXPORT BinMXCAFDoc_NoteBalloonDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteCommentDriver)
Standard_EXPORT Standard_Boolean Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBalloonDriver, BinMXCAFDoc_NoteDriver)
protected:

View File

@@ -1,96 +0,0 @@
// Created on: 2017-02-13
// Created by: Eugeny NIKONOV
// Copyright (c) 2005-2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDF_Attribute.hxx>
#include <TColStd_HArray1OfByte.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <BinMXCAFDoc_NoteBinDataDriver.hxx>
#include <XCAFDoc_NoteBinData.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBinDataDriver, BinMXCAFDoc_NoteDriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteBinDataDriver::BinMXCAFDoc_NoteBinDataDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMXCAFDoc_NoteDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteBinData)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_NoteBinDataDriver::NewEmpty() const
{
return new XCAFDoc_NoteBinData();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_NoteBinDataDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const
{
if (!BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable))
return Standard_False;
Handle(XCAFDoc_NoteBinData) aNote = Handle(XCAFDoc_NoteBinData)::DownCast(theTarget);
if (aNote.IsNull())
return Standard_False;
TCollection_ExtendedString aTitle;
TCollection_AsciiString aMIMEtype;
Standard_Integer nbSize;
if (!(theSource >> aTitle >> aMIMEtype >> nbSize))
return Standard_False;
Handle(TColStd_HArray1OfByte) aData;
if (nbSize > 0)
{
aData.reset(new TColStd_HArray1OfByte(1, nbSize));
theSource.GetByteArray(&aData->ChangeFirst(), nbSize);
}
aNote->Set(aTitle, aMIMEtype, aData);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_NoteBinDataDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const
{
BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
Handle(XCAFDoc_NoteBinData) aNote = Handle(XCAFDoc_NoteBinData)::DownCast(theSource);
if (!aNote.IsNull())
{
theTarget << aNote->Title() << aNote->MIMEtype() << aNote->Size();
if (aNote->Size() > 0)
theTarget.PutByteArray(&aNote->Data()->ChangeFirst(), aNote->Size());
}
}

View File

@@ -1,44 +0,0 @@
// Created on: 2017-02-13
// Created by: Sergey NIKONOV
// Copyright (c) 2005-2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMXCAFDoc_NoteBinDataDriver_HeaderFile
#define _BinMXCAFDoc_NoteBinDataDriver_HeaderFile
#include <BinMXCAFDoc_NoteDriver.hxx>
class BinMXCAFDoc_NoteBinDataDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NoteBinDataDriver, BinMXCAFDoc_NoteDriver)
class BinMXCAFDoc_NoteBinDataDriver : public BinMXCAFDoc_NoteDriver
{
public:
Standard_EXPORT BinMXCAFDoc_NoteBinDataDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NoteBinDataDriver, BinMXCAFDoc_NoteDriver)
};
#endif // _BinMXCAFDoc_NoteBinDataDriver_HeaderFile

View File

@@ -1,91 +0,0 @@
// Created on: 2017-02-13
// Created by: Eugeny NIKONOV
// Copyright (c) 2005-2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDF_Attribute.hxx>
#include <BinMXCAFDoc_NoteCommentDriver.hxx>
#include <XCAFDoc_NoteComment.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteCommentDriver, BinMXCAFDoc_NoteDriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteCommentDriver::BinMXCAFDoc_NoteCommentDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMXCAFDoc_NoteDriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_NoteComment)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_NoteCommentDriver::NewEmpty() const
{
return new XCAFDoc_NoteComment();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Standard_Boolean BinMXCAFDoc_NoteCommentDriver::Paste(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const
{
if (!BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable))
return Standard_False;
Handle(XCAFDoc_NoteComment) aNote = Handle(XCAFDoc_NoteComment)::DownCast(theTarget);
if (aNote.IsNull())
return Standard_False;
TCollection_ExtendedString aComment;
if (!(theSource >> aComment))
return Standard_False;
aNote->Set(aComment);
return Standard_True;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
void BinMXCAFDoc_NoteCommentDriver::Paste(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const
{
BinMXCAFDoc_NoteDriver::Paste(theSource, theTarget, theRelocTable);
Handle(XCAFDoc_NoteComment) aNote = Handle(XCAFDoc_NoteComment)::DownCast(theSource);
if (!aNote.IsNull())
theTarget << aNote->Comment();
}
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteCommentDriver::BinMXCAFDoc_NoteCommentDriver(const Handle(Message_Messenger)& theMsgDriver,
Standard_CString theName)
: BinMXCAFDoc_NoteDriver(theMsgDriver, theName)
{
}

View File

@@ -1,49 +0,0 @@
// Created on: 2017-02-13
// Created by: Sergey NIKONOV
// Copyright (c) 2005-2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMXCAFDoc_NoteCommentDriver_HeaderFile
#define _BinMXCAFDoc_NoteCommentDriver_HeaderFile
#include <BinMXCAFDoc_NoteDriver.hxx>
class BinMXCAFDoc_NoteCommentDriver;
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_NoteCommentDriver, BinMXCAFDoc_NoteDriver)
class BinMXCAFDoc_NoteCommentDriver : public BinMXCAFDoc_NoteDriver
{
public:
Standard_EXPORT BinMXCAFDoc_NoteCommentDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_NoteCommentDriver, BinMXCAFDoc_NoteDriver)
protected:
BinMXCAFDoc_NoteCommentDriver(const Handle(Message_Messenger)& theMsgDriver,
Standard_CString theName);
};
#endif // _BinMXCAFDoc_NoteCommentDriver_HeaderFile

View File

@@ -22,6 +22,24 @@
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_NoteDriver, BinMDF_ADriver)
//=======================================================================
//function :
//purpose :
//=======================================================================
BinMXCAFDoc_NoteDriver::BinMXCAFDoc_NoteDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Note)->Name())
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMXCAFDoc_NoteDriver::NewEmpty() const
{
return new XCAFDoc_Note();
}
//=======================================================================
//function :
//purpose :

View File

@@ -35,6 +35,10 @@ class BinMXCAFDoc_NoteDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMXCAFDoc_NoteDriver(const Handle(Message_Messenger)& theMsgDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;

View File

@@ -39,10 +39,6 @@ BinMXCAFDoc_NoteDriver.cxx
BinMXCAFDoc_NoteDriver.hxx
BinMXCAFDoc_NoteBalloonDriver.cxx
BinMXCAFDoc_NoteBalloonDriver.hxx
BinMXCAFDoc_NoteCommentDriver.cxx
BinMXCAFDoc_NoteCommentDriver.hxx
BinMXCAFDoc_NoteBinDataDriver.cxx
BinMXCAFDoc_NoteBinDataDriver.hxx
BinMXCAFDoc_NotesToolDriver.cxx
BinMXCAFDoc_NotesToolDriver.hxx
BinMXCAFDoc_ShapeToolDriver.cxx
@@ -57,3 +53,7 @@ BinMXCAFDoc_VisMaterialToolDriver.cxx
BinMXCAFDoc_VisMaterialToolDriver.hxx
BinMXCAFDoc_VolumeDriver.cxx
BinMXCAFDoc_VolumeDriver.hxx
BinMXCAFDoc_AnimationDriver.cxx
BinMXCAFDoc_AnimationDriver.hxx
BinMXCAFDoc_AnimationToolDriver.cxx
BinMXCAFDoc_AnimationToolDriver.hxx

View File

@@ -983,3 +983,21 @@ void Bnd_Box::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Gap)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Flags)
}
//=======================================================================
//function : InitFromJson
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
{
Standard_Integer aPos = theStreamPos;
OCCT_INIT_VECTOR_CLASS (theSStream, "CornerMin", aPos, 3, &Xmin, &Ymin, &Zmin)
OCCT_INIT_VECTOR_CLASS (theSStream, "CornerMax", aPos, 3, &Xmax, &Ymax, &Zmax)
OCCT_INIT_FIELD_VALUE_REAL (theSStream, aPos, Gap);
OCCT_INIT_FIELD_VALUE_INTEGER (theSStream, aPos, Flags);
theStreamPos = aPos;
return Standard_True;
}

View File

@@ -305,6 +305,9 @@ public:
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
//! Inits the content of me into the stream
Standard_EXPORT Standard_Boolean InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos);
protected:
//! Bit flags.

View File

@@ -150,12 +150,12 @@ void CDM_MetaData::UnsetIsReadOnly() {
//function : DumpJson
//purpose :
//=======================================================================
void CDM_MetaData::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
void CDM_MetaData::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRetrieved)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDocument)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myDocument)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myFolder)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)

View File

@@ -17,6 +17,7 @@
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Message.hxx>
#include <TDocStd_Document.hxx>
#include <TDF_Label.hxx>
#include <TCollection_AsciiString.hxx>
@@ -34,6 +35,7 @@
#include <TDF_ListIteratorOfAttributeDeltaList.hxx>
#include <Standard_DomainError.hxx>
#include <XmlDrivers_MessageReportStorage.hxx>
//=======================================================================
@@ -147,11 +149,81 @@ static Standard_Integer DDocStd_DumpCommand (Draw_Interpretor& di,
}
return 0;
}
di << "TDocStd_DumpCommand : Error\n";
std::cerr << "TDocStd_DumpCommand : Error\n";
return 1;
}
//=======================================================================
//function : DDocStd_ReadMessageReport
//=======================================================================
static Standard_Integer DDocStd_ReadMessageReport (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 2)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
TCollection_ExtendedString aFileName (theArgVec[1]);
Handle(Message_Report) aReport = Message::DefaultReport (Standard_False);
if (aReport.IsNull())
{
std::cerr << "Error: Message_Report is not created.\n";
return 0;
}
Handle(Message_ReportWriter) aWriter = aReport->MessageWriter();
if (aWriter.IsNull())
{
aWriter = new XmlDrivers_MessageReportStorage();
aWriter->SetFileName (aFileName);
aReport->SetMessageWriter (aWriter);
}
if (!aWriter->ImportReport (aReport))
{
std::cerr << "Error: Message_Report can not be exported in " << aFileName << ".\n";
return 0;
}
return 0;
}
//=======================================================================
//function : DDocStd_WriteMessageReport
//=======================================================================
static Standard_Integer DDocStd_WriteMessageReport (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 2)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
TCollection_ExtendedString aFileName (theArgVec[1]);
Handle(Message_Report) aReport = Message::DefaultReport (Standard_False);
if (aReport.IsNull())
{
std::cerr << "Error: Message_Report is not created.\n";
return 0;
}
Handle(Message_ReportWriter) aWriter = aReport->MessageWriter();
if (aWriter.IsNull())
{
aWriter = new XmlDrivers_MessageReportStorage();
aWriter->SetFileName (aFileName);
aReport->SetMessageWriter (aWriter);
}
if (!aWriter->ExportReport (aReport))
{
std::cerr << "Error: Message_Report can not be exported in " << aFileName << ".\n";
return 0;
}
return 0;
}
//=======================================================================
//function : ModificationCommands
@@ -174,5 +246,15 @@ void DDocStd::ToolsCommands(Draw_Interpretor& theCommands)
"DumpCommand (DOC)",
__FILE__, DDocStd_DumpCommand, g);
}
theCommands.Add ("ReadMessageReport",
"ReadMessageReport FileName"
"\nRestores content of the default Message_Report from the file. This file is an XML document."
"\nIt might be restored into report using ReadMessageReport."
__FILE__, DDocStd_ReadMessageReport, g);
theCommands.Add ("WriteMessageReport",
"WriteMessageReport FileName"
"\nStores the default Message_Report into a file. This is an XML document."
"\nIt might be restored into report using ReadMessageReport."
__FILE__, DDocStd_WriteMessageReport, g);
}

View File

@@ -425,6 +425,7 @@ void Draw_Appli(int argc, char** argv, const FDraw_InitAppli Draw_InitAppli)
// standard commands
// *****************************************************************
Draw::BasicCommands(theCommands);
Draw::MessageCommands(theCommands);
Draw::VariableCommands(theCommands);
Draw::UnitCommands(theCommands);
if (!Draw_Batch) Draw::GraphicCommands(theCommands);

View File

@@ -132,6 +132,9 @@ public:
//! Defines Draw basic commands
Standard_EXPORT static void BasicCommands (Draw_Interpretor& I);
//! Defines Draw message commands
Standard_EXPORT static void MessageCommands (Draw_Interpretor& I);
//! Defines Draw variables handling commands.
Standard_EXPORT static void VariableCommands (Draw_Interpretor& I);

View File

@@ -23,6 +23,7 @@
void Draw::Commands (Draw_Interpretor& theCommands)
{
Draw::BasicCommands(theCommands);
Draw::MessageCommands(theCommands);
Draw::VariableCommands(theCommands);
Draw::GraphicCommands(theCommands);
Draw::PloadCommands(theCommands);

View File

@@ -0,0 +1,266 @@
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Draw.hxx>
#include <Draw_Printer.hxx>
#include <Message.hxx>
#include <Message_Messenger.hxx>
#include <Message_PrinterOStream.hxx>
#include <Message_PrinterSystemLog.hxx>
#include <Message_PrinterToReport.hxx>
#include <Message_Report.hxx>
#include <Standard_Dump.hxx>
//==============================================================================
//function : printerType
//purpose :
//==============================================================================
Standard_Boolean printerType (const TCollection_AsciiString& theTypeName,
Handle(Standard_Type)& theType)
{
if (theTypeName == "ostream")
{
theType = STANDARD_TYPE(Message_PrinterOStream);
}
else if (theTypeName == "systemlog")
{
theType = STANDARD_TYPE(Message_PrinterSystemLog);
}
else if (theTypeName == "report")
{
theType = STANDARD_TYPE(Message_PrinterToReport);
}
else if (theTypeName == "draw")
{
theType = STANDARD_TYPE(Draw_Printer);
}
else
return Standard_False;
return Standard_True;
}
//==============================================================================
//function : createPrinter
//purpose :
//==============================================================================
Handle(Message_Printer) createPrinter (const Handle(Standard_Type)& theType, Draw_Interpretor& theDI)
{
const Standard_CString aTypeName = theType->Name();
if (aTypeName == STANDARD_TYPE(Message_PrinterOStream)->Name())
{
return new Message_PrinterOStream();
}
else if (aTypeName == STANDARD_TYPE(Message_PrinterSystemLog)->Name())
{
return new Message_PrinterSystemLog ("draw_messages");
}
else if (aTypeName == STANDARD_TYPE(Message_PrinterToReport)->Name())
{
Handle(Message_PrinterToReport) aMessagePrinter = new Message_PrinterToReport();
const Handle(Message_Report)& aReport = Message::DefaultReport (Standard_True);
aMessagePrinter->SetReport (aReport);
return aMessagePrinter;
}
else if (aTypeName == STANDARD_TYPE(Draw_Printer)->Name())
{
return new Draw_Printer (theDI);
}
return Handle(Message_Printer)();
}
//==============================================================================
//function : SendMessage
//purpose :
//==============================================================================
static Standard_Integer SendMessage (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 2)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
const Handle(Message_Messenger)& aMessenger = Message::DefaultMessenger();
Handle(Standard_Type) aPrinterType;
for (Standard_Integer anArgIter = 1; anArgIter < theArgNb; ++anArgIter)
{
TCollection_AsciiString anArg (theArgVec[anArgIter]);
anArg.LowerCase();
aMessenger->Send (anArg);
}
return 0;
}
//==============================================================================
//function : DumpMessenger
//purpose :
//==============================================================================
static Standard_Integer DumpMessenger (Draw_Interpretor& theDI, Standard_Integer, const char**)
{
Standard_SStream aStream;
const Handle(Message_Messenger)& aMessenger = Message::DefaultMessenger();
aMessenger->DumpJson (aStream);
theDI << "Message_Messenger\n";
theDI << Standard_Dump::FormatJson (aStream);
return 0;
}
//==============================================================================
//function : SetMessagePrinter
//purpose :
//==============================================================================
static Standard_Integer SetMessagePrinter (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 2)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
const Handle(Message_Messenger)& aMessenger = Message::DefaultMessenger();
Handle(Standard_Type) aPrinterType;
for (Standard_Integer anArgIter = 1; anArgIter < theArgNb; ++anArgIter)
{
TCollection_AsciiString anArg (theArgVec[anArgIter]);
anArg.LowerCase();
if (anArg == "-clear")
{
aMessenger->ChangePrinters().Clear();
}
else if (anArg == "-type"
&& anArgIter + 1 < theArgNb)
{
TCollection_AsciiString aVal (theArgVec[++anArgIter]);
if (!printerType (aVal, aPrinterType))
{
std::cout << "Syntax error: unknown printer type '" << aVal << "'\n";
return 1;
}
if (aMessenger->HasPrinter (aPrinterType))
continue;
aMessenger->AddPrinter (createPrinter (aPrinterType, theDI));
}
else
{
std::cout << "Syntax error: unknown argument '" << theArgVec[anArgIter] << "'\n";
return 1;
}
}
return 0;
}
//==============================================================================
//function : SetReportMetric
//purpose :
//==============================================================================
static Standard_Integer SetReportMetric(Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 1)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
const Handle(Message_Report)& aReport = Message::DefaultReport (Standard_True);
if (aReport.IsNull())
return 1;
aReport->ClearMetrics();
for (int i = 1; i < theArgNb; i++)
{
Standard_Integer aMetricId = Draw::Atoi (theArgVec[i]);
if (aMetricId < Message_MetricType_UserTimeCPU || aMetricId > Message_MetricType_MemHeapUsage)
{
std::cout << "Unrecognized message metric: " << aMetricId << std::endl;
return 1;
}
aReport->SetActiveMetric ((Message_MetricType)aMetricId, Standard_True);
}
return 0;
}
//==============================================================================
//function : PrintReport
//purpose :
//==============================================================================
static Standard_Integer PrintReport(Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
if (theArgNb < 1)
{
std::cout << "Error: wrong number of arguments! See usage:\n";
theDI.PrintHelp (theArgVec[0]);
return 1;
}
const Handle(Message_Report)& aReport = Message::DefaultReport (Standard_True);
if (aReport.IsNull())
return 1;
if (theArgNb > 1) // default messenger
{
aReport->SendMessages (Message::DefaultMessenger());
}
else // stream
{
Standard_SStream aSStream;
aReport->Dump (aSStream);
theDI << aSStream;
}
return 0;
}
void Draw::MessageCommands(Draw_Interpretor& theCommands)
{
static Standard_Boolean Done = Standard_False;
if (Done) return;
Done = Standard_True;
std::ios::sync_with_stdio();
const char* group = "DRAW Message Commands";
theCommands.Add("SetMessagePrinter",
"SetMessagePrinter [-type ostream|systemlog|report|draw] [-clear]"
"\n\t\t: Sets printer into messenger or remove all printers."
"\n : Option -type set type of printer. Printers are applyed with And combination."
"\n : Option -clear remove all printers in messenger",
__FILE__, SetMessagePrinter, group);
theCommands.Add("DumpMessenger",
"DumpMessenger"
"\n Prints DumpJson information about Messenger.\n",
__FILE__, DumpMessenger, group);
theCommands.Add("SendMessage",
"SendMessage text [text ...]"
"\n Sends the text into the messenger.\n",
__FILE__, SendMessage, group);
theCommands.Add("SetReportMetric", "SetReportMetric [metric...] \n Activate report metrics, deactivate all if there are no parameters.\n",
__FILE__, SetReportMetric, group);
theCommands.Add("PrintReport", "PrintReport [messenger] \n Send report content to default messenger or stream (if parameter is absent).\n",
__FILE__, PrintReport, group);
}

View File

@@ -15,6 +15,7 @@
#include <Draw_Printer.hxx>
#include <Standard_Dump.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
@@ -44,3 +45,12 @@ void Draw_Printer::send (const TCollection_AsciiString& theString,
*myTcl << theString << "\n";
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Draw_Printer::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
}

View File

@@ -32,6 +32,8 @@ public:
//! Creates a printer connected to the interpretor.
Standard_EXPORT Draw_Printer (Draw_Interpretor& theTcl);
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
protected:
//! Send a string message with specified trace level.

View File

@@ -43,6 +43,7 @@ Draw_Marker2D.hxx
Draw_Marker3D.cxx
Draw_Marker3D.hxx
Draw_MarkerShape.hxx
Draw_MessageCommands.cxx
Draw_Number.cxx
Draw_Number.hxx
Draw_PInterp.hxx

View File

@@ -15,6 +15,8 @@
#define Font_BRepTextBuilder_Header
#include <StdPrs_BRepTextBuilder.hxx>
class Font_TextFormatter;
//! Alias for porting from old name.
typedef StdPrs_BRepTextBuilder Font_BRepTextBuilder;

View File

@@ -38,7 +38,7 @@ Font_FTFont::Font_FTFont (const Handle(Font_FTLibrary)& theFTLib)
myActiveFTFace(NULL),
myFontAspect (Font_FontAspect_Regular),
myWidthScaling(1.0),
myLoadFlags (FT_LOAD_NO_HINTING | FT_LOAD_TARGET_NORMAL),
myLoadFlags (/*FT_LOAD_NO_HINTING | */FT_LOAD_TARGET_NORMAL),
myUChar (0U),
myToUseUnicodeSubsetFallback (Font_FontMgr::ToUseUnicodeSubsetFallback())
{

View File

@@ -17,6 +17,10 @@
#include <Font_FTFont.hxx>
#include <Precision.hxx>
IMPLEMENT_STANDARD_RTTIEXT (Font_TextFormatter, Standard_Transient)
namespace
{
typedef NCollection_Vec2<Standard_ShortReal> Vec2f;
@@ -55,16 +59,17 @@ Font_TextFormatter::Font_TextFormatter()
: myAlignX (Graphic3d_HTA_LEFT),
myAlignY (Graphic3d_VTA_TOP),
myTabSize (8),
myWrappingWidth (0.0f),
myLastSymbolWidth (0.0f),
myMaxSymbolWidth (0.0f),
//
myPen (0.0f, 0.0f),
myRectsNb (0),
myLineSpacing (0.0f),
myAscender (0.0f),
myIsFormatted (false),
//
myLinesNb (0),
myRectLineStart (0),
myRectWordStart (0),
myNewLineNb(0),
myPenCurrLine (0.0f),
myBndTop (0.0f),
@@ -94,10 +99,12 @@ void Font_TextFormatter::Reset()
myIsFormatted = false;
myString.Clear();
myPen.x() = myPen.y() = 0.0f;
myRectsNb = 0;
myLineSpacing = myAscender = 0.0f;
myCorners.Clear();
myNewLines.Clear();
myLastSymbolWidth = 0.0f;
myMaxSymbolWidth = 0.0f;
}
// =======================================================================
@@ -119,16 +126,14 @@ void Font_TextFormatter::Append (const NCollection_String& theString,
int aSymbolsCounter = 0; // special counter to process tabulation symbols
// first pass - render all symbols using associated font on single ZERO baseline
for (NCollection_Utf8Iter anIter = theString.Iterator(); *anIter != 0;)
Standard_Utf32Char aCharThis;
for (Font_TextFormatter::Iterator aFormatterIt (*this); aFormatterIt .More(); aFormatterIt .Next())
{
const Standard_Utf32Char aCharThis = *anIter;
const Standard_Utf32Char aCharNext = *++anIter;
aCharThis = aFormatterIt.Symbol();
const Standard_Utf32Char aCharNext = aFormatterIt.SymbolNext();
if (aCharThis == '\x0D' // CR (carriage return)
|| aCharThis == '\a' // BEL (alarm)
|| aCharThis == '\f' // FF (form feed) NP (new page)
|| aCharThis == '\b' // BS (backspace)
|| aCharThis == '\v') // VT (vertical tab)
Standard_ShortReal anAdvanceX = 0;
if (IsCommandSymbol (aCharThis))
{
continue; // skip unsupported carriage control codes
}
@@ -136,79 +141,66 @@ void Font_TextFormatter::Append (const NCollection_String& theString,
{
aSymbolsCounter = 0;
myNewLines.Append (myPen.x());
continue; // will be processed on second pass
anAdvanceX = 0; // the symbol has null width
}
else if (aCharThis == ' ')
{
++aSymbolsCounter;
myPen.x() += theFont.AdvanceX (' ', aCharNext);
continue;
anAdvanceX = theFont.AdvanceX (' ', aCharNext);
}
else if (aCharThis == '\t')
{
const Standard_Integer aSpacesNum = (myTabSize - (aSymbolsCounter - 1) % myTabSize);
myPen.x() += theFont.AdvanceX (' ', aCharNext) * Standard_ShortReal(aSpacesNum);
anAdvanceX = theFont.AdvanceX (' ', aCharNext) * Standard_ShortReal(aSpacesNum);
aSymbolsCounter += aSpacesNum;
continue;
}
else
anAdvanceX = theFont.AdvanceX (aCharThis, aCharNext);
++aSymbolsCounter;
myCorners.Append (myPen);
myPen.x() += theFont.AdvanceX (aCharThis, aCharNext);
++myRectsNb;
myPen.x() += anAdvanceX;
myMaxSymbolWidth = Max (myMaxSymbolWidth, anAdvanceX);
}
myLastSymbolWidth = myPen.x() - myCorners.Last().x();
}
// =======================================================================
// function : newLine
// purpose :
// =======================================================================
void Font_TextFormatter::newLine (const Standard_Integer theLastRect)
void Font_TextFormatter::newLine (const Standard_Integer theLastRect,
const Standard_ShortReal theMaxLineWidth)
{
if (myRectLineStart >= myRectsNb)
Standard_Integer aFirstCornerId = myRectLineStart;
Standard_Integer aLastCornerId = theLastRect;
if (aFirstCornerId >= myCorners.Length())
{
++myLinesNb;
myPenCurrLine -= myLineSpacing;
return;
}
Standard_ShortReal aXMin = BottomLeft (aFirstCornerId).x();
Font_Rect aBndBox;
BndBox (aLastCornerId, aBndBox);
Standard_ShortReal aXMax = aBndBox.Right;
myMoveVec.y() = myPenCurrLine;
switch (myAlignX)
{
default:
case Graphic3d_HTA_LEFT:
{
myMoveVec.x() = (myNewLineNb > 0) ? -myNewLines.Value (myNewLineNb - 1) : 0.0f;
break;
}
case Graphic3d_HTA_RIGHT:
{
myMoveVec.x() = (myNewLineNb < myNewLines.Length())
? -myNewLines.Value (myNewLineNb)
: -myPen.x();
break;
}
case Graphic3d_HTA_CENTER:
{
const Standard_ShortReal aFrom = (myNewLineNb > 0)
? myNewLines.Value (myNewLineNb - 1)
: 0.0f;
const Standard_ShortReal aTo = (myNewLineNb < myNewLines.Length())
? myNewLines.Value (myNewLineNb)
: myPen.x();
myMoveVec.x() = -0.5f * (aFrom + aTo);
break;
}
case Graphic3d_HTA_LEFT: myMoveVec.x() = -aXMin; break;
case Graphic3d_HTA_RIGHT: myMoveVec.x() = -aXMin + (theMaxLineWidth - (aXMax - aXMin)) - theMaxLineWidth; break;
case Graphic3d_HTA_CENTER: myMoveVec.x() = -aXMin + 0.5f * (theMaxLineWidth - (aXMax - aXMin)) - 0.5f * theMaxLineWidth; break;
}
move (myCorners, myMoveVec, myRectLineStart, theLastRect);
++myLinesNb;
myPenCurrLine -= myLineSpacing;
myRectLineStart = myRectWordStart = theLastRect + 1;
myRectLineStart = theLastRect + 1;
}
// =======================================================================
@@ -217,13 +209,13 @@ void Font_TextFormatter::newLine (const Standard_Integer theLastRect)
// =======================================================================
void Font_TextFormatter::Format()
{
if (myRectsNb == 0 || myIsFormatted)
if (myCorners.Length() == 0 || myIsFormatted)
{
return;
}
myIsFormatted = true;
myLinesNb = myRectLineStart = myRectWordStart = 0;
myLinesNb = myRectLineStart = 0;
myBndTop = 0.0f;
myBndWidth = 0.0f;
myMoveVec.x() = myMoveVec.y() = 0.0f;
@@ -232,59 +224,56 @@ void Font_TextFormatter::Format()
myPenCurrLine = -myAscender;
Standard_Integer aRectIter = 0;
myNewLineNb = 0;
Standard_ShortReal aMaxLineWidth = -1.0f;
for (NCollection_Utf8Iter anIter = myString.Iterator(); *anIter != 0; ++anIter)
{
const Standard_Utf32Char aCharThis = *anIter;
if (aCharThis == '\x0D' // CR (carriage return)
|| aCharThis == '\a' // BEL (alarm)
|| aCharThis == '\f' // FF (form feed) NP (new page)
|| aCharThis == '\b' // BS (backspace)
|| aCharThis == '\v') // VT (vertical tab)
{
continue; // skip unsupported carriage control codes
}
else if (aCharThis == '\x0A') // LF (line feed, new line)
{
// calculate max line width
if (myNewLineNb == 0)
{
aMaxLineWidth = myNewLines.Value(0);
}
else
{
aMaxLineWidth = Max (aMaxLineWidth, myNewLines.Value (myNewLineNb) - myNewLines.Value (myNewLineNb - 1));
}
const Standard_Integer aLastRect = aRectIter - 1; // last rect on current line
newLine (aLastRect);
Standard_ShortReal aMaxLineWidth = Wrapping();
if (HasWrapping())
{
aMaxLineWidth = Max (aMaxLineWidth, MaximumSymbolWidth()); // it is not possible to wrap less than symbol width
}
else
{
if (myNewLines.IsEmpty()) // If only one line
aMaxLineWidth = myPen.x();
else
{
for (int aLineIt = 0; aLineIt < myNewLines.Size(); aLineIt++)
aMaxLineWidth = Max (aMaxLineWidth, LineWidth (aLineIt));
aMaxLineWidth = Max (aMaxLineWidth, LineWidth (myNewLines.Size())); // processing the last line also
}
}
for (Font_TextFormatter::Iterator aFormatterIt (*this);
aFormatterIt .More(); aFormatterIt .Next())
{
const Standard_Utf32Char aCharThis = aFormatterIt.Symbol();
aRectIter = aFormatterIt.SymbolPosition();
if (aCharThis == '\x0A') // LF (line feed, new line)
{
const Standard_Integer aLastRect = aRectIter; // last rect on current line
newLine (aLastRect, aMaxLineWidth);
++myNewLineNb;
continue;
}
else if (aCharThis == ' '
|| aCharThis == '\t')
else if (HasWrapping()) // wrap lines longer than maximum width
{
myRectWordStart = aRectIter;
continue;
Standard_Integer aFirstCornerId = myRectLineStart;
Font_Rect aBndBox;
BndBox (aRectIter, aBndBox);
const Standard_ShortReal aNextXPos = aBndBox.Right - BottomLeft (aFirstCornerId).x();
if (aNextXPos > aMaxLineWidth) // wrap the line and do processing of the symbol
{
const Standard_Integer aLastRect = aRectIter - 1; // last rect on current line
newLine (aLastRect, aMaxLineWidth);
}
}
++aRectIter;
}
// If only one line
if (aMaxLineWidth < 0.0f)
{
aMaxLineWidth = myPen.x();
}
else // Consider last line
{
aMaxLineWidth = Max (aMaxLineWidth, myPen.x() - myNewLines.Value (myNewLineNb - 1));
}
myBndWidth = aMaxLineWidth;
// move last line
newLine (myRectsNb - 1);
newLine (myCorners.Length() - 1, aMaxLineWidth);
// apply vertical alignment style
if (myAlignY == Graphic3d_VTA_BOTTOM)
@@ -302,6 +291,126 @@ void Font_TextFormatter::Format()
if (myAlignY != Graphic3d_VTA_TOP)
{
moveY (myCorners, myBndTop, 0, myRectsNb - 1);
moveY (myCorners, myBndTop, 0, myCorners.Length() - 1);
}
}
// =======================================================================
// function : BndBox
// purpose :
// =======================================================================
Standard_Boolean Font_TextFormatter::BndBox (const Standard_Integer theIndex, Font_Rect& theBndBox) const
{
if (theIndex < 0 || theIndex >= Corners().Size())
return Standard_False;
const NCollection_Vec2<Standard_ShortReal>& aLeftCorner = BottomLeft (theIndex);
if (theIndex + 1 < myCorners.Length()) // not the last symbol
{
const NCollection_Vec2<Standard_ShortReal>& aNextLeftCorner = BottomLeft (theIndex + 1);
theBndBox.Left = aLeftCorner.x();
theBndBox.Bottom = aLeftCorner.y();
theBndBox.Top = theBndBox.Bottom + myLineSpacing;
if (Abs (aLeftCorner.y() - aNextLeftCorner.y()) < Precision::Confusion()) // in the same row
{
theBndBox.Right = aNextLeftCorner.x();
}
else
{
// the next symbol is on the next row either by '\n' or by wrapping
Standard_ShortReal aLineWidth = LineWidth (LineIndex (theIndex));
theBndBox.Left = aLeftCorner.x();
switch (myAlignX)
{
case Graphic3d_HTA_LEFT: theBndBox.Right = aLineWidth; break;
case Graphic3d_HTA_RIGHT: theBndBox.Right = myBndWidth; break;
case Graphic3d_HTA_CENTER: theBndBox.Right = 0.5f * (myBndWidth + aLineWidth); break;
}
}
}
else // the last symbol
{
theBndBox.Left = aLeftCorner.x();
theBndBox.Right = aLeftCorner.x() + myLastSymbolWidth;
theBndBox.Bottom = aLeftCorner.y();
theBndBox.Top = theBndBox.Bottom + myLineSpacing;
}
return Standard_True;
}
// =======================================================================
// function : IsLFSymbol
// purpose :
// =======================================================================
Standard_Boolean Font_TextFormatter::IsLFSymbol (const Standard_Integer theIndex) const
{
Font_Rect aBndBox;
if (!BndBox (theIndex, aBndBox))
return Standard_False;
return Abs (aBndBox.Right - aBndBox.Left) < Precision::Confusion();
}
// =======================================================================
// function : FirstPosition
// purpose :
// =======================================================================
Standard_ShortReal Font_TextFormatter::FirstPosition() const
{
switch (myAlignX)
{
default:
case Graphic3d_HTA_LEFT: return 0; break;
case Graphic3d_HTA_RIGHT: return myBndWidth; break;
case Graphic3d_HTA_CENTER: return 0.5f * myBndWidth; break;
}
}
// =======================================================================
// function : LinePositionIndex
// purpose :
// =======================================================================
Standard_Integer Font_TextFormatter::LinePositionIndex (const Standard_Integer theIndex) const
{
Standard_Integer anIndex = 0;
Standard_ShortReal anIndexHeight = BottomLeft (theIndex).y();
for (Standard_Integer aPrevIndex = theIndex-1; aPrevIndex >= 0; aPrevIndex--)
{
if (BottomLeft (aPrevIndex).y() > anIndexHeight)
break;
anIndex++;
}
return anIndex;
}
// =======================================================================
// function : LineIndex
// purpose :
// =======================================================================
Standard_Integer Font_TextFormatter::LineIndex (const Standard_Integer theIndex) const
{
if (myLineSpacing < 0.0f)
return 0;
return (Standard_Integer)Abs((BottomLeft (theIndex).y() + myAscender) / myLineSpacing);
}
// =======================================================================
// function : LineWidth
// purpose :
// =======================================================================
Standard_ShortReal Font_TextFormatter::LineWidth (const Standard_Integer theIndex) const
{
if (theIndex < 0)
return 0;
if (theIndex < myNewLines.Length())
return theIndex == 0 ? myNewLines[0] : myNewLines[theIndex] - myNewLines[theIndex -1];
if (theIndex == myNewLines.Length()) // the last line
return theIndex == 0 ? myPen.x() : myPen.x() - myNewLines[theIndex -1];
return 0;
}

View File

@@ -25,10 +25,111 @@
class Font_FTFont;
DEFINE_STANDARD_HANDLE(Font_TextFormatter, Standard_Transient)
//! This class intended to prepare formatted text.
class Font_TextFormatter
//! Case of the formatter using:
//! Handle(Font_TextFormatter) aFormatter = new Font_TextFormatter();
//! aFormatter->Append(text_1, aFont1);
//! aFormatter->Append(text_2, aFont2);
//! aFormatter->Format();
//!
//! Example of corners indices for the text:
//! "row_1\n" - 0-5
//! "\n" - 6
//! "\n" - 7
//! "row_2\n" - 8-13
//! Processing of \n symbol:
//! - it is placed on the row where it appears
//! - BndBox for \n has zero width
//! - if the last symbol is \n, use LastBndBox() to get position on the next row
//!
//! Pay attention that fonts should have the same LineSpacing value
//!
class Font_TextFormatter : public Standard_Transient
{
public:
//! Iteration filter flags. Command symbols are skipped with any filter.
enum IterationFilter
{
IterationFilter_None = 0x0000, //!< no filter
IterationFilter_ExcludeInvisible = 0x0002, //!< exclude ' ', '\t', '\n'
};
//! Iterator through light sources.
class Iterator
{
public:
//! Constructor with initialization.
Iterator (const Font_TextFormatter& theFormatter,
IterationFilter theFilter = IterationFilter_None)
: myFilter (theFilter), myIter (theFormatter.myString.Iterator())
{
mySymbolPosition = readNextSymbol (-1, mySymbolChar);
mySymbolNext = readNextSymbol (mySymbolPosition, mySymbolCharNext);
}
//! Returns TRUE if iterator points to a valid item.
Standard_Boolean More() const { return mySymbolPosition >= 0; }
//! Returns TRUE if next item exists
Standard_Boolean HasNext() const { return mySymbolNext >= 0; }
//! Returns current symbol.
Standard_Utf32Char Symbol() const { return mySymbolChar; }
//! Returns the next symbol if exists.
Standard_Utf32Char SymbolNext() const { return mySymbolCharNext; }
//! Returns current symbol position.
Standard_Integer SymbolPosition() const { return mySymbolPosition; }
//! Returns the next symbol position.
Standard_Integer SymbolPositionNext() const { return mySymbolNext; }
//! Moves to the next item.
void Next()
{
mySymbolPosition = mySymbolNext;
mySymbolChar = mySymbolCharNext;
mySymbolNext = readNextSymbol (mySymbolPosition, mySymbolCharNext);
}
protected:
Standard_Integer readNextSymbol (const Standard_Integer aSymbolStartingFrom, Standard_Utf32Char& theSymbolChar)
{
Standard_Integer aNextSymbol = aSymbolStartingFrom;
for (; *myIter != 0; ++myIter)
{
const Standard_Utf32Char aCharCurr = *myIter;
if (Font_TextFormatter::IsCommandSymbol (aCharCurr))
{
continue; // skip unsupported carriage control codes
}
aNextSymbol++;
if ((myFilter & IterationFilter_ExcludeInvisible) != 0)
{
if (aCharCurr == '\x0A'|| // LF (line feed, new line)
aCharCurr == ' ' ||
aCharCurr == '\t')
continue;
}
++myIter;
theSymbolChar = aCharCurr;
return aNextSymbol; // found the first next, not command and not filtered symbol
}
return -1; // the next symbol is not found
}
protected:
IterationFilter myFilter; //!< possibility to filter not-necessary symbols
NCollection_Utf8Iter myIter; //!< the next symbol iterator value over the text formatter string
Standard_Integer mySymbolPosition; //!< the current position
Standard_Utf32Char mySymbolChar; //!< the current symbol
Standard_Integer mySymbolNext; //!< position of the next symbol in iterator, if zero, the iterator is finished
Standard_Utf32Char mySymbolCharNext; //!< the current symbol
};
//! Default constructor.
Standard_EXPORT Font_TextFormatter();
@@ -49,16 +150,32 @@ public:
Standard_EXPORT void Format();
//! Returns specific glyph rectangle.
inline const NCollection_Vec2<Standard_ShortReal>& TopLeft (const Standard_Integer theIndex) const
{
return myCorners.Value (theIndex);
}
inline const NCollection_Vec2<Standard_ShortReal>& BottomLeft (const Standard_Integer theIndex) const
{ return myCorners.Value (theIndex); }
//! Returns current rendering string.
inline const NCollection_String& String() const
{
return myString;
}
//! Returns symbol bounding box
//! @param bounding box.
Standard_EXPORT Standard_Boolean BndBox (const Standard_Integer theIndex, Font_Rect& theBndBox) const;
//! Returns the line height
//! \param theIndex a line index, obtained by LineIndex()
Standard_ShortReal LineHeight (const Standard_Integer theIndex) const
{ return theIndex == 0 ? myAscender : myLineSpacing; }
//!< Returns width of a line
Standard_EXPORT Standard_ShortReal LineWidth (const Standard_Integer theIndex) const;
//! Returns true if the symbol by the index is '\n'. The width of the symbol is zero.
Standard_EXPORT Standard_Boolean IsLFSymbol (const Standard_Integer theIndex) const;
//! Returns position of the first symbol in a line using alignment
Standard_EXPORT Standard_ShortReal FirstPosition() const;
//! Returns column index of the corner index in the current line
Standard_EXPORT Standard_Integer LinePositionIndex (const Standard_Integer theIndex) const;
//! Returns row index of the corner index among text lines
Standard_EXPORT Standard_Integer LineIndex (const Standard_Integer theIndex) const;
//! Returns tab size.
inline Standard_Integer TabSize() const
@@ -66,6 +183,21 @@ public:
return myTabSize;
}
//!< Returns horizontal alignment style
Graphic3d_HorizontalTextAlignment HorizontalTextAlignment() const { return myAlignX; }
//!< Returns vertical alignment style
Graphic3d_VerticalTextAlignment VerticalTextAlignment() const { return myAlignY; }
//!< Sets text wrapping width, zero means that the text is not bounded by width
void SetWrapping (const Standard_ShortReal theWidth) { myWrappingWidth = theWidth; }
//!< Returns text maximum width, zero means that the text is not bounded by width
Standard_Boolean HasWrapping() const { return myWrappingWidth > 0; }
//!< Returns text maximum width, zero means that the text is not bounded by width
Standard_ShortReal Wrapping() const { return myWrappingWidth; }
//! @return width of formatted text.
inline Standard_ShortReal ResultWidth() const
{
@@ -78,6 +210,9 @@ public:
return myLineSpacing * Standard_ShortReal(myLinesNb);
}
//!< @return maximum width of the text symbol
inline Standard_ShortReal MaximumSymbolWidth() const { return myMaxSymbolWidth; }
//! @param bounding box.
inline void BndBox (Font_Rect& theBndBox) const
{
@@ -98,16 +233,40 @@ public:
theBndBox.Bottom = theBndBox.Top - myLineSpacing * Standard_ShortReal(myLinesNb);
}
//!< Returns internal container of the top left corners of a formatted rectangles.
const NCollection_Vector < NCollection_Vec2<Standard_ShortReal> >& Corners() const { return myCorners; }
const NCollection_Vector<Standard_ShortReal>& NewLines() const { return myNewLines; }
//!< Returns true if the symbol is CR, BEL, FF, NP, BS or VT
static inline Standard_Boolean IsCommandSymbol (const Standard_Utf32Char& theSymbol)
{
if (theSymbol == '\x0D' // CR (carriage return)
|| theSymbol == '\a' // BEL (alarm)
|| theSymbol == '\f' // FF (form feed) NP (new page)
|| theSymbol == '\b' // BS (backspace)
|| theSymbol == '\v') // VT (vertical tab)
return Standard_True;
return Standard_False;
}
DEFINE_STANDARD_RTTIEXT (Font_TextFormatter, Standard_Transient)
protected: //! @name class auxiliary methods
//! Move glyphs on the current line to correct position.
Standard_EXPORT void newLine (const Standard_Integer theLastRect);
Standard_EXPORT void newLine (const Standard_Integer theLastRect,
const Standard_ShortReal theMaxLineWidth);
protected: //! @name configuration
Graphic3d_HorizontalTextAlignment myAlignX; //!< horizontal alignment style
Graphic3d_VerticalTextAlignment myAlignY; //!< vertical alignment style
Standard_Integer myTabSize; //!< horizontal tabulation width (number of space symbols)
Standard_ShortReal myWrappingWidth; //!< text is wrapped by the width if it is defined (more 0)
Standard_ShortReal myLastSymbolWidth; //!< width of the last symbol
Standard_ShortReal myMaxSymbolWidth; //!< maximum symbol width of the formatter string
protected: //! @name input data
@@ -116,18 +275,16 @@ protected: //! @name input data
myPen; //!< current pen position
NCollection_Vector < NCollection_Vec2<Standard_ShortReal> >
myCorners; //!< The top left corners of a formatted rectangles.
Standard_Integer myRectsNb; //!< rectangles number
NCollection_Vector<Standard_ShortReal>
myNewLines; //!< position at LF
Standard_ShortReal myLineSpacing; //!< line spacing (computed as maximum of all fonts involved in text formatting)
Standard_ShortReal myAscender; //!<
Standard_ShortReal myAscender; //!< line spacing for the first line
bool myIsFormatted; //!< formatting state
protected: //! @name temporary variables for formatting routines
Standard_Integer myLinesNb; //!< overall (new)lines number (including splitting by width limit)
Standard_Integer myRectLineStart; //!< id of first rectangle on the current line
Standard_Integer myRectWordStart; //!< id of first rectangle in the current word
Standard_Integer myNewLineNb;
Standard_ShortReal myPenCurrLine; //!< current baseline position
@@ -135,6 +292,8 @@ protected: //! @name temporary variables for formatting routines
Standard_ShortReal myBndWidth;
NCollection_Vec2<Standard_ShortReal>
myMoveVec; //!< local variable
friend Iterator;
};
#endif // Font_TextFormatter_Header

View File

@@ -15,6 +15,8 @@ Graphic3d_Aspects.cxx
Graphic3d_Aspects.hxx
Graphic3d_AspectFillArea3d.cxx
Graphic3d_AspectFillArea3d.hxx
Graphic3d_AspectFillCapping.cxx
Graphic3d_AspectFillCapping.hxx
Graphic3d_AspectLine3d.cxx
Graphic3d_AspectLine3d.hxx
Graphic3d_AspectMarker3d.cxx
@@ -39,6 +41,7 @@ Graphic3d_BvhCStructureSetTrsfPers.cxx
Graphic3d_BvhCStructureSetTrsfPers.hxx
Graphic3d_Camera.cxx
Graphic3d_Camera.hxx
Graphic3d_CameraTile.cxx
Graphic3d_CameraTile.hxx
Graphic3d_CappingFlags.hxx
Graphic3d_CLight.cxx
@@ -116,6 +119,7 @@ Graphic3d_PolygonOffset.cxx
Graphic3d_PolygonOffset.hxx
Graphic3d_PriorityDefinitionError.hxx
Graphic3d_RenderingMode.hxx
Graphic3d_RenderingParams.cxx
Graphic3d_RenderingParams.hxx
Graphic3d_RenderTransparentMethod.hxx
Graphic3d_SequenceOfGroup.hxx

View File

@@ -0,0 +1,110 @@
// Created on: 2017-04-14
// Created by: Anton POLETAEV
// Copyright (c) 2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_AspectFillCapping.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectFillCapping, Standard_Transient)
// =======================================================================
// function : Graphic3d_AspectFillCapping
// purpose :
// =======================================================================
Graphic3d_AspectFillCapping::Graphic3d_AspectFillCapping()
: myFlags (Flags_None),
myHatchingState (0)
{
Graphic3d_MaterialAspect aMaterial;
aMaterial.SetColor (Quantity_NOC_BLACK);
aMaterial.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
aMaterial.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
aMaterial.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
aMaterial.SetReflectionModeOff (Graphic3d_TOR_EMISSION);
aMaterial.SetMaterialType (Graphic3d_MATERIAL_ASPECT);
SetHatchStyle (Aspect_HS_HORIZONTAL);
SetHatchMaterial (aMaterial);
}
// =======================================================================
// function : SetHatchStyle
// purpose :
// =======================================================================
void Graphic3d_AspectFillCapping::SetHatchStyle (const Aspect_HatchStyle theStyle)
{
myStippleHatch = new Graphic3d_HatchStyle (theStyle);
myTextureHatch.Nullify();
myHatchingState++;
}
// =======================================================================
// function : SetHatchStyle
// purpose :
// =======================================================================
void Graphic3d_AspectFillCapping::SetHatchStyle (const Handle(Graphic3d_HatchStyle)& theStyle)
{
myStippleHatch = theStyle;
myTextureHatch.Nullify();
myHatchingState++;
}
// =======================================================================
// function : SetHatchStyle
// purpose :
// =======================================================================
void Graphic3d_AspectFillCapping::SetHatchStyle (const Handle(Graphic3d_TextureMap)& theTexture)
{
myStippleHatch.Nullify();
myTextureHatch = theTexture;
myHatchingState++;
}
// =======================================================================
// function : SetHatchMaterial
// purpose :
// =======================================================================
void Graphic3d_AspectFillCapping::SetHatchMaterial (const Graphic3d_MaterialAspect& theMaterial)
{
myHatchMaterial = theMaterial;
myHatchingState++;
}
// =======================================================================
// function : SetToDrawHatch
// purpose :
// =======================================================================
void Graphic3d_AspectFillCapping::SetToDrawHatch (const Standard_Boolean theToDraw)
{
setFlag (theToDraw, Flags_DrawHatching);
myHatchingState++;
}
// =======================================================================
// function : SetHatchZoomPeristent
// purpose :
// =======================================================================
void Graphic3d_AspectFillCapping::SetHatchZoomPeristent (const Standard_Boolean theToSet)
{
setFlag (theToSet, Flags_HatchZoomPersistent);
myHatchingState++;
}
// =======================================================================
// function : SetHatchRotationPeristent
// purpose :
// =======================================================================
void Graphic3d_AspectFillCapping::SetHatchRotationPeristent (const Standard_Boolean theToSet)
{
setFlag (theToSet, Flags_HatchRotationPersistent);
myHatchingState++;
}

View File

@@ -0,0 +1,164 @@
// Created on: 2017-04-14
// Created by: Anton POLETAEV
// Copyright (c) 2017 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Graphic3d_AspectFillCapping_HeaderFile
#define _Graphic3d_AspectFillCapping_HeaderFile
#include <Aspect_HatchStyle.hxx>
#include <Graphic3d_Aspects.hxx>
#include <Graphic3d_HatchStyle.hxx>
#include <Graphic3d_MaterialAspect.hxx>
#include <Graphic3d_ShaderProgram.hxx>
#include <Graphic3d_TextureMap.hxx>
#include <Standard_Transient.hxx>
//! Defines graphical attributes for drawing section planes on solids resulted from clipping (cutting) planes.
class Graphic3d_AspectFillCapping : public Graphic3d_Aspects
{
public:
//! Default constructor.
Standard_EXPORT Graphic3d_AspectFillCapping();
public:
//! Sets material for filling section created by clipping.
void SetMaterial (const Graphic3d_MaterialAspect& theMaterial) { myMaterial = theMaterial; }
//! Returns material for filling section created by clipping.
const Graphic3d_MaterialAspect& Material() const { return myMaterial; }
//! Sets flag indicating whether object's material (instead of defined by this aspect) should be used for filling section.
void SetUseObjectMaterial (const Standard_Boolean theToUse) { setFlag (theToUse, Flags_UseObjectMaterial); }
//! Returns flag indicating whether object's material (instead of defined by this aspect) should be used for filling section.
Standard_Boolean ToUseObjectMaterial() const { return (myFlags & Flags_UseObjectMaterial) != 0; }
//! Sets texture for filling section created by clipping.
void SetTexture (const Handle(Graphic3d_TextureMap)& theTexture) { myTexture = theTexture; }
//! Returns texture for filling section created by clipping.
const Handle(Graphic3d_TextureMap)& Texture() const { return myTexture; }
//! Sets flag indicating whether object's texture (instead of defined by this aspect) should be used for filling section.
void SetUseObjectTexture (const Standard_Boolean theToUse) { setFlag (theToUse, Flags_UseObjectTexture); }
//! Returns flag indicating whether object's texture (instead of defined by this aspect) should be used for filling section.
Standard_Boolean ToUseObjectTexture() const { return (myFlags & Flags_UseObjectTexture) != 0; }
//! Sets OpenGL/GLSL shader program.
void SetShader (const Handle(Graphic3d_ShaderProgram)& theShader) { myShader = theShader; }
//! Returns OpenGL/GLSL shader program.
const Handle(Graphic3d_ShaderProgram)& Shader() const { return myShader; }
//! Sets flag indicating whether object's shader (instead of defined by this aspect) should be used for filling section.
void SetUseObjectShader (const Standard_Boolean theToUse) { setFlag (theToUse, Flags_UseObjectShader); }
//! Returns flag indicating whether object's shader (instead of defined by this aspect) should be used for filling section.
Standard_Boolean ToUseObjectShader() const { return (myFlags & Flags_UseObjectShader) != 0; }
public:
//! Sets style of hatch defined by predefined stipple mask.
Standard_EXPORT void SetHatchStyle (const Aspect_HatchStyle theStyle);
//! Sets style of hatch defined by custom stipple mask.
Standard_EXPORT void SetHatchStyle (const Handle(Graphic3d_HatchStyle)& theStyle);
//! Sets style of hatch defined by texture map (decal texture with alpha channel should be used).
Standard_EXPORT void SetHatchStyle (const Handle(Graphic3d_TextureMap)& theTexture);
//! Sets material style for hatch lines (texture).
Standard_EXPORT void SetHatchMaterial (const Graphic3d_MaterialAspect& theMaterial);
//! Returns material style for hatch lines (texture).
const Graphic3d_MaterialAspect& HatchMaterial() const { return myHatchMaterial; }
//! Sets boolean flag indicating whether the hatch layer should be drawn or not.
Standard_EXPORT void SetToDrawHatch (const Standard_Boolean theToDraw);
//! Returns boolean flag indicating whether the hatch layer should be drawn or not.
Standard_Boolean ToDrawHatch() const { return (myFlags & Flags_DrawHatching) != 0; }
//! Sets flag controlling behavior of hatch texture mapping on zooming.
//! @param theToSet [in] if passed TRUE the texture will keep constant screen-scale independent of zooming.
Standard_EXPORT void SetHatchZoomPeristent (const Standard_Boolean theToSet);
//! Returns value of flag controlling behavior of hatch texture mapping on zooming.
Standard_Boolean IsHatchZoomPersistent() { return (myFlags & Flags_HatchZoomPersistent) != 0; }
//! Sets flag controlling behavior of hatch texture mapping on camera rotation around heading vector.
Standard_EXPORT void SetHatchRotationPeristent (const Standard_Boolean theToSet);
//! Returns value of flag controlling behavior of hatch texture mapping on camera rotation around heading vector.
Standard_Boolean IsHatchRotationPersistent() { return (myFlags & Flags_HatchRotationPersistent) != 0; }
//! Returns true if hatch is defined by texture.
Standard_Boolean IsTextureHatch() const { return !myTextureHatch.IsNull(); }
//! Returns texture map defining the hatch.
const Handle(Graphic3d_TextureMap)& TextureHatch() const { return myTextureHatch; }
//! Returns true if hatch is defined by stipple mask.
Standard_Boolean IsStippleHatch() const { return !myStippleHatch.IsNull(); }
//! Returns the stipple mask.
const Handle(Graphic3d_HatchStyle)& StippleHatch() const { return myStippleHatch; }
//! Returns modification counter for hatching state.
Standard_Size HatchingState() const { return myHatchingState; }
private:
enum Flags
{
Flags_None = 0x00, //!< no flags
Flags_UseObjectMaterial = 0x01, //!< use object material
Flags_UseObjectTexture = 0x02, //!< use object texture
Flags_UseObjectShader = 0x04, //!< use object GLSL program
Flags_HatchZoomPersistent = 0x08, //!< zoom-persistent texturing
Flags_HatchRotationPersistent = 0x10, //!< rotation-persistent texturing
Flags_DrawHatching = 0x20, //!< draw hatching
Flags_UseObjectProperties = //!< use entire fill area aspect from object
Flags_UseObjectMaterial
| Flags_UseObjectTexture
| Flags_UseObjectShader
};
void setFlag (const Standard_Boolean theToUse, const unsigned int theFlag)
{
myFlags = theToUse ? myFlags | theFlag : myFlags & ~theFlag;
}
private:
Graphic3d_MaterialAspect myMaterial;
Handle(Graphic3d_TextureMap) myTexture;
Handle(Graphic3d_ShaderProgram) myShader;
Handle(Graphic3d_HatchStyle) myStippleHatch;
Handle(Graphic3d_TextureMap) myTextureHatch;
Graphic3d_MaterialAspect myHatchMaterial;
unsigned int myFlags;
Standard_Size myHatchingState;
public:
DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectFillCapping, Graphic3d_Aspects)
};
DEFINE_STANDARD_HANDLE (Graphic3d_AspectFillCapping, Graphic3d_Aspects)
#endif // _Graphic3d_AspectFillCapping_HeaderFile

View File

@@ -55,3 +55,13 @@ Graphic3d_AspectText3d::Graphic3d_AspectText3d (const Quantity_Color& theColor,
myTextFont = new TCollection_HAsciiString (theFont);
}
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_AspectText3d::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS(theOStream, theDepth, Graphic3d_Aspects)
}

View File

@@ -110,6 +110,9 @@ public:
//! Returns text FontAspect
Font_FontAspect GetTextFontAspect() const { return myTextFontAspect; }
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
};

View File

@@ -523,7 +523,7 @@ public:
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
protected:

View File

@@ -245,4 +245,28 @@ void Graphic3d_CLight::SetRange (Standard_ShortReal theValue)
Standard_OutOfRange_Raise_if (theValue < 0.0, "Graphic3d_CLight::SetRange(), Bad value for falloff range");
updateRevisionIf (Abs (Range() - theValue) > ShortRealEpsilon());
myDirection.w() = theValue;
};
};
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_CLight::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myId)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPosition)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myColor)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDirection)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myParams)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySmoothness)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIntensity)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myType)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRevision)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsHeadlight)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsEnabled)
}

View File

@@ -204,6 +204,9 @@ public:
//! @return modification counter
Standard_Size Revision() const { return myRevision; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
private:

View File

@@ -442,6 +442,14 @@ Bnd_Box Graphic3d_CView::MinMaxValues (const Standard_Boolean theToIncludeAuxili
theToIncludeAuxiliary);
aResult.Add (aBox);
}
// force HLRValidation to False on all structures calculated in the view
for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructsComputed); aStructIter.More(); aStructIter.Next())
{
Bnd_Box aBox = aStructIter.Value()->MinMaxValues();
aResult.Add (aBox);
}
return aResult;
}
@@ -1394,3 +1402,39 @@ void Graphic3d_CView::DiagnosticInformation (TColStd_IndexedDataMapOfStringStrin
theDict.ChangeFromIndex (theDict.Add ("VRserial", aSerial)) = aSerial;
}
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_CView::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Graphic3d_DataStructureManager);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myId)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myRenderParams)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBgColor)
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myStructureManager)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCamera.get())
for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsToCompute); anIter.More(); anIter.Next())
{
Handle(Graphic3d_Structure) aStructToCompute = anIter.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructToCompute.get())
}
for (Graphic3d_SequenceOfStructure::Iterator anIter (myStructsComputed); anIter.More(); anIter.Next())
{
Handle(Graphic3d_Structure) aStructComputed = anIter.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aStructComputed.get())
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInComputedMode)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRemoved)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShadingModel)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisualization)
}

View File

@@ -96,6 +96,12 @@ public:
//! Sets camera used by the view.
virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) { myCamera = theCamera; }
//! Returns necessity to flip OY in projection matrix
virtual Standard_Boolean IsToFlipOutput() const { return Standard_False; }
//! Sets state of flip OY necessity in projection matrix
virtual void SetToFlipOutput (const Standard_Boolean) {}
public:
//! Returns default Shading Model of the view; Graphic3d_TOSM_FRAGMENT by default.
@@ -534,6 +540,9 @@ public: //! @name obsolete Graduated Trihedron functionality
(void )theMin;
(void )theMax;
}
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
private:

View File

@@ -1676,4 +1676,24 @@ void Graphic3d_Camera::DumpJson (Standard_OStream& theOStream, Standard_Integer
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEye)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDistance)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxialScale)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myProjType)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFOVy)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFOVyTan)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZNear)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZFar)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAspect)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myScale)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZFocus)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZFocusType)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIOD)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIODType)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myTile)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMatricesD)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myMatricesF)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myWorldViewProjState)
}

View File

@@ -78,6 +78,18 @@ private:
//! Return true if Projection was not invalidated.
Standard_Boolean IsProjectionValid() const { return myIsProjectionValid; }
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const
{
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Orientation)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &MProjection)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &LProjection)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &RProjection)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsOrientationValid)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsProjectionValid)
}
public:

View File

@@ -0,0 +1,30 @@
// Created on: 2020-02-06
// Created by: Svetlana SHUTINA
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_CameraTile.hxx>
#include <Standard_Dump.hxx>
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_CameraTile::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &TotalSize)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &TileSize)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &Offset)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsTopDown)
}

View File

@@ -16,6 +16,7 @@
#include <Graphic3d_Vec2.hxx>
#include <Standard_Integer.hxx>
#include <Standard_OStream.hxx>
#include <Standard_TypeDef.hxx>
//! Class defines the area (Tile) inside a view.
@@ -82,6 +83,9 @@ public:
&& anOffset1.x() == anOffset2.x()
&& anOffset1.y() == anOffset2.y();
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
};

View File

@@ -24,19 +24,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ClipPlane,Standard_Transient)
namespace
{
static volatile Standard_Integer THE_CLIP_PLANE_COUNTER = 0;
static Handle(Graphic3d_AspectFillArea3d) defaultAspect()
{
Graphic3d_MaterialAspect aMaterial (Graphic3d_NOM_DEFAULT);
Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d();
anAspect->SetDistinguishOff();
anAspect->SetFrontMaterial (aMaterial);
anAspect->SetHatchStyle (Aspect_HS_HORIZONTAL);
anAspect->SetInteriorStyle (Aspect_IS_SOLID);
anAspect->SetInteriorColor (Quantity_NOC_GRAY20);
anAspect->SetSuppressBackFaces (false);
return anAspect;
}
}
// =======================================================================
@@ -44,19 +31,8 @@ namespace
// purpose :
// =======================================================================
Graphic3d_ClipPlane::Graphic3d_ClipPlane()
: myAspect (defaultAspect()),
myPrevInChain(NULL),
myPlane (0.0, 0.0, 1.0, 0.0),
myEquation (0.0, 0.0, 1.0, 0.0),
myEquationRev(0.0, 0.0,-1.0, 0.0),
myChainLenFwd(1),
myFlags (Graphic3d_CappingFlags_None),
myEquationMod(0),
myAspectMod (0),
myIsOn (Standard_True),
myIsCapping (Standard_False)
{
makeId();
init();
}
// =======================================================================
@@ -64,19 +40,8 @@ Graphic3d_ClipPlane::Graphic3d_ClipPlane()
// purpose :
// =======================================================================
Graphic3d_ClipPlane::Graphic3d_ClipPlane (const Graphic3d_Vec4d& theEquation)
: myAspect (defaultAspect()),
myPrevInChain(NULL),
myPlane (theEquation.x(), theEquation.y(), theEquation.z(), theEquation.w()),
myEquation (theEquation),
myEquationRev(0.0, 0.0,-1.0, 0.0),
myChainLenFwd(1),
myFlags (Graphic3d_CappingFlags_None),
myEquationMod(0),
myAspectMod (0),
myIsOn (Standard_True),
myIsCapping (Standard_False)
{
makeId();
init (gp_Pln (theEquation.x(), theEquation.y(), theEquation.z(), theEquation.a()));
updateInversedPlane();
}
@@ -84,42 +49,27 @@ Graphic3d_ClipPlane::Graphic3d_ClipPlane (const Graphic3d_Vec4d& theEquation)
// function : Graphic3d_ClipPlane
// purpose :
// =======================================================================
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const Graphic3d_ClipPlane& theOther)
: Standard_Transient(theOther),
myAspect (defaultAspect()),
myPrevInChain(NULL),
myPlane (theOther.myPlane),
myEquation (theOther.myEquation),
myEquationRev(theOther.myEquationRev),
myChainLenFwd(1),
myFlags (theOther.myFlags),
myEquationMod(0),
myAspectMod (0),
myIsOn (theOther.myIsOn),
myIsCapping (theOther.myIsCapping)
Graphic3d_ClipPlane::Graphic3d_ClipPlane (const Graphic3d_ClipPlane& theOther)
: Standard_Transient (theOther)
{
makeId();
*myAspect = *theOther.CappingAspect();
*mySectionStyle = *theOther.CappingSectionStyle();
init (theOther.myPlane,
theOther.myEquationRev,
theOther.myIsOn,
theOther.myIsCapping,
theOther.ToOverrideCappingAspect(),
theOther.CappingSectionStyle());
updateInversedPlane();
}
// =======================================================================
// function : Graphic3d_ClipPlane
// purpose :
// =======================================================================
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const gp_Pln& thePlane)
: myAspect (defaultAspect()),
myPrevInChain(NULL),
myPlane (thePlane),
myChainLenFwd(1),
myFlags (Graphic3d_CappingFlags_None),
myEquationMod(0),
myAspectMod (0),
myIsOn (Standard_True),
myIsCapping (Standard_False)
Graphic3d_ClipPlane::Graphic3d_ClipPlane (const gp_Pln& thePlane)
{
thePlane.Coefficients (myEquation[0], myEquation[1], myEquation[2], myEquation[3]);
init (thePlane);
updateInversedPlane();
makeId();
}
// =======================================================================
@@ -131,7 +81,7 @@ void Graphic3d_ClipPlane::SetEquation (const Graphic3d_Vec4d& theEquation)
myPlane = gp_Pln (theEquation.x(), theEquation.y(), theEquation.z(), theEquation.w());
myEquation = theEquation;
updateInversedPlane();
myEquationMod++;
myOrientationDirty = Standard_True;
}
// =======================================================================
@@ -143,7 +93,7 @@ void Graphic3d_ClipPlane::SetEquation (const gp_Pln& thePlane)
myPlane = thePlane;
thePlane.Coefficients (myEquation[0], myEquation[1], myEquation[2], myEquation[3]);
updateInversedPlane();
myEquationMod++;
myOrientationDirty = Standard_True;
}
// =======================================================================
@@ -183,128 +133,114 @@ Handle(Graphic3d_ClipPlane) Graphic3d_ClipPlane::Clone() const
// =======================================================================
void Graphic3d_ClipPlane::SetCappingColor (const Quantity_Color& theColor)
{
myAspect->SetInteriorColor (theColor);
myAspect->ChangeFrontMaterial().SetColor (theColor);
mySectionStyle->SetInteriorColor (theColor);
mySectionStyle->ChangeFrontMaterial().SetColor (theColor);
++myAspectMod;
}
// =======================================================================
// function : SetCappingMaterial
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::SetCappingMaterial (const Graphic3d_MaterialAspect& theMat)
void Graphic3d_ClipPlane::SetCappingSectionStyle (const Handle(Graphic3d_AspectFillCapping)& theStyle)
{
myAspect->SetFrontMaterial (theMat);
if (myAspect->FrontMaterial().MaterialType() != Graphic3d_MATERIAL_ASPECT)
mySectionStyle = theStyle;
if (mySectionStyle->FrontMaterial().MaterialType() != Graphic3d_MATERIAL_ASPECT)
{
myAspect->SetInteriorColor (theMat.Color());
}
++myAspectMod;
}
// =======================================================================
// function : SetCappingTexture
// function : OrientationMatrix
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::SetCappingTexture (const Handle(Graphic3d_TextureMap)& theTexture)
const Graphic3d_Mat4& Graphic3d_ClipPlane::OrientationMatrix() const
{
if (!theTexture.IsNull())
if (myOrientationDirty)
{
myAspect->SetTextureMapOn();
Handle(Graphic3d_TextureSet) aTextureSet = myAspect->TextureSet();
if (aTextureSet.IsNull() || aTextureSet->Size() != 1)
const Standard_ShortReal aDirection[] = {
static_cast<Standard_ShortReal> (myEquation[0]),
static_cast<Standard_ShortReal> (myEquation[1]),
static_cast<Standard_ShortReal> (myEquation[2])
};
const Standard_ShortReal aTranslate[] = {
static_cast<Standard_ShortReal> (myEquation[0] * -myEquation[3]),
static_cast<Standard_ShortReal> (myEquation[1] * -myEquation[3]),
static_cast<Standard_ShortReal> (myEquation[2] * -myEquation[3])
};
Standard_ShortReal aSide1[] = { 0.0f, 0.0f, 0.0f };
Standard_ShortReal aSide2[] = { 0.0f, 0.0f, 0.0f };
const Standard_ShortReal aMagintude = static_cast<Standard_ShortReal> (Sqrt (myEquation[0] * myEquation[0] + myEquation[2] * myEquation[2]));
if (aMagintude < ShortRealSmall())
{
aTextureSet = new Graphic3d_TextureSet (theTexture);
aSide1[0] = 1.0f;
}
else
{
aTextureSet->SetFirst (theTexture);
aSide1[0] = aDirection[2] / aMagintude;
aSide1[2] = -aDirection[0] / aMagintude;
}
myAspect->SetTextureSet (aTextureSet);
aSide2[0] = (-aSide1[1] * aDirection[2]) - (-aSide1[2] * aDirection[1]);
aSide2[1] = (-aSide1[2] * aDirection[0]) - (-aSide1[0] * aDirection[2]);
aSide2[2] = (-aSide1[0] * aDirection[1]) - (-aSide1[1] * aDirection[0]);
myOrientationMat.SetValue (0, 0, aSide1[0]);
myOrientationMat.SetValue (1, 0, aSide1[1]);
myOrientationMat.SetValue (2, 0, aSide1[2]);
myOrientationMat.SetValue (3, 0, 0.0F);
myOrientationMat.SetValue (0, 1, aDirection[0]);
myOrientationMat.SetValue (1, 1, aDirection[1]);
myOrientationMat.SetValue (2, 1, aDirection[2]);
myOrientationMat.SetValue (3, 1, 0.0F);
myOrientationMat.SetValue (0, 2, aSide2[0]);
myOrientationMat.SetValue (1, 2, aSide2[1]);
myOrientationMat.SetValue (2, 2, aSide2[2]);
myOrientationMat.SetValue (3, 2, 0.0F);
myOrientationMat.SetValue (0, 3, aTranslate[0]);
myOrientationMat.SetValue (1, 3, aTranslate[1]);
myOrientationMat.SetValue (2, 3, aTranslate[2]);
myOrientationMat.SetValue (3, 3, 1.0F);
myOrientationDirty = Standard_False;
}
else
return myOrientationMat;
}
// =======================================================================
// function : init
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::init (const gp_Pln& thePlane,
const Graphic3d_Vec4d& theEquationRev,
const Standard_Boolean theIsOn,
const Standard_Boolean theIsCapping,
const Standard_Boolean theOverrideStyle,
const Handle(Graphic3d_AspectFillCapping)& theStyle)
{
if (myEntityUID.IsEmpty())
{
myAspect->SetTextureMapOff();
myAspect->SetTextureSet (Handle(Graphic3d_TextureSet)());
myEntityUID = TCollection_AsciiString ("Graphic3d_ClipPlane_") //DynamicType()->Name()
+ TCollection_AsciiString (Standard_Atomic_Increment (&THE_CLIP_PLANE_COUNTER));
}
++myAspectMod;
}
// =======================================================================
// function : SetCappingHatch
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::SetCappingHatch (const Aspect_HatchStyle theStyle)
{
myAspect->SetHatchStyle (theStyle);
++myAspectMod;
}
// =======================================================================
// function : SetCappingCustomHatch
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::SetCappingCustomHatch (const Handle(Graphic3d_HatchStyle)& theStyle)
{
myAspect->SetHatchStyle (theStyle);
++myAspectMod;
}
// =======================================================================
// function : SetCappingHatchOn
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::SetCappingHatchOn()
{
myAspect->SetInteriorStyle (Aspect_IS_HATCH);
++myAspectMod;
}
// =======================================================================
// function : SetCappingHatchOff
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::SetCappingHatchOff()
{
myAspect->SetInteriorStyle (Aspect_IS_SOLID);
++myAspectMod;
}
// =======================================================================
// function : SetCappingAspect
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::SetCappingAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect)
{
myAspect = theAspect;
++myAspectMod;
}
// =======================================================================
// function : setCappingFlag
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::setCappingFlag (bool theToUse, int theFlag)
{
if (theToUse)
{
myFlags |= theFlag;
}
else
{
myFlags &= ~(theFlag);
}
++myAspectMod;
}
// =======================================================================
// function : makeId
// purpose :
// =======================================================================
void Graphic3d_ClipPlane::makeId()
{
myId = TCollection_AsciiString ("Graphic3d_ClipPlane_") //DynamicType()->Name()
+ TCollection_AsciiString (Standard_Atomic_Increment (&THE_CLIP_PLANE_COUNTER));
myPrevInChain = NULL;
myEquationRev = theEquationRev;
myChainLenFwd = 1;
myPlane = thePlane;
myPlane.Coefficients (myEquation[0], myEquation[1], myEquation[2], myEquation[3]);
myIsOn = theIsOn;
myIsCapping = theIsCapping;
myOverrideObjectStyle = theOverrideStyle;
mySectionStyle = theStyle.IsNull() ? new Graphic3d_AspectFillCapping() : theStyle;
myOrientationDirty = Standard_True;
}
// =======================================================================
@@ -326,7 +262,7 @@ void Graphic3d_ClipPlane::updateChainLen()
// =======================================================================
void Graphic3d_ClipPlane::SetChainNextPlane (const Handle(Graphic3d_ClipPlane)& thePlane)
{
++myEquationMod;
myOrientationDirty = Standard_True;
if (!myNextInChain.IsNull())
{
myNextInChain->myPrevInChain = NULL;
@@ -349,11 +285,11 @@ void Graphic3d_ClipPlane::DumpJson (Standard_OStream& theOStream, Standard_Integ
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySectionStyle.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myNextInChain.get())
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myPrevInChain)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myId)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myEntityUID)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPlane)

Some files were not shown because too many files have changed in this diff Show More