public MoveEdgeControlPointAction(IGTFEdgeModel edgeModel, int edgeIndex, Vector2 newPosition, float newTightness)
 {
     EdgeModel    = edgeModel;
     EdgeIndex    = edgeIndex;
     NewPosition  = newPosition;
     NewTightness = newTightness;
 }
예제 #2
0
        public static List <IGTFEdgeModel> GetDropEdgeModelsToDelete(IGTFEdgeModel edge)
        {
            List <IGTFEdgeModel> edgeModelsToDelete = new List <IGTFEdgeModel>();

            if (edge.ToPort != null && edge.ToPort.Capacity == PortCapacity.Single)
            {
                foreach (var edgeToDelete in edge.ToPort.ConnectedEdges)
                {
                    if (!ReferenceEquals(edgeToDelete, edge))
                    {
                        edgeModelsToDelete.Add(edgeToDelete);
                    }
                }
            }

            if (edge.FromPort != null && edge.FromPort.Capacity == PortCapacity.Single)
            {
                foreach (var edgeToDelete in edge.FromPort.ConnectedEdges)
                {
                    if (!ReferenceEquals(edgeToDelete, edge))
                    {
                        edgeModelsToDelete.Add(edgeToDelete);
                    }
                }
            }

            return(edgeModelsToDelete);
        }
예제 #3
0
        public EdgeControlPoint(EdgeControl edgeControl, IGTFEdgeModel edgeModel, int controlPointIndex)
        {
            m_EdgeControl       = edgeControl;
            m_EdgeModel         = edgeModel;
            m_ControlPointIndex = controlPointIndex;

            AddToClassList(k_ClassName);

            RegisterCallback <PointerDownEvent>(OnPointerDown);
            RegisterCallback <PointerMoveEvent>(OnPointerMove);
            RegisterCallback <PointerUpEvent>(OnPointerUp);

            style.position = Position.Absolute;
        }
예제 #4
0
        public static IGraphElement CreateEdge(this ElementBuilder elementBuilder, IStore store, IGTFEdgeModel model)
        {
            var ui = new Edge();

            ui.Setup(model, store, elementBuilder.GraphView);
            return(ui);
        }
 public AddControlPointOnEdgeAction(IGTFEdgeModel edgeModel, int atIndex, Vector2 position)
 {
     EdgeModel = edgeModel;
     AtIndex   = atIndex;
     Position  = position;
 }
 public SetEdgeEditModeAction(IGTFEdgeModel edgeModel, bool value)
 {
     EdgeModel = edgeModel;
     Value     = value;
 }
 public RemoveEdgeControlPointAction(IGTFEdgeModel edgeModel, int edgeIndex)
 {
     EdgeModel = edgeModel;
     EdgeIndex = edgeIndex;
 }