Some MeshVS commands not supported in Draw Test Harness

When testing MeshVS (Mesh Visualization Service) component with Draw Test Harness, I find meshdispmode command and meshselmode command are not supported. However, both commands are listed in occt_test_harness.pdf.

I searched a very old topic which was similar to my concern. It seemed meshselmode command was supported before.
https://dev.opencascade.org/content/selecting-nodes-elements-mesh

Why these two commands are deleted in latest OCCT?

Attachments: 
Kirill Gavrilov's picture

MeshVS_Mesh inherits AIS_InteractiveObject so that most of general-purpose commands from ViewerTest plugin are applicable to mesh objects as well. This includes commands "vselmode" and "vsetdispmode" managing active display and selection modes.

Mowei Wang's picture

Hello Kirill,

Thank you. "vselmode" command targets geometry entities, not including mesh entities. I guess it'll be not very difficult to add mesh selection modes to "vselmode" command.

Another question, when "4 - face" selection mode is chosen for "vselmode" command, only the surface visible faces can be selected. How to select the faces behind the scene with click-selection or box-selection?

Kirill Gavrilov's picture

4=face is only for AIS_Shape presentations. Each interactive object defines it's own list of selection modes - so you would need checking documentation of MeshVS_Mesh as a C++ class. It defines selection modes not as a list, but rather a bitmask MeshVS_SelectionModeFlags:

typedef enum
{
  MeshVS_SMF_Mesh    = 0x0000,
  MeshVS_SMF_Node    = 0x0001,
  MeshVS_SMF_0D      = 0x0002,
  MeshVS_SMF_Link    = 0x0004,
  MeshVS_SMF_Face    = 0x0008,
  MeshVS_SMF_Volume  = 0x0010,

  MeshVS_SMF_Element = MeshVS_SMF_0D | MeshVS_SMF_Link | MeshVS_SMF_Face | MeshVS_SMF_Volume,
  MeshVS_SMF_All     = MeshVS_SMF_Element | MeshVS_SMF_Node,

  MeshVS_SMF_Group   = 0x0100

} MeshVS_SelectionModeFlags;
pload XDE VISUALIZATION
vinit View1
meshfromstl m [locate_data_file bearing.stl]
vfit
# MeshVS_DMF_Shading = 0x0002
vsetdispmode m 2
# MeshVS_SMF_Face    = 0x0008
vselmode m 8 1

vmoveto 200 200
vstate -entities

Point detection returns a list of entities through picking ray sorted from closest to farthest, and on click the topmost element is selected from this list.

Mowei Wang's picture

Yes, well done. It also supplies "-add" and "-set" option.

# Both nodes and surface elements can be selected
vselmode s -add 1 1
vselmode s -add 8 1
# First node selection, then surface element selection
vselmode s -set 1 1
vselmode s -set 8 1

BTW, how to get the ID of the topmost element for click-selection? And how to get a list of IDs for box-selection?

Kirill Gavrilov's picture

Why these two commands are deleted in latest OCCT?

"Latest" is a little bit imprecise here. From git log it seems this change was done almost 8 years ago, and released in OCCT 6.8.0.

Mowei Wang's picture

Thank your for correcting my misunderstandings. I'll check the older OCCT releases and try to find the implementation of "meshselmode" command.