[vtkusers] Problem with vtkCubeAxesActor2D!
njuzg
guangz at u.washington.edu
Wed Jul 22 03:32:56 EDT 2009
Hi, all:
I was stuck with the vtkCubeAxesActor2D class right now? I did can
successfully make it work with Tcl environment. But I cannot do the same
thing with C++, is there some tricks behind this class in C++ envrionment?
When i tried to built it, I got the following error message :
cubeAxes.obj : error LNK2019: unresolved external symbol "public: static
class vtkCubeAxesActor2D * __cdecl vtkCubeAxesActor2D::New(void)"
(?New at vtkCubeAxesActor2D@@SAPAV1 at XZ) referenced in function _main
Anyone knows what the reason is behind this? Thanks very much!
Here is what I did :
vtkXMLPolyDataReader *reader = vtkXMLPolyDataReader::New();
reader->SetFileName("E:/VTK setup/My demo/cccc.vtk");
vtkTransform *aTransform = vtkTransform::New();
aTransform->Identity();
aTransform->RotateY(0);
aTransform->Scale(1, 1, 1);
vtkTransformPolyDataFilter *transform = vtkTransformPolyDataFilter::New();
transform->SetTransform(aTransform);
transform->SetInputConnection(reader->GetOutputPort());
vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
normals->SetInputConnection(transform->GetOutputPort());
vtkPolyDataMapper *pMapper = vtkPolyDataMapper::New();
pMapper->SetInputConnection(normals->GetOutputPort());
vtkActor *pActor = vtkActor::New();
pActor->SetMapper(pMapper);
pActor->GetProperty()->SetColor(0, 1, 1);
vtkOutlineFilter *outline = vtkOutlineFilter::New();
outline->SetInputConnection(normals->GetOutputPort());
vtkPolyDataMapper *mapOutline = vtkPolyDataMapper::New();
mapOutline->SetInputConnection(outline->GetOutputPort());
vtkActor *outlineActor = vtkActor::New();
outlineActor->SetMapper(mapOutline);
outlineActor->GetProperty()->SetColor(0,0, 0);
vtkRenderer *ren1 = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer(ren1);
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
vtkInteractorStyleTrackballCamera *style =
vtkInteractorStyleTrackballCamera::New();
iren->SetInteractorStyle(style);
vtkCubeAxesActor2D *axes1 = vtkCubeAxesActor2D::New();
axes1->SetInput(normals->GetOutput());
axes1->SetCamera(ren1->GetActiveCamera());
axes1->SetLabelFormat("%6.4g");
axes1->SetFlyModeToOuterEdges();
axes1->SetFontFactor(0.8);
axes1->SetAxisTitleTextProperty(tprop);
axes1->SetAxisLabelTextProperty(tprop);
ren1->AddViewProp(axes1);
vtkCamera *cam1 = vtkCamera::New();
cam1->SetPosition(-30, -30, -60);
cam1->SetFocalPoint(10, -20, 10);
cam1->ComputeViewPlaneNormal();
cam1->OrthogonalizeViewUp();
cam1->SetViewUp(0, 0, 1);
ren1->SetActiveCamera(cam1);
ren1->AddActor(pActor);
ren1->AddViewProp(outlineActor);
ren1->SetBackground(.3, .3, .3);
renWin->SetSize(1500, 1040);
renWin->Render();
Any hlep will be appreciated!
--
View this message in context: http://www.nabble.com/Problem-with-vtkCubeAxesActor2D%21-tp24601383p24601383.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list