Exemplo n.º 1
0
        public void SetOrigin(Vector3 origin)
        {
            if (m_Origin == origin)
            {
                return;
            }

            m_Origin = origin;
            GeometryUpdated.Invoke();
        }
Exemplo n.º 2
0
        public void SetCoefficient(float coef)
        {
            if (coef < 0)
            {
                return;
            }

            m_Coefficient = coef;
            GeometryUpdated.Invoke();
        }
Exemplo n.º 3
0
        public void SetPointPosition(int pointIndex, Vector3 position)
        {
            if (pointIndex < 0 || pointIndex >= m_PointsPositions.Count)
            {
                return;
            }

            m_PointsPositions[pointIndex] = position;
            GeometryUpdated.Invoke();
        }
Exemplo n.º 4
0
        private void OnDeserialized()
        {
            AddToMyShapeDatas(PointData);

            PointsNotSameValidator  = new PointsNotSameValidator(EnumeratePoints());
            LinesIntersectValidator = new LinesIntersectValidator(this);
            PointData.NameUpdated.Subscribe(NameUpdated);

            GeometryUpdated.Invoke();
        }
Exemplo n.º 5
0
        public void SetAxis(int axisNum, Vector3 axis)
        {
            if (axisNum < 0 || axisNum >= 3)
            {
                return;
            }

            m_Axes[axisNum] = axis;
            NonZeroVolumeValidator.Update();
            GeometryUpdated.Invoke();
        }
Exemplo n.º 6
0
        public void SetRadius(float radius)
        {
            if (radius < 0)
            {
                return;
            }

            m_Radius = radius;

            GeometryUpdated.Invoke();
        }
Exemplo n.º 7
0
        public void SetLength(float length)
        {
            if (length < 0)
            {
                return;
            }

            m_Length = length;
            //NonZeroVolumeValidator.Update();
            GeometryUpdated.Invoke();
        }
        private void OnDeserialized()
        {
            AddToMyShapeDatas(PointData);

            TargetPointsNotSameValidator   = new PointsNotSameValidator(EnumerateTargetPoints());
            ParallelPointsNotSameValidator = new PointsNotSameValidator(EnumerateParallelPoints());

            PointData.NameUpdated.Subscribe(NameUpdated);

            ProjectionAlongLineValidator = new ProjectionAlongLineValidator(this);

            GeometryUpdated.Invoke();
        }
Exemplo n.º 9
0
        public void SetBaseVerticesCount(int count)
        {
            if (count > 8 || count < 3)
            {
                return;
            }

            m_VerticesAtTheBaseCount = count;

            Clear();
            ConstructPrism();

            GeometryUpdated.Invoke();
        }
 public void SetProjectedPoint(PointData pointData)
 {
     if (m_ProjectedPoint == pointData)
     {
         return;
     }
     if (m_ProjectedPoint != null)
     {
         m_ProjectedPoint.GeometryUpdated.Unsubscribe(GeometryUpdated);
     }
     m_ProjectedPoint = pointData;
     if (m_ProjectedPoint != null)
     {
         m_ProjectedPoint.GeometryUpdated.Subscribe(GeometryUpdated);
     }
     GeometryUpdated.Invoke();
 }
Exemplo n.º 11
0
        private void OnDeserialized()
        {
            //NonZeroVolumeValidator = new NonZeroVolumeValidator(m_Axes);
            //NonZeroVolumeValidator.Update();
            GeometryUpdated.Invoke();

            foreach (var shapeData in
                     new [] { m_CompositeShapeData }.Cast <ShapeData>()
                     .Concat(m_Points)
                     .Concat(m_Lines)
                     .Concat(m_Polygons))
            {
                AddToMyShapeDatas(shapeData);
            }

            m_CompositeShapeData.SetShapeName("Cube");
        }
 public void SetSecondPointOnTargetLine(PointData pointData)
 {
     if (m_SecondPointOnTargetLine == pointData)
     {
         return;
     }
     if (m_SecondPointOnTargetLine != null)
     {
         m_SecondPointOnTargetLine.GeometryUpdated.Unsubscribe(GeometryUpdated);
     }
     m_SecondPointOnTargetLine = pointData;
     if (m_SecondPointOnTargetLine != null)
     {
         m_SecondPointOnTargetLine.GeometryUpdated.Subscribe(GeometryUpdated);
     }
     GeometryUpdated.Invoke();
 }
        public void SetFirstPointOnParallelLine(PointData pointData)
        {
            if (m_FirstPointOnParallelLine == pointData)
            {
                return;
            }

            if (m_FirstPointOnParallelLine != null)
            {
                m_FirstPointOnParallelLine.GeometryUpdated.Unsubscribe(GeometryUpdated);
            }

            m_FirstPointOnParallelLine = pointData;
            if (m_FirstPointOnParallelLine != null)
            {
                m_FirstPointOnParallelLine.GeometryUpdated.Subscribe(GeometryUpdated);
            }

            GeometryUpdated.Invoke();
        }
Exemplo n.º 14
0
        public void SetPoint(int lineNum, int pointNum, PointData pointData)
        {
            if (m_PointsOnLines[lineNum][pointNum] == pointData)
            {
                return;
            }

            if (m_PointsOnLines[lineNum][pointNum] != null)
            {
                m_PointsOnLines[lineNum][pointNum].GeometryUpdated.Unsubscribe(GeometryUpdated);
            }

            m_PointsOnLines[lineNum][pointNum] = pointData;
            if (m_PointsOnLines[lineNum][pointNum] != null)
            {
                m_PointsOnLines[lineNum][pointNum].GeometryUpdated.Subscribe(GeometryUpdated);
            }

            GeometryUpdated.Invoke();
        }
Exemplo n.º 15
0
 public void SetOrigin(Vector3 origin)
 {
     m_Origin = origin;
     GeometryUpdated.Invoke();
 }
Exemplo n.º 16
0
        private void OnDeserialized()
        {
            GeometryUpdated.Invoke();

            m_CompositeShapeData.SetShapeName("Prism");
        }
Exemplo n.º 17
0
 public void SetOffset(Vector3 offset)
 {
     m_Offset = offset;
     GeometryUpdated.Invoke();
 }
Exemplo n.º 18
0
 /// <summary>
 /// </summary>
 protected void InvokeGeometryUpdated()
 {
     GeometryUpdated?.Invoke();
 }