[vtkusers] hack in vtkTransform

Anka Kochanowska pluszcz at gmail.com
Thu May 2 10:24:10 EDT 2013


Hi All!

Using vtk5.10 (Ubuntu 12.04), I am always getting messages:

Warning: In
/export01/anka/ibis2/sb/ibisExternalDependencies/vtk-5.10/src/Common/vtkTransform.cxx,
line 201
vtkTransform (0x1b6e680): InternalUpdate: doing hack to support legacy
code.  This is deprecated in VTK 4.2.  May be removed in a future version.


What do I have to do to get rid of the warning?


Here is a simple example:
//IncerseTransform

#include "vtkMatrix4x4.h"

#include "vtkTransform.h"

#include "vtkLinearTransform.h"

#include "vtkSmartPointer.h"


int main(int arg, char ** argv)

 {

	vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();

    transform->Identity();

    vtkMatrix4x4 *mat = transform->GetMatrix();

    mat->SetElement(0,0,-0.994485);

    mat->SetElement(0,1,0.0114648);

    mat->SetElement(0,2,0.10425);

    mat->SetElement(0,3,-109.911);

    mat->SetElement(1,0,0.104868);

    mat->SetElement(1,1,0.123302);

    mat->SetElement(1,2,0.986813);

    mat->SetElement(1,3,36.2377);

    mat->SetElement(2,0,-0.00154065);

    mat->SetElement(2,1,0.992303);

    mat->SetElement(2,2,-0.123824);

    mat->SetElement(2,3,-41.2797);


    double det = mat->Determinant(mat);


    cout << "Determinant = " << det << endl;


    vtkIndent indent;

    mat->PrintSelf(cout, indent);


    vtkSmartPointer<vtkMatrix4x4> invMat = vtkSmartPointer<vtkMatrix4x4>::New();

    invMat->Identity();

    cout << "GetInverse will produce warning\n";

    transform->GetInverse(invMat);

    cout << "out of GetInverse\n";

    return 0;

  }

CMakeLists.txt


cmake_minimum_required(VERSION 2.6)

PROJECT(InverseIransform)

FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})

ADD_EXECUTABLE(InverseIransform inversetransform.cxx)
TARGET_LINK_LIBRARIES(InverseIransform vtkHybrid)


Anka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130502/a5b4e8ed/attachment.htm>


More information about the vtkusers mailing list