📄 fileio.cpp
字号:
min.fx = min.fy = max.fx = max.fy = 0.0f; return true; case FILE_READ: ExecInput(Desc); nPnt = i; nPntSet = i-1; if(file2)FileValues(file2, 1, 0.0f, 1.0f); else if(file1)FileValues(file1, 2, Start, fabs(Step) > defs.min4log ? Step : 1.0); if(file1) free(file1); if(file2) free(file2); pgFill.hatch = &pgFillLine; if(i && Values)return true; break; case FILE_WRITE: i = nPntSet+1; return ExecOutput(Notary->RegisterGO(this), "DataPolygon", Desc); } return false;}boolRegLine::FileIO(int rw){ descIO Desc[] = { {"type", typNZINT, &type, 0L}, {"nPoints", typINT, &nPoints, 0L}, {"BgCol", typDWORD, &BgColor, 0L}, {"Line", typLINEDEF, &LineDef, 0L}, {"Range", typFRECT, &lim, 0L}, {"uClip", typFRECT, &uclip, 0L}, {"mx", typNZLFLOAT, &mx, 0L}, {"my", typNZLFLOAT, &my, 0L}, {"li1", typLFPOINT, &l1, 0L}, {"li2", typLFPOINT, &l2, 0L}, {"li3", typLFPOINT, &l3, 0L}, {"li4", typLFPOINT, &l4, 0L}, {"li5", typLAST | typLFPOINT, &l5, 0L}}; switch(rw) { case INIT_VARS: InitVarsGO(Desc); cp = 0; memcpy(&LineDef, defs.GetLine(), sizeof(LineDEF)); BgColor = defs.Color(COL_BG); pts = 0L; return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "RegLine", Desc); } return false;}
void
SDellipse::RegGO(void *n)
{
if(n) {
if(rl)rl->RegGO(n);
((notary*)n)->AddRegGO(this);
}
}
boolSDellipse::FileIO(int rw){ descIO Desc[] = { {"type", typNZINT, &type, 0L}, {"Line", typLINEDEF, &LineDef, 0L}, {"Range", typFRECT, &lim, 0L}, {"Regr", typGOBJ, &rl, 0L}, {"Data", typLAST | typFPLST, &val, &nPoints}}; switch(rw) { case INIT_VARS: InitVarsGO(Desc); memcpy(&LineDef, defs.GetOutLine(), sizeof(LineDEF)); pts = 0L; return true; case FILE_READ: ExecInput(Desc); if(rl) rl->parent = this; return true; case FILE_WRITE: if(rl) rl->FileIO(rw); return ExecOutput(Notary->RegisterGO(this), "SDellipse", Desc); } return false;}boolErrorBar::FileIO(int rw){ descIO Desc[] = { {"Type", typNZINT, &type, 0L}, {"ssRef", typIPLST, &ssRef, &cssRef}, {"Pos", typLFPOINT, &fPos, 0L}, {"Err", typLFLOAT, &ferr, 0L}, {"Size", typLFLOAT, &SizeBar, 0L}, {"Line", typLAST | typLINEDEF, &ErrLine, 0L}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); SizeBar = defs.GetSize(SIZE_ERRBAR); ErrLine.width = defs.GetSize(SIZE_ERRBAR_LINE); ErrLine.color = defs.Color(COL_SYM_LINE); return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "ErrorBar", Desc); } return false;}boolArrow::FileIO(int rw){ descIO Desc[] = { {"Type", typNZINT, &type, 0L}, {"ssRef", typIPLST, &ssRef, &cssRef}, {"moveable", typNZINT, &moveable, 0L}, {"p1", typLFPOINT, &pos1, 0L}, {"p2", typLFPOINT, &pos2, 0L}, {"CapW", typLFLOAT, &cw, 0L}, {"CapL", typLFLOAT, &cl, 0L}, {"Line", typLAST | typLINEDEF, &LineDef, 0L}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); cw = defs.GetSize(SIZE_ARROW_CAPWIDTH); cl = defs.GetSize(SIZE_ARROW_CAPLENGTH); LineDef.color = parent ? parent->GetColor(COL_DATA_LINE) : defs.Color(COL_DATA_LINE); LineDef.width = parent ? parent->GetSize(SIZE_ARROW_LINE) : defs.GetSize(SIZE_ARROW_LINE); type = ARROW_LINE; dh1 = dh2 = 0L; return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "Arrow", Desc); } return false;}boolBox::FileIO(int rw){ descIO Desc[] = { {"Type", typNZINT, &type, 0L}, {"ssRef", typIPLST, &ssRef, &cssRef}, {"High", typLFPOINT, &pos1, 0L}, {"Low", typLFPOINT, &pos2, 0L}, {"Size", typLFLOAT, &size, 0L}, {"Line", typLINEDEF, &Outline, 0L}, {"FillLine", typLINEDEF, &Hatchline, 0L}, {"Fill", typFILLDEF, &Fill, 0L}, {"Name", typLAST | typTEXT, &name, 0L}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); memcpy(&Outline, defs.GetOutLine(), sizeof(LineDEF)); memcpy(&Fill, defs.GetFill(), sizeof(FillDEF)); if(Fill.hatch)memcpy(&Hatchline, Fill.hatch, sizeof(LineDEF)); Fill.hatch = &Hatchline; size = defs.GetSize(SIZE_BAR); ssRef = 0L; return true; case FILE_READ: ExecInput(Desc); Fill.hatch = &Hatchline; return true; case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "Box", Desc); } return false;}boolWhisker::FileIO(int rw){ descIO Desc[] = { {"Type", typNZINT, &type, 0L}, {"ssRef", typIPLST, &ssRef, &cssRef}, {"High", typLFPOINT, &pos1, 0L}, {"Low", typLFPOINT, &pos2, 0L}, {"Size", typLFLOAT, &size, 0L}, {"Line", typLAST | typLINEDEF, &LineDef, 0L}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); size = defs.GetSize(SIZE_WHISKER); LineDef.width = defs.GetSize(SIZE_WHISKER_LINE); LineDef.color = defs.Color(COL_WHISKER); return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "Whisker", Desc); } return false;}boolDropLine::FileIO(int rw){ descIO Desc[] = { {"Type", typINT, &type, 0L}, {"ssRef", typIPLST, &ssRef, &cssRef}, {"Pos", typLFPOINT, &fPos, 0L}, {"Line", typLAST | typLINEDEF, &LineDef, 0L}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); LineDef.color = defs.Color(COL_SYM_LINE); return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "DropLine", Desc); } return false;}boolSphere::FileIO(int rw){ descIO Desc[] = { {"Type", typNZINT, &type, 0L}, {"Line", typLINEDEF, &Line, 0L}, {"Fill", typFILLDEF, &Fill, 0L}, {"Pos", typPOINT3D, &fPos, 0L}, {"Size", typLFLOAT, &size, 0L}, {"ssRef", typLAST | typIPLST, &ssRef, &cssRef}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); size = defs.GetSize(SIZE_SYMBOL); Line.color = defs.Color(COL_SYM_LINE); Line.width = defs.GetSize(SIZE_SYM_LINE); Fill.color = defs.Color(COL_SYM_FILL); scl = 0L; nscl = 0; return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "Sphere", Desc); } return false;}boolPlane3D::FileIO(int rw){ descIO Desc[] = { {"Line", typLINEDEF, &Line, 0L}, {"Fill", typFILLDEF, &Fill, 0L}, {"values", typLAST | typFPLST3D, &dt, &ndt}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); ipl = 0L; pts = 0L; return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "Plane3D", Desc); } return false;}boolBrick::FileIO(int rw){ descIO Desc[] = { {"Line", typLINEDEF, &Line, 0L}, {"Fill", typFILLDEF, &Fill, 0L}, {"Pos", typPOINT3D, &fPos, 0L}, {"depth", typLFLOAT, &depth, 0L}, {"width", typLFLOAT, &width, 0L}, {"height", typLFLOAT, &height, 0L}, {"flags", typDWORD, &flags, 0L}, {"ssRef", typLAST | typIPLST, &ssRef, &cssRef}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); Line.color = defs.Color(COL_SYM_LINE); Line.width = defs.GetSize(SIZE_SYM_LINE); Fill.color = defs.Color(COL_SYM_FILL); faces = (plane**)calloc(6, sizeof(plane*)); mrc.left = mrc.right = mrc.top = mrc.bottom = 0;
mo = 0L;
return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "Brick", Desc); } return false;}boolDropLine3D::FileIO(int rw){ descIO Desc[] = { {"Type", typINT, &type, 0L}, {"Line", typLINEDEF, &Line, 0L}, {"Pos", typPOINT3D, &fPos, 0L}, {"ssRef", typLAST | typIPLST, &ssRef, &cssRef}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); Line.color = defs.Color(COL_SYM_LINE); Line.width = defs.GetSize(SIZE_HAIRLINE); mo = 0L; mrc.left = mrc.right = mrc.top = mrc.bottom = 0; ls[0] = ls[1] = ls[2] = ls[3] = ls[4] = ls[5] = 0L; return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "DropLine3D", Desc); } return false;}boolArrow3D::FileIO(int rw){ descIO Desc[] = { {"Type", typINT, &type, 0L}, {"Line", typLINEDEF, &Line, 0L}, {"Org", typPOINT3D, &fPos1, 0L}, {"Pos", typPOINT3D, &fPos2, 0L}, {"CapW", typLFLOAT, &cw, 0L}, {"CapL", typLFLOAT, &cl, 0L}, {"ssRef", typLAST | typIPLST, &ssRef, &cssRef}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); cw = defs.GetSize(SIZE_ARROW_CAPWIDTH); cl = defs.GetSize(SIZE_ARROW_CAPLENGTH); Line.color = defs.Color(COL_ARROW); Line.width = defs.GetSize(SIZE_ARROW_LINE); ls[0] = ls[1] = ls[2] = 0L; cap = 0L; type = ARROW_LINE; return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "Arrow3D", Desc); } return false;}boolLine3D::FileIO(int rw){ descIO Desc[] = { {"Line", typLINEDEF, &Line, 0L}, {"ssRefX", typTEXT, &x_range, 0L}, {"ssRefY", typTEXT, &y_range, 0L}, {"ssRefZ", typTEXT, &z_range, 0L}, {"ssRef", typIPLST, &ssRef, &cssRef},
{"values", typLAST | typFPLST3D, &values, &nPts}}; switch(rw) { case SAVE_VARS:
return SaveVarGO(Desc);
case INIT_VARS: InitVarsGO(Desc); Line.color = defs.Color(COL_DATA_LINE); Line.width = defs.GetSize(SIZE_DATA_LINE); ls = 0L; pts = 0L; npts = 0L; mo=0L; mrc.left = mrc.right = mrc.top = mrc.bottom = 0; min.fx = min.fy = min.fz = max.fx = max.fy = max.fz = 0.0; return true; case FILE_READ: ExecInput(Desc); if(nPts > 1) ls = (line_segment **)calloc(nPts-1, sizeof(line_segment*)); return true; case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "Line3D", Desc); } return false;}boolLabel::FileIO(int rw){ descIO Desc[] = { {"ssRef", typIPLST, &ssRef, &cssRef}, {"moveable", typNZINT, &moveable, 0L}, {"Pos", typNZLFPOINT, &fPos, 0L}, {"Dist", typNZLFPOINT, &fDist, 0L}, {"Flags", typDWORD, &flags, 0L}, {"TxtDef", typLAST | typTXTDEF, &TextDef, 0L}}; switch(rw) { case SAVE_VARS: return SaveVarGO(Desc); case INIT_VARS: InitVarsGO(Desc); TextDef.ColTxt = 0x0L; TextDef.ColBg = 0x00ffffffL; TextDef.fSize = defs.GetSize(SIZE_TEXT); TextDef.RotBL = TextDef.RotCHAR = 0.0; TextDef.iSize = 0; TextDef.Align = TXA_VTOP | TXA_HLEFT; TextDef.Mode = TXM_TRANSPARENT; TextDef.Style = TXS_NORMAL; TextDef.Font = FONT_HELVETICA; TextDef.text = 0L; bgcolor = 0x00ffffffL; bgLine.width = 0.0; bgLine.patlength = 6.0; bgLine.color = bgcolor; bgLine.pattern = 0L; CursorPos = 0; defDisp = 0L; bBGvalid = bModified = false; curr_z = 0.0; is3D = false; fmt_txt = 0L;
return true; case FILE_READ: return ExecInput(Desc); case FILE_WRITE: return ExecOutput(Notary->RegisterGO(this), "Label", Desc); } return false;}
void
mLabel::RegGO(void *n)
{
int i;
if(n) {
if(Lines) for(i = 0; i < nLines; i++) if(Lines[i]) Lines[i]->RegGO(n);
((notary*)n)->AddRegGO(this);
}
}
boolmLabel::FileIO(int rw){ descIO Desc[] = { {"moveable", typNZINT, &moveable, 0L}, {"Pos", typNZLFPOINT, &fPos, 0L}, {"Dist", typNZLFPOINT, &fDist, 0L},
{"lspc", typLFLOAT, &lspc, 0L}, {"Flags", typDWORD, &flags, 0L},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -