unit QCadGDITypes;


interface

const
 ftSolid=100;
 ftRadial=101;
 ftLinear=200;
 ftImage=600;
 ftAlpha=601;

idm_lathe=1;
idm_mill=2;
VERT=1; HORZ=0;
EPOINT=1; ELINE=2; EARC=3; ECIRCLE=4; ELINEARC=8;
ETEXT=5;  EARROW=6;ELEADER=7; EWITNESS=9; EIMAGE=10;
EPOINTLINE=10; EPOINTARC=11; EELLIPSE=12; ERECT=13;
ECLIP=14;
RADIANS=57.2957795131;

  highlight_normal=0;
  highlight_pick=1;
  highlight_group=2;
  highlight_delete=3;
  highlight_unpick=4;
  highlight_result=5;
  highlight_toolpath=6;
  highlight_hittest=7;
  HITTEST_COLOR=99;
  MAX_LAYERS=254;
  MAX_VIEWS=90;
  TOP_VIEW=1; FRONT_VIEW=2; SIDE_VIEW=3; ISO_VIEW=4;
  CDL=1;
  DXF=2;
  IGES=3;

  MAX_DRAW=100000;  // max pixels
  MIN_VIEW_HEIGHT=0.04;
  id_values=5;
id_center=6;
id_endpoint=7;
id_intersection=8;
id_midpoint=9;
id_sketch=10;
id_point=11;
id_closest=12;
id_window=13;
crZoom=10;
max_element_value=1000000000.0;



type
 TDPoint=Record x,y,z:double; end;
 TDLine=Record Point1,Point2:TDPoint; end;
 TDArc=Record Center:TDPoint; r,sa,ea:double; end;
 TElementY=record
  etype:integer;
  color:longint;
  line_type:integer;
  view:integer;
  layer:integer;
  highlight:byte;
  deleted:boolean;
  delete_number:integer;
  Tag:integer;
  coord:array[1..6] of double;
 end;

 TDView3D=Record number:integer; a1,b1,c1,a2,b2,c2,a3,b3,c3:double; end;
 TDView=(vTOP,vFRONT,vSIDE,vISO);
 TDFilter=(fAll,fPoints,fLines,fArcs,fPointLine,fPointArc,fLineArc);
 TDUnits=(uINCH,uMM);

 diline=record {infinite line}
  a:double;
  b:double;
  c:double;
end;

 dside=1..4;

 dreal=double;

 tdarcview=record
  ax,ay,az,bx,by,bz,cx,cy,cz:dreal;
  used:boolean;
 end;

 dpoint=record
  x:dreal;
  y:dreal;
  z:dreal;
 end;

 darc=record
  center:dpoint;
  r:dreal;
  sa:dreal;
  ea:dreal;
 end;

 dstring =array[0..200] of char;

 dline=record
  point1:dpoint;
  point2:dpoint;
 end;

  
 {$ifdef paintbox}
 TGPGraphics=Tcanvas;  
 {$endif}


var
 calcerrstr:array[902..908]of string;

implementation

begin
   calcerrstr[902]:='PARALLEL LINES';
   calcerrstr[903]:='UNDEFINED LINE';
   calcerrstr[904]:='ARC DOES NOT INTERSECT';
   calcerrstr[905]:='RADIUS DOES NOT INTERSECT';
   calcerrstr[906]:='CONCENTRIC CIRCLES';
   calcerrstr[907]:='CAN''T ALLOCATE MEMORY';
   calcerrstr[908]:='3 POINTS ON SAME LINE';

end.
 