|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.graphics.Shape org.proteinshader.graphics.ExtrudedShape org.proteinshader.graphics.Ribbon
public class Ribbon
Draws a segment of a three-dimensional ribbon by using a
rectangular-shaped waist polygon.
The broad surface of the ribbon will have texture coordinates and
will be whatever material color is set before drawing. However, the
narrower sides will be set to a default color for now.
Field Summary | |
---|---|
static double |
ALPHA_HEIGHT
The default ribbon height (y-axis dimension) for an alpha-helix region is 3.0 angstroms. |
static float |
ALPHA_S_COORD_END
The texture s-coordinate for alpha-helices ends at 1.0. |
static float |
ALPHA_S_COORD_START
The texture s-coordinate for alpha-helices starts at 0.0. |
static int |
ALPHA_STACKS
The default number of stacks for an alpha-helix segment is 10. |
static float |
ALPHA_THIN_SIDE_S_MAX
The texture s-coordinate for the thin side of alpha-helices ends at 0.125. |
static float |
ALPHA_THIN_SIDE_S_MIN
The texture s-coordinate for the thin side of alpha-helices starts at 0.0. |
static double |
ALPHA_WIDTH
The default ribbon width (x-axis dimension) for an alpha-helix region is 0.2 angstroms. |
static double |
BETA_HEIGHT
The default is 4.0 angstroms. |
static float |
BETA_S_COORD_END
The texture s-coordinate for beta-strands ends at 1.0. |
static float |
BETA_S_COORD_START
The texture s-coordinate for beta-strands starts at 0.0. |
static int |
BETA_STACKS
The default number of stacks for a beta-strand segment is 10. |
static float |
BETA_THIN_SIDE_S_MAX
The texture s-coordinate for the thin side of beta-strands ends at 0.125. |
static float |
BETA_THIN_SIDE_S_MIN
The texture s-coordinate for the thin side of beta-strands starts at 0.0. |
static double |
BETA_WIDTH
The default ribbon width (x-axis dimension) for a BetaStrand region is 0.2 angstroms. |
static double |
LOOP_HEIGHT
The default ribbon height (y-axis dimension) for a Loop region is 1.0 angstroms. |
static float |
LOOP_S_COORD_END
The texture s-coordinate for loops ends at 0.75 rather than at 1.0. |
static float |
LOOP_S_COORD_START
The texture s-coordinate for loops starts at 0.25 rather than at 0.0. |
static int |
LOOP_STACKS
The default number of stacks for a loop segment is 10. |
static float |
LOOP_THIN_SIDE_S_MAX
The texture s-coordinate for the thin side of loops ends at 0.125. |
static float |
LOOP_THIN_SIDE_S_MIN
The texture s-coordinate for the thin side of loops starts at 0.0. |
static double |
LOOP_WIDTH
The default ribbon width (x-axis dimension) for a Loop region is 0.25 angstroms. |
static float[] |
THIN_SIDES_COLOR
The default color for the narrow sides of the three-dimensional ribbon is gray. |
Fields inherited from class org.proteinshader.graphics.ExtrudedShape |
---|
END_CAP_COLOR, START_CAP_COLOR |
Fields inherited from class org.proteinshader.graphics.Shape |
---|
HALF_PI, PI, SPECULAR_COLOR, TWO_PI |
Constructor Summary | |
---|---|
Ribbon()
Constructs a Ribbon using the default values for a LOOP. |
|
Ribbon(double width,
double height,
double sCoordStart,
double sCoordEnd,
boolean counterclockwise,
double thinMinS,
double thinMaxS)
Constructs a Ribbon. |
|
Ribbon(RegionEnum regionType)
Constructs a Ribbon using default values based on the Region type (Helix, BetaStrand, or Loop). |
Method Summary | |
---|---|
void |
applyThinSidesColor(GL gl,
float alpha,
float specularExp)
Calls the setMaterial() method of superclass Shape with the THIN_SIDES_COLOR along with the alpha value and specular exponent given as aguments. |
void |
createDisplayLists(GL gl,
LocalFrame[] frames,
SegmentListInfo info)
Creates an OpenGL display list for the thin sides of the ribbon, and also calls on the createDisplayLists() method of superclass ExtrudedShape to save the OpenGL display lists for the main (broad surface) part of the ribbon and for the start and end caps. |
int |
createThinSidesDisplayList(GL gl,
LocalFrame[] frames)
Caches an OpenGL display list for the thin sides of a segment of a ribbon. |
void |
draw(GL gl,
LocalFrame[] frames)
Uses an array of LocalFrame objects to draw the broad surfaces of of a ribbon. |
void |
drawEndCap(GL gl,
LocalFrame frame)
Creates a cap for the end of a segment by drawing the waist polygon. |
void |
drawStartCap(GL gl,
LocalFrame frame)
Creates a cap for the beginning of a segment by drawing the waist polygon. |
void |
drawThinSideSurfaces(GL gl,
LocalFrame[] frames)
Draws the thin side surfaces for a segment of a ribbon. |
void |
setDimensions(double width,
double height)
Sets the width (x-axis dimension) and the height (y-axis dimension) of the rectangular waist polygon. |
void |
setSCoordParameters(double sCoordStart,
double sCoordEnd,
boolean counterclockwise)
Sets the lowest and highest s-coordinate for texture, and also sets the direction in which the s-texture coordinate increases. |
void |
setThinSideMinAndMaxS(double thinMinS,
double thinMaxS)
Sets the minimum and maximum values for the texture s-coordinate for the thin sides of the ribbon. |
Methods inherited from class org.proteinshader.graphics.ExtrudedShape |
---|
applyEndCapColor, applyStartCapColor, createDisplayList, createEndCapDisplayList, createStartCapDisplayList |
Methods inherited from class org.proteinshader.graphics.Shape |
---|
deleteDisplayList, executeDisplayList, executeDisplayList, setMaterial |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float[] THIN_SIDES_COLOR
public static final double LOOP_WIDTH
public static final double LOOP_HEIGHT
public static final int LOOP_STACKS
public static final float LOOP_S_COORD_START
public static final float LOOP_S_COORD_END
public static final float LOOP_THIN_SIDE_S_MIN
public static final float LOOP_THIN_SIDE_S_MAX
public static final double ALPHA_WIDTH
public static final double ALPHA_HEIGHT
public static final int ALPHA_STACKS
public static final float ALPHA_S_COORD_START
public static final float ALPHA_S_COORD_END
public static final float ALPHA_THIN_SIDE_S_MIN
public static final float ALPHA_THIN_SIDE_S_MAX
public static final double BETA_WIDTH
public static final double BETA_HEIGHT
public static final int BETA_STACKS
public static final float BETA_S_COORD_START
public static final float BETA_S_COORD_END
public static final float BETA_THIN_SIDE_S_MIN
public static final float BETA_THIN_SIDE_S_MAX
Constructor Detail |
---|
public Ribbon()
public Ribbon(RegionEnum regionType)
regionType
- the type can be HELIX, BETA_STRAND, or LOOP.public Ribbon(double width, double height, double sCoordStart, double sCoordEnd, boolean counterclockwise, double thinMinS, double thinMaxS)
width
- the x-axis dimension.height
- the y-axis dimension.sCoordStart
- lowest s-coordinate for texture mapping.sCoordEnd
- hightest s-coordinate for texture mapping.counterclockwise
- determines the direction in which the
s-texture coordinate increases as it goes
around the rectangle in the xy-plane.thinMinS
- minimum texture s-coordinate for thin side.thinMaxS
- maximum texture s-coordinate for thin side.Method Detail |
---|
public void applyThinSidesColor(GL gl, float alpha, float specularExp)
gl
- the current GL object.alpha
- component of RGBA colorspecularExp
- the specular exponent for Phong lighting
calculations.public void createDisplayLists(GL gl, LocalFrame[] frames, SegmentListInfo info)
createDisplayLists
in class ExtrudedShape
gl
- the current GL object.frames
- array of LocalFrames for positioning a waist
polygon.info
- the info object to store the name (an integer) of
each OpenGL display list that is created.public int createThinSidesDisplayList(GL gl, LocalFrame[] frames)
gl
- the current GL object.frames
- array of LocalFrames for positioning a waist
polygon.
public void draw(GL gl, LocalFrame[] frames)
draw
in class ExtrudedShape
gl
- the current GL object.frames
- array of LocalFrames for positioning a waist
polygon.public void drawStartCap(GL gl, LocalFrame frame)
drawStartCap
in class ExtrudedShape
gl
- the current GL object.frame
- the frame for positioning the waist polygon.public void drawEndCap(GL gl, LocalFrame frame)
drawEndCap
in class ExtrudedShape
gl
- the current GL object.frame
- the frame for positioning the waist polygon.public void drawThinSideSurfaces(GL gl, LocalFrame[] frames)
gl
- the current GL object.frames
- array of LocalFrames for positioning a waist
polygon.public void setDimensions(double width, double height)
width
- the width.height
- the height.public void setSCoordParameters(double sCoordStart, double sCoordEnd, boolean counterclockwise)
sCoordStart
- lowest s-coordinate for texture mapping.sCoordEnd
- hightest s-coordinate for texture mapping.counterclockwise
- determines the direction in which the
s-texture coordinate increases as it goes
around the rectangle in the xy-plane.public void setThinSideMinAndMaxS(double thinMinS, double thinMaxS)
thinMinS
- the starting s-coordinate.thinMaxS
- the ending s-coordinate.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |