Is it possible to modify the Hilighting of Objects?

Hi all,

I would like to use another form of hilighting my selected objects. Since my Objects have quite a lot of edges, i would like to stop drawing contour lines of all edges.

The reason for this is the way my objects are displayerd when zoomed away: the Objects base colors are almost invisible since the selection lines are all rendered, no matter on what zoom level.
Can this behaviour be changed?
Could i just modify the base color of the selection instead?
Would the latter be possible without modification of OCCT's sources?

My only other idea of a workaround is to disable Selection altogether, do my own picking and manging selection states of my objects with application code. This will be cumbersome.

Tilman Leune's picture

I solved this one (kinda):

with a valid Handle(Ais_Shape):

myAis_Shape->SetHilightMode(3);

Leads to Highlighting (and selection marking) of the entire Shape with a single color.
While this looks not to well for transparent areas, it at least reduces the lag when a lot of objects are highligthed.

As it is not directly mentioned in the Documentation, i post a list of hilighting modes available:

  • Mode 0: Standard behavioue (wireframe)
  • Mode 1: solid color marking
  • Mode 2: bounding-box marking (with a dashed line)
  • Mode 3: No marking at all ( might be possible to texture map here, but i dont know)
James Blackmon's picture

Hi, Tilman:

Very helpful, but how to change the highlight color?

By the way, as the documentation you mentioned, is it "Reference Documentation" you got after installation of OCC? I had hard time to browse/search through it.

Thanks,
James

Tilman Leune's picture

Hi James,

On changing the hilight color:
you can use AIS_InteractiveContext::SetHilightColor(Quantity_NOC_YELLOW)

and

AIS_InteractiveContext::SetSelectionColor(Quantity_NOC_RED)

Be prepared however that you will find some issues of colors not correctly set back to what tehy where if you keep automatic hilighting enabled.

You may find this helpfull in that case:

http://www.opencascade.org/org/forum/thread_17791/

The reference documentation is a seperate download from the occ download center, located here

http://www.opencascade.org/getocc/download/loadocc/

James Blackmon's picture

Thanks a lot for your kind help, Tilman.