public static object getInstance(BoundingBox3d box, View view) { AxeBox axe = new AxeBox(box); axe.View = view; return(axe); }
public void RenderAxeBox() { if (_axeBoxDisplayed) { GL.MatrixMode(MatrixMode.Modelview); _scene.LightSet.Disable(); _axe.setScale(_scaling); _axe.Draw(_cam); // for debug if (DISPLAY_AXE_WHOLE_BOUNDS) { AxeBox abox = (AxeBox)_axe; BoundingBox3d box = abox.WholeBounds; Parallelepiped p = new Parallelepiped(box); p.FaceDisplayed = false; p.WireframeColor = Color.MAGENTA; p.WireframeDisplayed = true; p.Draw(_cam); } _scene.LightSet.Enable(); } }
internal void correctCameraPositionForIncludingTextLabels(ViewPort viewport) { _cam.SetViewPort(viewport); _cam.shoot(_cameraMode); _axe.Draw(_cam); Clear(); AxeBox abox = (AxeBox)_axe; BoundingBox3d newBounds = abox.WholeBounds.scale(_scaling); if (_viewmode == Modes.ViewPositionMode.TOP) { float radius = (float)Math.Max(newBounds.xmax - newBounds.xmin, newBounds.ymax - newBounds.ymin); radius += radius * STRETCH_RATIO; _cam.RenderingSphereRadius = radius; } else { _cam.RenderingSphereRadius = (float)newBounds.getRadius(); Coord3d target = newBounds.getCenter(); Coord3d eye = _viewpoint.cartesian().@add(target); _cam.Target = target; _cam.Eye = eye; } }