Show ControlPoint.cs syntax highlighted
using System;
using System.Drawing;
using System.Collections;
using Tao.Platform.Windows;
using Tao.OpenGl;
namespace New_Study_Project
{
public class ControlPoint
{
/* Definitions of the Program */
public enum State{OnlyCircle, CornerDownLeft, CornerDownRight, CornerUpLeft, CornerUpRight, LineDown, LineRight, LineUp, LineLeft};
/* position and some stuff */
private PointF controlPoint;
private PointF lastLocation;
private PointF location;
private State state;
private Spline spline;
private float width = 20.0f;
private float heigth = 20.0f;
/* End of Definitions of the Program */
public ControlPoint(PointF point, Spline suzan, State st)
{
this.controlPoint = point;
this.location = controlPoint;
this.lastLocation = controlPoint;
this.state = st;
this.spline = suzan;
}
/*******************************************************************/
/* functions for moving and setting */
/*******************************************************************/
public void setControlPoint(PointF spoint)
{
this.controlPoint = spoint;
this.location = controlPoint;
this.lastLocation = controlPoint;
}
public PointF getControlPoint()
{
return this.controlPoint;
}
public Spline getSpline
{
get
{
return this.spline;
}
set
{
this.spline = value;
}
}
public void moveControlPoint(PointF mpoint)
{
this.controlPoint = new PointF((this.controlPoint.X+mpoint.X), (this.controlPoint.Y+mpoint.Y));
this.location = controlPoint;
this.lastLocation = controlPoint;
}
/*******************************************************************/
/* some function for returning values */
/*******************************************************************/
public float getX
{
get
{
return this.controlPoint.X;
}
set
{
this.controlPoint.X = value;
this.location.X = controlPoint.X;
this.lastLocation.X = controlPoint.X;
}
}
public float getY
{
get
{
return this.controlPoint.Y;
}
set
{
this.controlPoint.Y = value;
this.location.Y = controlPoint.Y;
this.lastLocation.Y = controlPoint.Y;
}
}
public PointF Location
{
get
{
return this.controlPoint;
}
set
{
this.controlPoint = value;
}
}
public PointF LastLocation
{
get
{
return this.lastLocation;
}
set
{
this.lastLocation = value;
}
}
public float Width
{
get
{
return this.width;
}
set
{
this.width = value;
}
}
public float Heigth
{
get
{
return this.heigth;
}
set
{
this.heigth = value;
}
}
public State getState()
{
return this.state;
}
/*******************************************************************/
/* ----------------------------------------------------------- */
/*******************************************************************/
}
}
See more files for this project here