0022962: Invalid realization of reading and writing material in STEP.
[occt.git] / src / OpenGl / OpenGl_tgl_util.cxx
CommitLineData
7fd59977 1/***********************************************************************
2
3FONCTION :
4----------
5file OpenGl_tgl_util :
6
7
8REMARQUES:
9----------
10
11
12HISTORIQUE DES MODIFICATIONS :
13--------------------------------
14xx-xx-xx : xxx ; Creation.
1506-03-96 : FMN ; Suppression code inutile:
1601-04-96 : CAL ; Integration MINSK portage WNT
1729-04-96 : FMN ; Correction Warning.
1830-01-97 : FMN ; Suppression call_util_init_indexes()
19
20************************************************************************/
21
22/*----------------------------------------------------------------------*/
23/*
24* Includes
25*/
26
27
28#include <OpenGl_tgl_all.hxx>
29
30#include <stdlib.h>
31#include <string.h>
32
33#include <InterfaceGraphic_Graphic3d.hxx>
34#include <InterfaceGraphic_Visual3d.hxx>
35
36#include <OpenGl_tsm.hxx>
37#include <OpenGl_tgl_util.hxx>
38#include <OpenGl_tgl_pick.hxx>
39#include <OpenGl_telem_filters.hxx>
40
41#include <OpenGl_context.hxx>
42
43#ifdef WNT
44#include <OpenGl_Extension.hxx>
45#include <InterfaceGraphic_wntio.hxx>
46#endif /* WNT */
47
48/*----------------------------------------------------------------------*/
49
50Tintlst inc_pick_filter;
51Tintlst exc_pick_filter;
52Tintlst inc_highl_filter;
53Tintlst exc_highl_filter;
54Tintlst inc_invis_filter;
55Tintlst exc_invis_filter;
56
57/*----------------------------------------------------------------------*/
58
59void
60call_util_init_filters( Tint wsid )
61{
62 Tint pick_inc_names[1] = { CALL_DEF_STRUCTPICKABLE };
63 Tint highl_inc_names[1] = { CALL_DEF_STRUCTHIGHLIGHTED };
64 Tint invis_inc_names[1] = { CALL_DEF_STRUCTNOVISIBLE };
65
66 Tint pick_excl_names[1] = { CALL_DEF_STRUCTNOPICKABLE };
67
68 inc_highl_filter.number = 1;
69 inc_highl_filter.integers = highl_inc_names;
70 exc_highl_filter.number = 0;
71 exc_highl_filter.integers = 0;
72 TglSetHighlFilter( wsid, 1, highl_inc_names, 0, 0 );
73
74 inc_pick_filter.number = 1;
75 inc_pick_filter.integers = pick_inc_names;
76 exc_pick_filter.number = 1;
77 exc_pick_filter.integers = pick_excl_names;
78 TglSetPickFilter( wsid, 1, pick_inc_names, 1, pick_excl_names );
79
80 inc_invis_filter.number = 1;
81 inc_invis_filter.integers = invis_inc_names;
82 exc_invis_filter.number = 0;
83 exc_invis_filter.integers = 0;
84 TglSetInvisFilter( wsid, 1, invis_inc_names, 0, 0 );
85
86 return;
87}
88
89/*----------------------------------------------------------------------*/
90
91Tint
92call_util_test_structure( Tint stid )
93{
94 TStatus stat;
95 Tint num;
96 tsm_node ptr;
97
98 stat = TsmGetStructure( stid, &num, &ptr );
99 if( stat == TSuccess )
100 {
101 if( num )
102 return 2;
103 return 1;
104 }
105 return 0;
106}
107
108/*----------------------------------------------------------------------*/
109
110/*
111call_util_osd_getenv (symbol, value)
112char *symbol, *value
113
114Gets an environment variable.
115*/
116
117EXPORT extern int call_util_osd_getenv ( char *symbol,
118 char *value,
119 int lval )
120{
121 char *s;
122
123 if ((s = getenv (symbol)) == NULL) return (0);
124 if ((int)strlen (s) > lval) return (0);
125 strcpy (value, s);
126 return (1);
127}
128/*----------------------------------------------------------------------*/