[vtkusers] changes from 4.x to 5.x

Dave Reed davelist at mac.com
Tue Sep 9 09:31:05 EDT 2008


On Sep 9, 2008, at 3:52 AM, Mathieu Malaterre wrote:

> Dave,
>
> On Tue, Sep 9, 2008 at 12:04 AM, Dave Reed <davelist at mac.com> wrote:
>>
>> I'm getting back to using VTK after being gone for a while so I'm  
>> trying to
>> adjust to some of the changes between 4.x and 5.x. At the moment, I  
>> have
>> 5.0.3 on my Mac because that was the easiest to get working via  
>> MacPorts.
>>
>> At the bottom of this message is some old Python code that worked  
>> on 4.x and
>> printed the number of polygons that were rendered. I've also tried  
>> updating
>> the code to use the SetInputConnection and GetOutputPort methods,  
>> but that
>> has no effect.
>>
>> With 5.0.3 on my system, it says GetNumberOfPolys is not a valid  
>> attribute.
>>
>> The output says it's a vtkPolyData, but the Python dir command  
>> doesn't list
>> many of the vtkPolyData methods. Here is the output:
>>
>> vtkPolyData
>> ['AddObserver', 'BreakOnError', 'DebugOff', 'DebugOn', 'FastDelete',
>> 'GetAddressAsString', 'GetClassName', 'GetDebug',  
>> 'GetGlobalWarningDisplay',
>> 'GetMTime', 'GetReferenceCount', 'GlobalWarningDisplayOff',
>> 'GlobalWarningDisplayOn', 'HasObserver', 'InvokeEvent', 'IsA',  
>> 'IsTypeOf',
>> 'Modified', 'NewInstance', 'PrintRevisions', 'Register',  
>> 'RemoveObserver',
>> 'RemoveObservers', 'SafeDownCast', 'SetDebug',  
>> 'SetGlobalWarningDisplay',
>> 'SetReferenceCount', 'UnRegister']
>
>
> You are missing all of the specific vtkPolyData member functions.
>
> With VTK 5.2 I am getting:
>
> ['AddCellReference', 'AddReferenceToCell', 'Allocate', 'BuildCells',
> 'BuildLinks', 'ComputeBounds', 'CopyCells', 'CopyStructure',
> 'DeepCopy', 'DeleteCell', 'DeleteCells', 'DeleteLinks', 'DeletePoint',
> 'GetActualMemorySize', 'GetCell', 'GetCellBounds',
> 'GetCellEdgeNeighbors', 'GetCellNeighbors', 'GetCellPoints',
> 'GetCellType', 'GetClassName', 'GetDataObjectType', 'GetGhostLevel',
> 'GetLines', 'GetMaxCellSize', 'GetNumberOfCells', 'GetNumberOfLines',
> 'GetNumberOfPieces', 'GetNumberOfPolys', 'GetNumberOfStrips',
> 'GetNumberOfVerts', 'GetPiece', 'GetPointCells', 'GetPolys',
> 'GetStrips', 'GetUpdateExtent', 'GetVerts', 'Initialize',
> 'InsertNextCell', 'InsertNextLinkedPoint', 'IsA', 'IsEdge',
> 'IsPointUsedByCell', 'IsTriangle', 'NewInstance',
> 'RemoveCellReference', 'RemoveDeletedCells', 'RemoveGhostCells',
> 'RemoveReferenceToCell', 'ReplaceCellPoint', 'Reset',
> 'ResizeCellList', 'ReverseCell', 'SafeDownCast', 'SetLines',
> 'SetPolys', 'SetStrips', 'SetVerts', 'ShallowCopy', 'Squeeze']
>
> I would think this is an issue with your MacPort package. Either raise
> the question in there forums or try to rebuild VTK from scratch on
> your system (if you have cmake on your system it should be easy).


Thanks for letting me know it should work. I had installed 5.0.2 about  
two years ago on a Linux system at work using cmake and it seems to  
have the same issue also so either there's some issues with the early  
5.0.x builds or I'm having the same build problem on both systems  
(perhaps related to the Python bindings). I'm currently trying to  
build 5.2 on my Mac directly (not via macports) so we'll see if it  
works on that.

Thanks,
Dave




More information about the vtkusers mailing list