Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoFontSizeElement.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 : Paul S. Strauss (MMM yyyy)
25** Modified by : Nick Thompson (MMM yyyy)
26** Modified by : Thad Beier (MMM yyyy)
27**=======================================================================*/
28/*=======================================================================
29 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
30 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
31 *** ***
32 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
33 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
34 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
35 *** ***
36 *** RESTRICTED RIGHTS LEGEND ***
37 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
38 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
39 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
40 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
41 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
42 *** ***
43 *** COPYRIGHT (C) 1996-2018 BY FEI S.A.S, ***
44 *** BORDEAUX, FRANCE ***
45 *** ALL RIGHTS RESERVED ***
46**=======================================================================*/
47/*=======================================================================
48** Modified by : VSG (MMM YYYY)
49**=======================================================================*/
50
51
52#ifndef _SO_FONT_SIZE_ELEMENT
53#define _SO_FONT_SIZE_ELEMENT
54
55#include <Inventor/SbString.h>
56#include <Inventor/elements/SoFloatElement.h>
57
70SoEXTENDER_Documented class SoFontSizeElement : public SoFloatElement {
71
72 SO_ELEMENT_HEADER(SoFontSizeElement);
73
74 public:
78 static void set(SoState *state, float size)
79 { SoFloatElement::set(getClassTypeId(), getClassStackIndex(), state, size); }
80
84 static void set(SoState *state, SoNode *, float size)
85 { set(state, size); }
86
90 static float get(SoState *state);
91
95 static float getDefault();
96
100 virtual void push(SoState *state);
101
102private:
103
105 virtual void init(SoState *state);
106
110 virtual SbBool matches(const SoElement* elt) const;
111
113 virtual SoElement* copyMatchInfo() const;
114
115 private:
116 // Initializes class
117 static void initClass();
118 static void exitClass();
119
126 static void enablePolygonFontSizeScale(SoState* state);
127
128 /* retrieve if font size is scaled */
129 static bool isScaled(SoState *state);
130
132 static unsigned int getPolygonFontSize()
133 {
134 return s_polygonFontSize;
135 }
136
137 private:
138 virtual ~SoFontSizeElement();
139
140 private:
141 static float s_defaultFontSize;
142 static bool s_isSet;
143
145 const static unsigned int s_polygonFontSize;
146
148 float m_scale;
150 bool m_isScaled;
151};
152
153#endif /* _SO_FONT_SIZE_ELEMENT */
154
155
Abstract base class for all state elements.
Definition SoElement.h:102
Element's subclasses store a single float, int, or enum value.
Stores the current font size.
virtual void push(SoState *state)
Overrides push() method to copy values from next instance in the stack.
static void set(SoState *state, SoNode *, float size)
Sets the current font size.
static SoType getClassTypeId()
Returns the type identifier for this class.
static float getDefault()
Returns the default font size.
static void set(SoState *state, float size)
Sets the current font size.
static float get(SoState *state)
Returns the current font size from the state.
static int getClassStackIndex()
Returns the stack id for this element.
Abstract base class for all database nodes.
Definition SoNode.h:145
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87