|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.graphics.typography.TextLabelManager
public class TextLabelManager
Knows how to create and cache OpenGL display lists holding the glTexSubImage() with a bitmap for a text label that can be pasted onto curved surfaces.
Field Summary | |
---|---|
static int |
BYTES_PER_PIXEL
The blank texture map has 2 bytes per pixel. |
static String |
MAP
The 'textlabel.frag' fragment shader uniform variable for a 2D texture map is named 'textLabelMap'. |
static int |
TABLA_RASA_HEIGHT
The blank texture map is 128 pixels high. |
static int |
TABLA_RASA_WIDTH
The blank texture map is 128 pixels wide. |
static int |
X_OFFSET
The x-offset for pasting a subimage is 47 pixels. |
static int |
Y_OFFSET
The y-offset is 0 pasting a submimage is 0 pixels. |
Constructor Summary | |
---|---|
TextLabelManager()
Constructs a TextLabelManager. |
Method Summary | |
---|---|
void |
cacheDisplayLists(GL gl,
List<String> textLabels)
Caches an OpenGL display list holding glTexSubImage2D( bitmap ) for each textLabel in the list given as an argument. |
void |
deleteDisplayLists(GL gl)
Frees graphics card memory for any OpenGL display lists currently being used to store text labels. |
void |
deleteTablaRasa(GL gl)
Frees graphics card memory for the tabla rasa. |
void |
enableTexture(GL gl,
String segmentID,
int shaders,
RegionEnum regionType)
Enables OpenGL texture mapping and binds a texture with text cooresponding to the segmentID given as an argument. |
void |
loadTablaRasa(GL gl)
Loads a blank texture map, the reusable tabla rasa. |
void |
readGlyphSet()
Obtains a set of glyphs by using the default '.conf' configuration file in the fonts directory. |
void |
setDebug(boolean debug)
Setting debug to true will turn on debugging (which prints data to standard out). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MAP
public static final int X_OFFSET
public static final int Y_OFFSET
public static final int TABLA_RASA_WIDTH
public static final int TABLA_RASA_HEIGHT
public static final int BYTES_PER_PIXEL
Constructor Detail |
---|
public TextLabelManager()
Method Detail |
---|
public void cacheDisplayLists(GL gl, List<String> textLabels)
gl
- the current GL object.textLabels
- a list of AminoAcid residueIDs.public void deleteDisplayLists(GL gl)
gl
- the current GL object.public void enableTexture(GL gl, String segmentID, int shaders, RegionEnum regionType)
gl
- the current GL object.segmentID
- the segmentID will be used to select a subimage.shaders
- the name (an integer) of the shader pair that is
used for texture mapped text.regionType
- the region type can be Loop, Helix, or
BetaStrand.public void loadTablaRasa(GL gl)
gl
- the current GL object.public void deleteTablaRasa(GL gl)
gl
- the current GL object.public void readGlyphSet() throws GlyphException
GlyphException
- if a problem occurs while trying to read
the set of glyphs from a file.public void setDebug(boolean debug)
debug
- boolean value to turn debugging on or off.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |