public override void UpdateHandles() { GizmoHandle targetHandle = _data.TargetHandle; if (_data.Border.IsVisible) { targetHandle.Set3DShapeVisible(_data.TopBoxIndex, true); targetHandle.Set3DShapeVisible(_data.RightBoxIndex, true); targetHandle.Set3DShapeVisible(_data.BottomBoxIndex, true); targetHandle.Set3DShapeVisible(_data.LeftBoxIndex, true); targetHandle.Set3DShapeVisible(_data.TopLeftBoxIndex, true); targetHandle.Set3DShapeVisible(_data.TopRightBoxIndex, true); targetHandle.Set3DShapeVisible(_data.BottomRightBoxIndex, true); targetHandle.Set3DShapeVisible(_data.BottomLeftBoxIndex, true); } else { targetHandle.Set3DShapeVisible(_data.TopBoxIndex, false); targetHandle.Set3DShapeVisible(_data.RightBoxIndex, false); targetHandle.Set3DShapeVisible(_data.BottomBoxIndex, false); targetHandle.Set3DShapeVisible(_data.LeftBoxIndex, false); targetHandle.Set3DShapeVisible(_data.TopLeftBoxIndex, false); targetHandle.Set3DShapeVisible(_data.TopRightBoxIndex, false); targetHandle.Set3DShapeVisible(_data.BottomRightBoxIndex, false); targetHandle.Set3DShapeVisible(_data.BottomLeftBoxIndex, false); } targetHandle.Set3DShapeVisible(_data.BorderQuadIndex, false); }
public GizmoPolygon2DBorder(GizmoPlaneSlider2D planeSlider, GizmoHandle targetHandle, PolygonShape2D targetPolygon) { _planeSlider = planeSlider; _targetHandle = targetHandle; _targetPolygon = targetPolygon; _borderPolygonIndex = _targetHandle.Add2DShape(_borderPolygon); _borderPolygon.PtContainMode = Shape2DPtContainMode.OnBorder; _thickBorderPolygonIndex = _targetHandle.Add2DShape(_thickBorderPolygon); _thickBorderPolygon.PtContainMode = Shape2DPtContainMode.OnBorder; _thickBorderPolygon.BorderRenderDesc.BorderType = Shape2DBorderType.Thick; _thickBorderPolygon.BorderRenderDesc.Direction = Shape2DBorderDirection.Outward; _controllerData.Border = this; _controllerData.PlaneSlider = _planeSlider; _controllerData.BorderPolygon = _borderPolygon; _controllerData.BorderPolygonIndex = _borderPolygonIndex; _controllerData.ThickBorderPolygon = _thickBorderPolygon; _controllerData.ThickBorderPolygonIndex = _thickBorderPolygonIndex; _controllerData.Gizmo = targetHandle.Gizmo; _controllerData.TargetHandle = targetHandle; _controllerData.TargetPolygon = _targetPolygon; _controllers[(int)GizmoPolygon2DBorderType.Thin] = new GizmoThinPolygon2DBorderController(_controllerData); _controllers[(int)GizmoPolygon2DBorderType.Thick] = new GizmoThickPolygon2DBorderController(_controllerData); _targetHandle.Gizmo.PreUpdateBegin += OnGizmoPreUpdateBegin; }
public GizmoCircle3DBorder(GizmoPlaneSlider3D planeSlider, GizmoHandle targetHandle, CircleShape3D targetCircle) { _planeSlider = planeSlider; _targetHandle = targetHandle; _targetCircle = targetCircle; _borderCircleIndex = _targetHandle.Add3DShape(_borderCircle); _borderCircle.RaycastMode = Shape3DRaycastMode.Wire; _borderTorusIndex = _targetHandle.Add3DShape(_borderTorus); _borderTorus.WireRenderDesc.NumTubeSlices = 0; _borderCylTorusIndex = _targetHandle.Add3DShape(_borderCylTorus); _controllerData.Border = this; _controllerData.PlaneSlider = _planeSlider; _controllerData.Gizmo = Gizmo; _controllerData.TargetHandle = _targetHandle; _controllerData.TargetCircle = targetCircle; _controllerData.BorderCircle = _borderCircle; _controllerData.BorderTorus = _borderTorus; _controllerData.BorderCylTorus = _borderCylTorus; _controllerData.BorderCircleIndex = _borderCircleIndex; _controllerData.BorderTorusIndex = _borderTorusIndex; _controllerData.BorderCylTorusIndex = _borderCylTorusIndex; _controllers[(int)GizmoCircle3DBorderType.Thin] = new GizmoThinCircle3DBorderController(_controllerData); _controllers[(int)GizmoCircle3DBorderType.Torus] = new GizmoTorusCircle3DBorderController(_controllerData); _controllers[(int)GizmoCircle3DBorderType.CylindricalTorus] = new GizmoCylindricalTorusCircle3DBorderController(_controllerData); Gizmo.PreUpdateBegin += OnGizmoPreUpdateBegin; }
public SceneGizmoCamPrjSwitchLabel(SceneGizmo sceneGizmo) { _sceneGizmo = sceneGizmo; _handle = _sceneGizmo.Gizmo.CreateHandle(GizmoHandleId.SceneGizmoCamPrjSwitchLabel); _handle.Add2DShape(_labelQuad); sceneGizmo.Gizmo.PreUpdateBegin += OnGizmoPreUpdateBegin; sceneGizmo.Gizmo.PreHandlePicked += OnGizmoHandlePicked; }
public GizmoQuad3DBorder(GizmoPlaneSlider3D planeSlider, GizmoHandle targetHandle, QuadShape3D targetQuad) { _planeSlider = planeSlider; _targetHandle = targetHandle; _targetQuad = targetQuad; _borderQuadIndex = _targetHandle.Add3DShape(_borderQuad); _borderQuad.RaycastMode = Shape3DRaycastMode.Wire; _topBoxIndex = _targetHandle.Add3DShape(_topBox); _rightBoxIndex = _targetHandle.Add3DShape(_rightBox); _bottomBoxIndex = _targetHandle.Add3DShape(_bottomBox); _leftBoxIndex = _targetHandle.Add3DShape(_leftBox); _topLeftBoxIndex = _targetHandle.Add3DShape(_topLeftBox); _topRightBoxIndex = _targetHandle.Add3DShape(_topRightBox); _bottomRightBoxIndex = _targetHandle.Add3DShape(_bottomRightBox); _bottomLeftBoxIndex = _targetHandle.Add3DShape(_bottomLeftBox); _sortedBoxIndices.Add(_topBoxIndex); _sortedBoxIndices.Add(_rightBoxIndex); _sortedBoxIndices.Add(_bottomBoxIndex); _sortedBoxIndices.Add(_leftBoxIndex); _sortedBoxIndices.Add(_topLeftBoxIndex); _sortedBoxIndices.Add(_topRightBoxIndex); _sortedBoxIndices.Add(_bottomRightBoxIndex); _sortedBoxIndices.Add(_bottomLeftBoxIndex); _controllerData.Border = this; _controllerData.PlaneSlider = _planeSlider; _controllerData.Gizmo = Gizmo; _controllerData.TargetHandle = _targetHandle; _controllerData.TargetQuad = _targetQuad; _controllerData.BorderQuad = _borderQuad; _controllerData.TopBox = _topBox; _controllerData.RightBox = _rightBox; _controllerData.BottomBox = _bottomBox; _controllerData.LeftBox = _leftBox; _controllerData.TopLeftBox = _topLeftBox; _controllerData.TopRightBox = _topRightBox; _controllerData.BottomRightBox = _bottomRightBox; _controllerData.BottomLeftBox = _bottomLeftBox; _controllerData.BorderQuadIndex = _borderQuadIndex; _controllerData.TopBoxIndex = _topBoxIndex; _controllerData.RightBoxIndex = _rightBoxIndex; _controllerData.BottomBoxIndex = _bottomBoxIndex; _controllerData.LeftBoxIndex = _leftBoxIndex; _controllerData.TopLeftBoxIndex = _topLeftBoxIndex; _controllerData.TopRightBoxIndex = _topRightBoxIndex; _controllerData.BottomRightBoxIndex = _bottomRightBoxIndex; _controllerData.BottomLeftBoxIndex = _bottomLeftBoxIndex; _controllers[(int)GizmoQuad3DBorderType.Thin] = new GizmoThinQuad3DBorderController(_controllerData); _controllers[(int)GizmoQuad3DBorderType.Box] = new GizmoBoxQuad3DBorderController(_controllerData); Gizmo.PreUpdateBegin += OnGizmoPreUpdateBegin; }
public GizmoHandle CreateHandle(int id) { if (_handles.Contains(id)) { return(null); } var handle = new GizmoHandle(this, id); _handles.Add(handle); return(handle); }
public GizmoCircle2DBorder(GizmoPlaneSlider2D planeSlider, GizmoHandle targetHandle, CircleShape2D targetCircle) { _planeSlider = planeSlider; _targetHandle = targetHandle; _targetCircle = targetCircle; _borderCircleIndex = _targetHandle.Add2DShape(_borderCircle); _borderCircle.PtContainMode = Shape2DPtContainMode.OnBorder; _controllerData.Border = this; _controllerData.PlaneSlider = _planeSlider; _controllerData.BorderCircle = _borderCircle; _controllerData.BorderCircleIndex = _borderCircleIndex; _controllerData.Gizmo = targetHandle.Gizmo; _controllerData.TargetHandle = targetHandle; _controllerData.TargetCircle = _targetCircle; _controllers[(int)GizmoCircle2DBorderType.Thin] = new GizmoThinCircle2DBorderController(_controllerData); _targetHandle.Gizmo.PreUpdateBegin += OnGizmoPreUpdateBegin; }
public GizmoRATriangle3DBorder(GizmoPlaneSlider3D planeSlider, GizmoHandle targetHandle, RightAngTriangle3D targetRiangle) { _planeSlider = planeSlider; _targetHandle = targetHandle; _targetTriangle = targetRiangle; _borderTriangleIndex = _targetHandle.Add3DShape(_borderTriangle); _borderTriangle.RaycastMode = Shape3DRaycastMode.Wire; _controllerData.Border = this; _controllerData.PlaneSlider = _planeSlider; _controllerData.Gizmo = _targetHandle.Gizmo; _controllerData.TargetHandle = _targetHandle; _controllerData.TargetTriangle = _targetTriangle; _controllerData.BorderTriangle = _borderTriangle; _controllerData.BorderTriangleIndex = _borderTriangleIndex; _controllers[(int)GizmoQuad3DBorderType.Thin] = new GizmoThinRATriangle3DBorderController(_controllerData); _targetHandle.Gizmo.PreUpdateBegin += OnGizmoPreUpdateBegin; }
/// <summary> /// Constructor. /// </summary> /// <param name="gizmo">The gizmo which owns the slider.</param> /// <param name="handleId">The id of the slider handle.</param> public GizmoSlider(Gizmo gizmo, int handleId) { _gizmo = gizmo; _handle = Gizmo.CreateHandle(handleId); }