

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.proteinshader.structure.io.TubeVertices
public class TubeVertices
Creates the vertices for a segment of a threedimensional tube by
using a waist polygon that approximates a circle as the number of
vertices in the waist polygon becomes large.
This class is similar to the Tube class in the gui package, but
instead of calling on OpenGL to draw a tube, the draw() method
returns a 2D array of doubles with the xyzcoordinates for each
Vertex. The 2D array is intended to be printed for debugging
purposes, or can be used to transfer data from the ProteinShader
program over to MatLab, where the tube can be drawn using MatLab
patch objects to produce a simple wireframe model (which may be
useful for debugging).
FORMAT:
Each row of the matrix represents the vertices [V1, V2, V3,...VN]
of a GL_TRIANGLE_STRIP, and is of the form:
row = [x1, y1, z1, x2, y2, z2,...xN, yN, zN]
The first row is the triangle strip at the Nterminus of a Segment,
while the last row is the triangle strip at the Cterminus. The
order of vertices follows the pattern shown on page 44 of the "OpenGL
Programming Guide", 5th Edition, by Shreiner, Woo, Neider, and Davis.
Note that the same collection of vertices can be used to draw either
a GL_TRIANGLE_STRIP or a GL_QUAD_STRIP. For the first row, the even
numbered vertices can be used to create a start cap (to close the
end of the tube). For the last row, the odd numbered vertices can
be used to create an end cap.
See the comments for the Tube class in the graphics package for
additional details of how the vertices are drawn.
Field Summary  

static double 
ALPHA_RADIUS
The default radius for a Helix region waist polygon is 1.5 angstroms. 
static int 
ALPHA_SLICES
The default number of slices for a Helix region waist polygon is 16. 
static int 
ALPHA_STACKS
The default number of stacks for an alphahelix segment is 10. 
static double 
BETA_RADIUS
The default radius for a BetaStrand region waist polygon is 1.5 angstroms. 
static int 
BETA_SLICES
The default number of slices for a BetaStrand region waist polygon is 16. 
static int 
BETA_STACKS
The default number of stacks for a betastrand segment is 10. 
static double 
HALF_PI
Onehalf Pi is defined as 1.57079632679489. 
static double 
LOOP_RADIUS
The default radius for a Loop region waist polygon is 0.75 angstroms. 
static int 
LOOP_SLICES
The default number of slices for a Loop region waist polygon is 8. 
static int 
LOOP_STACKS
The default number of stacks for a loop segment is 10. 
static double 
PI
Pi is defined as 3.14159265358979. 
static double 
TWO_PI
2*Pi is defined as 6.28318530717958. 
Constructor Summary  

TubeVertices()
Constructs a Tube object that can be used for rendering tubes with a circularshaped waist polygon. 

TubeVertices(double radius,
int slices)
Constructs a TubeVertices object that can be used for rendering tubes with a circularshaped waist polygon. 

TubeVertices(RegionEnum regionType)
Constructs a TubeVertices object that can be used for rendering tubes with a circularshaped waist polygon. 
Method Summary  

double[][] 
draw(LocalFrame[] frames)
Uses an array of LocalFrame objects to draw a segment of a tube. 
void 
setRadius(double radius)
Sets the radius used for drawing the waist polygon, which approximates a circle as the number of vertices becomes large. 
void 
setSlices(int slices)
Sets the number of slices that the nearly circular waist polygon would be divided into if a line was drawn from the center of the polygon to each vertex. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Field Detail 

public static final double PI
public static final double TWO_PI
public static final double HALF_PI
public static final double LOOP_RADIUS
public static final int LOOP_SLICES
public static final int LOOP_STACKS
public static final double ALPHA_RADIUS
public static final int ALPHA_SLICES
public static final int ALPHA_STACKS
public static final double BETA_RADIUS
public static final int BETA_SLICES
public static final int BETA_STACKS
Constructor Detail 

public TubeVertices()
public TubeVertices(RegionEnum regionType)
regionType
 the type can be HELIX, BETA_STRAND, or LOOP.public TubeVertices(double radius, int slices)
radius
 the radius of the circular waist polygon.slices
 determines the number of vertices in the circle.Method Detail 

public double[][] draw(LocalFrame[] frames)
frames
 array of LocalFrames for positioning a waist
polygon.public void setRadius(double radius)
radius
 the radius of the circular waist polygon.public void setSlices(int slices)
slices
 the number of slices the circle is divided into.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 