0023830: BRepExtrema_DistShapeShape does not find intersection of face with edge
[occt.git] / src / Xw / Xw_isdefine_color.cxx
CommitLineData
b311480e 1// Copyright (c) 1999-2012 OPEN CASCADE SAS
2//
3// The content of this file is subject to the Open CASCADE Technology Public
4// License Version 6.5 (the "License"). You may not use the content of this file
5// except in compliance with the License. Please obtain a copy of the License
6// at http://www.opencascade.org and read it completely before using this file.
7//
8// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10//
11// The Original Code and all software distributed under the License is
12// distributed on an "AS IS" basis, without warranty of any kind, and the
13// Initial Developer hereby disclaims all such warranties, including without
14// limitation, any warranties of merchantability, fitness for a particular
15// purpose or non-infringement. Please see the License for the specific terms
16// and conditions governing the rights and limitations under the License.
17
7fd59977 18
19#include <Xw_Extension.h>
20
b311480e 21/* ifdef then trace on */
7fd59977 22#ifdef TRACE
23#define TRACE_ISDEFINE_COLOR
24#endif
25
26/*
27 XW_STATUS Xw_isdefine_color(acolormap,index):
28 XW_EXT_COLORMAP *acolormap Colormap extension structure
29 int index ; Color index 0 >= x < MAXCOLOR
30
31 Returns XW_ERROR if BadColor index or Color is not define
32 Returns XW_SUCCESS if Color is defined
33
34*/
35#ifdef XW_PROTOTYPE
36XW_STATUS Xw_isdefine_color (void* acolormap, int index)
37#else
38XW_STATUS Xw_isdefine_color (acolormap,index)
39void *acolormap;
40int index ;
41#endif /*XW_PROTOTYPE*/
42{
43XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ;
44XW_STATUS status = XW_ERROR ;
45//int i ;
46
47 if( pcolormap && ((index < 0) ||
48 ((index >= 0) && (index < pcolormap->maxcolor) &&
49 (pcolormap->define[index]))) ) {
50 status = XW_SUCCESS ;
51 }
52
53#ifdef TRACE_ISDEFINE_COLOR
54if( Xw_get_trace() > 2 ) {
55 printf(" %d = Xw_isdefine_color(%lx,%d)\n",status,(long ) pcolormap,index) ;
56}
57#endif
58
59 return (status);
60}
61
62#ifdef XW_PROTOTYPE
63XW_STATUS Xw_isdefine_colorindex (XW_EXT_COLORMAP* acolormap, int index)
64#else
65XW_STATUS Xw_isdefine_colorindex (acolormap,index)
66XW_EXT_COLORMAP *acolormap;
67int index ;
68#endif /*XW_PROTOTYPE*/
69/*
70 Verify Index range Only
71*/
72{
73XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ;
74XW_STATUS status = XW_ERROR ;
75
76 if( pcolormap && (index >= 0) && (index < pcolormap->maxcolor) ) {
77 status = XW_SUCCESS ;
78 }
79
80#ifdef TRACE_ISDEFINE_COLOR
81if( Xw_get_trace() > 2 ) {
82 printf(" %d = Xw_isdefine_colorindex(%lx,%d)\n",status,(long ) pcolormap,index) ;
83}
84#endif
85
86 return (status) ;
87}
88#ifdef XW_PROTOTYPE
89XW_STATUS Xw_ifsystem_colorindex (XW_EXT_COLORMAP* acolormap, int index)
90#else
91XW_STATUS Xw_ifsystem_colorindex (acolormap,index)
92XW_EXT_COLORMAP *acolormap;
93int index ;
94#endif /*XW_PROTOTYPE*/
95/*
96 Check if System color index
97*/
98{
99XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ;
100XW_STATUS status = XW_ERROR ;
101
102 if( pcolormap && (index >= 0) && (index < pcolormap->maxcolor) &&
103 (pcolormap->define[index] == SYSTEMCOLOR) ) {
104 status = XW_SUCCESS ;
105 }
106
107#ifdef TRACE_ISDEFINE_COLOR
108if( Xw_get_trace() > 2 ) {
109 printf(" %d = Xw_ifsystem_colorindex(%lx,%d)\n",status,(long ) pcolormap,index) ;
110}
111#endif
112
113 return (status) ;
114}
115
116#ifdef XW_PROTOTYPE
117XW_STATUS Xw_ifimage_colorindex (XW_EXT_COLORMAP* acolormap, int index)
118#else
119XW_STATUS Xw_ifimage_colorindex (acolormap,index)
120XW_EXT_COLORMAP *acolormap;
121int index ;
122#endif /*XW_PROTOTYPE*/
123/*
124 Check if image color index
125*/
126{
127XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ;
128XW_STATUS status = XW_ERROR ;
129
130 if( pcolormap && (index >= 0) && (index < pcolormap->maxcolor) &&
131 (pcolormap->define[index] == IMAGECOLOR) ) {
132 status = XW_SUCCESS ;
133 }
134
135#ifdef TRACE_ISDEFINE_COLOR
136if( Xw_get_trace() > 2 ) {
137 printf(" %d = Xw_ifimage_colorindex(%lx,%d)\n",status,(long ) pcolormap,index) ;
138}
139#endif
140
141 return (status) ;
142}
143
144#ifdef XW_PROTOTYPE
145XW_STATUS Xw_ifbackground_colorindex (XW_EXT_COLORMAP* acolormap, int index)
146#else
147XW_STATUS Xw_ifbackground_colorindex (acolormap,index)
148XW_EXT_COLORMAP *acolormap;
149int index ;
150#endif /*XW_PROTOTYPE*/
151/*
152 Check if background color index
153*/
154{
155XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ;
156XW_STATUS status = XW_ERROR ;
157
158 if( pcolormap && ((index < 0) ||
159 ((index >= 0) && (index < pcolormap->maxcolor) &&
160 (pcolormap->define[index] == BACKCOLOR))) ) {
161 status = XW_SUCCESS ;
162 }
163
164#ifdef TRACE_ISDEFINE_COLOR
165if( Xw_get_trace() > 2 ) {
166 printf(" %d = Xw_ifbackground_colorindex(%lx,%d)\n",status,(long ) pcolormap,index) ;
167}
168#endif
169
170 return (status) ;
171}
172
173#ifdef XW_PROTOTYPE
174XW_STATUS Xw_ifhighlight_colorindex (XW_EXT_COLORMAP* acolormap, int index)
175#else
176XW_STATUS Xw_ifhighlight_colorindex (acolormap,index)
177XW_EXT_COLORMAP *acolormap;
178int index ;
179#endif /*XW_PROTOTYPE*/
180/*
181 Check if highlight color index
182*/
183{
184XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ;
185XW_STATUS status = XW_ERROR ;
186
187 if( pcolormap && (index >= 0) && (index < pcolormap->maxcolor) &&
188 (pcolormap->define[index] == HIGHCOLOR) ) {
189 status = XW_SUCCESS ;
190 }
191
192#ifdef TRACE_ISDEFINE_COLOR
193if( Xw_get_trace() > 2 ) {
194 printf(" %d = Xw_ifhighlight_colorindex(%lx,%d)\n",status,(long ) pcolormap,index) ;
195}
196#endif
197
198 return (status) ;
199}