Hi,<br><br>I'm trying to add a filter to ParaView, but I'm having problems compiling the code. I have this files:<br><br><u>vtkFlipCoordsFilter.h</u><br><br>#ifndef __vtkFlipCoordsFilter_h<br>#define __vtkFlipCoordsFilter_h
<br><br>#include "vtkPointSetAlgorithm.h"<br><br>class VTK_EXPORT vtkFlipCoordsFilter : public vtkPointSetAlgorithm<br>{<br>public:<br>        vtkTypeRevisionMacro(vtkFlipCoordsFilter,vtkPointSetAlgorithm);<br>        void PrintSelf(ostream& os, vtkIndent indent);
<br>        static vtkFlipCoordsFilter* New();<br><br><br>        //Description:<br>        //Set/get wich axis coordinates should be negated.<br>        //x=0, y=1, z=2<br>        vtkSetClampMacro(Axis, int, 0, 2);<br>        vtkGetMacro(Axis, int);<br><br>protected:
<br>        vtkFlipCoordsFilter();<br>        ~vtkFlipCoordsFilter();<br><br>        int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);<br>        int Axis;<br>private:<br>        vtkFlipCoordsFilter(const vtkFlipCoordsFilter&); //not implemented
<br>        void operator= (const vtkFlipCoordsFilter&);//not implemented<br>};<br><br>#endif<br><br><u>vtkFlipCoordsFilter.cxx<br><br></u>#include "vtkFlipCoordsFilter.h"<br><br>#include "vtkCellData.h"<br>
#include "vtkPointData.h"<br>#include "vtkPoints.h"<br>#include "vtkPointSet.h"<br>#include "vtkInformation.h"<br>#include "vtkInformationVector.h"<br>#include "vtkObjectFactory.h
"<br><br>vtkStandardNewMacro(vtkFlipCoordsFilter);<br>vtkCxxRevisionMacro(vtkFlipCoordsFilter, "$Revision: 1.1 $");<br><br>//----------------------------------------------------------------------------<br>vtkFlipCoordsFilter::vtkFlipCoordsFilter(){
<br> this->Axis = 1;<br>}<br><br>//----------------------------------------------------------------------------<br>int vtkFlipCoordsFilter::RequestData(vtkInformation* vtkNotUsed(request), vtkInformationVector** inputVector, vtkInformationVector* outputVector){
<br><br> // get the information objects<br> vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);<br> vtkInformation *outInfo = outputVector->GetInformationObject(0);<br><br> // get the input and output
<br> vtkPointSet *input = vtkPointSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));<br> vtkPointSet *output = vtkPointSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));<br><br> // Copy the structure of the input dataset to the output.
<br> output->CopyStructure(input);<br><br> int numPts = input->GetNumberOfPoints();<br> vtkPoints *points = input->GetPoints();<br> vtkPoints *newPts = vtkPoints::New();<br> newPts->SetNumberOfPoints(numPts);
<br><br> double pt[3];<br> int i;<br><br> for (i = 0; i < numPts; i++)<br> {<br> // Negate the specified coordinate.<br> points->GetPoint(i, pt);<br> pt[this->Axis] *= -1;<br> newPts->SetPoint(i, pt);
<br> }<br><br> output->GetPointData()->CopyNormalsOff(); // distorted geometry <br> output->GetPointData()->PassData(input->GetPointData());<br> output->GetCellData()->CopyNormalsOff(); // distorted geometry
<br> output->GetCellData()->PassData(input->GetCellData());<br><br> output->SetPoints(newPts);<br> newPts->Delete();<br><br> return 1;<br>}<br><br>//----------------------------------------------------------------------------
<br>void vtkFlipCoordsFilter::PrintSelf(ostream& os, vtkIndent indent){<br> this->Superclass::PrintSelf(os, indent);<br><br> os << indent << "Axis: " << this->Axis << endl;<br>
}<br><br>ccmake runs fine, but when I run make I get this message (verbose is on):<br><br>abnocte@abnocte-laptop:~/software/modulos/flipCoords$ make<br>/home/abnocte/software/cmake-2.4.3-Linux-i386/bin/cmake -H/home/abnocte/software/modulos/flipCoords -B/home/abnocte/software/modulos/flipCoords --check-build-system CMakeFiles/Makefile.cmake 0
<br>/home/abnocte/software/cmake-2.4.3-Linux-i386/bin/cmake -E cmake_progress_start /home/abnocte/software/modulos/flipCoords/CMakeFiles 4<br>make -f CMakeFiles/Makefile2 all<br>make[1]: se ingresa al directorio `/home/abnocte/software/modulos/flipCoords'
<br>make -f CMakeFiles/myCustom.dir/build.make CMakeFiles/myCustom.dir/depend<br>make[2]: se ingresa al directorio `/home/abnocte/software/modulos/flipCoords'<br>/home/abnocte/software/cmake-2.4.3-Linux-i386/bin/cmake -E cmake_progress_report /home/abnocte/software/modulos/flipCoords/CMakeFiles 4
<br>[ 25%] Generating vtkFlipCoordsFilterClientServer.cxx <strong><- this is never generated</strong> <br>./vtkFlipCoordsFilter.h 1 /home/abnocte/software/modulos/flipCoords/vtkFlipCoordsFilterClientServer.cxx<br>./vtkFlipCoordsFilter.h: 6: class: not found
<br>./vtkFlipCoordsFilter.h: 9: Syntax error: word unexpected (expecting ")")<br>make[2]: *** [vtkFlipCoordsFilterClientServer.cxx] Error 2<br>make[2]: se sale del directorio `/home/abnocte/software/modulos/flipCoords'
<br>make[1]: *** [CMakeFiles/myCustom.dir/all] Error 2<br>make[1]: se sale del directorio `/home/abnocte/software/modulos/flipCoords'<br>make: *** [all] Error 2<u><br></u><br><br>Any ideas??<br><u><br></u>Thanks<u><br>
</u><u><br></u><br>