Options
All
  • Public
Menu

Class PolygonContext

Hierarchy

  • PolygonContext

Index

Constructors

constructor

  • Parameters

    • polygonContextID: any

    Returns PolygonContext

Properties

Private polygonContextID

polygonContextID: number

Methods

cleanMesh

  • cleanMesh(doClean: boolean, callbackFunc?: any): Promise<Object>
  • Converts a mesh to a manifold representation for compatibility with a 3D printer. A manifold mesh has no holes, border edges, inverted triangles, or intersecting and interior polygons. Not all meshes can be cleaned in a single operation. Prior application of parameters in the Optimize function may be necessary to successfully clean a mesh.

    Parameters

    • doClean: boolean

      ff true the mesh will be cleaned, if false, the mesh will only be analyzed, with results returned in the promise

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (data)

    callbackFunc(data)

    Where data is:

    data.err = err;
    

    data.numBorders data.numFlippedTriangles data.numHoles data.numNonManifold

clearTextureMap

  • clearTextureMap(callbackFunc?: any): Promise<Object>
  • Clears the current texture map

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

colorizePolygonFromVolumeData

  • colorizePolygonFromVolumeData(renderEngineContext: RenderEngineContext, vrColor?: boolean, callbackFunc?: any): Promise<Object>
  • Generate vertex colors for the polygon context, resulting in a colorized object

    pparam

    renderEngineContext rendering engine that will perform the rendering operation

    Parameters

    • renderEngineContext: RenderEngineContext
    • Default value vrColor: boolean = true

      true if using Volume Rendering (VR) colorization or false for Transfer Function (TF) colorization

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

convertToIndexBuffer

  • convertToIndexBuffer(callbackFunc?: any): Promise<Object>
  • Converts a mesh from an vertex buffer represtentation to an index buffer representation. This operation can result in a large reduction in the number of vertices needed to define the mesh. This will also reduce the amount of memory required to store the mesh data.

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

enableCutPlanes

  • enableCutPlanes(cutPlanesEnabled: boolean, callbackFunc?: any): Promise<Object>
  • Setting to determine if the polygon rendering should be effected by the cut planes

    Parameters

    • cutPlanesEnabled: boolean

      true if polygons should be clipped by cut planes, false otherwise

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

enableTextureLighting

  • enableTextureLighting(textureLightingEnabled: boolean, callbackFunc?: any): Promise<Object>
  • Setting to determine if texture lighting shoudl be enabled or disabled

    Parameters

    • textureLightingEnabled: boolean

      true if texture lighting is to be enabled, false otherwise

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

enableUniformShading

  • enableUniformShading(uniformShading: boolean, callbackFunc?: any): Promise<Object>
  • This method determine if shading is enabled for the whole polygon context

    Parameters

    • uniformShading: boolean

      true if the entire polygon context shoudl have shading enabled, false otherwise

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

getMeshDetails

  • getMeshDetails(callbackFunc?: any): Promise<Object>
  • Get the current polygon mesh details and return this from the promse.

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (data)

    callbackFunc(data)

    Where data is:

    data.err data.numVerticies data.numPolygons data.numIndicies

getPolygonContextID

  • getPolygonContextID(): number
  • Return the polygon context ID associated with this object

    Returns number

getTransform

  • getTransform(callbackFunc?: any): Promise<Object>
  • Get the current a 4x4 matrix that is multiplied to each vertices before being displayed

    Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (matrix: Matrix )

    callbackFunc(matrix: Matrix )

invertMeshGradients

  • invertMeshGradients(invertGradients: boolean, callbackFunc?: any): Promise<Object>
  • Allows the mesh gradients to be inverted

    Parameters

    • invertGradients: boolean
    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

optimize

  • optimize(cleanIslands: boolean, islandPercentage: number, decimate: boolean, decimatePercentage: number, smoothBefore: boolean, smoothAfter: boolean, smoothAmount: number, flip: boolean, callbackFunc?: any): Promise<Object>
  • Executes a set of mesh optimization algorithms such as polygon decimation, connected set limitation, and vertex smoothing. This method can perfom all of these operations, or a subset of them.

    Parameters

    • cleanIslands: boolean

      determings if the connected set reduction operation is run

    • islandPercentage: number

      value between 0 and 100 that sets the connected set size threshold. For example, if a mesh has 100 polygons and islandPercentage is set to 10, then all sets containing 10 or fewer polygons are deleted

    • decimate: boolean

      determings if the decimate operation is run

    • decimatePercentage: number

      value between 0 and 100 that determines the percentage of polygons that will be removed. For example, if set to 75, then 75 percent of the polygons will be removed.

    • smoothBefore: boolean

      determines if the smoothing operation is run before the decimate operation

    • smoothAfter: boolean

      determines if the smoothing operation is run after the decimate operation

    • smoothAmount: number

      value between 0 and 1 that determines how aggressively the mesh is smoothed. Higher values equate to more smoothing.

    • flip: boolean

      determines if the polygon flip operation is applied

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

release

  • release(): number
  • Returns number

releaseSessionResources

  • releaseSessionResources(callbackFunc?: any): Promise<Object>
  • Parameters

    • Optional callbackFunc: any

    Returns Promise<Object>

renderPolygonOutline

  • renderPolygonOutline(lineWidth: number, callbackFunc?: any): Promise<Object>
  • When rendeirng polygons on MPR views, you typically render as an outline that intersects with the curent view. The width of the line is specified by this method. This is NOT used when setType is set to lines.

    Parameters

    • lineWidth: number

      width of the line when rendering an outline.

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

save

  • save(filename: string, polygonFileType: PolygonFileType, callbackFunc?: any): Promise<Object>
  • Saves the polygon context to the specifieid file on the server, in either OBJ, STL, or OBJ format.

    Parameters

    • filename: string
    • polygonFileType: PolygonFileType
    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

setCullMode

  • setCullMode(cullMode: CullMode, callbackFunc?: any): Promise<Object>
  • Sets the backface culling mode

    Parameters

    • cullMode: CullMode
    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

setTextureMapFromFile

  • setTextureMapFromFile(filename: string, callbackFunc?: any): Promise<Object>
  • Sets the texture mapping source to the specified JPEG file.

    Parameters

    • filename: string
    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

setTextureMapFromRenderEngine

  • setTextureMapFromRenderEngine(renderEngineContext: RenderEngineContext, callbackFunc?: any): Promise<Object>
  • Sets the texture mapping source to the specified rendering engine.

    Parameters

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

setTransform

  • setTransform(matrix: Matrix, callbackFunc?: any): Promise<Object>
  • Sets a 4x4 matrix for each of the vertices to be multiplied by before being displayed

    Parameters

    • matrix: Matrix
    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

setType

  • setType(polygonType: PolygonType, callbackFunc?: any): Promise<Object>
  • Sets if polygon rendering mode should be lines (as an outline) or triangles

    Parameters

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

setUniformColor

  • setUniformColor(uniformColor: Color, callbackFunc?: any): Promise<Object>
  • This method sets the color for the entire polygon context

    Parameters

    • uniformColor: Color

      color to be applied to the entire polygon context

    • Optional callbackFunc: any

    Returns Promise<Object>

    This is an asynchronous method that returns a Promise as follows:

    Promise .then() .catch (err: ReturnCode )

    callbackFunc(err: ReturnCode )

Generated using TypeDoc