* k22; = k11 * k22-k12 * k21; = b1 * k22-b2 * k12; = k11 * b2-b1 * k21; (d! = 0) = dx/d; = dx; (d! = 0) = dy/d; = dy; Result = False ;//*** дефолтовая НЕ перетинаються (
(((x11 <= x) && (x <= x12)) && ((y11 <= y) && (y <= y12)) | |
((x12 <= x) && (x <= x11)) && ((y11 <= y) && (y <= y12)) | |
((x11 <= x) && (x <= x12)) && ((y12 <= y) && (y <= y11)) | |
((x12 <= x) && (x <= x11)) && ((y12 <= y) && (y <= y11)))
&&
(((x21 <= x) && (x <= x22)) && ((y21 <= y) && (y <= y22)) | |
((x22 <= x) && (x <= x21)) && ((y21 <= y) && (y <= y22)) | |
((x21 <= x) && (x <= x22)) && ((y22 <= y) && (y <= y21)) | |
((x22 <= x) && (x <= x21)) && ((y22 <= y) && (y <= y21)))) = True; (Result );
}; TTriangleLst :: Filter ()
{* Item; Accept; = (TTriangle *) FirstItem; (Item)
{= False; ((Cross (& (Item-> A), Line)) | |
(Cross (& (Item-> B), Line)) | |
(Cross (& (Item-> C), Line))) = Tr ue; (Accept)
{> Crossed = True;
}; = (TTriangle *) Item-> Next;
};
}; TTriangleLst :: Repaint ()
{:: Repaint ();> Draw ();
}; TProgaMenu: public TControlLst
{: Repaint ();
}; TProga: public TApplication
{: Menu; Tag; Lines; MainMenu (); onNew; onLoad; onSave; onRun; onExit; doNew (void * Sender); doLoad (void * Sender); doSave (void * Sender); doExit (void * Sender); doRun (void * Sender); BkRepaint (); ();
};
// ********************************************* **********
// RealiZation
// ********************************************* **********
// *** TControl methods :: TControl (Byte AX, Byte AY, TCaption ACaption, Byte ACol, Byte ABkCol, Byte AActiveCol, int ATag)
{= efNext; = AX; = AY; (Caption, ACaption); = ACol; = ABkCol; = AActiveCol; = False; = ATag;
}; TControl :: SetClr (Byte AItem, Byte ACol)
{(AItem)
{0: Color = ACol; break; 1: ActiveCol = ACol; break; 2: BkCol = ACol;
};
}; TControl :: Enter ()
{= True; ();
}; TControl :: Exit ()
{= False; ();
};
// *** TButtons methods :: TButton (TApplication * AOwner, Byte AX, Byte AY, TCaption ACaption, int ATag, PAppButtonClick AClick): (AX, AY, ACaption, BLUE, LIGHTGRAY, RED, ATag)
{= AOwner; = AClick; ();
}; TButton :: Draw ()
{text_info ti; (& ti); (X, Y); (Active) (ActiveCol); (BkCol); (Color); (int I = 0; I
}; TButton :: Enter ()
{:: Enter (); ();
}; TButton :: Run ()
{Key; CtrlKey; Quit; = False;
{(& Key, & CtrlKey); (Key)
{VK_UP: if (CtrlKey)
{= True; = efPrev;
}; break; VK_ENTER:
{= True; = efNext;
((Owner) -> * onClick) (this);
}; break; VK_DOWN: if (CtrlKey)
{= True; = efNext;
}; break; VK_ESC:
{= Tr...