00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _SO_PPATTERN_
00024 #define _SO_PPATTERN_
00025
00026 #include <Inventor/fields/SoSFString.h>
00027 #include <Inventor/fields/SoSFBool.h>
00028
00029 #include <Inventor/nodes/SoNode.h>
00030 #include <Inventor/SbPList.h>
00031
00032 #include <Inventor/elements/SoPatternElement.h>
00033
00034 class SoGLRenderAction;
00035 class SoCallbackAction;
00036
00113 class SoPattern : public SoNode {
00114
00115 SO_NODE_HEADER( SoPattern );
00116
00117 public:
00123 SoSFString category;
00129 SoSFString name;
00130
00134 SoPattern();
00135
00141 enum FilterType {
00145 INCLUSIVE_FILTER,
00149 EXCLUSIVE_FILTER
00150 };
00151
00164 SoNONUNICODE static SbBool loadPatterns( const char* fileName, int numFilters = 0,
00165 const SbString* filterNames = NULL,
00166 FilterType filterType = INCLUSIVE_FILTER );
00167
00179 static SbBool loadPatterns( const SbString& fileName, int numFilters = 0,
00180 const SbString* filterNames = NULL,
00181 FilterType filterType = INCLUSIVE_FILTER );
00182
00190 static void getPatternNames( int& number, SbString*& names,
00191 const char* category = NULL );
00192
00201 SoNONUNICODE static void addPattern( const char* category, const char* name,
00202 const unsigned char* bytes );
00203
00210 static void addPattern( const SbString& category, const SbString& name,
00211 const unsigned char* bytes );
00212
00220 SoNONUNICODE static void getPattern( const char* category, const char* name, unsigned char*& bytes );
00221
00227 static void getPattern( const SbString& category, const SbString& name, unsigned char*& bytes );
00228
00233 inline virtual void setOverride(const SbBool state)
00234 { override.setValue(state); }
00235
00239 inline virtual SbBool isOverride() const
00240 { return override.getValue(); }
00241
00242 private:
00243 virtual void doAction( SoAction *action );
00244 virtual void callback( SoCallbackAction *action );
00245 virtual void GLRender( SoGLRenderAction *action );
00246
00247
00248
00249 private:
00250 static void initClass();
00251 static void exitClass();
00252
00253 SoSFBool override;
00254
00255 private:
00256
00257 virtual ~SoPattern();
00258
00259 private:
00260 static SbPList m_patternList;
00261 static int m_numFilter;
00262
00263 };
00264
00265
00266 #endif // _SO_PATTERN_
00267
00268