7fd59977 |
1 | /*********************************************************************** |
2 | |
3 | FONCTION : |
4 | ---------- |
5 | file OpenGl_tgl_util : |
6 | |
7 | |
8 | REMARQUES: |
9 | ---------- |
10 | |
11 | |
12 | HISTORIQUE DES MODIFICATIONS : |
13 | -------------------------------- |
14 | xx-xx-xx : xxx ; Creation. |
15 | 06-03-96 : FMN ; Suppression code inutile: |
16 | 01-04-96 : CAL ; Integration MINSK portage WNT |
17 | 29-04-96 : FMN ; Correction Warning. |
18 | 30-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 | |
50 | Tintlst inc_pick_filter; |
51 | Tintlst exc_pick_filter; |
52 | Tintlst inc_highl_filter; |
53 | Tintlst exc_highl_filter; |
54 | Tintlst inc_invis_filter; |
55 | Tintlst exc_invis_filter; |
56 | |
57 | /*----------------------------------------------------------------------*/ |
58 | |
59 | void |
60 | call_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 | |
91 | Tint |
92 | call_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 | /* |
111 | call_util_osd_getenv (symbol, value) |
112 | char *symbol, *value |
113 | |
114 | Gets an environment variable. |
115 | */ |
116 | |
117 | EXPORT 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 | /*----------------------------------------------------------------------*/ |