Beispiel #1
0
        protected override void UpdateGeometry()
        {
            PointsNotSameValidator.Update();
            if (!PointsNotSameValidator.IsValid())
            {
                return;
            }

            if (m_PointsOnLines[0][0] == null ||
                m_PointsOnLines[0][1] == null ||
                m_PointsOnLines[1][0] == null ||
                m_PointsOnLines[1][1] == null)
            {
                return;
            }

            LinesIntersectValidator.Update();
            if (!LinesIntersectValidator.IsValid())
            {
                return;
            }

            PointData.SetPosition(GeometryUtils.PointOfIntersection(
                                      m_PointsOnLines[0][0].Position,
                                      m_PointsOnLines[0][1].Position,
                                      m_PointsOnLines[1][0].Position,
                                      m_PointsOnLines[1][1].Position));
        }
Beispiel #2
0
        private void OnDeserialized()
        {
            UniquenessValidator    = new LineUniquenessValidator(this);
            PointsNotSameValidator = new PointsNotSameValidator(EnumeratePoints());

            NameUpdated.Subscribe(PointsNotSameValidator.Update);
            PointsNotSameValidator.Update();
        }
 protected override void UpdateGeometry()
 {
     PointsNotSameValidator.Update();
     if (!PointsNotSameValidator.IsValid())
     {
         return;
     }
     if (m_ProjectedPoint == null || m_FirstPointOnTargetLine == null || m_SecondPointOnTargetLine == null)
     {
         return;
     }
     PointData.SetPosition(m_ProjectedPoint.Position.ProjectionOnLine(
                               m_FirstPointOnTargetLine.Position,
                               m_SecondPointOnTargetLine.Position));
 }
Beispiel #4
0
        private void OnDeserialized()
        {
            PointsAreInOnePlaneValidator = new PolygonPointsAreInOnePlaneValidator(this);
            PointsAreOnSameLineValidator = new PolygonPointsAreOnSameLineValidator(this);
            LinesDontIntersectValidator  = new PolygonLinesDontIntersectValidator(this);
            PolygonUniquenessValidator   = new PolygonUniquenessValidator(this);

            PointsNotSameValidator = new PointsNotSameValidator(EnumeratePoints());
            NameUpdated.Subscribe(PointsNotSameValidator.Update);

            PointsAreInOnePlaneValidator.Update();
            PointsAreOnSameLineValidator.Update();
            LinesDontIntersectValidator.Update();
            PointsNotSameValidator.Update();
        }
Beispiel #5
0
        protected override void UpdateGeometry()
        {
            PointsNotSameValidator.Update();
            if (!PointsNotSameValidator.IsValid())
            {
                return;
            }

            if (m_FirstPoint == null || m_SecondPoint == null || m_Coefficient == 0)
            {
                return;
            }

            Vector3 v = m_SecondPoint.Position - m_FirstPoint.Position;

            PointData.SetPosition(m_FirstPoint.Position + v * m_Coefficient);
        }
        protected override void UpdateGeometry()
        {
            PointsNotSameValidator.Update();
            if (!PointsNotSameValidator.IsValid())
            {
                return;
            }

            if (m_ThirdPoint == null || m_SourcePoint == null || m_SecondPoint == null)
            {
                return;
            }

            Vector3 v2  = m_ThirdPoint.Position - m_SourcePoint.Position;
            Vector3 v1  = m_SecondPoint.Position - m_SourcePoint.Position;
            Vector3 sum = m_SourcePoint.Position + v1 * Coefficient1 + v2 * Coefficient2;

            PointData.SetPosition(sum);
        }
        protected override void UpdateGeometry()
        {
            TargetPointsNotSameValidator.Update();
            ParallelPointsNotSameValidator.Update();

            ProjectionAlongLineValidator.Update();

            if (!ParallelPointsNotSameValidator.IsValid() ||
                !TargetPointsNotSameValidator.IsValid())
            {
                return;
            }

            if (m_FirstPointOnTargetLine == null ||
                m_ProjectedPoint == null ||
                m_SecondPointOnTargetLine == null ||
                m_FirstPointOnParallelLine == null ||
                m_SecondPointOnParallelLine == null)
            {
                return;
            }

            if (!ProjectionAlongLineValidator.IsValid())
            {
                return;
            }

            Vector3 vAlong = m_SecondPointOnParallelLine.Position - m_FirstPointOnParallelLine.Position;

            Vector3 point = m_ProjectedPoint.Position + vAlong;

            PointData.SetPosition(GeometryUtils.PointOfIntersection(point,
                                                                    m_ProjectedPoint.Position,
                                                                    m_FirstPointOnTargetLine.Position,
                                                                    m_SecondPointOnTargetLine.Position));
        }