CRhinoObject Highlight


#1

Hi Dale,

I would like to “highlight” an object doing this

const CRhinoObject* pOBJECT = (… here I get a pointer on my object)
if( pOBJECT != NULL ) pOBJECT->Highlight( );

But the object is never “Highlighted”…
“Highlighted” means for me “PINK” like when Rhino popup a little windows asking to choose between 2 curves clicked for exemple.

I must mention than my object is “SELECTED”… so already “yellow” in the document…

Is it why it’s not possible to highlight it ? Or have I to do something more to see it “pink” ?

Regards,
Fred


(Dale Fugier) #2

Hi Fred,

If an object is already selected, then enabling highlight isn’t really going to do anything.

Why are you calling CRhinoObject::Highlight()?

– Dale


#3

Hi Dale,

Because we have a « group » selected.
Because this group is selected… each component of it are selected too.

For a particular purpose, we are offering to the user, inside a dialog, a tree-view describing this group.
When clicking on a branch (a branch = an element of the group) we would like to highlight « this » component.

This dialog is a panel, activated by an event watcher…
This event watcher catch the « selected », « unselected » events…
So we can’t unselected ourself the group just for hilight a component of it and not the other…
This would be make the event watcher becom crazy !

So we have to find a way to « highlight » one component of a group « selected »…

BR
Fred


(Menno Deij - van Rijswijk) #4

So we can’t unselected ourself the group just for hilight a component of it and not the other…
This would be make the event watcher becom crazy !

I don’t think that should be a problem, in pseudo-code I would do something like this:

bool respondingAlready = false;
void OnObjectSelected(obj)
  if respondingAlready: return
  if obj is in group: 
  {
    respondingAlready = true
    unselect(objects in group) 
    highlight(obj)
    respondingAlready = false
  }  

by setting respondingAlready to true, you prevent re-entry of the OnObjectSelected event watcher.