00001 /************************************************************************* 00002 * $Id: idcnt3d.h,v 1.1 2005/09/09 08:22:27 bellet Exp $ 00003 ************************************************************************** 00004 This software is governed by the CeCILL license under French law and 00005 abiding by the rules of distribution of free software. You can use, 00006 modify and/ or redistribute the software under the terms of the CeCILL 00007 license as circulated by CEA, CNRS and INRIA at the following URL 00008 "http://www.cecill.info". 00009 00010 As a counterpart to the access to the source code and rights to copy, 00011 modify and redistribute granted by the license, users are provided only 00012 with a limited warranty and the software's author, the holder of the 00013 economic rights, and the successive licensors have only limited 00014 liability. 00015 00016 In this respect, the user's attention is drawn to the risks associated 00017 with loading, using, modifying and/or developing or reproducing the 00018 software by the user in light of its specific status of free software, 00019 that may mean that it is complicated to manipulate, and that also 00020 therefore means that it is reserved for developers and experienced 00021 professionals having in-depth computer knowledge. Users are therefore 00022 encouraged to load and test the software's suitability as regards their 00023 requirements in conditions enabling the security of their systems and/or 00024 data to be ensured and, more generally, to use and operate it in the 00025 same conditions as regards security. 00026 00027 The fact that you are presently reading this means that you have had 00028 knowledge of the CeCILL license and that you accept its terms. 00029 00030 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00031 l'Image). All rights reserved. See License.txt for details. 00032 00033 Version 1.0 05/09/2005 00034 *************************************************************************/ 00035 00036 #ifndef __IDCNT3D_H__ 00037 #define __IDCNT3D_H__ 00038 #include "idgen.h" 00039 //#include "idima.h" 00040 #include "idpoint.h" 00041 00042 /* 00043 * Declarations diverses permettant d'utiliser le type CNT3 of IDO 00044 */ 00045 00046 /* structure CONTOUR3D */ 00047 00048 #define CNT3D_FLOAT (CNT3D | TY_IDPOINT) 00049 typedef void * PCONTOUR3D ; 00050 typedef PIDPOINT * PCONTOUR3D_FLOAT ; /* PIDPOINT !! */ 00051 typedef struct { 00052 int UsedNbX; /* JPR */ 00053 int __dum; /* pour alignement frontiere Double Mot */ 00054 int DimX; 00055 int Numero; 00056 char *_message,*_fichier; 00057 int BitsPerPixel; /* nombre de bits reellement utilises */ 00058 int Type; /* IMPERATIVEMENT DERNIER DE LA STRUCTURE */ 00059 00060 } PRIVATE_CONTOUR3D; 00061 00062 00063 #define _IdCnt3DPrivate(cnt) (((PRIVATE_CONTOUR3D*)(cnt))-1) 00064 00065 #include "idcnt3d-restricted.h" 00066 00067 #ifndef SWIG 00068 #define IdCnt3DDimX(cnt_) ( _IdCnt3DPrivate(cnt_)->DimX) 00069 #define IdCnt3DUsedNbX(cnt_) ( _IdCnt3DPrivate(cnt_)->UsedNbX) 00070 #define IdCnt3DUsedNbPts(cnt_) ( _IdCnt3DPrivate(cnt_)->UsedNbX) 00071 #define IdCnt3DSetUsedNbX(cnt_,nb) ( _IdCnt3DPrivate(cnt_)->UsedNbX=(nb) ) 00072 #define IdCnt3DSetUsedNbPts(cnt_,nb) ( _IdCnt3DPrivate(cnt_)->UsedNbX=(nb) ) 00073 #define IdCnt3DGetUsedNbPts(cnt_) ( _IdCnt3DPrivate(cnt_)->UsedNbX) 00074 #define IdCnt3DGetUsedNbX(cnt_) ( _IdCnt3DPrivate(cnt_)->UsedNbX) 00075 #define IdCnt3DType(cnt_) ( _IdCnt3DPrivate(cnt_)->Type) 00076 00077 #else 00078 int IdCnt3DDimX(PCONTOUR3D); 00079 int IdCnt3DUsedNbX(PCONTOUR3D); 00080 int IdCnt3DNbPts(PCONTOUR3D); 00081 int IdCnt3DUsedNbPts(PCONTOUR3D); 00082 int IdCnt3DSetUsedNbX(PCONTOUR3D,int); 00083 int IdCnt3DGetUsedNbPts(PCONTOUR3D); 00084 int IdCnt3DGetUsedNbX(PCONTOUR3D); 00085 int IdCnt3DType(PCONTOUR3D); 00086 #endif 00087 00088 #ifndef SWIG 00089 #define IdCnt3DNbPts(cnt_) ( _IdCnt3DPrivate(cnt_)->DimX) 00090 #define IdCnt3DSetY(contour_,i,val) (contour_)[(i)]->Y=(val) 00091 #define IdCnt3DSetX(contour_,i,val) (contour_)[(i)]->X=(val) 00092 #define IdCnt3DSetZ(contour_,i,val) (contour_)[(i)]->Z=(val) 00093 #define IdCnt3DGetX(contour_,i) (contour_)[(i)]->X 00094 #define IdCnt3DGetY(contour_,i) (contour_)[(i)]->Y 00095 #define IdCnt3DGetZ(contour_,i) (contour_)[(i)]->Z 00096 #define IdCnt3DModifyPoint(contour_,i,valx,valy,valz) \ 00097 (contour_)[(i)]->X=(valx),(contour_)[(i)]->Y=(valy),(contour_)[(i)]->Z=(valz) 00098 #define IdCnt3DAllocLikeContour(cn) ((!(cn)) ? 0 \ 00099 : IdCnt3DAlloc ( IdCnt3DDimX(cn),IdCnt3DType(cn) )) 00100 #define IdCnt3DSameSizeAndType(i1,i2) ( (i1)&&(i2) \ 00101 && (IdCnt3DDimX(i1)==IdCnt3DDimX(i2)) \ 00102 && (IdCnt3DType(i1)==IdCnt3DType(i2)) ) 00103 #define IdCnt3DSameSize(i1,i2) ( (i1)&&(i2) \ 00104 && (IdCnt3DDimX(i1)==IdCnt3DDimX(i2)) ) 00105 #endif 00106 /* FUNCTION DESCRIPTION ************************************************** 00107 00108 IdCnt3DNbPts (macro) 00109 00110 RESUME: donne le points d'un CONTOUR3D (PCONTOUR3D) (identique a IdCnt3DDimX ...) 00111 00112 DESCRIPTION: donne le points d'un CONTOUR3D (identique a IdCnt3DDimX ...) 00113 (celui precise lors de l'allocation ou de la modif de longueur) 00114 00115 SYNTAXE: int nbrPts = IdCnt3DNbPts (PCONTOUR3D cnt1); 00116 00117 PARAMETRES: nom : cnt1 00118 type : PCONTOUR3D 00119 role : Pointeur vers le contour source 00120 00121 FICHIER: idcnt3d.h 00122 EXEMPLE: 00123 00124 ******************************************************** END DESCRIPTION */ 00125 00126 00127 /* FUNCTION DESCRIPTION ************************************************** 00128 00129 IdCnt3DType (macro) 00130 00131 RESUME: Donne le type d'un contour (PCONTOUR3D) LibIDO. 00132 00133 DESCRIPTION: Donne le type d'un contour LibIDO. 00134 00135 SYNTAXE: int typ_cn = IdCnt3DType (PCONTOUR3D cn); 00136 00137 RETOUR: type : int 00138 role : Type du contour Libido. #defini par le tableau suivant : 00139 00140 #define CNT3D_FLOAT (CNT3D | TY_FLOAT) 00141 00142 Les autres, pas definis... 00143 00144 #define CNT3D_CHAR (CNT3D | TY_CHAR) 00145 #define CNT3D_UCHAR (CNT3D | TY_UCHAR) 00146 #define CNT3D_SHORT (CNT3D | TY_SHORT) 00147 #define CNT3D_USHORT (CNT3D | TY_USHORT) 00148 #define CNT3D_LONG (CNT3D | TY_LONG) 00149 #define CNT3D_FLOAT (CNT3D | TY_FLOAT) 00150 #define CNT3D_DOUBLE (CNT3D | TY_DOUBLE) 00151 00152 00153 PARAMETRES: nom : cn 00154 type : Objet contour3D LibIDO 00155 role : contour3D LibIDO a scruter 00156 00157 FICHIER: idcnt3d.h 00158 00159 EXEMPLE: 00160 00161 ******************************************************** END DESCRIPTION */ 00162 00163 00164 00165 /* FUNCTION DESCRIPTION ************************************************** 00166 00167 IdCnt3DGetUsedNbPts (macro) 00168 00169 RESUME: donne le nb de points UTILISES d'un CONTOUR3D (PCONTOUR3D) 00170 00171 DESCRIPTION: donne le nb de points UTILISES d'un CONTOUR3D 00172 00173 SYNTAXE: int nbPtsUtilises = IdCnt3DGetUsedNbPts (PCONTOUR3D cnt); 00174 00175 PARAMETRES: nom : ima 00176 type : PCONTOUR3D 00177 acces : I, N 00178 role : Pointeur vers le contour source 00179 00180 FICHIER: idcnt3d.h 00181 00182 EXEMPLE: 00183 00184 ******************************************************** END DESCRIPTION */ 00185 00186 00187 /* FUNCTION DESCRIPTION ************************************************** 00188 00189 IdCnt3DSetY (macro) 00190 00191 RESUME: Positionne la valeur de la coord. Y d'un point d'un contour (PCONTOUR3D) 00192 00193 DESCRIPTION: Positionne la valeur de la coord. Y d'un point d'un contour. 00194 Le point DOIT deja exister. 00195 00196 SYNTAXE: void IdCntSetY(PCONTOUR3D cnt, int numPoint, nombre coordY); 00197 00198 RETOUR: type : rien 00199 role : 00200 00201 PARAMETRES: 00202 nom : cnt 00203 type : PCONTOUR3D 00204 role : contour d'origine. 00205 00206 nom : i 00207 type : entier 00208 role : numero du point a modifier 00209 00210 nom : val 00211 type : entier, ou double, ou ... 00212 role : coordonne Y du point a modifier 00213 00214 FICHIER: idcnt3d.h 00215 00216 EXEMPLE: 00217 ******************************************************** END DESCRIPTION */ 00218 00219 00220 /* FUNCTION DESCRIPTION ************************************************** 00221 00222 IdCnt3DSetX (macro) 00223 00224 RESUME: Positionne la valeur de la coord. X d'un point d'un contour3D (PCONTOUR3D) 00225 00226 DESCRIPTION: Positionne la valeur de la coordonnee X d'un point d'un contour3D. 00227 Le point DOIT deja exister. 00228 00229 SYNTAXE: void IdCnt3DSetX(PCONTOUR3D cnt, int numPoint , nombre coordX); 00230 00231 RETOUR: type : rien 00232 role : 00233 00234 PARAMETRES: 00235 nom : cnt 00236 type : PCONTOUR3D 00237 role : contour d'origine. 00238 00239 nom : i 00240 type : entier 00241 role : numero du point a modifier 00242 00243 nom : val 00244 type : entier, ou double, ou ... 00245 role : coordonne X du point a modifier 00246 00247 FICHIER: idcnt3d.h 00248 00249 EXEMPLE: 00250 00251 ******************************************************** END DESCRIPTION */ 00252 00253 00254 00255 /* FUNCTION DESCRIPTION ************************************************** 00256 00257 IdCnt3DSetZ (macro) 00258 00259 RESUME: Positionne la valeur de la coord. Z d'un point d'un contour3D (PCONTOUR3D) 00260 00261 DESCRIPTION: Positionne la valeur de la coordonnee Z d'un point d'un contour3D. 00262 Le point DOIT deja exister. 00263 00264 SYNTAXE: void IdCnt3DSetZ(PCONTOUR3D cnt, int numPoint , nombre coordX); 00265 00266 RETOUR: type : rien 00267 role : 00268 00269 PARAMETRES: 00270 nom : cnt 00271 type : PCONTOUR3D 00272 role : contour d'origine. 00273 00274 nom : i 00275 type : entier 00276 role : numero du point a modifier 00277 00278 nom : val 00279 type : entier, ou double, ou ... 00280 role : coordonnee Z du point a modifier 00281 00282 FICHIER: idcnt3d.h 00283 00284 EXEMPLE: 00285 00286 ******************************************************** END DESCRIPTION */ 00287 00288 00289 00290 /* FUNCTION DESCRIPTION ************************************************** 00291 00292 IdCnt3DGetX (macro) 00293 00294 RESUME: Recupere la valeur de la coord. X d'un point d'un contour 3D (PCONTOUR3D) 00295 00296 DESCRIPTION: Recupere la valeur de la coordonnee X d'un point d'un contour 3D. 00297 Le point DOIT deja exister. 00298 00299 SYNTAXE: double valCoordX = IdCnt3DGetX(PCONTOUR3D cnt,int numPoint); 00300 00301 RETOUR: type : entier, ou double, ou ... 00302 role : 00303 00304 PARAMETRES: 00305 nom : cnt 00306 type : PCONTOUR3D 00307 role : contour d'origine. 00308 00309 nom : i 00310 type : entier 00311 role : numero du point dont on veut la coordonnee X 00312 00313 FICHIER: idcnt3d.h 00314 00315 EXEMPLE: 00316 00317 ******************************************************** END DESCRIPTION */ 00318 00319 00320 /* FUNCTION DESCRIPTION ************************************************** 00321 00322 IdCnt3DGetY (macro) 00323 00324 RESUME: Recupere la valeur de la coord. Y d'un point d'un contour 3D (PCONTOUR3D) 00325 00326 DESCRIPTION: Recupere la valeur de la coordonnee Y d'un point d'un contour 3D. 00327 Le point DOIT deja exister. 00328 00329 SYNTAXE: nombre valCoordy = IdCnt3DGetY(PCONTOUR3D cnt,int numPoint); 00330 00331 RETOUR: type : entier, ou double, ou ... 00332 role : 00333 00334 PARAMETRES: 00335 nom : cnt 00336 type : PCONTOUR3D 00337 role : contour d'origine. 00338 00339 nom : i 00340 type : entier 00341 role : numero du point dont on veut la coordonnee y 00342 00343 FICHIER: idcnt3d.h 00344 00345 EXEMPLE: 00346 00347 ******************************************************** END DESCRIPTION */ 00348 00349 00350 /* FUNCTION DESCRIPTION ************************************************** 00351 00352 IdCnt3DGetZ (macro) 00353 00354 RESUME: Recupere la valeur de la coord. Z d'un point d'un contour 3D (PCONTOUR3D) 00355 00356 DESCRIPTION: Recupere la valeur de la coordonnee Y d'un point d'un contour 3D. 00357 Le point DOIT deja exister. 00358 00359 SYNTAXE: nombre valCoordZ = IdCnt3DGetZ(PCONTOUR3D cnt,int numPoint); 00360 00361 RETOUR: type : entier, ou double, ou ... 00362 role : 00363 00364 PARAMETRES: 00365 nom : cnt 00366 type : PCONTOUR3D 00367 role : contour d'origine. 00368 00369 nom : i 00370 type : entier 00371 role : numero du point dont on veut la coordonnee Z 00372 00373 FICHIER: idcnt3d.h 00374 00375 EXEMPLE: 00376 00377 ******************************************************** END DESCRIPTION */ 00378 00379 00380 /* FUNCTION DESCRIPTION ************************************************** 00381 00382 IdCnt3DModifyPoint (macro) 00383 00384 RESUME: Modifie la valeur des coord. X Y Z d'1 point d'un contour 3D (PCONTOUR3D) 00385 00386 DESCRIPTION: Positionne la valeur des coord. X Y d'un point d'un contour 3D. 00387 Le point DOIT deja exister (aucun controle !!!). 00388 00389 SYNTAXE: void IdCnt3DSetY(PCONTOUR3D cnt, int numPoint, nombre coordX, nombre coordY); 00390 00391 RETOUR: type : rien 00392 role : 00393 00394 PARAMETRES: 00395 nom : cnt 00396 type : PCONTOUR3D 00397 role : contour d'origine. 00398 00399 nom : i 00400 type : entier 00401 role : numero du point a modifier 00402 00403 nom : coordX, coordY, coordZ 00404 type : entier, ou double, ou ... 00405 role : coordonne Y du point a modifier 00406 00407 FICHIER: idcnt.h 00408 00409 EXEMPLE: 00410 00411 ******************************************************** END DESCRIPTION */ 00412 00413 00414 00415 /* FUNCTION DESCRIPTION ************************************************** 00416 00417 IdCnt3DAllocLikeContour (macro) 00418 00419 RESUME: Alloc. d'1 contour 3D (PCONTOUR3D) de memes taille et type qu'1 autre 00420 00421 DESCRIPTION: Allocation d'un contour 3D de memes taille et meme type 00422 qu'un autre. 00423 00424 SYNTAXE: PCONTOUR3D cnt2 = IdCnt3DAllocLikeContour (PCONTOUR3D cnt1 ); 00425 00426 RETOUR: type : PCONTOUR3D 00427 role : Pointeur vers le contour 3D alloue (a convertir en un type 00428 valide : PCONTOUR3D_FLOAT par exemple ). 00429 00430 00431 PARAMETRES: nom : contour1 00432 type : PCONTOUR3D, ou PCONTOUR3D_??? 00433 role : Pointeur vers le contour 'modele'. 00434 00435 FICHIER: idcnt3d.h 00436 00437 ******************************************************** END DESCRIPTION */ 00438 00439 00440 /* FUNCTION DESCRIPTION ************************************************** 00441 00442 IdCnt3DSameSizeAndType (macro) 00443 00444 RESUME: Comparaison du type et de la taille de deux contours 3D (PCONTOUR3D). 00445 00446 DESCRIPTION: Comparaison du type et de la taille de deux contours 3D. 00447 00448 SYNTAXE: int retCode = IdCnt3DSameSizeAndType(PCONTOUR3D cnt1, PCONTOUR3D cnt2 ); 00449 00450 RETOUR: type : int 00451 role : Vrai si les deux contours EXISTENT et ont la meme taille et 00452 le meme type. 00453 00454 PARAMETRES: nom : cnt1, cnt2 00455 type : PCONTOUR3D, ou PCONTOUR3D_??? 00456 role : Pointeurs vers les contours a comparer. 00457 00458 FICHIER : idcnt3d.h 00459 00460 ******************************************************** END DESCRIPTION */ 00461 00462 00463 00464 00465 /* FUNCTION DESCRIPTION ************************************************** 00466 00467 IdCnt3DSameSize (macro) 00468 00469 RESUME: Comparaison de la taille de deux contours 3D (PCONTOUR3D). 00470 00471 DESCRIPTION: Comparaison de la taille de deux contours 3D. 00472 00473 SYNTAXE: int retCode = IdCnt3DSameSize(PCONTOUR3D cnt1, PCONTOUR3D cnt2); 00474 00475 RETOUR: type : int 00476 role : Vrai si les deux contours EXISTENT et ont la meme taille 00477 00478 PARAMETRES: nom : cnt1, cnt2 00479 type : PCONTOUR3D, ou PCONTOUR3D_??? 00480 role : Pointeurs vers les contours 3D a comparer. 00481 00482 FICHIER : idcnt3d.h 00483 00484 ******************************************************** END DESCRIPTION */ 00485 00486 00487 /* FUNCTION DESCRIPTION ************************************************** 00488 00489 IdCnt3DSameType (macro) 00490 00491 RESUME: Comparaison du type de deux contours 3D (PCONTOUR3D). 00492 00493 DESCRIPTION: Comparaison du type de deux contours 3D. 00494 00495 SYNTAXE: int retCode = IdCnt3DSameType(PCONTOUR3D cnt1, PCONTOUR3D cnt2 ); 00496 00497 RETOUR: type : int 00498 role : Vrai si les deux contours 3D EXISTENT et ont le meme type. 00499 00500 PARAMETRES: nom : cnt1, cnt2 00501 type : PCONTOUR3D, ou PCONTOUR3D_??? 00502 role : Pointeurs vers les contours 3D a comparer. 00503 00504 FICHIER : idcnt3d.h 00505 00506 ******************************************************** END DESCRIPTION */ 00507 00508 PCONTOUR3D IdCnt3DAlloc (int, int); 00509 00510 PCONTOUR3D IdCnt3DClear (PCONTOUR3D); 00511 PCONTOUR3D IdCnt3DCopy (PCONTOUR3D,PCONTOUR3D); 00512 00513 #ifndef SWIG 00514 #define IdCnt3DSameType(i1,i2) ( (i1)&&(i2) \ 00515 && (IdCnt3DType(i1)==IdCnt3DType(i2)) ) 00516 00517 #define IdCnt3DFree(contour_) \ 00518 _IdCnt3DFree((PCONTOUR3D*)&(contour_)) 00519 00520 #define IdCnt3DDestroyNoControl(contour_) \ 00521 _IdCnt3DDestroyNoControl((PCONTOUR3D*)&(contour_)) 00522 00523 #define IdCnt3DAddPoint(contour_,x,y,z,n) \ 00524 _IdCnt3DAddPoint(&(contour_), (x), (y), (z), (n) ) 00525 00526 #define IdCnt3DAddPnt(contour_,p) \ 00527 _IdCnt3DAddPnt(&(contour_),(p) ) 00528 #define IdCnt3DInsertPnt(contour_,numPoint,p) \ 00529 _IdCnt3DInsertPnt(&(contour_),(numPoint),(p)) 00530 00531 #define IdCnt3DInsertPoint(contour_,numPoint,x,y,z,n) \ 00532 _IdCnt3DInsertPoint(&(contour_),(numPoint), (x), (y), (z), (n) ) 00533 #endif 00534 00535 #ifdef SWIG 00536 int IdCnt3DSameSizeAndType(PCONTOUR3D,PCONTOUR3D); 00537 int IdCnt3DSameType(PCONTOUR3D,PCONTOUR3D); 00538 int IdCnt3DSameSize(PCONTOUR3D,PCONTOUR3D); 00539 void IdCnt3DDestroyNoControl (PCONTOUR3D); 00540 int IdCnt3DAddPoint (PCONTOUR3D_FLOAT, double, double, double, int); 00541 int IdCnt3DAddPnt (PCONTOUR3D_FLOAT, PIDPOINT); 00542 int IdCnt3DInsertPnt(PCONTOUR3D_FLOAT, int, PIDPOINT); 00543 int IdCnt3DInsertPoint(PCONTOUR3D_FLOAT, int, double, double, double, int); 00544 PCONTOUR3D IdCnt3DAllocLikeContour (PCONTOUR3D); 00545 void IdCnt3DFree (PCONTOUR3D); 00546 /* int IdCnt3DClean (PCONTOUR3D_FLOAT); */ 00547 #endif 00548 00549 PCONTOUR3D IdCnt3DVecteurToContour (PIDPOINT[], int, int, int ); 00550 PCONTOUR3D IdCnt3DModifLongueur (PCONTOUR3D,int); 00551 int IdCnt3DMoveContour (PCONTOUR3D_FLOAT, double , double, double); 00552 00553 int IdCnt3DDelPoint (PCONTOUR3D,int); 00554 00555 00556 00557 /* int _IdCnt3DClean (PCONTOUR3D_FLOAT *); */ 00558 /* define IdCnt3DClean(contour_) _IdCnt3DClean(&(contour_)) */ 00559 /* Ou est passe le source de ce truc la ?!? JPR */ 00560 00561 PCONTOUR3D IdCnt3DConcat (PCONTOUR3D,PCONTOUR3D); 00562 00563 #endif