# Class CartoonRenderer

java.lang.Object
org.jmol.render.ShapeRenderer
org.jmol.renderbio.StrandsRenderer
org.jmol.renderbio.RocketsRenderer
org.jmol.renderbio.CartoonRenderer

public class CartoonRenderer extends RocketsRenderer

## Field Summary

Fields
Modifier and Type
Field
Description
`protected BS`
`bsVisible`
`protected boolean`
`cartoonsFancy`
`protected short[]`
`colixes`
`protected short[]`
`colixesBack`
`protected P3[]`
`controlPoints`
`protected P3[]`
`controlPointScreens`
`protected boolean`
`isCarbohydrate`
`protected boolean`
`isNucleic`
`protected boolean`
`isPhosphorusOnly`
`protected int[]`
`leadAtomIndices`
`protected short[]`
`mads`
`protected int`
`monomerCount`
`protected Monomer[]`
`monomers`
`protected boolean`
`renderStruts`
`protected P3[]`
`ribbonBottomScreens`
`protected P3[]`
`ribbonTopScreens`
`protected STR[]`
`structureTypes`
`protected V3[]`
`wingVectors`
`protected boolean`
`wireframeOnly`

### Fields inherited from class RocketsRenderer

`cordMidPoints, helixRockets, renderArrowHeads`

### Fields inherited from class StrandsRenderer

`baseStrandOffset, strandCount, strandSeparation`

### Fields inherited from class ShapeRenderer

`colix, exportType, flags, g3d, isExport, mad, ms, myVisibilityFlag, shape, shapeID, tm, vwr`

## Constructor Summary

Constructors
Constructor
Description
`CartoonRenderer()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`calcScreenControlPoints()`
`protected P3[]`
`calcScreens(float offsetFraction, short[] mads)`
calculate screen points based on control points and wing positions (cartoon, strand, meshRibbon, and ribbon)
`protected void`
`drawSegmentAB(Atom atomA, Atom atomB, short colixA, short colixB, float max)`
`protected short`
`getLeadColix(int i)`
`protected short`
`getLeadColixBack(int i)`
`protected Point3fi`
`getStrutPointIfNeeded(Atom a)`
Get strut point for trace, rocket, strand
`protected boolean`
`render()`
`protected void`
`renderBioShape(BioShape bioShape)`
`protected void`
`renderHermiteArrowHead(int i)`
`protected void`
`renderHermiteConic(int i, boolean thisTypeOnly, int tension)`
`protected void`
`renderHermiteCylinder(P3[] screens, int i)`
`protected void`
`renderHermiteRibbon(boolean doFill, int i, boolean thisTypeOnly)`
`protected boolean`
`setBioColix(short colix)`
`protected boolean`
`setColix(short colix)`
`protected void`
`setStrutPoint(Atom a, Point3fi newPt)`

### Methods inherited from class RocketsRenderer

`adjustStrut, calcRopeMidPoints, renderRockets, setupRR`

### Methods inherited from class StrandsRenderer

`renderStrands, renderStrandShape, setStrandCount`

### Methods inherited from class ShapeRenderer

`initRenderer, isVisibleForMe, renderShape, setup, setViewerG3dShapeID`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### cartoonsFancy

protected boolean cartoonsFancy

### monomerCount

protected int monomerCount

### monomers

protected Monomer[] monomers

### isNucleic

protected boolean isNucleic

### isPhosphorusOnly

protected boolean isPhosphorusOnly

### isCarbohydrate

protected boolean isCarbohydrate

### bsVisible

protected BS bsVisible

### ribbonTopScreens

protected P3[] ribbonTopScreens

### ribbonBottomScreens

protected P3[] ribbonBottomScreens

### controlPoints

protected P3[] controlPoints

### controlPointScreens

protected P3[] controlPointScreens

### leadAtomIndices

protected int[] leadAtomIndices

### wingVectors

protected V3[] wingVectors

### mads

protected short[] mads

### colixes

protected short[] colixes

### colixesBack

protected short[] colixesBack

### structureTypes

protected STR[] structureTypes

### wireframeOnly

protected boolean wireframeOnly

### renderStruts

protected boolean renderStruts

## Constructor Details

### CartoonRenderer

public CartoonRenderer()

## Method Details

### renderBioShape

protected void renderBioShape(BioShape bioShape)

Overrides:
  `renderBioShape` in class `RocketsRenderer`

### render

protected boolean render()

Specified by:
  `render` in class `ShapeRenderer`

### setBioColix

protected boolean setBioColix(short colix)

### calcScreenControlPoints

protected void calcScreenControlPoints()

### calcScreens

protected P3[] calcScreens(float offsetFraction, short[] mads)
calculate screen points based on control points and wing positions (cartoon, strand, meshRibbon, and ribbon)

Parameters:
  `offsetFraction` -
  `mads` -
Returns:
  Point3i array THAT MUST BE LATER FREED

### getLeadColix

protected short getLeadColix(int i)

### getLeadColixBack

protected short getLeadColixBack(int i)

### setColix

protected boolean setColix(short colix)

### renderHermiteCylinder

protected void renderHermiteCylinder(P3[] screens, int i)

### renderHermiteConic

protected void renderHermiteConic(int i, boolean thisTypeOnly, int tension)

### renderHermiteRibbon

protected void renderHermiteRibbon(boolean doFill, int i, boolean thisTypeOnly)

Parameters:
  `doFill` -
  `i` -
  `thisTypeOnly` - true for Cartoon but not MeshRibbon

### renderHermiteArrowHead

protected void renderHermiteArrowHead(int i)

### drawSegmentAB

protected void drawSegmentAB(Atom atomA, Atom atomB, short colixA, short colixB, float max)

### getStrutPointIfNeeded

protected Point3fi getStrutPointIfNeeded(Atom a)
Get strut point for trace, rocket, strand

Parameters:
  `a` - control atom
Returns:
  point only if not null and not already set

### setStrutPoint

protected void setStrutPoint(Atom a, Point3fi newPt)