Skip to content

Commit

Permalink
a quick round of cleanup
Browse files Browse the repository at this point in the history
Add in a number of missing api.md files and cleanup
many that were already there. Removed a couple
classes that were no longer used. Removed some
methods on classes that no longer make sense.
Removed some commented out code that was not
currently being used.
  • Loading branch information
martinken committed Oct 12, 2016
1 parent e73af92 commit 00b3ced
Show file tree
Hide file tree
Showing 40 changed files with 359 additions and 1,258 deletions.
28 changes: 3 additions & 25 deletions Sources/Rendering/Core/Actor/api.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
vtkActor is used to represent an entity in a rendering scene. It inherits
functions related to the actors position, and orientation from
vtkProp. The actor also has scaling and maintains a reference to the
vtkProp3D. The actor also has scaling and maintains a reference to the
defining geometry (i.e., the mapper), rendering properties, and possibly a
texture map. vtkActor combines these instance variables into one 4x4
transformation matrix as follows: [x y z 1] = [x y z 1] Translate(-origin)
Scale(scale) Rot(y) Rot(x) Rot (z) Trans(origin) Trans(position)

## See Also

Property Texture Mapper Assembly Follower LODActor
Property Mapper

## newInstance()

Expand All @@ -32,32 +32,10 @@ are used in that process.
virtual void GetActors(vtkPropCollection *);
```

## renderOpaqueGeometry(viewport)

Support the standard render methods.
Returns 0 on success, 1 on failure.

## renderTranslucentPolygonalGeometry(viewport)

Support the standard render methods.

## hasTranslucentPolygonalGeometry()

Does this prop have some translucent polygonal geometry?

## render(renderer, mapper)

This causes the actor to be rendered. It in turn will render the actor's
property, texture map and then mapper. If a property hasn't been
assigned, then the actor will create one automatically. Note that a side
effect of this method is that the pipeline will be updated.

## releaseGraphicsResources(window)

Release any graphics resources that are being consumed by this actor.
The parameter window could be used to determine which graphic
resources to release.

## property

Set/Get the property object that controls this actors surface
Expand All @@ -70,7 +48,7 @@ property object.

Create a new property suitable for use with this type of Actor.
For example, a vtkMesaActor should create a vtkMesaProperty
in this function. The default is to just call vtkProperty::New.
in this function. The default is to create a vtkProperty.

## backfaceProperty

Expand Down
17 changes: 0 additions & 17 deletions Sources/Rendering/Core/Actor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,6 @@ function vtkActor(publicAPI, model) {
return !publicAPI.getIsOpaque();
};

publicAPI.releaseGraphicsResources = (win) => {
// pass this information onto the mapper
if (model.mapper) {
model.mapper.releaseGraphicsResources(win);
}

// TBD: pass this information onto the texture(s)

// pass this information to the properties
if (model.property) {
model.property.releaseGraphicsResources(win);
}
if (model.backfaceProperty) {
model.backfaceProperty.releaseGraphicsResources(win);
}
};

publicAPI.makeProperty = vtkProperty.newInstance;

publicAPI.getProperty = () => {
Expand Down
57 changes: 57 additions & 0 deletions Sources/Rendering/Core/Actor2D/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
vtkActor2D is used to represent a 2D entity in a rendering scene. It inherits
functions related to the actors position, and orientation from
vtkProp. The actor also has scaling and maintains a reference to the
defining geometry (i.e., the mapper), rendering properties, and possibly a
texture map.

## See Also

Property2D Mapper2D

## newInstance()

Create an instance of vtkActor2D

## getActors2D()

For some exporters and other other operations we must be
able to collect all the actors or volumes. These methods
are used in that process.

## hasTranslucentPolygonalGeometry()

Does this prop have some translucent polygonal geometry?

## property

Set/Get the property object that controls this actors surface
properties. This should be an instance of a vtkProperty object. Every
actor must have a property associated with it. If one isn't specified,
then one will be generated automatically. Multiple actors can share one
property object.

## makeProperty()

Create a new property suitable for use with this type of Actor.
The default is to create a vtkProperty2D.

## mapper

This is the method that is used to connect an actor to the end of a
visualization pipeline, i.e. the mapper. This should be a subclass
of vtkMapper2D. Typically vtkPolyDataMapper2D will be used.

## bounds()

Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).

## getMTime()

Get the newest "modification time" of the actor, its properties, and texture (if set).

## getRedrawMTime()

Return the mtime of anything that would cause the rendered image to
appear differently. Usually this involves checking the mtime of the
prop plus anything else it depends on such as properties, textures,
etc.
40 changes: 2 additions & 38 deletions Sources/Rendering/Core/Camera/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Rotate the focal point about the view up vector, using the camera's position as
rotation. Note that the view up vector is whatever was set via SetViewUp, and is not necessarily
perpendicular to the direction of projection. The result is a horizontal rotation of the scene.

### elevation(angle)
### elevation(angle)

Rotate the camera about the cross product of the negative of the direction of projection and the
view up vector, using the focal point as the center of rotation. The result is a vertical rotation
Expand Down Expand Up @@ -121,7 +121,7 @@ of these values must be positive. How the clipping planes are set can have a lar
well z-buffering works. In particular the front clipping plane can make a very big difference.
Setting it to 0.01 when it really could be 1.0 can have a big impact on your z-buffer resolution
farther away. The default clipping range is (0.1,1000). Clipping distance is measured in world
coordinate unless a scale factor exists in camera's ModelTransformMatrix.
coordinates.

### thickness

Expand Down Expand Up @@ -153,16 +153,6 @@ using the transform's matrix to multiply the old points by the new transform.
Get the ViewPlaneNormal. This vector will point opposite to the direction of projection, unless
you have created a sheared output view using SetViewShear/SetObliqueAngles.

### viewShear

Set/get the shear transform of the viewing frustum. Parameters are dx/dz, dy/dz, and center.
center is a factor that describes where to shear around. The distance dshear from the camera
where no shear occurs is given by (dshear = center * FocalDistance).

### eyeAngle

Set/Get the separation between eyes (in degrees). This is used when generating stereo images.

### focalDisk

Set the size of the cameras lens in world coordinates. This is only used when the renderer is
Expand Down Expand Up @@ -190,32 +180,6 @@ calculation. Default is (0.5, -0.5, -0.5).
Set/Get top right corner point of the screen. This will be used only for offaxis frustum
calculation. Default is (0.5, 0.5, -0.5).

### eyeSeparation

Set/Get distance between the eyes. This will be used only for offaxis frustum calculation.
Default is 0.06.

### eyePosition

Set/Get the eye position (center point between two eyes). This is a convenience function that
sets the translation component of EyeTransformMatrix. This will be used only for offaxis
frustum calculation.

### getEyePlaneNormal()

Get normal vector from eye to screen rotated by EyeTransformMatrix. This will be used only for
offaxis frustum calculation.

### eyeTransformMatrix

Set/Get eye transformation matrix. This is the transformation matrix for the point between
eyes. This will be used only for offaxis frustum calculation. Default is identity.

### modelTransformMatrix

Set/Get model transformation matrix. This matrix could be used for model related transformations
such as scale, shear, roations and translations.

### getViewTransformMatrix()

Return the matrix of the view transform. The ViewTransform depends on only three ivars: the
Expand Down
30 changes: 0 additions & 30 deletions Sources/Rendering/Core/Camera/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ function vtkCamera(publicAPI, model) {
// Set up private variables and methods
const viewMatrix = mat4.create();
const projectionMatrix = mat4.create();
// let viewUp = new vec3.fromValues(0, 1, 0);
// let distance = 0.0002;

publicAPI.orthogonalizeViewUp = () => {
const vt = publicAPI.getViewTransformMatrix();
Expand Down Expand Up @@ -261,18 +259,6 @@ function vtkCamera(publicAPI, model) {

};

publicAPI.setEyePosition = eyePosition => {

};

publicAPI.getEyePosition = () => {

};

publicAPI.getEyePlaneNormal = () => {

};

publicAPI.getViewTransformMatrix = () => {
const eye = model.position;
const at = model.focalPoint;
Expand Down Expand Up @@ -325,8 +311,6 @@ function vtkCamera(publicAPI, model) {
mat4.perspective(projectionMatrix, vtkMath.radiansFromDegrees(fovy), aspect, cRange[0], cRange[1]);
}

// No stereo, no view shear at the current time

mat4.transpose(projectionMatrix, projectionMatrix);
return projectionMatrix;
};
Expand Down Expand Up @@ -420,19 +404,13 @@ export const DEFAULT_VALUES = {
thickness: 1000,
windowCenter: [0, 0],
viewPlaneNormal: [0, 0, 1],
viewShear: [0, 0, 1],
eyeAngle: 2,
focalDisk: 1,
useOffAxisProjection: false,
screenBottomLeft: [-0.5, -0.5, -0.5],
screenBottomRight: [0.5, -0.5, -0.5],
screenTopRight: [0.5, 0.5, -0.5],
eyeSeparation: 0.06,
// eyeTransformMatrix: mat4.create(), // can't do these here, or else
// modelTransformMatrix: mat4.create(), // every instance shares same default
userViewTransform: null,
userTransform: null,
leftEye: 1,
freezeFocalPoint: false,
useScissor: false,
};
Expand All @@ -443,8 +421,6 @@ export function extend(publicAPI, model, initialValues = {}) {
Object.assign(model, DEFAULT_VALUES, initialValues);

// Make sure we have our own objects
model.eyeTransformMatrix = mat4.create();
model.modelTransformMatrix = mat4.create();

// Build VTK API
macro.obj(publicAPI, model);
Expand All @@ -459,13 +435,8 @@ export function extend(publicAPI, model, initialValues = {}) {
'useHorizontalViewAngle',
'viewAngle',
'parallelScale',
'eyeAngle',
'focalDisk',
'useOffAxisProjection',
'eyeSeparation',
'eyeTransformMatrix',
'modelTransformMatrix',
'leftEye',
'freezeFocalPoint',
'useScissor',
]);
Expand All @@ -484,7 +455,6 @@ export function extend(publicAPI, model, initialValues = {}) {

macro.setGetArray(publicAPI, model, [
'viewUp',
'viewShear',
'screenBottomLeft',
'screenBottomRight',
'screenTopRight',
Expand Down
45 changes: 45 additions & 0 deletions Sources/Rendering/Core/Coordinate/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Introduction

vtkCoordinate performs coordinate transformation, and represent position, in a variety of vtk coordinate systems

vtkCoordinate represents position in a variety of coordinate systems, and
converts position to other coordinate systems. It also supports relative
positioning, so you can create a cascade of vtkCoordinate objects (no loops
please!) that refer to each other. The typical usage of this object is
to set the coordinate system in which to represent a position (e.g.,
SetCoordinateSystemToNormalizedDisplay()), set the value of the coordinate
(e.g., SetValue()), and then invoke the appropriate method to convert to
another coordinate system (e.g., GetComputedWorldValue()).
The coordinate systems in vtk are as follows:

<PRE>
DISPLAY - x-y pixel values in window
NORMALIZED DISPLAY - x-y (0,1) normalized values
VIEWPORT - x-y pixel values in viewport
NORMALIZED VIEWPORT - x-y (0,1) normalized value in viewport
VIEW - x-y-z (-1,1) values in camera coordinates. (z is depth)
WORLD - x-y-z global coordinate values
USERDEFINED - x-y-z in User defined space
</PRE>

If you cascade vtkCoordinate objects, you refer to another vtkCoordinate
object which in turn can refer to others, and so on. This allows you to
create composite groups of things like vtkActor2D that are positioned
relative to one another. Note that in cascaded sequences, each
vtkCoordinate object may be specified in different coordinate systems!

## See Also

vtkActor2D

### referenceCoordinate

Make this coordinate relative to another coordinate instance.

### viewport

The viewport to use for calculations that require it.

### value

The x y z location of this point.
12 changes: 12 additions & 0 deletions Sources/Rendering/Core/ImageMapper/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Introduction

vtkImageMapper provides 2D image display support for vtk.
It can be associated with a vtkImageSlice prop and placed within a Renderer.

## See Also

vtkImageSlice vtkImageProperty vtkInteractorStyleImage

### zSlice

What slice of image data to display from a 3D volume.
2 changes: 1 addition & 1 deletion Sources/Rendering/Core/ImageMapper/example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ actor.getProperty().setColorLevel(127);
actor.setMapper(mapper);

const gridSource = vtkImageGridSource.newInstance();
gridSource.setDataExtent(0, 511, 0, 511, 0, 0);
gridSource.setDataExtent(0, 200, 0, 200, 0, 0);
gridSource.setGridSpacing(16, 16, 0);
gridSource.setGridOrigin(8, 8, 0);
mapper.setInputConnection(gridSource.getOutputPort());
Expand Down
4 changes: 0 additions & 4 deletions Sources/Rendering/Core/ImageMapper/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import * as macro from '../../../macro';
import vtkMath from '../../../Common/Core/Math';

// ----------------------------------------------------------------------------
// vtkProperty2D methods
// ----------------------------------------------------------------------------

function vtkImageMapper(publicAPI, model) {
// Set our className
model.classHierarchy.push('vtkImageMapper');
Expand Down
Loading

0 comments on commit 00b3ced

Please sign in to comment.