Hi all,
<div><br></div><div>I have a vtk render window where I am creating a surface using vtkVoxelContoursToSurfaceFilter and display.</div><div>The surface displays well.</div><div>I want to add another vtk object which defines the outline of the surface. I created it using vtk lines.</div>
<div>My problem is that when I add the second one, the first object becomes very small,(not the actual size)</div><div>How could I fix this issue?</div><div><br></div><div>Below is a part of my code demonstrate the problem.</div>
<div><br></div><div><div><br></div><div> vtkSmartPointer<vtkCellArray> cells = vtkSmartPointer<vtkCellArray>::New();</div><div><br></div><div> for (int i=0; i< (t_val-1) ;i++){</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> for (int j=0; j< (n+m-2);j++){</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> cells->InsertNextCell(4);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>cells->InsertCellPoint((i*(n+m-1))+j);</div><div>
<span class="Apple-tab-span" style="white-space:pre">                </span>cells->InsertCellPoint((i*(n+m-1))+(j+1));</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>cells->InsertCellPoint(((i+1)*(n+m-1))+(j+1));</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>cells->InsertCellPoint(((i+1)*(n+m-1)) +j);</div><div><br></div><div> }</div><div> }</div><div><br></div><div> vtkSmartPointer<vtkPolyData> poly = vtkSmartPointer<vtkPolyData>::New();</div>
<div> poly->SetPoints(points);</div><div> poly->SetPolys(cells);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div> CArray <double,double> *ScalarValues = doc->get_CFD_ScalarValues(pAirfoil,m_value);</div>
<div> poly->GetPointData()->SetScalars(weights);</div><div><br></div><div><br></div><div> vtkSmartPointer<vtkVoxelContoursToSurfaceFilter> contoursToSurface = vtkSmartPointer<vtkVoxelContoursToSurfaceFilter>::New();</div>
<div> contoursToSurface->SetInput(poly);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer<vtkPoints> points_sections = vtkSmartPointer<vtkPoints>::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer<vtkCellArray> cells_sections = vtkSmartPointer<vtkCellArray>::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer<vtkPolyData> polyData_sections = vtkSmartPointer<vtkPolyData>::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>polyData_sections->Allocate();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>connectivity = new vtkIdType[a+b];</div><div><br></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>for(unsigned int c = 0; c < (a+b); c++)</div><div> {</div><div> connectivity[c] = c+i*(a+b);</div><div><br></div><div> }</div><div> polyData_sections->InsertNextCell(VTK_LINE,(a+b),connectivity);</div>
<div> </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div><br></div><div><br></div><div> vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();</div>
<div> mapper->SetInputConnection(poly->GetProducerPort());</div><div> mapper->ScalarVisibilityOn();</div><div> mapper->SetColorModeToMapScalars();</div><div> mapper->SetLookupTable(colorLookupTable);</div>
<div> mapper->SetScalarMaterialModeToDefault();</div><div> mapper->SetScalarRange(min,max);</div><div><br></div><div> polyData_sections->SetPoints(points_sections);</div><div> vtkSmartPointer<vtkPolyDataMapper> mapper_sections = vtkSmartPointer<vtkPolyDataMapper>::New();</div>
<div> </div><div> mapper_sections->SetInput(polyData_sections);</div><div> vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();</div><div> actor->SetMapper(mapper);</div><div> actor->Modified();</div>
<div><br></div><div> vtkSmartPointer<vtkActor> actor_sections = vtkSmartPointer<vtkActor>::New();</div><div> actor_sections->SetMapper(mapper_sections);</div><div> actor_sections->GetProperty()->SetColor(255, 0, 0);</div>
<div> actor_sections->Modified();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div> </div><div><br></div><div> renderer->RemoveAllViewProps();</div><div> renderer->Modified();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>renderer->AddActor(actor);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>renderer->AddActor(actor_sections);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>renderer->ResetCamera();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>renderer->SetBackground(1,1,1);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>renderer->ResetCamera();</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>renWin->Render();</div></div><div><br></div><div>Please help me.</div><div>Thanks.</div>