From: Eduardo DAVILA Date: Sat, 22 Oct 2022 08:58:05 +0000 (+0200) Subject: #3495 Extrude normals conflict X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=7adae3b62a9d3adf11e40486e130277d2ad04fdf;p=creaVtk.git #3495 Extrude normals conflict --- diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.cxx index f254fc4..63cdfea 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.cxx @@ -45,6 +45,8 @@ void LinearExtrusionFilter::Process() std::vector dir = bbGetInputDirection(); extrude = vtkLinearExtrusionFilter::New(); triangleFilter = vtkTriangleFilter::New(); + + extrude->SetInputData( bbGetInputIn() ); extrude->SetExtrusionTypeToNormalExtrusion(); if (dir.size()==3) @@ -53,11 +55,25 @@ void LinearExtrusionFilter::Process() } else { extrude->SetVector(1, 0, 0); } - extrude->SetScaleFactor( bbGetInputScalarFactor() * (-1) ); + // extrude->SetScaleFactor( bbGetInputScalarFactor() * (-1) ); + extrude->SetScaleFactor( bbGetInputScalarFactor() ); extrude->Update(); triangleFilter->SetInputData( extrude->GetOutput() ); triangleFilter->Update( ); - bbSetOutputOut( triangleFilter->GetOutput() ); + + vtkPolyData *outputPolydata = triangleFilter->GetOutput(); + printf("EED LinearExtrusionFilter::Process A\n"); + if (bbGetInputScalarFactor()>1 ) + { + printf("EED LinearExtrusionFilter::Process B\n"); + vtkReverseSense * reverseSense = vtkReverseSense::New(); + reverseSense->SetInputData( triangleFilter->GetOutput() ); + reverseSense->ReverseNormalsOff(); + reverseSense->ReverseCellsOn(); + reverseSense->Update(); + outputPolydata=reverseSense->GetOutput(); + } + bbSetOutputOut( outputPolydata ); } else { bbSetOutputOut( NULL ); }// if bbGetInputIn diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.cxx index c48f31c..5c0ddab 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.cxx @@ -38,7 +38,6 @@ void PolyDataNormals::Process() if (bbGetInputIn()!=NULL) { - vtkPolyDataNormals* normal = vtkPolyDataNormals::New(); normal->SetInputData( bbGetInputIn() ); if (bbGetInputComputeType()==0) @@ -136,8 +135,8 @@ void PolyDataNormals::Process() } else { bbSetOutputOut( NULL ); }// if In - } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== @@ -148,32 +147,29 @@ void PolyDataNormals::bbUserSetDefaultValues() bbSetInputIn(NULL); bbSetOutputOut( NULL ); } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void PolyDataNormals::bbUserInitializeProcessing() { - // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers -// if any - - +// if any } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void PolyDataNormals::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any - } -} -// EO namespace bbcreaVtk + +}// EO namespace bbcreaVtk