<commit_before>/*=========================================================================

  Program:   Visualization Toolkit
  Module:    TestRotationalExtrusionFilter.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .SECTION Thanks
// This test was written by <NAME>, Kitware SAS 2011

#include "vtkCamera.h"
#include "vtkLineSource.h"
#include "vtkNew.h"
#include "vtkPolyDataMapper.h"
#include "vtkPolyDataNormals.h"
#include "vtkProperty.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRotationalExtrusionFilter.h"
#include "vtkTestUtilities.h"

//----------------------------------------------------------------------------
int TestRotationalExtrusion( int argc, char * argv [] )
{
  // Create a line source
  vtkNew<vtkLineSource> line;
  line->SetPoint1( 0., 1., 0. );
  line->SetPoint2( 0., 1., 2. );
  line->SetResolution( 10 );

  // Create 3/4 of a cylinder by rotational extrusion
  vtkNew<vtkRotationalExtrusionFilter> lineSweeper;
  lineSweeper->SetResolution( 20 );
  lineSweeper->SetInputConnection( line->GetOutputPort() );
  lineSweeper->SetAngle( 270 );

  // Create normals for smooth rendering
  vtkNew<vtkPolyDataNormals> normals;
  normals->SetInputConnection( lineSweeper->GetOutputPort() );

  // Create mapper for surface representation
  vtkNew<vtkPolyDataMapper> cylMapper;
  cylMapper->SetInputConnection( normals->GetOutputPort() );
  cylMapper->SetResolveCoincidentTopologyPolygonOffsetParameters( 0, 1 );
  cylMapper->SetResolveCoincidentTopologyToPolygonOffset();

  // Create mapper for wireframe representation
  vtkNew<vtkPolyDataMapper> cylMapperW;
  cylMapperW->SetInputConnection( lineSweeper->GetOutputPort() );
  cylMapperW->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 );
  cylMapperW->SetResolveCoincidentTopologyToPolygonOffset();

  // Create actor for surface representation
  vtkNew<vtkActor> cylActor;
  cylActor->SetMapper( cylMapper.GetPointer() );
  cylActor->GetProperty()->SetRepresentationToSurface();
  cylActor->GetProperty()->SetInterpolationToGouraud();
  cylActor->GetProperty()->SetColor( 1., 0.3882, .2784 ); // tomato

  // Create actor for wireframe representation
  vtkNew<vtkActor> cylActorW;
  cylActorW->SetMapper( cylMapperW.GetPointer() );
  cylActorW->GetProperty()->SetRepresentationToWireframe();
  cylActorW->GetProperty()->SetColor( 0., 0., 0.);
  cylActorW->GetProperty()->SetAmbient( 1. );
  cylActorW->GetProperty()->SetDiffuse( 0. );
  cylActorW->GetProperty()->SetSpecular( 0. );

  // Create a renderer, add actors to it
  vtkNew<vtkRenderer> ren1;
  ren1->AddActor( cylActor.GetPointer() );
  ren1->AddActor( cylActorW.GetPointer() );
  ren1->SetBackground( 1., 1., 1. );

  // Create a renderWindow
  vtkNew<vtkRenderWindow> renWin;
  renWin->AddRenderer( ren1.GetPointer() );
  renWin->SetSize( 300, 300 );<commit_msg>Highlighting line source of rotational extrusion<commit_after>/*=========================================================================

  Program:   Visualization Toolkit
  Module:    TestRotationalExtrusionFilter.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .SECTION Thanks
// This test was written by <NAME>, Kitware SAS 2011

#include "vtkCamera.h"
#include "vtkLineSource.h"
#include "vtkNew.h"
#include "vtkPolyDataMapper.h"
#include "vtkPolyDataNormals.h"
#include "vtkProperty.h"
#include "vtkRegressionTestImage.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRotationalExtrusionFilter.h"
#include "vtkTestUtilities.h"

//----------------------------------------------------------------------------
int TestRotationalExtrusion( int argc, char * argv [] )
{
  // Create a line source
  vtkNew<vtkLineSource> line;
  line->SetPoint1( 0., 1., 0. );
  line->SetPoint2( 0., 1., 2. );
  line->SetResolution( 10 );

  // Create mapper for line segment
  vtkNew<vtkPolyDataMapper> lineMapper;
  lineMapper->SetInputConnection( line->GetOutputPort() );

  // Create actor for line segment
  vtkNew<vtkActor> lineActor;
  lineActor->SetMapper( lineMapper.GetPointer() );
  lineActor->GetProperty()->SetLineWidth( 5 );
  lineActor->GetProperty()->SetColor( 0., .749, 1. ); // deep sky blue

  // Create 3/4 of a cylinder by rotational extrusion
  vtkNew<vtkRotationalExtrusionFilter> lineSweeper;
  lineSweeper->SetResolution( 20 );
  lineSweeper->SetInputConnection( line->GetOutputPort() );
  lineSweeper->SetAngle( 270 );

  // Create normals for smooth rendering
  vtkNew<vtkPolyDataNormals> normals;
  normals->SetInputConnection( lineSweeper->GetOutputPort() );

  // Create mapper for surface representation
  vtkNew<vtkPolyDataMapper> cylMapper;
  cylMapper->SetInputConnection( normals->GetOutputPort() );
  cylMapper->SetResolveCoincidentTopologyPolygonOffsetParameters( 0, 1 );
  cylMapper->SetResolveCoincidentTopologyToPolygonOffset();

  // Create mapper for wireframe representation
  vtkNew<vtkPolyDataMapper> cylMapperW;
  cylMapperW->SetInputConnection( lineSweeper->GetOutputPort() );
  cylMapperW->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 );
  cylMapperW->SetResolveCoincidentTopologyToPolygonOffset();

  // Create actor for surface representation
  vtkNew<vtkActor> cylActor;
  cylActor->SetMapper( cylMapper.GetPointer() );
  cylActor->GetProperty()->SetRepresentationToSurface();
  cylActor->GetProperty()->SetInterpolationToGouraud();
  cylActor->GetProperty()->SetColor( 1., .3882, .2784 ); // tomato

  // Create actor for wireframe representation
  vtkNew<vtkActor> cylActorW;
  cylActorW->SetMapper( cylMapperW.GetPointer() );
  cylActorW->GetProperty()->SetRepresentationToWireframe();
  cylActorW->GetProperty()->SetColor( 0., 0., 0.);
  cylActorW->GetProperty()->SetAmbient( 1. );
  cylActorW->GetProperty()->SetDiffuse( 0. );
  cylActorW->GetProperty()->SetSpecular( 0. );

  // Create a renderer, add actors to it
  vtkNew<vtkRenderer> ren1;
  ren1->AddActor( lineActor.GetPointer() );
  ren1->AddActor( cylActor.GetPointer() );
  ren1->AddActor( cylActorW.GetPointer() );
  ren1->SetBackground( 1., 1., 1. );

  // Create a renderWindow
  vtkNew<vtkRenderWindow> renWin;
  renWin->AddRenderer( ren1.GetPointer() );
  renWin->SetSize( 300, 300 );
{'fraction_non_alphanumeric': 0.1798550930529905, 'fraction_numerical': 0.01647961358147464, 'mean_word_length': 4.596184419713832, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7051789', 'n_tokens_mistral': 2243, 'n_tokens_neox': 2110, 'n_words': 472}