Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoXtMaterialList.h
Go to the documentation of this file.
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : David Mott (MMM yyyy)
25**=======================================================================*/
26/*=======================================================================
27 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
28 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
29 *** ***
30 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
31 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
32 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
33 *** ***
34 *** RESTRICTED RIGHTS LEGEND ***
35 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
36 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
37 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
38 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
39 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
40 *** ***
41 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
42 *** BORDEAUX, FRANCE ***
43 *** ALL RIGHTS RESERVED ***
44**=======================================================================*/
45/*=======================================================================
46** Modified by : VSG (MMM YYYY)
47**=======================================================================*/
48
49
50#ifdef _WIN32
52#else // _WIN32
53
54#ifndef _SO_XT_MATERIAL_LIST_H_
55#define _SO_XT_MATERIAL_LIST_H_
56
57#include <X11/Intrinsic.h>
58#include <Inventor/SbBasic.h>
62
63// callback function prototypes
64typedef void SoXtMaterialListCB(void *userData, const SoMaterial *mtl);
65
67//
68// Class: SoXtMaterialList
69//
70//
72
103 public:
112 SoWidget parent = NULL,
113 const char *name = NULL,
114 SbBool buildInsideParent = TRUE,
115 const char *dir = NULL);
120
128 void *userData = NULL)
129 { callbackList->addCallback((SoCallbackListCB *) f, userData);}
130
136 void *userData = NULL)
137 { callbackList->removeCallback((SoCallbackListCB *) f, userData); }
138
139 private:
140
141 // This constructor takes a boolean whether to build the widget now.
142 // Subclasses can pass FALSE, then call SoXtMaterialList::buildWidget()
143 // when they are ready for it to be built.
146 SoWidget parent,
147 const char *name,
148 SbBool buildInsideParent,
149 const char *dir,
150 SbBool buildNow);
151
152 // redefine these
153 virtual SbString getDefaultWidgetName() const;
154 virtual SbString getDefaultTitle() const;
155 virtual SbString getDefaultIconTitle() const;
156
157 // Build routines
158 SoWidget buildWidget(SoWidget parent);
159 SoWidget buildPulldownMenu(SoWidget parent);
160
161 private:
162 char *materialDir; // the parent directory of materials
163 SoCallbackList *callbackList; // funcs to invoke when a mtl is picked
164 SbPList menuItems; // Widgets
165 SbPList mtlPalettes; // list of palettes
166 SbPList palette; // the current palette
167 int curPalette; // index into mtlPalettes
168 SoWidget mtlList; // the Motif list of materials
169
170 // Fill up the mtlList with a new palette
171 void fillInMaterialList();
172 SbBool setupPalettes();
173
174 // Callback routines from Xt/Motif
175 static void menuPick(SoWidget, int, XtPointer);
176 static void listPick(SoWidget, SoXtMaterialList *, XtPointer);
177
178 // this is called by both constructors
179 void constructorCommon(const char *dir, SbBool buildNow);
180
181};
182
183#endif // _SO_XT_MATERIAL_LIST_H_
184
185#endif // _WIN32
186
187
#define SoEXTENDER
#define TRUE
Possible value of SbBool.
Definition SbBase.h:77
void * XtPointer
Definition SoQtDef.h:118
#define SoWidget
Definition SoQtDef.h:40
#define SoXtMaterialList
Definition SoXt2SoQt.h:97
#define SoXtMaterialListCB
Definition SoXt2SoQt.h:98
void SoXtMaterialListCB(void *userData, const SoMaterial *mtl)
List of generic (void *) pointers.
Definition SbPList.h:77
Class for smart character strings.
Definition SbString.h:202
Manages a list of callbacks and associated data.
void addCallback(SoCallbackListCB *f, void *userData=NULL)
Adds a function to the list of callback functions.
void removeCallback(SoCallbackListCB *f, void *userData=NULL)
Removes a function from the list of callback functions.
Surface material definition node.
Definition SoMaterial.h:173
Abstract base class for all Open Inventor components.
Component which lets you edit a material interactively.
SoXtMaterialList(SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE, const char *dir=NULL)
The constructor is passed a directory name which serves as the home directory for the material palett...
~SoXtMaterialList()
Destructor.
void removeCallback(SoXtMaterialListCB *f, void *userData=NULL)
Removes callback.
void addCallback(SoXtMaterialListCB *f, void *userData=NULL)
Registers functions that will be called whenever the user chooses a new material from the list.
int SbBool
Boolean type.
Definition SbBase.h:87
void SoCallbackListCB(void *userData, void *callbackData)