Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
ordalie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luc.moulinier
ordalie
Commits
39458774
Commit
39458774
authored
Jan 30, 2019
by
luc.moulinier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pleins de bugs ...
parent
26aae2a3
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
329 additions
and
398 deletions
+329
-398
Extensions/biotext0.1/src/libbiotext-dev0.1.so
Extensions/biotext0.1/src/libbiotext-dev0.1.so
+0
-0
Extensions/biotext0.1/src/libbiotext0.1.so
Extensions/biotext0.1/src/libbiotext0.1.so
+0
-0
Extensions/biotext0.1/src/tkBioCmds.c
Extensions/biotext0.1/src/tkBioCmds.c
+85
-80
Extensions/biotext0.1/src/tkBioCmds.o
Extensions/biotext0.1/src/tkBioCmds.o
+0
-0
Extensions/biotext0.1/src/tkBioUnix.o
Extensions/biotext0.1/src/tkBioUnix.o
+0
-0
Extensions/biotext0.1/src/tkBioUtil.o
Extensions/biotext0.1/src/tkBioUtil.o
+0
-0
Extensions/biotext0.1/src/tkBiotext.o
Extensions/biotext0.1/src/tkBiotext.o
+0
-0
src/ordali_StrucObj.tcl
src/ordali_StrucObj.tcl
+8
-0
src/ordali_affiche.tcl
src/ordali_affiche.tcl
+27
-257
src/ordali_graphic3d.tcl
src/ordali_graphic3d.tcl
+34
-3
src/ordali_misc.tcl
src/ordali_misc.tcl
+117
-17
src/ordali_mode.tcl
src/ordali_mode.tcl
+6
-7
src/ordali_outils.tcl
src/ordali_outils.tcl
+4
-1
src/ordali_sequence.tcl
src/ordali_sequence.tcl
+26
-20
src/ordali_source.tcl
src/ordali_source.tcl
+2
-0
src/ordali_superposition.tcl
src/ordali_superposition.tcl
+4
-0
src/ordali_v2.tcl
src/ordali_v2.tcl
+16
-13
No files found.
Extensions/biotext0.1/src/libbiotext-dev0.1.so
deleted
100755 → 0
View file @
26aae2a3
File deleted
Extensions/biotext0.1/src/libbiotext0.1.so
deleted
100755 → 0
View file @
26aae2a3
File deleted
Extensions/biotext0.1/src/tkBioCmds.c
View file @
39458774
...
...
@@ -24,9 +24,9 @@ BiotextSelectionCmd(Biotext *BiotextPtr,
int objc,
Tcl_Obj * const objv[])
{
int cmdIndex, r, c;
static CONST84 char *selCmdNames[] = {
"clear", "from", "to", (char *)NULL
};
...
...
@@ -277,7 +277,7 @@ BiotextSequencesCmd(Biotext *BiotextPtr,
*--------------------------------------------------------------
*/
int
BiotextMappingCmd(Biotext *BiotextPtr,
BiotextMappingCmd(
register
Biotext *BiotextPtr,
Tcl_Interp *interp,
int objc,
Tcl_Obj * const objv[])
...
...
@@ -285,14 +285,17 @@ BiotextMappingCmd(Biotext *BiotextPtr,
char *tmp;
int i, j, k, nmap;
Tcl_Obj **OMap, **OneE ;
Tk_Window tkwin = BiotextPtr->tkwin;
XColor *Cfg, *Cbg;
XGCValues gcValues;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg...?");
return TCL_ERROR;
}
Tcl_ListObjGetElements(interp,objv[2],&nmap,&OMap);
BiotextPtr->nbMapping
=
nmap;
BiotextPtr->nbMapping
=
nmap;
if (BiotextPtr->Mapping != NULL)
ckfree((char *)BiotextPtr->Mapping);
BiotextPtr->Mapping = (Tag *)ckalloc(nmap*sizeof(Tag));
...
...
@@ -300,13 +303,30 @@ BiotextMappingCmd(Biotext *BiotextPtr,
for (i=0;i<nmap;i++) {
Tcl_ListObjGetElements(interp,OMap[i],&j,&OneE);
tmp = Tcl_GetString(OneE[0]);
BiotextPtr->Mapping[i].smap=tmp[0];
BiotextPtr->Mapping[i].fg = Tk_3DBorderColor(Tk_Alloc3DBorderFromObj(interp,BiotextPtr->tkwin,OneE[1]))->pixel;
BiotextPtr->Mapping[i].bg = Tk_3DBorderColor(Tk_Alloc3DBorderFromObj(interp,BiotextPtr->tkwin,OneE[2]))->pixel;
BiotextPtr->Mapping[i].bgBorder = Tk_Get3DBorderFromObj(BiotextPtr->tkwin, OneE[2]);
}
BiotextPtr->Mapping[i].smap = tmp[0];
BiotextPtr->Mapping[i].bgBorder = Tk_Get3DBorder(interp, tkwin, Tcl_GetString(OneE[2]));
Biotext_AssignColors(BiotextPtr, 2);
Cfg = Tk_AllocColorFromObj(interp, tkwin, OneE[1]);
Cbg = Tk_AllocColorFromObj(interp, tkwin, OneE[2]);
BiotextPtr->Mapping[i].Cfg = Cfg;
BiotextPtr->Mapping[i].Cbg = Cbg;
BiotextPtr->Mapping[i].fg = Cfg->pixel;
BiotextPtr->Mapping[i].bg = Cbg->pixel;
BiotextPtr->Mapping[i].gc = NULL;
/* Create a graphical context for the tag */
gcValues.graphics_exposures = False;
gcValues.font = Tk_FontId(BiotextPtr->tkfont);
gcValues.foreground = BiotextPtr->Mapping[i].fg;
//gcValues.background = Tk_3DBorderColor(BiotextPtr->fgBorder)->pixel;
gcValues.background = BiotextPtr->Mapping[i].bg;
BiotextPtr->Mapping[i].gc = Tk_GetGC(tkwin, GCFont|GCForeground|GCBackground, &gcValues);
//BiotextPtr->Mapping[i].gc = Tk_GetGC(tkwin, GCGraphicsExposures|GCFont|GCForeground|GCBackground, &gcValues);
}
Biotext_AssignMappingColors(BiotextPtr);
if (BiotextPtr->SeqMat != NULL) {
if (BiotextPtr->MapSeq == NULL) {
...
...
@@ -328,11 +348,7 @@ BiotextMappingCmd(Biotext *BiotextPtr,
}
}
if (! pt) {
for (j=0;j<BiotextPtr->lgSeqs;j++) {
if (BiotextPtr->MapSeq[i][j] < 0 || BiotextPtr->MapSeq[i][j] >= BiotextPtr->nbMapping) {
break;
}
}
BiotextPtr->MapSeq[i][j] = -1;
}
}
}
...
...
@@ -382,12 +398,14 @@ BiotextMapCmd(Biotext *BiotextPtr,
} else {
Tcl_GetBooleanFromObj(interp,objv[2],&bool);
if (bool) {
/* map ON */
if (BiotextPtr->flags & MAP_RESIDUES) {
return TCL_OK;
} else {
BiotextPtr->flags |= MAP_RESIDUES;
}
} else {
/* map OFF */
if (BiotextPtr->flags & MAP_RESIDUES) {
BiotextPtr->flags &= ~MAP_RESIDUES;
} else {
...
...
@@ -444,7 +462,7 @@ BiotextTagCmd(Biotext *BiotextPtr,
switch ((enum tagCommand) cmdIndex) {
case CMD_TAG_CONFIG:
if (objc != 8) {
Tcl_WrongNumArgs(interp, 1, objv, "tag configure tagName -foreground fgCol
-background bgCol
");
Tcl_WrongNumArgs(interp, 1, objv, "tag configure tagName -foreground fgCol
or -background bgColor
");
return TCL_ERROR;
}
...
...
@@ -452,18 +470,28 @@ BiotextTagCmd(Biotext *BiotextPtr,
/* Now take the tag definition */
bg = fg = -1;
bgBorder = NULL;
for (i=4;i<7;i+=2) {
XColor *Cfg, *Cbg;
Cfg = Cbg = NULL;
for (i=4;i<8;i+=2) {
if (strcasecmp(Tcl_GetString(objv[i]),"-foreground") == 0 || strcasecmp(Tcl_GetString(objv[i]),"-fg") == 0) {
fg = Tk_3DBorderColor(Tk_Alloc3DBorderFromObj(interp,BiotextPtr->tkwin,objv[i+1]))->pixel;
Cfg = Tk_AllocColorFromObj(interp, BiotextPtr->tkwin, objv[i+1]);
fg = Cfg->pixel;
}
if (strcasecmp(Tcl_GetString(objv[i]),"-background") == 0 || strcasecmp(Tcl_GetString(objv[i]),"-bg") == 0) {
bg = Tk_3DBorderColor(Tk_Alloc3DBorderFromObj(interp,BiotextPtr->tkwin,objv[i+1]))->pixel;
Cbg = Tk_AllocColorFromObj(interp, BiotextPtr->tkwin, objv[i+1]);
bg = Cbg->pixel;
bgBorder = Tk_Get3DBorderFromObj(BiotextPtr->tkwin,objv[i+1]);
}
}
/* Are colors OK ? */
if (bg == -1 || fg == -1) {
/* bad colors names */
return TCL_ERROR;
}
/* check if tag already exists */
iTag
=
0;
iTag
=
0;
for (i=0;i<BiotextPtr->nbTags;i++) {
if (strcmp(tagName,BiotextPtr->Tags[i].tagName) == 0)
break;
...
...
@@ -483,30 +511,32 @@ BiotextTagCmd(Biotext *BiotextPtr,
/* now initialize */
RemoveTaggedPositionsInAlignment(BiotextPtr,-1);
}
if (bg == -1 || fg == -1)
return TCL_ERROR;
/* fill the tag structure */
BiotextPtr->Tags[iTag].tagName=(char *)ckalloc((strlen(tagName)+1)*sizeof(char));
strcpy(BiotextPtr->Tags[iTag].tagName,tagName);
BiotextPtr->Tags[iTag].Cfg = Cfg;
BiotextPtr->Tags[iTag].Cbg = Cbg;
BiotextPtr->Tags[iTag].fg = fg;
BiotextPtr->Tags[iTag].bg = bg;
BiotextPtr->Tags[iTag].bgBorder = bgBorder;
Biotext_Assign
Colors(BiotextPtr, 3
);
Biotext_Assign
TagColors(BiotextPtr, iTag
);
break;
case CMD_TAG_ADD:
tagName = Tcl_GetString(objv[3]);
/*
check if tag exists
*/
/*
the tag must have been defined previously
*/
for(i=0;i<BiotextPtr->nbTags;i++) {
if (strcmp(BiotextPtr->Tags[i].tagName,tagName) == 0)
break;
}
if (i==BiotextPtr->nbTags)
if (i==BiotextPtr->nbTags) {
/* unknown tag */
return TCL_ERROR;
iTag=i;
}
iTag = i;
/* now check the indexes -
* There must be an even number of indexes
...
...
@@ -535,7 +565,7 @@ BiotextTagCmd(Biotext *BiotextPtr,
for(k=col1;k<=col2;k++)
BiotextPtr->TagSeq[i][k]=iTag;
}
break;
case CMD_TAG_REMOVE:
if (objc == 3) {
...
...
@@ -595,7 +625,6 @@ BiotextTagCmd(Biotext *BiotextPtr,
break;
}
BiotextPtr->flags |= UPDATE_SCROLLBAR;
BiotextEventuallyRedraw(BiotextPtr);
return TCL_OK;
...
...
@@ -707,9 +736,9 @@ BiotextYViewCmd(register Biotext *BiotextPtr,
int objc,
Tcl_Obj * const objv[])
{
int index,
char
sPerPage;
int index,
line
sPerPage;
index =
char
sPerPage = 0;
index =
line
sPerPage = 0;
if (objc == 2) {
double first, last;
char buf[TCL_DOUBLE_SPACE];
...
...
@@ -727,7 +756,7 @@ BiotextYViewCmd(register Biotext *BiotextPtr,
double fraction;
int count;
char
sPerPage = BiotextPtr->heightChar;
line
sPerPage = BiotextPtr->heightChar;
index = BiotextPtr->topIndex;
switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction,&count)) {
...
...
@@ -737,7 +766,7 @@ BiotextYViewCmd(register Biotext *BiotextPtr,
index = (int) (fraction*BiotextPtr->nbSeqs + 0.5);
break;
case TK_SCROLL_PAGES: {
index += count *
char
sPerPage;
index += count *
line
sPerPage;
break;
}
case TK_SCROLL_UNITS:
...
...
@@ -747,11 +776,8 @@ BiotextYViewCmd(register Biotext *BiotextPtr,
return TCL_ERROR;
}
}
if (index >= BiotextPtr->nbSeqs) {
index = BiotextPtr->nbSeqs - 1;
}
if (index >= BiotextPtr->nbSeqs - charsPerPage ) {
index = BiotextPtr->nbSeqs - charsPerPage;
if (index > (BiotextPtr->nbSeqs - linesPerPage) ) {
index = BiotextPtr->nbSeqs - linesPerPage;
}
if (index < 0) {
index = 0;
...
...
@@ -1228,9 +1254,6 @@ BiotextInsertCols(register Biotext *BiotextPtr,
start = index + 1;
stop2 = index + count + 1;
}
//fprintf(stderr,"InsertCols: index %d lgs %d stop1 %d start %d stop2 %d\n",index,lgs,stop1,start,stop2);
//fflush(stderr);
for (j=0;j<nseq;j++) {
for (i=lgs-1;i>stop1;i--) {
...
...
@@ -1360,7 +1383,7 @@ BiotextDeleteCmd(register Biotext *BiotextPtr,
Tcl_Obj * const objv[])
{
char *what, *iStr, dummy;
int i, i
s, i
f, result;
int i, i
ds, id
f, result;
if (objc < 4 && (strcmp(Tcl_GetString(objv[2]),"colsgaps"))) {
Tcl_WrongNumArgs(interp, 1, objv, " delete <colsgaps|cols|rows> ?all|end|index?");
...
...
@@ -1383,6 +1406,7 @@ BiotextDeleteCmd(register Biotext *BiotextPtr,
return TCL_ERROR;
}
result = TCL_OK;
if (strcasecmp(what,"cols") == 0) {
if (strcasecmp(iStr, "end") == 0) {
i = BiotextPtr->lgSeqs - 1;
...
...
@@ -1392,16 +1416,16 @@ BiotextDeleteCmd(register Biotext *BiotextPtr,
result = BiotextDeleteCols(BiotextPtr, i);
} else if (strcasecmp(what, "rows") == 0) {
if (strcasecmp(iStr, "end") == 0) {
is = BiotextPtr->nbSeqs - 1;
i
f = i
s+1;
} else if
{
strcasecmp(iStr, "all") == 0) {
is = 0;
if = BiotextPtr->nbSeqs;
i
d
s = BiotextPtr->nbSeqs - 1;
i
df = id
s+1;
} else if
(
strcasecmp(iStr, "all") == 0) {
i
d
s = 0;
i
d
f = BiotextPtr->nbSeqs;
} else {
sscanf(iStr, "%d", &is);
i
f = i
s+1;
sscanf(iStr, "%d", &i
d
s);
i
df = id
s+1;
}
for (i=i
s;i<i
f;i++) {
for (i=i
ds;i<id
f;i++) {
result = BiotextDeleteRows(BiotextPtr, i);
}
} else {
...
...
@@ -1457,10 +1481,7 @@ BiotextDeleteColsGaps(register Biotext *BiotextPtr)
BiotextDeleteCols(BiotextPtr, i);
ckfree((char *)colToDel);
//fprintf(stdout,"\nRemColsGaps : lgs %d currC %d\n",BiotextPtr->lgSeqs, BiotextPtr->currentC);
//fflush(stdout);
return TCL_OK;
}
...
...
@@ -1549,9 +1570,9 @@ BiotextDeleteRows(register Biotext *BiotextPtr,
BiotextPtr->TagSeq = (int **)ckrealloc((char *)BiotextPtr->TagSeq,nbs*sizeof(int *));
BiotextPtr->SeqGrp = (int *)ckrealloc((char *)BiotextPtr->SeqGrp, nbs*sizeof(int));
BiotextPtr->nbSeqs = nbs - 1;
return TCL_OK;
}
...
...
@@ -1581,7 +1602,7 @@ BiotextGroupCmd(register Biotext *BiotextPtr,
char *smode;
int nseq, i, idx, nmGrp, inm, isq, mode;
Tcl_Obj **OIdx;
/*
* !! GROUP NAME IS HANDLED BY THE TCL CALLER !!!
*
...
...
@@ -1589,7 +1610,7 @@ BiotextGroupCmd(register Biotext *BiotextPtr,
* Find a group name. Loop through existing names
* and find the first missing one
*/
/*
isIn = 1;
nmGrp = 0;
...
...
@@ -1603,7 +1624,7 @@ BiotextGroupCmd(register Biotext *BiotextPtr,
}
}
*/
/*
* Syntax: <pathname> group ?-new|-merge? name index
*
...
...
@@ -1879,10 +1900,7 @@ BiotextPushCmd(register Biotext *BiotextPtr,
r = BiotextPtr->currentR;
c = BiotextPtr->currentC;
icol = c;
//fprintf(stdout,"Push : r= %3d, c= %3d\n",r,c);
//fflush(stdout);
/*
* Find the closest gap to the left/right
*/
...
...
@@ -1922,13 +1940,9 @@ BiotextPushCmd(register Biotext *BiotextPtr,
/* we have to update the scrollbars */
BiotextPtr->flags |= UPDATE_SCROLLBAR;
} else if (nextGap == BiotextPtr->lgSeqs) {
//fprintf(stdout,"--> lgs AV Ins %d\n",BiotextPtr->lgSeqs);
//fflush(stdout);
BiotextInsertCols(BiotextPtr, BiotextPtr->lgSeqs-1, 1);
nextGap = BiotextPtr->lgSeqs-1;
//fprintf(stdout,"--> lgs AP ins %d\n",BiotextPtr->lgSeqs);
//fflush(stdout);
/* we have to update the scrollbars */
BiotextPtr->flags |= UPDATE_SCROLLBAR;
}
...
...
@@ -1936,8 +1950,6 @@ BiotextPushCmd(register Biotext *BiotextPtr,
/*
* We can then push the sequence
*/
//fprintf(stderr,"av do Push : c=%3d lgs= %3d\n",BiotextPtr->currentC, BiotextPtr->lgSeqs);
//fflush(stderr);
if (nGrp != 0 && BiotextPtr->nbrGrps > 0) {
for(i=0;i<BiotextPtr->nbSeqs;i++)
if (BiotextPtr->SeqGrp[i] == nGrp)
...
...
@@ -1951,15 +1963,8 @@ BiotextPushCmd(register Biotext *BiotextPtr,
else
BiotextPtr->currentC++;
//fprintf(stderr,"fin Push : c=%3d lgs= %3d\n",BiotextPtr->currentC, BiotextPtr->lgSeqs);
//fflush(stderr);
//BiotextPtr->flags |= UPDATE_SCROLLBAR;
BiotextEventuallyRedraw(BiotextPtr);
//fprintf(stderr,"fin Push : c=%3d lgs= %3d\n\n",BiotextPtr->currentC, BiotextPtr->lgSeqs);
//fflush(stderr);
return TCL_OK;
}
...
...
Extensions/biotext0.1/src/tkBioCmds.o
deleted
100755 → 0
View file @
26aae2a3
File deleted
Extensions/biotext0.1/src/tkBioUnix.o
deleted
100755 → 0
View file @
26aae2a3
File deleted
Extensions/biotext0.1/src/tkBioUtil.o
deleted
100755 → 0
View file @
26aae2a3
File deleted
Extensions/biotext0.1/src/tkBiotext.o
deleted
100755 → 0
View file @
26aae2a3
File deleted
src/ordali_StrucObj.tcl
View file @
39458774
...
...
@@ -1062,6 +1062,14 @@ proc SetupPDBObject {} {
}
oo::define Structure method _typeChn
{
chn
}
{
my TypRes
set L
[
DenombreLaListe $TypRes
(
$c
)]
return
[
lindex
[
lindex $L 0
]
0
]
}
oo::define Structure method selcolor
{
col
}
{
my variable ResSel ResCol
...
...
src/ordali_affiche.tcl
View file @
39458774
...
...
@@ -314,21 +314,6 @@ proc DetruitUnPDB {pdbid} {
}
proc UpdateVisibleAnnotations {} {
global db Anno
set Lanno [ManageAnnotation getall [MacCourant]]
set Anno(Lnoms) [list]
set Anno(Lnoms) [list "None" "All"]
foreach {pka pks nom col zone} $Lanno {
lappend Anno(Lanno) [list $pka $nom $col $zone]
lappend Anno(Lnoms) $nom
}
return
}
proc AjoutePDB {{what ok}} {
global WAP LNOrdali ListePDB
...
...
@@ -612,10 +597,10 @@ proc AskAddSeqs {} {
set TAddS(KeepClus) 0
}
if {
0
} {
set TAddS(File) "
add_jaris
.tfa"
if {
1
} {
set TAddS(File) "
2zbk_b
.tfa"
set TAddS(Position) "end"
set TAddS(seqInsert) "
Q5ZAV6
"
set TAddS(seqInsert) "
A9TJG7
"
set TAddS(Align) 1
}
set res [array get TAddS]
...
...
@@ -3389,243 +3374,6 @@ proc CherchePCI {w args} {
}
proc ShowAnnotation {args} {
foreach {pka pks nom text col zone} [ManageAnnotation get $::Anno(Nom)] {
$NomTextSeq tag configure Anno_$pka -bg $col
$NomTextSeq tag add Anno_$pka {*}$zone
}
return
}
proc EditeAnnotation {} {
set ::Anno
return
}
proc ManageAnnotation {what pk {nom ""} {txt ""} {col ""} {zon ""}} {
set Lann [list]
switch $what {
"record" {
lappend ::Anno(Lanno) [list $::Anno(iAnno) -1 $txt $col $zon]
incr ::Anno(iAnno)
}
"edit" {
$::db eval {update annotation set annotation=$txt, color=$col, zone=$zon where pk_annotation=$pk}
}
}
return $Lann
}
proc AjouteAnnotation {} {
set zon [$::NomTextSeq tag ranges selZone]
if {$zon == {} } {
FaireLire "No alignment zones defined !"
return
}
$::NomTextSeq tag remove selZone 1.0 end
set txt [$::Anno(WText) get 1.0 end]
set txt [string map {"'" " "} $txt]
$::Anno(WText) delete 1.0 end
set col $::Anno(Color)
set colAff [CouleurO2Ordali $::Anno(Color)]
set nom $::Anno(Nom)
set txt "$::Anno(iAnno) - $txt"
set txtnsp [string map {_ @ " " _} $txt]
set Ntag "FDisp_$txtnsp"
$::NomTextSeq tag configure $Ntag -background $colAff
$::NomTextSeq tag add $Ntag {*}$zon
ManageAnnotation "record" [MacCourant] $nom $txt $col $zon
return
}
proc FindTagPatch {tag x y} {
global NomTextSeq
set Lranges [$NomTextSeq tag ranges $tag]
set LgoodX [list]
foreach {p1 p2} $Lranges {
lassign [split $p1 .] y1 x1
lassign [split $p2 .] y2 x2
if {$x >= $x1 && $x < $x2} {
lappend LgoodX $y1
lappend Lx1 $x1
lappend Lx2 $x2
}
}
set LggodX [lsort -integer $LgoodX]
set jprev [lindex $LgoodX 0]
set jstart $jprev ; set jfin -1
if {$jprev == $y} {
set jy 1
} else {
set jy 0
}
foreach j [lrange $LgoodX 1 end] {
if {$j == $y} {set jy 1}
if {$j != ($jprev + 1)} {
if {$jy} {
set jfin $jprev
break
} else {
set jstart $j
}
}
set jprev $j
}
if {$jfin == -1} {
set jfin $jprev
}
# cree liste du patch
set x1 [lsort -unique -integer $Lx1]
set x2 [lsort -unique -integer $Lx2]
set Lres [list]
for {set y $jstart} {$y <= $jfin} {incr y} {
lappend Lres $y.$x1 $y.$x2
}
return $Lres
}
proc PositionAnnotation {w xp yp {quoi ""}} {
lassign [split [$w index @$xp,$yp] .] y x
$::NomTextSeq configure -state normal
switch $quoi {
"debut" {
set Lt [$::NomTextSeq tag names $y.$x]
set disp [lsearch -inline -regexp $Lt {^FDisp\_[0-9]+\_}]
if {$disp ne ""} {
regexp {FDisp_([0-9]+)_(.+)} $disp tmp ian txt
set anno [lsearch -inline -exact -index 0 $::Anno(Lanno) $ian]
lassign $anno ian pka txt col zone
$::Anno(WText) delete 1.0 end
$::Anno(WText) insert end $txt
set Lcol [$::WOrdali(ComboColAnno) cget -values]
set icol [lsearch -exact $Lcol $::Anno(Color)]
$::WOrdali(ComboColAnno) index $icol
$::NomTextSeq configure -state disabled
return
}
set ::Anno(xdebut) $x
set ::Anno(ydebut) $y
}
"move" {
set xd [set ::Anno(xdebut)]
set yd [set ::Anno(ydebut)]
if {$x < $xd} {
set xt $xd
set xd $x
set x $xt
}
if {$y < $yd} {
set yt $yd
set yd $y
set y $yt
}
set Lt {}
for {set i $yd} {$i <= $y} {incr i} {
lappend Lt $i.$xd $i.$x
}
if {$Lt != {}} {
$w tag add selZone {*}$Lt
}
}
"termine" {
if {0} {
#$w configure -state disabled
set xd $::Anno(xdebut)
set yd $::Anno(ydebut)
if {$xd < $x} {
set xm $xd ; set xx $x
} else {
set xm $x ; set xx $xd
}
if {$yd < $y} {
set ym $yd ; set yx $y
} else {
set ym $y ; set yx $yd
}
set tx [expr {$xx-$xm+1}]
set ty [expr {$yx-$ym+1}]
text .tmsg -bg yellow -fg blue -font "Helvetica 22 bold"
place .tmsg \
-x $xp -y $yp \
-in $::NomTextSeq
}
}
"delete" {
set Lt [$::NomTextSeq tag names $y.$x]
set disp [lsearch -inline -regexp $Lt {^FDisp\_[0-9]+\_}]
if {$disp ne ""} {
regexp {FDisp_([0-9]+)} $disp tmp ian
set iLanno [lsearch -exact -index 0 $::Anno(Lanno) $ian]
set anno [lindex $::Anno(Lanno) $iLanno]
lassign $anno ian pka txt col zone
set Lr [FindTagPatch $disp $x y]
$::NomTextSeq tag remove $disp {*}$Lr
foreach p $Lr {
set i [lsearch -exact $zone $p]
if {$i == -1} {
puts "$p not in zone"
} else {