You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

237 lines
9.8 KiB
C#

1 month ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeoSigma.SigmaDrawerStyle
{
public class Constants
{
public const double InvalidDouble = -1E101;
public const int PLINE_NAME_ALONG_CURVE = 0x08000000;
//曲线内部上名字
public const int PLINE_IN_NAME_AUTO_DECREASE = 0x10000000; // 当文字太大时自动缩小
public static LineType ParseLineType(string typeString)
{
LineType lineType = LineType.PLINE_ZERO;
switch (typeString)
{
case "NODRAW":
lineType = LineType.PLINE_NODRAW;
break;
case "W":
lineType = LineType.PLINE_W;
break;
case "V":
lineType = LineType.PLINE_VIRTUAL;
break;
case "D":
lineType = LineType.PLINE_DESIGN;
break;
case "M":
lineType = LineType.PLINE_MIDLE;
break;
case "S":
lineType = LineType.PLINE_SOLID;
break;
case "C":
lineType = LineType.PLINE_CLOSE;
break;
case "B":
lineType = LineType.PLINE_BEZIER;
break;
case "P":
lineType = LineType.PLINE_SPLINE;
break;
case "O":
lineType = LineType.PLINE_OFFSET;
break;
case "T":
lineType = LineType.PLINE_TRANSPARENT;
break;
case "A":
lineType = LineType.PLINE_WAVE;
break;
case "AS":
lineType = LineType.PLINE_WAVE_SOLID;
break;
case "BS":
lineType = LineType.PLINE_BS;
break;
case "BC":
lineType = LineType.PLINE_BC;
break;
case "PS":
lineType = LineType.PLINE_SPLINES;
break;
case "PC":
lineType = LineType.PLINE_SPLINEC;
break;
case "OS":
lineType = LineType.PLINE_OFFSET_SOLID;
break;
case "TS":
lineType = LineType.PLINE_TS;
break;
case "HS":
lineType = LineType.PLINE_HS;
break;
case "TBS":
lineType = LineType.PLINE_TBS;
break;
case "TPS":
lineType = LineType.PLINE_T_SPLINES;
break;
case "TC":
lineType = LineType.PLINE_TC;
break;
case "TB":
lineType = LineType.PLINE_TB;
break;
default:
lineType = LineType.PLINE_ZERO;
break;
}
return lineType;
}
}
//曲线类型
public enum LineType
{
PLINE_ZERO = 0x00000000, //原始
PLINE_NODRAW = 0x00000001, //不画曲线
PLINE_W = 0x00000002, //'W' //
PLINE_VIRTUAL = 0x00000004, //'V'
PLINE_DESIGN = 0x00000008, //'D'
PLINE_MIDLE = 0x00000010, //'M'
PLINE_SOLID = 0x00000020, //'S'
PLINE_CLOSE = 0x00000040, //'C'
PLINE_BEZIER = 0x00000080, //'B'
PLINE_SPLINE = 0x00000100, //'P' //三次样条光滑
PLINE_OFFSET = 0x00000200, //'O'
PLINE_TRANSPARENT = 0x00000400, //'T' //透明
PLINE_WAVE = 0x00000800, //'A' //波浪线
PLINE_TRANSPARENT_VALUE = 0x00001000, //'H' // 'H' 透明度
PLINE_SMOOTH_HEAD = 0x00010000, //曲线圆头显示
PLINE_MARK_NAME_NUM = 0x00020000, //表示按个数上名字
PLINE_MARK_NAME_STEP = 0x00040000, //表示按步长上名字
PLINE_WAVE_SOLID = (PLINE_WAVE | PLINE_SOLID), //AS //波浪线+充填
PLINE_BS = (PLINE_BEZIER | PLINE_SOLID), //'B'*256+'S'
PLINE_BC = (PLINE_BEZIER | PLINE_CLOSE), //'B'*256+'C'
PLINE_SPLINES = (PLINE_SPLINE | PLINE_SOLID), //'P'*256+'S' //三次样条光滑+充填+闭合
PLINE_SPLINEC = (PLINE_SPLINE | PLINE_CLOSE), //'P'*256+'C' //三次样条光滑+闭合
PLINE_OFFSET_SOLID = (PLINE_OFFSET | PLINE_SOLID), //'O'*256+'S'
PLINE_OFFSET_SOLID_B = (PLINE_OFFSET | PLINE_SOLID | PLINE_BEZIER), //'O'*256+'S'+'B'
PLINE_OFFSET_B = (PLINE_OFFSET | PLINE_BEZIER), //'O'*256+'B'
PLINE_TS = (PLINE_TRANSPARENT | PLINE_SOLID), //'T'*256+'S' //充填透明
PLINE_HS = (PLINE_TRANSPARENT_VALUE | PLINE_SOLID), //'H'*256+'S' //充填透明度
PLINE_TBS = (PLINE_TRANSPARENT | PLINE_BS), //'T'*256+'B'+'S' //B样条平滑充填透明
PLINE_T_SPLINES = (PLINE_TRANSPARENT | PLINE_SPLINES), //'T'*256+'P'+'S' //S样条平滑充填透明
PLINE_TB = (PLINE_TRANSPARENT | PLINE_BEZIER), //'T'*256+'B' //平滑透明
PLINE_TC = (PLINE_TRANSPARENT | PLINE_CLOSE), //'T'*256+'C' //闭合透明
PLINE_T_WAVE_S = (PLINE_TRANSPARENT | PLINE_WAVE_SOLID), //TAS //波浪线+充填+透明
PLINE_EMBELLISH_ALL = (PLINE_NODRAW | PLINE_SOLID | PLINE_CLOSE | PLINE_BEZIER | PLINE_SPLINE | PLINE_OFFSET | PLINE_TRANSPARENT | PLINE_TRANSPARENT_VALUE | PLINE_WAVE), //曲线修饰中的所有曲线类型
PLINE_TYPE_ALL = (PLINE_W | PLINE_MIDLE | /*PLINE_VIRTUAL|*/PLINE_DESIGN | PLINE_EMBELLISH_ALL), //曲线的所有类型
}
//上两个符号
public enum TwoMarkType
{
PLINE_FAL_DIS_IN = 0x02000000, //两符号间的距离
PLINE_FAL_DIS_HEAD = 0x04000000, //到曲线两端的距离
PLINE_FAL_DIS_ALL = (PLINE_FAL_DIS_IN | PLINE_FAL_DIS_HEAD),
}
public enum CurveLocalStyle
{
PLINE_LOCAT_TYPE_L = 0x00080000, //标注桩号值
PLINE_LOCAT_TYPE_Z = 0x00100000, //标注Z值
PLINE_LOCAT_SCALEONE = 0x00200000, //统一刻度
PLINE_LOCAT_DIRECTION = 0x00400000, //统一方向
PLINE_LOCAT_NODE = 0x00800000, //标注在节点处
PLINE_LOCAT_TO_INT = 0x01000000, //桩号取整
PLINE_LOCAT_HEAD_TAIL = 0x02000000, //标注曲线首尾桩号
PLINE_LOACT_ALL = (PLINE_LOCAT_TYPE_L | PLINE_LOCAT_TYPE_Z | PLINE_LOCAT_SCALEONE | PLINE_LOCAT_DIRECTION | PLINE_LOCAT_NODE | PLINE_LOCAT_TO_INT | PLINE_LOCAT_HEAD_TAIL),
}
public enum TextStyleFlags
{
// 水平对齐方式
alignLeft = 0x00000001, //居左
alignCenterH = 0x00000002, //水平居中
alignRight = 0x00000004, //居右(缺省)
alignLeftMult = 0x00010000, // 多行水平左对齐
alignCenterMult = 0x00020000, // 多行水平居中对齐
alignRightMult = 0x00040000, // 多行水平右对齐
alignAllPosition = (alignLeft | alignCenterH | alignRight),
alignAllMult = (alignLeftMult | alignCenterMult | alignRightMult),
// 垂直对齐方式
alignTop = 0x00000008, // 居上
alignCenterV = 0x00000010, // 垂直居中
alignBottom = 0x00000020, // 居下(缺省)
alignAllV = (alignTop | alignCenterV | alignBottom),
// 文字外框方式
frameNull = 0x00000040, // 空
frameRect = 0x00000080, // 矩形
frameCircle = 0x00000100, // 圆
frameEllipse = 0x00000200, // 椭圆
frameAll = (frameNull | frameRect | frameCircle | frameEllipse),
immovableSize = 0x00000400, // 固定文字大小,不随比例改变而改变显示大小
backgroundColor = 0x00000800, // 是否有背景颜色
noCanMoveCoor = 0x00001000 // 不能移动点类坐标
};
//曲线充填符号
public enum LineSolid
{
PLINE_SOLID_BEZIER = LineType.PLINE_BEZIER, //B样条平滑充填
PLINE_SOLID_BCLOSE = LineType.PLINE_BC, //B样条闭合平滑充填
PLINE_SOLID_SPLINE = LineType.PLINE_SPLINE, //S样条平滑充填
PLINE_SOLID_SCLOSE = LineType.PLINE_SPLINEC, //S样条平滑充填闭合
}
//名字类型
public enum CurveNameStyleType
{
NameHead,
NameTail,
}
//桩号类型
public enum CurveLocationType
{
LOCAT_TYPE_L = 0, //桩号
LOCAT_TYPE_Z = 1, //Z值
}
//渐变色类型
public enum GradientType
{
styleHorizonal = 0x00000001, //水平
styleVertical = 0x00000002, //垂直
styleDiagonalUp = 0x00000004, //斜上
styleDiagonalDown = 0x00000008, //斜下
styleCornerDiagonalUp = 0x00000010, //角部辐射(斜上)
styleCornerDiagonalDown = 0x00000020, //角部辐射(斜下)
styleCenter = 0x00000040 //中心辐射
}
public enum ColorStyleFlags
{
ModeAround = 0x0001, //循环获得颜色
ModeUseAlpha = 0x0002, //使用透明度
ModeShowSmooth = 0x0100, //颜色平滑过渡
ModeShowFixed = 0x0200, //颜色固定数目,任意指定个数后插值得到
ModeShowVariable = 0x0400, //颜色可变数目,数目与颜色个数相同
ModeShowAll = (ModeShowSmooth | ModeShowFixed | ModeShowVariable)
};
}