OCC22377 Patch for visualization component
[occt.git] / src / OpenGl / OpenGl_togl_highlightcolor.cxx
CommitLineData
7fd59977 1
2#include <OpenGl_tgl_all.hxx>
3
4#include <InterfaceGraphic_Labels.hxx>
5#include <InterfaceGraphic_Graphic3d.hxx>
6
7#include <OpenGl_tgl.hxx>
8#include <OpenGl_tgl_funcs.hxx>
9#include <OpenGl_tgl_subrs.hxx>
10#include <OpenGl_telem_highlight.hxx>
11#include <OpenGl_tgl_utilgr.hxx>
12
13void EXPORT
14call_togl_highlightcolor
15(
16 CALL_DEF_STRUCTURE * astructure,
17 CALL_DEF_COLOR * acolor,
18 int create
19 )
20{
21 Tint index;
22 TEL_HIGHLIGHT hrep = { TelHLForcedColour };
23
24 call_func_set_edit_mode (CALL_PHIGS_EDIT_REPLACE);
25 call_func_open_struct (astructure->Id);
26 call_func_set_elem_ptr (0);
27 call_func_del_elems_labels (Structure_LABHighlight, Structure_LABVisibility);
28 call_func_close_struct ();
29
30 if (create) {
31 call_func_set_edit_mode (CALL_PHIGS_EDIT_INSERT);
32 call_func_open_struct (astructure->Id);
33 call_func_set_elem_ptr (0);
34 call_func_set_elem_ptr_label(Structure_LABHighlight);
35 index = call_util_rgbindex(acolor->r, acolor->g, acolor->b);
36 hrep.col.rgb[0] = acolor->r,
37 hrep.col.rgb[1] = acolor->g,
38 hrep.col.rgb[2] = acolor->b;
39 TelSetHighlightRep (0, index, &hrep);
40 call_subr_set_highl_rep (index);
41 call_func_close_struct ();
42 }
43 return;
44}