Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

jAPIvectoriels.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 #ifndef jAPIvectorielsH
00003 #define jAPIvectorielsH
00004 //---------------------------------------------------------------------------
00005 
00006 #include <vector.h>
00007 #include <math.h>
00008 #include <stdio.h>
00009 
00010 double __fastcall jMATnorme(TPoint deb, TPoint fin) { return sqrt((fin.x-deb.x)*(fin.x-deb.x)+(fin.y-deb.y)*(fin.y-deb.y)); }
00011 double __fastcall jMATangle(TPoint deb, TPoint origine, TPoint fin);
00012 double __fastcall jMATlength(TPoint p) { return sqrt(p.x*p.x+p.y*p.y); }
00013 
00014 bool   __fastcall jDRWpoint(TCanvas * cv, TPoint p, int size);
00015 bool   __fastcall jDRWrectangle(TCanvas * cv, int x1, int y1, int x2, int y2);
00016 
00017 bool __fastcall jVCTcopy(vector <TPoint> * src, vector <TPoint> * dst);
00018 
00019 bool __fastcall jVCTrotation(const TPoint point, TPoint & dst, const TPoint origine, double angle);
00020 bool __fastcall jVCTrotation(const TPoint & point, const TPoint origine, double angle);
00021 
00022 bool __fastcall jVCTstretch(vector <TPoint> * src, vector <TPoint> * dst, TPoint origine, double coeffx, double coeffy);
00023 bool __fastcall jVCTstretch(vector <TPoint> * v, TPoint origine, double coeffx, double coeffy);
00024 
00025 bool __fastcall jVCTrotate(vector <TPoint> * src, vector <TPoint> * dst, TPoint origine, double angle);
00026 bool __fastcall jVCTrotate(vector <TPoint> * v, TPoint origine, double angle);
00027 
00028 bool __fastcall jVCTmove(vector <TPoint> * src, vector <TPoint> * dst, int x, int y);
00029 bool __fastcall jVCTmove(vector <TPoint> * v, int x, int y);
00030 TRect __fastcall jVCTzone(vector <TPoint> * v);
00031 bool __fastcall jVCTmove(vector <TPoint> * src, vector <TPoint> * dst, TPoint p);
00032 bool __fastcall jVCTmove(vector <TPoint> * v, TPoint p);
00033 
00034 bool __fastcall jVCTfetch(vector <TPoint> * src, vector <TPoint> * dst, TRect zone);
00035 bool __fastcall jVCTfetch(vector <TPoint> * v, TRect zone);
00036 bool __fastcall jVCTfetch(vector <TPoint> * src, vector <TPoint> * dst, TRect z_src, TRect z_dst);
00037 bool __fastcall jVCTfetch(vector <TPoint> * v, TRect z_src, TRect z_dst);
00038 
00039 bool __fastcall jVCTdirection(vector <TPoint> * src, vector <TPoint> * dst, TPoint debX, TPoint debY, bool conserveProportion = false);
00040 bool __fastcall jVCTdirection(vector <TPoint> * v, TPoint debX, TPoint debY, bool conserveProportion = false);
00041 
00042 bool __fastcall jVCTloadFromFile(vector<TPoint> * v, FILE * f);
00043 bool __fastcall jVCTsaveToFile(vector<TPoint> * v, FILE * f);
00044 bool __fastcall jVCTloadFromStream(vector<TPoint> * v, TStream * _str);
00045 bool __fastcall jVCTsaveToStream(vector<TPoint> * v, TStream * _str);
00046 
00047 TRect __fastcall jVCTunion(TRect & r1, TRect & r2);
00048 TRect __fastcall jVCTinter(TRect & r1, TRect & r2);
00049 bool __fastcall  jVCTcollision(TRect & r1, TRect & r2);
00050 bool __fastcall  jVCTinside(TRect & r1, TRect & r2);
00051 
00052 /* jVCTcenteredCadre
00053 @description EN : Find the maximal centered Cadre inside the new Cadre "container", that conserves the ratio of "content"
00054 @description FR : Trouve le cadre centré maximal dans le cadre "container", qui conserve les proportions de "content"
00055 @author : JEG
00056 @param container : the cadre containing the new Cadre
00057 @param content : the cadre to be fetch
00058 @return        : the inside centered carde 
00059 */
00060 TRect __fastcall jVCTcenteredCadre(TRect container, TRect content);
00061 
00062 // fetch the rectangle (_content) into another (_container) conserving its proportions
00063 TRect  __fastcall jVCTfetch(const TRect & _container, const TRect & _content);
00064 TPoint __fastcall jVCTfetch(const TRect & _newCadre, const TRect & _oldCadre, const TPoint & _point);
00065 
00066 bool __fastcall jDRWline(TCanvas * cv, TPoint a, TPoint b, int Size, int style, TColor couleur);
00067 bool __fastcall jDRWshape(TCanvas * cv, vector <TPoint> * v);
00068 
00069 /* jDRWtext
00070 @description EN : Allow to draw a text on a Canvas with any orientation
00071 @description FR : Permet d'écrire un texte sur un canvas avec une orientation quelconque
00072 @param _cv     : the canvas to draw on
00073 @param _text   : the text to draw
00074 @param _posX   : the x position to start writing from
00075 @param _posY   : the y position to start writing from
00076 @param _angle  : the angle of the orientation
00077 @author : CGI
00078 */
00079 bool __fastcall jDRWtext(TCanvas * cv, AnsiString _text, int _posX, int _posY, int _angle); 
00080 
00081 
00082 bool __fastcall  jVCTinside(TPoint p, vector <TPoint> * v);
00083 
00084 bool __fastcall  jPNTinside(TPoint p, TRect zone);
00085 bool __fastcall  jPNTinside(TPoint p, TPoint center, int rayon);
00086 
00087 #endif

Generated on Sat Nov 15 10:52:34 2003 for JAPI by doxygen 1.3.4