The Interfaces In VTK Can’t Be Used With Webassembly

Setting point size and line width doesn’t work

vtkProperty.h

  /**
   * Set/Get the diameter of a point. The size is expressed in screen units.
   * This is only implemented for OpenGL. The default is 1.0.
   */
  vtkSetClampMacro(PointSize, float, 0, VTK_FLOAT_MAX);
  vtkGetMacro(PointSize, float);


   /**
   * Set/Get the width of a Line. The width is expressed in screen units.
   * This is only implemented for OpenGL. The default is 1.0.
   */
  vtkSetClampMacro(LineWidth, float, 0, VTK_FLOAT_MAX);
  vtkGetMacro(LineWidth, float);

Shift polygons, lines and points will fail in wasm. It will cause crash on web page.

void SetMapperAlwaysOnTop( vSP<vtkMapper> mapper )
{
    const double units0 = -66000;
    // mapper->SetResolveCoincidentTopologyToPolygonOffset();
    // mapper->SetRelativeCoincidentTopologyLineOffsetParameters(0, units0);
    // mapper->SetRelativeCoincidentTopologyPolygonOffsetParameters(0, units0);
    // mapper->SetRelativeCoincidentTopologyPointOffsetParameter(units0);
}

The new polydata generated by vtkFeatureEdge algorithm can’t be rendered in WebGL because something is wrong about samplerBuffer.

#define vSP vtkSmartPointer    
#define vSPNew(Var, Type)    vSP<Type> Var = vSP<Type>::New();

vSPNew( boundaryEdges, vtkFeatureEdges );
boundaryEdges->SetInputData( toothModel->GetToothPolyDataForShow() );
boundaryEdges->BoundaryEdgesOff();
boundaryEdges->FeatureEdgesOn();
boundaryEdges->NonManifoldEdgesOff();
boundaryEdges->ManifoldEdgesOff();
boundaryEdges->SetFeatureAngle( 30 );
boundaryEdges->Update();

Use PointData Scalar Rather Than CellData Scalar

The cell data scalar can’t be used to set color on web page with wasm. We can use point data scalar to get the same task done.

Categories: VTK

0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
trackback

[…] know, SetResolveCoincidentTopologyToPolygonOffset for mapper can make web page crash, related post: The Interfaces In VTK Can’t Be Used With Webassembly. After reading the source code of […]

Tex To PDF
: convert the Latex file which suffix is tex to a PDF file

X
1
0
Would love your thoughts, please comment.x
()
x