00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #pragma once
00024
00025 #include <Inventor/fields/SoSFString.h>
00026 #include <Inventor/fields/SoSFBool.h>
00027
00028 #include <Inventor/nodes/SoNode.h>
00029
00030 #include <Inventor/SbPImpl.h>
00031
00032 class SoGLRenderAction;
00033 class SoCallbackAction;
00034
00106 SO_PIMPL_PUBLIC_DECLARATION( SoPattern )
00107 class SoPattern : public SoNode {
00108
00109 SO_NODE_HEADER( SoPattern );
00110 SO_PIMPL_PUBLIC_HEADER( SoPattern )
00111
00112 public:
00118 SoSFString category;
00124 SoSFString name;
00125
00129 SoPattern();
00130
00136 enum FilterType {
00140 INCLUSIVE_FILTER,
00144 EXCLUSIVE_FILTER
00145 };
00146
00159 SoNONUNICODE static SbBool loadPatterns( const char* fileName, int numFilters = 0,
00160 const SbString* filterNames = NULL,
00161 FilterType filterType = INCLUSIVE_FILTER );
00162
00174 static SbBool loadPatterns( const SbString& fileName, int numFilters = 0,
00175 const SbString* filterNames = NULL,
00176 FilterType filterType = INCLUSIVE_FILTER );
00177
00185 static void getPatternNames( int& number, SbString*& names,
00186 const char* category = NULL );
00187
00196 SoNONUNICODE static void addPattern( const char* category, const char* name,
00197 const unsigned char* bytes );
00198
00205 static void addPattern( const SbString& category, const SbString& name,
00206 const unsigned char* bytes );
00207
00215 SoNONUNICODE static void getPattern( const char* category, const char* name, unsigned char*& bytes );
00216
00222 static void getPattern( const SbString& category, const SbString& name, unsigned char*& bytes );
00223
00228 inline virtual void setOverride(const SbBool state)
00229 { override.setValue(state); }
00230
00234 inline virtual SbBool isOverride() const
00235 { return override.getValue(); }
00236
00237 private:
00238 virtual void doAction( SoAction *action );
00239 virtual void callback( SoCallbackAction *action );
00240 virtual void GLRender( SoGLRenderAction *action );
00241
00242
00243
00244 private:
00245 static void initClass();
00246 static void exitClass();
00247
00248 SoSFBool override;
00249
00250 private:
00251
00252 virtual ~SoPattern();
00253 };
00254
00255