Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoTextureQualityElement.h
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 : Gavin Bell (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#ifndef _SO_TEXTURE_QUALITY_ELEMENT
51#define _SO_TEXTURE_QUALITY_ELEMENT
52
53#include <Inventor/elements/SoFloatElement.h>
54#include <Inventor/SoPreferences.h>
55
68SoEXTENDER_Documented class SoTextureQualityElement : public SoFloatElement {
69
70 SO_ELEMENT_HEADER(SoTextureQualityElement);
71
72 public:
76 static void set(SoState *state, float qual)
77 { SoFloatElement::set(getClassTypeId(), getClassStackIndex(), state, qual); }
78
82 static float get(SoState *state)
83 { return SoFloatElement::get(getClassTypeId(), getClassStackIndex(), state); }
84
88 static float getDefault() { return SoPreferences::getFloat ("OIV_TEXTURE_QUALITY", 0.5); }
89
91 static bool isSetInState(SoState *state);
92
93private:
94
96 virtual void init(SoState *state);
97
101 virtual SbBool matches(const SoElement* elt) const;
102
104 virtual SoElement* copyMatchInfo() const;
105
106 private:
107 // Initializes the SoTextureQualityElement class
108 static void initClass();
109 static void exitClass();
110
111 private:
112 virtual ~SoTextureQualityElement();
113
115 virtual void setElt(float value);
116
117 bool m_isSetInState;
118};
119
134SoEXTENDER_Documented class SoTextureOverrideElement : public SoElement {
135
136 SO_ELEMENT_HEADER(SoTextureOverrideElement);
137
138 enum {
139 TEXTURE_QUALITY = 0x1,
140 TEXTURE_IMAGE = 0x2
141 };
142
143 public:
144
149 virtual void push(SoState *state);
150
151 //
152 // "get" methods for each element which can be overridden.
153 //
154
159
164
165 //
166 // "set" methods for each element which can be overridden.
167 //
168
172 static void setQualityOverride(SoState *state,
173 SbBool override);
174
178 static void setImageOverride(SoState *state,
179 SbBool override);
180
184 virtual void print(FILE *fp) const;
185
186private:
187
189 virtual void init(SoState *state);
190
194 virtual SbBool matches(const SoElement *elt) const;
195
197 virtual SoElement *copyMatchInfo() const;
198
199 private:
200 // Initializes the SoTextureOverrideElement class
201 static void initClass();
202 static void exitClass();
203
204 private:
205 // Used by ::print method
206 void pFlag(FILE *, const char *, int) const;
207
208 uint32_t flags;
209};
210
211#endif /* _SO_TEXTURE_QUALITY_ELEMENT */
212
213
Abstract base class for all state elements.
Definition SoElement.h:102
Element's subclasses store a single float, int, or enum value.
static SoNONUNICODE float getFloat(const char *name, float defaultValue)
Returns the value of the specified environment variable in the Open Inventor environment,...
Traversal state.
Definition SoState.h:74
Stores the current texture override.
virtual void push(SoState *state)
Overrides push() method to copy values from next instance in the stack, and set up cache dependencies...
static SbBool getQualityOverride(SoState *state)
Returns TRUE iff SoTextureQualityElement is overridden.
virtual void print(FILE *fp) const
Prints element (for debugging).
static void setImageOverride(SoState *state, SbBool override)
Sets override flag for SoTextureImageElement.
static void setQualityOverride(SoState *state, SbBool override)
Sets override flag for SoTextureQualityElement.
static SbBool getImageOverride(SoState *state)
Returns TRUE iff SoTextureImageElement is overridden.
Stores the current texture quality.
static float getDefault()
Returns the default texture quality.
static int getClassStackIndex()
Returns the stack id for this element.
static void set(SoState *state, float qual)
Sets the current texture quality in the state.
static float get(SoState *state)
Returns current texture quality from the state.
static SoType getClassTypeId()
Returns the type identifier for this class.
static bool isSetInState(SoState *state)
Returns TRUE if element has been set in set.
int SbBool
Boolean type.
Definition SbBase.h:87