Exemplo n.º 1
0
        private void BoxOnMouseClick(object sender, MouseButton3DEventArgs mouseButton3DEventArgs)
        {
            // HitObject is our BoxVisual3D
            var boxVisual3D = mouseButton3DEventArgs.HitObject as Ab3d.Visuals.BoxVisual3D;

            if (boxVisual3D == null)
            {
                return; // This should not happen
            }
            // Toggle clicked and normal material
            if (!_isSelectedBoxClicked)
            {
                boxVisual3D.Material  = _clickedMaterial;
                _isSelectedBoxClicked = true;

                _totalClickedHeight += boxVisual3D.Size.Y;
            }
            else
            {
                boxVisual3D.Material  = _normalMaterial;
                _isSelectedBoxClicked = false;

                _totalClickedHeight -= boxVisual3D.Size.Y;
            }

            UpdateTotalClickedHeightText();
        }
Exemplo n.º 2
0
        private void OnDuckMouseDown(object sender, MouseButton3DEventArgs e)
        {
            var hitVisual3D = e.HitObject as ModelVisual3D;

            if (_duckModels.Contains(hitVisual3D))
            {
                _mouseDownModelVisual3D = hitVisual3D;
            }
        }
Exemplo n.º 3
0
 private void EventSource3DOnMouseUp(object sender, MouseButton3DEventArgs mouseButton3DEventArgs)
 {
     // Toggle between setting the start and end position
     if (!_isStartPositionSet)
     {
         _isStartPositionSet = true;
     }
     else
     {
         _isEndPositionSet = true;
     }
 }
Exemplo n.º 4
0
        private void OnDuckMouseUp(object sender, MouseButton3DEventArgs e)
        {
            if (_mouseDownModelVisual3D != null && _mouseDownModelVisual3D == e.HitObject)
            {
                // We have a click (mouse down + mouse up on the same duck Visual3D)
                SelectDuckVisual3D(_mouseDownModelVisual3D);
            }
            else
            {
                // If mouse was released on some other object or if mouse down was not on a duck object (_mouseDownModelVisual3D == null)
                ClearSelectedDuckVisual3D();
            }

            _mouseDownModelVisual3D = null;
        }
Exemplo n.º 5
0
 void eventSource_MouseDoubleClick(object sender, MouseButton3DEventArgs e)
 {
     AddEvent("MouseDoubleClick", e);
 }
Exemplo n.º 6
0
 void eventSource_MouseUp(object sender, MouseButton3DEventArgs e)
 {
     AddEvent("MouseUp", e);
 }