Ejemplo n.º 1
0
        public bool RemoveBehaviour(IGizmoBehaviour behaviour)
        {
            if (behaviour == null)
            {
                return(false);
            }

            if (behaviour == _moveGizmo)
            {
                _moveGizmo = null;
            }
            else if (behaviour == _rotationGizmo)
            {
                _rotationGizmo = null;
            }
            else if (behaviour == _scaleGizmo)
            {
                _scaleGizmo = null;
            }
            else if (behaviour == _universalGizmo)
            {
                _universalGizmo = null;
            }
            else if (behaviour == _sceneGizmo)
            {
                _sceneGizmo = null;
            }
            else if (behaviour == _objectTransformGizmo)
            {
                _objectTransformGizmo = null;
            }

            return(_behaviours.Remove(behaviour));
        }
        public SceneGizmoAxisCap(SceneGizmo sceneGizmo, int id, AxisDescriptor gizmoAxisDesc)
            : base(sceneGizmo, id)
        {
            _axisDesc       = gizmoAxisDesc;
            _midAxisBoxFace = _axisDesc.GetAssociatedBoxFace();
            _cap.SetZoomFactorTransform(_zoomFactorTransform);

            if (_axisDesc.IsPositive)
            {
                if (_axisDesc.Index == 0)
                {
                    _labelTexture = TexturePool.Get.XAxisLabel;
                }
                else if (_axisDesc.Index == 1)
                {
                    _labelTexture = TexturePool.Get.YAxisLabel;
                }
                else
                {
                    _labelTexture = TexturePool.Get.ZAxisLabel;
                }
            }

            _colorTransition            = new ColorTransition(_color);
            _cap.Gizmo.PreUpdateBegin  += OnGizmoPreUpdateBegin;
            _cap.Gizmo.PreHandlePicked += OnGizmoHandlePicked;
            _sceneGizmo.LookAndFeel.ConnectAxisCapLookAndFeel(_cap, _axisDesc.Index, _axisDesc.Sign);
        }
Ejemplo n.º 3
0
        public SceneGizmoMidCap(SceneGizmo sceneGizmo)
            : base(sceneGizmo, GizmoHandleId.SceneGizmoMidCap)
        {
            sceneGizmo.LookAndFeel.ConnectMidCapLookAndFeel(_cap);
            sceneGizmo.Gizmo.PreHandlePicked += OnGizmoHandlePicked;

            sceneGizmo.Gizmo.PreUpdateBegin += OnGizmoPreUpdateBegin;
        }
Ejemplo n.º 4
0
        public SceneGizmoCamPrjSwitchLabel(SceneGizmo sceneGizmo)
        {
            _sceneGizmo = sceneGizmo;
            _handle     = _sceneGizmo.Gizmo.CreateHandle(GizmoHandleId.SceneGizmoCamPrjSwitchLabel);
            _handle.Add2DShape(_labelQuad);

            sceneGizmo.Gizmo.PreUpdateBegin  += OnGizmoPreUpdateBegin;
            sceneGizmo.Gizmo.PreHandlePicked += OnGizmoHandlePicked;
        }
Ejemplo n.º 5
0
        public bool AddBehaviour(IGizmoBehaviour behaviour)
        {
            if (behaviour == null || behaviour.Gizmo != null)
            {
                return(false);
            }

            GizmoBehaviorInitParams initParams = new GizmoBehaviorInitParams();

            initParams.Gizmo = this;

            behaviour.Init_SystemCall(initParams);
            if (!_behaviours.Add(behaviour))
            {
                return(false);
            }

            Type behaviourType = behaviour.GetType();

            if (behaviourType == typeof(MoveGizmo))
            {
                _moveGizmo = behaviour as MoveGizmo;
            }
            else if (behaviourType == typeof(RotationGizmo))
            {
                _rotationGizmo = behaviour as RotationGizmo;
            }
            else if (behaviourType == typeof(ScaleGizmo))
            {
                _scaleGizmo = behaviour as ScaleGizmo;
            }
            else if (behaviourType == typeof(UniversalGizmo))
            {
                _universalGizmo = behaviour as UniversalGizmo;
            }
            else if (behaviourType == typeof(SceneGizmo))
            {
                _sceneGizmo = behaviour as SceneGizmo;
            }
            else if (behaviourType == typeof(ObjectTransformGizmo))
            {
                _objectTransformGizmo = behaviour as ObjectTransformGizmo;
            }

            behaviour.OnAttached();
            behaviour.OnEnabled();

            return(true);
        }
 public SceneGizmoCamViewportUpdater(SceneGizmo sceneGizmo)
 {
     _sceneGizmo = sceneGizmo;
 }
Ejemplo n.º 7
0
 public SceneGizmoCap(SceneGizmo sceneGizmo, int capHandleId)
 {
     _sceneGizmo = sceneGizmo;
     _cap        = new GizmoCap3D(sceneGizmo.Gizmo, capHandleId);
 }