27 #include <itksys/SystemTools.hxx>
43 int main(
int argc,
char* argv[])
56 renderWindow->GetVtkRenderWindow()->SetSize(500, 500);
57 renderWindow->GetRenderer()->Resize(500, 500);
59 renderWindow->GetRenderer()->SetDataStorage(dataStorage);
69 tracker->SetBounds(bounds);
70 tracker->AddTool(
"tool1");
74 source->SetTrackingDevice(tracker);
86 dataNode->SetData(cone);
87 dataNode->SetName(
"My tracked object");
88 dataNode->SetColor(0.0, 1.0, 1.0);
89 dataStorage->Add(dataNode);
93 visualizer->SetInput(0, source->GetOutput());
94 visualizer->SetRepresentationObject(0, cone);
101 cylinderNode->SetData(cylinder);
102 cylinderNode->SetName(
"My fixed object");
103 cylinderNode->SetColor(1.0, 0.0, 0.0);
104 dataStorage->Add(cylinderNode);
108 rotationMatrix.SetIdentity();
110 rotationMatrix[1][1] = cos(alpha);
111 rotationMatrix[1][2] = -sin(alpha);
112 rotationMatrix[2][1] = sin(alpha);
113 rotationMatrix[2][2] = cos(alpha);
119 affineTransform3D->SetOffset(offset);
120 affineTransform3D->SetMatrix(rotationMatrix);
124 cylinder->GetGeometry()->SetIndexToWorldTransform(fixedNavigationData->GetAffineTransform3D());
135 geometry->SetBounds(bounds);
139 source->StartTracking();
144 for (
int i = 0; i < 75; ++i)
147 visualizer->Update();
150 renderWindow->GetVtkRenderWindow()->Render();
153 MITK_INFO <<
"Position " << source->GetOutput()->GetPosition();
155 itksys::SystemTools::Delay(100);
159 source->StopTracking();
160 source->Disconnect();
171 fixedNavigationData->Compose(source->GetOutput(),
false);
174 cylinder->GetGeometry()->SetIndexToWorldTransform(fixedNavigationData->GetAffineTransform3D());
177 renderWindow->GetVtkRenderWindow()->Render();
181 itksys::SystemTools::Delay(2000);
virtual bool InitializeViews(const BaseGeometry *geometry, RequestType type=REQUEST_UPDATE_ALL, bool preserveRoughOrientationInWorldSpace=false)
itk::SmartPointer< Self > Pointer
static RenderingManager * GetInstance()
int main(int argc, char *argv[])
[What we will do]
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.