Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoPattern.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : P. ESTRADE (Nov 1999)
22**=======================================================================*/
23#pragma once
24
27
29
30#include <Inventor/SbPImpl.h>
31
34
107class SoPattern : public SoNode {
108
110 SO_PIMPL_PUBLIC_HEADER( SoPattern )
111
112 public:
125
130
144 EXCLUSIVE_FILTER
145 };
146
159 SoNONUNICODE static SbBool loadPatterns( const char* fileName, int numFilters = 0,
160 const SbString* filterNames = NULL,
161 FilterType filterType = INCLUSIVE_FILTER );
162
174 static SbBool loadPatterns( const SbString& fileName, int numFilters = 0,
175 const SbString* filterNames = NULL,
176 FilterType filterType = INCLUSIVE_FILTER );
177
185 static void getPatternNames( int& number, SbString*& names,
186 const char* category = NULL );
187
196 SoNONUNICODE static void addPattern( const char* category, const char* name,
197 const unsigned char* bytes );
198
205 static void addPattern( const SbString& category, const SbString& name,
206 const unsigned char* bytes );
207
215 SoNONUNICODE static void getPattern( const char* category, const char* name, unsigned char*& bytes );
216
222 static void getPattern( const SbString& category, const SbString& name, unsigned char*& bytes );
223
228 inline virtual void setOverride(const SbBool state)
229 { override.setValue(state); }
230
234 inline virtual SbBool isOverride() const
235 { return override.getValue(); }
236
237 private:
238 virtual void doAction( SoAction *action );
239 virtual void callback( SoCallbackAction *action );
240 virtual void GLRender( SoGLRenderAction *action );
241
242 //------------------------------------------------------------------------------
243
244 private:
245 static void initClass();
246 static void exitClass();
247
248 SoSFBool override;
249
250 private:
251 // Destructor
252 virtual ~SoPattern();
253};
254//--------------------------------------------------------------------------------
SO_PIMPL_PUBLIC_DECLARATION(SoFileDataAdapter)
#define SO_NODE_HEADER(className)
Definition SoSubNode.h:151
Class for smart character strings.
Definition SbString.h:202
Abstract base class for all actions.
Definition SoAction.h:132
Performs a generic traversal of a scene graph or path.
Renders a scene graph using Open Inventor's Render Engine.
Abstract base class for all database nodes.
Definition SoNode.h:145
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Node that define...
Definition SoPattern.h:107
SoSFString category
Specifies the name of a group of patterns.
Definition SoPattern.h:118
static void addPattern(const SbString &category, const SbString &name, const unsigned char *bytes)
Adds a new pattern specified as an array of 128 bytes.
static void getPatternNames(int &number, SbString *&names, const char *category=NULL)
Gets the names of loaded patterns.
static SoNONUNICODE SbBool loadPatterns(const char *fileName, int numFilters=0, const SbString *filterNames=NULL, FilterType filterType=INCLUSIVE_FILTER)
Loads a pattern file, with optional filtering of patterns.
static SoNONUNICODE void addPattern(const char *category, const char *name, const unsigned char *bytes)
Adds a new pattern specified as an array of 128 bytes.
static SbBool loadPatterns(const SbString &fileName, int numFilters=0, const SbString *filterNames=NULL, FilterType filterType=INCLUSIVE_FILTER)
Loads a pattern file, with optional filtering of patterns.
static void getPattern(const SbString &category, const SbString &name, unsigned char *&bytes)
Retrieves a pattern bitmap (an array of 128 bytes) specified by its category and name.
SoPattern()
Constructor.
static SoNONUNICODE void getPattern(const char *category, const char *name, unsigned char *&bytes)
Retrieves a pattern bitmap (an array of 128 bytes) specified by its category and name.
SoSFString name
Specifies the name of a pattern within a category.
Definition SoPattern.h:124
virtual void setOverride(const SbBool state)
Set the state of the override field.
Definition SoPattern.h:228
FilterType
Possible value of the filterType used by the method loadPatterns.
Definition SoPattern.h:136
@ INCLUSIVE_FILTER
Load only the patterns that are in the list of pattern names.
Definition SoPattern.h:140
virtual SbBool isOverride() const
Returns the state of the override field.
Definition SoPattern.h:234
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing a string.
Definition SoSFString.h:117
int SbBool
Boolean type.
Definition SbBase.h:87