Skip to content

Commit

Permalink
fix(Docs): Add new API docs; add small method to OrientationMarkerWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
floryst committed Dec 18, 2017
1 parent fd16369 commit 5df3710
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 48 deletions.
13 changes: 13 additions & 0 deletions Sources/Interaction/Widgets/OrientationMarkerWidget/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### setEnabled(enabling)

Sets the widget enabled status, i.e. to show the widget or not.

### setViewportCorner(vtkOrientationMarkerWidget.Corner)

Sets which corner to put the widget's viewport. Defaults to
BOTTOM_LEFT.

### setViewportSize(sizeFactor)

Sets the viewport size. The sizeFactor should be between 0.0 and 1.0.
It says how much of the main render window to color. Defaults to 0.2.
71 changes: 71 additions & 0 deletions Sources/Rendering/Core/AnnotatedCubeActor/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
### setResolution(resolution)

Sets the cube face resolution. Defaults to 200.

### setFontStyle(style)

Sets the font style. This is any valid CSS font style, e.g. normal,
bold, etc. Defaults to "normal".

### setFontFamily(family)

Sets the font family. This is any valid CSS font family name. Defaults
to "Arial".

### setFontColor(color)

Sets the font color. This is any valid CSS color. Defaults to "black".

### setEdgeThickness(thickness)

Edge thickness is a value between 0.0 and 1.0, and represents the
fraction of the face resolution to cover (for one edge). Defaults to
0.1.

If the thickness is 0, then no edge is rendered.

### setEdgeColor(color)

Sets the edge color. Defaults to black.

### setXPlusFaceProperty({ text, faceColor})

Sets the +X face property.

This takes an object, where you can optionally set the face text
or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.

### setXMinusFaceProperty({ text, faceColor})

Sets the -X face property.

This takes an object, where you can optionally set the face text
or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.

### setYPlusFaceProperty({ text, faceColor})

Sets the +Y face property.

This takes an object, where you can optionally set the face text
or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.

### setYMinusFaceProperty({ text, faceColor})

Sets the -Y face property.

This takes an object, where you can optionally set the face text
or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.

### setZPlusFaceProperty({ text, faceColor})

Sets the +Z face property.

This takes an object, where you can optionally set the face text
or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.

### setZMinusFaceProperty({ text, faceColor})

Sets the -Z face property.

This takes an object, where you can optionally set the face text
or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.
53 changes: 5 additions & 48 deletions Sources/Rendering/Core/AnnotatedCubeActor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,64 +121,21 @@ function vtkAnnotatedCubeActor(publicAPI, model) {
updateAllFaceTextures();
};

/**
* Sets edge thickness.
*
* Edge thickness is a value between 0.0 and 1.0, and represents
* the fraction of the face resolution to cover (for one edge).
*/
publicAPI.setEdgeThickness = (thickness) => {
model.edgeThickness = Math.min(1, Math.max(0, thickness));
updateAllFaceTextures();
};

/**
* Sets the +X face property.
*
* This takes an object, where you can optionally set the face text
* or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.
*/
publicAPI.setXPlusFaceProperty = prop => updateFaceTexture('xPlus', prop);
publicAPI.setEdgeColor = (color) => {
model.edgeColor = color;
updateAllFaceTextures();
};

/**
* Sets the -X face property.
*
* This takes an object, where you can optionally set the face text
* or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.
*/
publicAPI.setXPlusFaceProperty = prop => updateFaceTexture('xPlus', prop);
publicAPI.setXMinusFaceProperty = prop => updateFaceTexture('xMinus', prop);

/**
* Sets the +Y face property.
*
* This takes an object, where you can optionally set the face text
* or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.
*/

publicAPI.setYPlusFaceProperty = prop => updateFaceTexture('yPlus', prop);

/**
* Sets the -Y face property.
*
* This takes an object, where you can optionally set the face text
* or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.
*/
publicAPI.setYMinusFaceProperty = prop => updateFaceTexture('yMinus', prop);

/**
* Sets the +Z face property.
*
* This takes an object, where you can optionally set the face text
* or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.
*/
publicAPI.setZPlusFaceProperty = prop => updateFaceTexture('zPlus', prop);

/**
* Sets the -Z face property.
*
* This takes an object, where you can optionally set the face text
* or the face color, e.g. { text: 'Text', faceColor: '#0000ff' }.
*/
publicAPI.setZMinusFaceProperty = prop => updateFaceTexture('zMinus', prop);

// constructor
Expand Down

0 comments on commit 5df3710

Please sign in to comment.