+
+ // Find the plane equation for the camera view plane
+ double vn[3];
+ anActiveCamera->GetViewPlaneNormal( vn );
+ double position[3];
+ anActiveCamera->GetPosition( position );
+
+ vtkFloatingPointType bounds[6];
+ aRenderer->ComputeVisiblePropBounds( bounds );
+
+ double center[3];
+ center[0] = ( bounds[0] + bounds[1] ) / 2.0;
+ center[1] = ( bounds[2] + bounds[3] ) / 2.0;
+ center[2] = ( bounds[4] + bounds[5] ) / 2.0;
+
+ double width = sqrt( ( bounds[1]-bounds[0] ) * ( bounds[1]-bounds[0] ) +
+ ( bounds[3]-bounds[2] ) * ( bounds[3]-bounds[2] ) +
+ ( bounds[5]-bounds[4] ) * ( bounds[5]-bounds[4] ) );
+
+ double distance = sqrt( ( position[0]-center[0] ) * ( position[0]-center[0] ) +
+ ( position[1]-center[1] ) * ( position[1]-center[1] ) +
+ ( position[2]-center[2] ) * ( position[2]-center[2] ) );
+
+ vtkFloatingPointType range[2] = { distance - width/2.0, distance + width/2.0 };
+
+ SpinBox_Near->setValue( range[0] );
+ SpinBox_Far->setValue( range[1] );
+
+ return;
+ }
+ else if ( anActiveWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) {
+ OCCViewer_ViewWindow* aOCCFrame = dynamic_cast<OCCViewer_ViewWindow*>( anActiveWindow );
+
+ TextLabelNear->setText( tr( "Depth" ) );
+ TextLabelFar->setText( tr( "Thickness" ) );
+
+ Handle(V3d_View) view3d = ( (OCCViewer_ViewPort3d*)aOCCFrame->getViewPort() )->getView();
+
+ double depth, thickness;
+ int ztype = view3d->ZClipping( depth, thickness );
+ SpinBox_Near->setValue( depth );
+ SpinBox_Far->setValue( thickness );
+ TypeCB->setCurrentIndex( ztype );
+
+ //Handle(V3d_Plane) aPlane = new V3d_Plane( aOCCFrame->getViewer()->getViewer3d() ,0, 0, 1, -100);
+ //aPlane->Display(view3d);
+ }