public BrushPreset(BrushPreset other)
        {
            Reset();

            prefabs = new List <GameObject>(other.prefabs);

            name = other.name;

            brushSize      = other.brushSize;
            eraseBrushSize = other.eraseBrushSize;
            brushSpacing   = other.brushSpacing;

            positionOffset = other.positionOffset;

            orientationTransformMode = other.orientationTransformMode;
            orientationMode          = other.orientationMode;
            flipOrientation          = other.flipOrientation;
            rotation             = other.rotation;
            randomizeOrientation = other.randomizeOrientation;

            scaleTransformMode = other.scaleTransformMode;
            scaleMode          = other.scaleMode;
            scaleUniformMin    = other.scaleUniformMin;
            scaleUniformMax    = other.scaleUniformMax;
            scalePerAxisMin    = other.scalePerAxisMin;
            scalePerAxisMax    = other.scalePerAxisMax;
        }
Exemple #2
0
 public void ResetMoveSettings()
 {
     moveSurfaceOffset   = 0f;
     movePivotMode       = PivotMode.BoundsBottomCenter;
     moveLockUp          = false;
     moveOrientationMode = OrientationMode.SurfaceNormal;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OrientationProperty"/> class.
 /// </summary>
 /// <param name="mode">Mode.</param>
 // <param name="_name">property name</param>
 /// <param name="_targets">property targets. They have no meaning for this property, but we add them anyway.</param>
 /// <param name="_satXPoints">x points of the satisfaction linear spline</param>
 /// <param name="_satYPoints">y points of the satisfaction linear spline</param>
 public CLOrientationProperty(OrientationMode mode, string _name, List <CLTarget> _targets, List <float> _satXPoints, List <float> _satYPoints) :
     base(_name, _targets)
 {
     satFunction = new CLLinearSplineSatFunction(_satXPoints, _satYPoints);
     cost        = 1.5f;
     orientation = mode;
 }
Exemple #4
0
        public void CopyFrom(BrushSettings other)
        {
            brushRadius              = other.brushRadius;
            brushSpacing             = other.brushSpacing;
            brushOverlapCheckMode    = other.brushOverlapCheckMode;
            brushOverlapDistance     = other.brushOverlapDistance;
            brushOverlapCheckObjects = other.brushOverlapCheckObjects;
            brushOverlapCheckLayers  = other.brushOverlapCheckLayers;

            surfaceOffset = other.surfaceOffset;

            orientationTransformMode = other.orientationTransformMode;
            orientationMode          = other.orientationMode;
            alongBrushStroke         = other.alongBrushStroke;
            rotation = other.rotation;
            randomizeOrientationX = other.randomizeOrientationX;
            randomizeOrientationY = other.randomizeOrientationY;
            randomizeOrientationZ = other.randomizeOrientationZ;

            scaleTransformMode = other.scaleTransformMode;
            scaleMode          = other.scaleMode;
            scaleUniformMin    = other.scaleUniformMin;
            scaleUniformMax    = other.scaleUniformMax;
            scalePerAxisMin    = other.scalePerAxisMin;
            scalePerAxisMax    = other.scalePerAxisMax;

            pinFixedRotation      = other.pinFixedRotation;
            pinFixedRotationValue = other.pinFixedRotationValue;
            pinFixedScale         = other.pinFixedScale;
            pinFixedScaleValue    = other.pinFixedScaleValue;

            placeScale       = other.placeScale;
            placeEulerAngles = other.placeEulerAngles;

            multibrushEnabled           = other.multibrushEnabled;
            multibrushPaintSelectedSlot = other.multibrushPaintSelectedSlot;
            multibrushMode            = other.multibrushMode;
            multibrushPattern         = other.multibrushPattern;
            multibrushPatternContinue = other.multibrushPatternContinue;

            for (int i = 0; i < kNumMultibrushSlots; i++)
            {
                multibrushSlots[i] = other.multibrushSlots[i];
            }

            slopeEnabled      = other.slopeEnabled;
            slopeAngleMin     = other.slopeAngleMin;
            slopeAngleMax     = other.slopeAngleMax;
            slopeVector       = other.slopeVector;
            slopeVectorCustom = other.slopeVectorCustom;
            slopeVectorFlip   = other.slopeVectorFlip;

            gridEnabled = other.gridEnabled;
            gridOrigin  = other.gridOrigin;
            gridStep    = other.gridStep;
            gridPlane   = other.gridPlane;
            gridNormal  = other.gridNormal;
            gridAngle   = other.gridAngle;
        }
Exemple #5
0
 public static void setDefaultOrientationMode(OrientationMode orientationMode)
 {
     OgrePINVOKE.Viewport_setDefaultOrientationMode((int)orientationMode);
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #6
0
 public void setOrientationMode(OrientationMode orientationMode)
 {
     OgrePINVOKE.Viewport_setOrientationMode__SWIG_1(swigCPtr, (int)orientationMode);
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #7
0
 public void setOrientationMode(OrientationMode orientationMode)
 {
     OgrePINVOKE.Frustum_setOrientationMode(swigCPtr, (int)orientationMode);
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #8
0
        public static OrientationMode getDefaultOrientationMode()
        {
            OrientationMode ret = (OrientationMode)OgrePINVOKE.Viewport_getDefaultOrientationMode();

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #9
0
 public void ResetOrientation()
 {
     orientationTransformMode = TransformMode.Relative;
     orientationMode          = OrientationMode.AlongSurfaceNormal;
     flipOrientation          = false;
     rotation = new Vector3(0, 0, 0);
     randomizeOrientationX = 0.0f;
     randomizeOrientationY = 0.0f;
     randomizeOrientationZ = 0.0f;
 }
Exemple #10
0
        public OrientationMode getViewportOrientationMode()
        {
            OrientationMode ret = (OrientationMode)OgreOverlayPINVOKE.OverlayManager_getViewportOrientationMode(swigCPtr);

            if (OgreOverlayPINVOKE.SWIGPendingException.Pending)
            {
                throw OgreOverlayPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #11
0
        public OrientationMode getOrientationMode()
        {
            OrientationMode ret = (OrientationMode)OgrePINVOKE.Frustum_getOrientationMode(swigCPtr);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #12
0
    /// <summary>
    /// Calls to LinearPosition() or CatmullPosition() function depending on PlayMode.
    /// </summary>
    /// <param name="seg"> Segment the RailMover is in</param>
    /// <param name="ratio"> Ratio of the segment the RailMover is currently in.</param>
    /// <param name="mode"> Which mode was selected between Catmull or Linear.</param>
    /// <returns> A Quaternion with the position update.</returns>
    public Quaternion OrientationOnRail(int seg, float ratio, OrientationMode mode, Transform trans, bool isReversed)
    {
        switch (mode)
        {
        default:
        case OrientationMode.Line:
            return(LineOrientation(seg, ratio, trans, isReversed));

        case OrientationMode.Nodes:
            return(NodeOrientation(seg, ratio, isReversed));
        }
    }
Exemple #13
0
        /// <inheritdoc/>
        protected override void BeforeImageApply(
            Image <TPixel> source,
            Rectangle sourceRectangle,
            Configuration configuration)
        {
            OrientationMode orientation = GetExifOrientation(source);
            Size            size        = sourceRectangle.Size;

            switch (orientation)
            {
            case OrientationMode.TopRight:
                new FlipProcessor <TPixel>(FlipMode.Horizontal).Apply(source, sourceRectangle, configuration);
                break;

            case OrientationMode.BottomRight:
                new RotateProcessor <TPixel>((int)RotateMode.Rotate180, size).Apply(source, sourceRectangle, configuration);
                break;

            case OrientationMode.BottomLeft:
                new FlipProcessor <TPixel>(FlipMode.Vertical).Apply(source, sourceRectangle, configuration);
                break;

            case OrientationMode.LeftTop:
                new RotateProcessor <TPixel>((int)RotateMode.Rotate90, size).Apply(source, sourceRectangle, configuration);
                new FlipProcessor <TPixel>(FlipMode.Horizontal).Apply(source, sourceRectangle, configuration);
                break;

            case OrientationMode.RightTop:
                new RotateProcessor <TPixel>((int)RotateMode.Rotate90, size).Apply(source, sourceRectangle, configuration);
                break;

            case OrientationMode.RightBottom:
                new FlipProcessor <TPixel>(FlipMode.Vertical).Apply(source, sourceRectangle);
                new RotateProcessor <TPixel>((int)RotateMode.Rotate270, size).Apply(source, sourceRectangle, configuration);
                break;

            case OrientationMode.LeftBottom:
                new RotateProcessor <TPixel>((int)RotateMode.Rotate270, size).Apply(source, sourceRectangle, configuration);
                break;

            case OrientationMode.Unknown:
            case OrientationMode.TopLeft:
            default:
                break;
            }
        }
        public static Size Resize(this Size actualSize, Size newSize, ResizeMode resizeMode, OrientationMode orientationMode)
        {
            if (orientationMode == OrientationMode.RotateForBestFit)
            {
                if ((actualSize.Width > actualSize.Height) && !(newSize.Width > newSize.Height))
                    newSize = newSize.SwapWidthHeight();
                else if ((actualSize.Width < actualSize.Height) && !(newSize.Width < newSize.Height))
                    newSize = newSize.SwapWidthHeight();
            }

            var heightResizeFactor = newSize.Height / (double)actualSize.Height;
            var widthResizeFactor = newSize.Width / (double)actualSize.Width;

            if (resizeMode == ResizeMode.FitsInBox)
            {
                if (heightResizeFactor > widthResizeFactor)
                {
                    newSize = new Size(newSize.Width, (int)((double)actualSize.Height * widthResizeFactor));
                }
                else
                {
                    newSize = new Size((int)((double)actualSize.Width * heightResizeFactor), newSize.Height);
                }
            }
            else if (resizeMode == ResizeMode.BoxFitsIn || resizeMode == ResizeMode.BoxFitsInCropped)
            {
                if (heightResizeFactor < widthResizeFactor)
                {
                    newSize = new Size(newSize.Width, (int)((double)actualSize.Height * widthResizeFactor));
                }
                else
                {
                    newSize = new Size((int)((double)actualSize.Width * heightResizeFactor), newSize.Height);
                }
            }
            else if (resizeMode == ResizeMode.Stretch)
            {
                // Do nothing
            }
            else
            {
                throw new ArgumentException("Unsupported ResizeMode value.");
            }
            
            return newSize;
        }
Exemple #15
0
        private void _okButton_Click(object sender, EventArgs e)
        {
            if (_allRadioButton.Checked)
            {
                FirstPageNumber = 1;
                LastPageNumber  = PageCount;
            }
            else if (_selectedRadioButton.Checked)
            {
                FirstPageNumber = SelectedPageNumber;
                LastPageNumber  = SelectedPageNumber;
            }

            Direction   = (DirectionMode)_directionComboBox.SelectedIndex;
            EventOdd    = (EvenOddMode)_evenOddComboBox.SelectedIndex;
            Orientation = (OrientationMode)_orientationComboBox.SelectedIndex;
        }
Exemple #16
0
        /// <inheritdoc/>
        protected override void BeforeImageApply()
        {
            OrientationMode orientation = GetExifOrientation(this.Source);
            Size            size        = this.SourceRectangle.Size;

            switch (orientation)
            {
            case OrientationMode.TopRight:
                new FlipProcessor(FlipMode.Horizontal).Execute(this.Configuration, this.Source, this.SourceRectangle);
                break;

            case OrientationMode.BottomRight:
                new RotateProcessor((int)RotateMode.Rotate180, size).Execute(this.Configuration, this.Source, this.SourceRectangle);
                break;

            case OrientationMode.BottomLeft:
                new FlipProcessor(FlipMode.Vertical).Execute(this.Configuration, this.Source, this.SourceRectangle);
                break;

            case OrientationMode.LeftTop:
                new RotateProcessor((int)RotateMode.Rotate90, size).Execute(this.Configuration, this.Source, this.SourceRectangle);
                new FlipProcessor(FlipMode.Horizontal).Execute(this.Configuration, this.Source, this.SourceRectangle);
                break;

            case OrientationMode.RightTop:
                new RotateProcessor((int)RotateMode.Rotate90, size).Execute(this.Configuration, this.Source, this.SourceRectangle);
                break;

            case OrientationMode.RightBottom:
                new FlipProcessor(FlipMode.Vertical).Execute(this.Configuration, this.Source, this.SourceRectangle);
                new RotateProcessor((int)RotateMode.Rotate270, size).Execute(this.Configuration, this.Source, this.SourceRectangle);
                break;

            case OrientationMode.LeftBottom:
                new RotateProcessor((int)RotateMode.Rotate270, size).Execute(this.Configuration, this.Source, this.SourceRectangle);
                break;

            case OrientationMode.Unknown:
            case OrientationMode.TopLeft:
            default:
                break;
            }

            base.BeforeImageApply();
        }
    /// <summary>
    ///
    /// </summary>
    private void toggleOrientationMode()
    {
        if (Input.GetKeyDown(KeyCode.Tab))
        {
            switch (orientationMode)
            {
            case OrientationMode.Positional:
                orientationMode = OrientationMode.Rotational;
                break;

            case OrientationMode.Rotational:
                orientationMode = OrientationMode.Positional;
                break;

            default:
                break;
            }
        }
    }
        public void Reset()
        {
            brushSize      = 1.0f;
            eraseBrushSize = 1.0f;
            brushSpacing   = 0.5f;

            positionOffset = new Vector3(0, 0, 0);

            orientationTransformMode = TransformMode.Relative;
            orientationMode          = OrientationMode.AlongSurfaceNormal;
            flipOrientation          = false;
            rotation             = new Vector3(0, 0, 0);
            randomizeOrientation = new Vector3(0, 0, 0);


            scaleTransformMode = TransformMode.Relative;
            scaleMode          = ScaleMode.Uniform;
            scaleUniformMin    = 1.0f;
            scaleUniformMax    = 1.0f;
            scalePerAxisMin    = new Vector3(1, 1, 1);
            scalePerAxisMax    = new Vector3(1, 1, 1);
        }
Exemple #19
0
        private void CycleOrientationMode()
        {
            switch (orientationMode)
            {
            case OrientationMode.Head:
                orientationMode = OrientationMode.Mouselook;
                vrHead.Pose     = mouselook;
                break;

            case OrientationMode.Mouselook:
                orientationMode = OrientationMode.RightHand;
                vrHead.Pose     = rightHandPose;
                break;

            case OrientationMode.RightHand:
                orientationMode = OrientationMode.Head;
                vrHead.Pose     = headPose;
                break;

            default:
                throw new InvalidOperationException("Unknown orientation mode.");
            }
        }
Exemple #20
0
 public void SetOrientationMode(OrientationMode orientationMode)
 {
     SetOrientationMode(orientationMode, true);
 }
Exemple #21
0
		public void PointOrientedToScreen( Vector2 v, OrientationMode orientationMode, out Vector2 outv )
		{
			PointOrientedToScreen( v.x, v.y, orientationMode, out outv.x, out outv.y );
		}
Exemple #22
0
 public void ResetPlaceOrientation()
 {
     orientationTransformMode = TransformMode.Relative;
     orientationMode          = OrientationMode.SurfaceNormal;
     placeEulerAngles         = new Vector3(0, 0, 0);
 }
Exemple #23
0
		public void SetOrientationMode( OrientationMode orientationMode, bool setDefault )
		{
#if AXIOM_NO_VIEWPORT_ORIENTATIONMODE
			throw new AxiomException("Setting Viewport orientation mode is not supported");,
#endif
			OrientationMode = orientationMode;

			if ( setDefault )
			{
				DefaultOrientationMode = orientationMode;
			}

			if ( Camera != null )
			{
				Camera.OrientationMode = OrientationMode;
			}

			// Update the render system config
#if AXIOM_PLATFORM == AXIOM_PLATFORM_APPLE_IOS
			var rs = Root.Instance.RenderSystem;

			switch ( OrientationMode )
			{
				case OrientationMode.LandscapeLeft:
					rs.SetConfigOption( "Orientation", "Landscape Left" );
					break;
				case OrientationMode.LandscapeRight:
					rs.SetConfigOption( "Orientation", "Landscape Right" );
					break;
				case OrientationMode.Portrait:
					rs.SetConfigOption( "Orientation", "Portrait" );
					break;
			}
#endif
		}
Exemple #24
0
        public void CopyFrom(BrushSettings other)
        {
            brushRadius              = other.brushRadius;
            brushSpacing             = other.brushSpacing;
            brushOverallScale        = other.brushOverallScale;
            brushOverlapCheck        = other.brushOverlapCheck;
            brushOverlapCheckMode    = other.brushOverlapCheckMode;
            brushOverlapDistance     = other.brushOverlapDistance;
            brushOverlapCheckObjects = other.brushOverlapCheckObjects;
            brushOverlapCheckLayers  = other.brushOverlapCheckLayers;
            maxAlpha = other.maxAlpha;
            minAlpha = other.minAlpha;

            ppOrientationMode            = other.ppOrientationMode;
            ppFlipOrientation            = other.ppFlipOrientation;
            ppFixedRotation              = other.ppFixedRotation;
            ppFixedRotationValue         = other.ppFixedRotationValue;
            ppFixedRotationTransformMode = other.ppFixedRotationTransformMode;
            ppFixedScale              = other.ppFixedScale;
            ppFixedScaleValue         = other.ppFixedScaleValue;
            ppFixedScaleTransformMode = other.ppFixedScaleTransformMode;

            positionOffset = other.positionOffset;

            orientationTransformMode = other.orientationTransformMode;
            orientationMode          = other.orientationMode;
            flipOrientation          = other.flipOrientation;
            rotation = other.rotation;
            randomizeOrientationX = other.randomizeOrientationX;
            randomizeOrientationY = other.randomizeOrientationY;
            randomizeOrientationZ = other.randomizeOrientationZ;

            scaleTransformMode = other.scaleTransformMode;
            scaleMode          = other.scaleMode;
            scaleUniformMin    = other.scaleUniformMin;
            scaleUniformMax    = other.scaleUniformMax;
            scalePerAxisMin    = other.scalePerAxisMin;
            scalePerAxisMax    = other.scalePerAxisMax;
            scaleAux           = other.scaleAux;

            multibrushEnabled           = other.multibrushEnabled;
            multibrushPaintSelectedSlot = other.multibrushPaintSelectedSlot;
            multibrushMode            = other.multibrushMode;
            multibrushPattern         = other.multibrushPattern;
            multibrushPatternContinue = other.multibrushPatternContinue;

            for (int i = 0; i < kNumMultibrushSlots; i++)
            {
                multibrushSlots[i] = other.multibrushSlots[i];
            }

            advancedSettingsEnabled = other.advancedSettingsEnabled;

            slopeEnabled      = other.slopeEnabled;
            slopeAngleMin     = other.slopeAngleMin;
            slopeAngleMax     = other.slopeAngleMax;
            slopeVector       = other.slopeVector;
            slopeVectorCustom = other.slopeVectorCustom;
            slopeVectorFlip   = other.slopeVectorFlip;

            gridEnabled = other.gridEnabled;
            gridOrigin  = other.gridOrigin;
            gridStep    = other.gridStep;
            gridPlane   = other.gridPlane;
            gridNormal  = other.gridNormal;
            gridAngle   = other.gridAngle;
        }
Exemple #25
0
        public void SetOrientationMode(OrientationMode orientationMode, bool setDefault)
        {
#if AXIOM_NO_VIEWPORT_ORIENTATIONMODE
            throw new AxiomException("Setting Viewport orientation mode is not supported"); ,
Exemple #26
0
		public void PointOrientedToScreen( Real orientedX, Real orientedY, OrientationMode orientationMode, out Real screenX,
		                                   out Real screenY )
		{
			var orX = orientedX;
			var orY = orientedY;
			switch ( orientationMode )
			{
				case OrientationMode.Degree90:
					screenX = orY;
					screenY = Real.One - orX;
					break;
				case OrientationMode.Degree180:
					screenX = Real.One - orX;
					screenY = Real.One - orY;
					break;
				case OrientationMode.Degree270:
					screenX = Real.One - orY;
					screenY = orX;
					break;
				default:
					screenX = orX;
					screenY = orY;
					break;
			}
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="OrientationProperty"/> class.
 /// </summary>
 /// <param name="mode">Mode.</param>
 // <param name="_name">property name</param>
 /// <param name="_targets">property targets. They have no meaning for this property, but we add them anyway.</param>
 /// <param name="_satFunction">sat function</param>
 public CLOrientationProperty(OrientationMode mode, string _name, List <CLTarget> _targets, CLSatFunction _satFunction) :
     base(_name, _targets, _satFunction)
 {
     cost        = 1.5f;
     orientation = mode;
 }
 public void Start()
 {
     orientationMode = OrientationMode.Rotational;
 }
Exemple #29
0
 public static string SetOrientation(OrientationMode mode)
 {
     if (!mode.IsValidValue())
     {
         throw new ArgumentException("not a valid orientation mode.", "mode");
     }
     var id = IntPtr.Zero;
     var success = navigator_set_orientation_mode(mode, ref id) == BPS.BPS_SUCCESS;
     if (success)
     {
         using (var str = new BPSString(id))
         {
             return str.Value;
         }
     }
     else
     {
         BPS.bps_free(id);
     }
     return null;
 }
        public static Size Resize(this Size actualSize, Size newSize, ResizeMode resizeMode, OrientationMode orientationMode)
        {
            if (orientationMode == OrientationMode.RotateForBestFit)
            {
                if ((actualSize.Width > actualSize.Height) && !(newSize.Width > newSize.Height))
                {
                    newSize = newSize.SwapWidthHeight();
                }
                else if ((actualSize.Width < actualSize.Height) && !(newSize.Width < newSize.Height))
                {
                    newSize = newSize.SwapWidthHeight();
                }
            }

            var heightResizeFactor = newSize.Height / (double)actualSize.Height;
            var widthResizeFactor  = newSize.Width / (double)actualSize.Width;

            if (resizeMode == ResizeMode.FitsInBox)
            {
                if (heightResizeFactor > widthResizeFactor)
                {
                    newSize = new Size(newSize.Width, (int)((double)actualSize.Height * widthResizeFactor));
                }
                else
                {
                    newSize = new Size((int)((double)actualSize.Width * heightResizeFactor), newSize.Height);
                }
            }
            else if (resizeMode == ResizeMode.BoxFitsIn || resizeMode == ResizeMode.BoxFitsInCropped)
            {
                if (heightResizeFactor < widthResizeFactor)
                {
                    newSize = new Size(newSize.Width, (int)((double)actualSize.Height * widthResizeFactor));
                }
                else
                {
                    newSize = new Size((int)((double)actualSize.Width * heightResizeFactor), newSize.Height);
                }
            }
            else if (resizeMode == ResizeMode.Stretch)
            {
                // Do nothing
            }
            else
            {
                throw new ArgumentException("Unsupported ResizeMode value.");
            }

            return(newSize);
        }
Exemple #31
0
 private static extern int navigator_set_orientation_mode(OrientationMode mode, [In, Out]ref IntPtr id);
    private void Start()
    {
        currentOrientationMode = OrientationMode.Positional;

        InstantiateOrientationObjects();
    }
Exemple #33
0
		public void SetOrientationMode( OrientationMode orientationMode )
		{
			SetOrientationMode( orientationMode, true );
		}