Changeset 1124 in Sophya
- Timestamp:
- Aug 1, 2000, 1:05:06 PM (25 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/picmap.cc
r1122 r1124 22 22 //-- 23 23 24 #define MXMAPIDS 1 524 #define MXMAPIDS 16 25 25 static int MapNCols[MXMAPIDS] = {256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 26 256, 256, 256, 256, 256 }; 27 static const char* MapNoms[MXMAPIDS] = {"Grey32","InvGrey32","ColRJ32","ColBR32", 28 "ColRV32", "Grey128", "InvGrey128", "ColRJ128", 29 "ColBR128", "Col16", 30 "MIDAS_Pastel", "MIDAS_Heat", "MIDAS_Rainbow3", 31 "MIDAS_BlueRed", "MIDAS_BlueWhite" }; 32 static CMapId MapIds[MXMAPIDS] = { CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32, 33 CMAP_COLBR32, CMAP_COLRV32, CMAP_GREY128, 34 CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128, 35 CMAP_COL16, 36 CMAP_MIDAS_Pastel, CMAP_MIDAS_Heat, CMAP_MIDAS_Rainbow3, 37 CMAP_MIDAS_BlueRed, CMAP_MIDAS_BlueWhite } ; 26 256, 256, 256, 256, 256, 256 }; 27 28 // Tables de couleurs : 29 // 5 Standard PI , 32 couleurs 30 // 4 Standard PI , 128 couleurs 31 // 6 MIDAS , 256 couleurs 32 // 1 Standard PI 16 couleurs 33 34 static const char* MapNoms[MXMAPIDS] = { 35 "Grey32","InvGrey32","ColRJ32","ColBR32","ColRV32", 36 "Grey128","InvGrey128","ColRJ128","ColBR128", 37 "MIDAS_Pastel","MIDAS_Heat","MIDAS_Rainbow3", 38 "MIDAS_BlueRed","MIDAS_BlueWhite","MIDAS_RedWhite", 39 "Rainbow16"}; 40 41 static CMapId MapIds[MXMAPIDS] = { 42 CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32, CMAP_COLBR32, CMAP_COLRV32, 43 CMAP_GREY128, CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128, 44 CMAP_MIDAS_Pastel, CMAP_MIDAS_Heat, CMAP_MIDAS_Rainbow3, 45 CMAP_MIDAS_BlueRed, CMAP_MIDAS_BlueWhite, CMAP_MIDAS_RedWhite, 46 CMAP_COL16 } ; 38 47 39 48 static int mColTNums[8192]; // Max 8192 tables differentes pour le moment … … 41 50 42 51 static int NMaxTableAuto = 0; 43 static PIColorMap* mMaps[ 15] = {NULL, NULL, NULL, NULL, NULL,52 static PIColorMap* mMaps[MXMAPIDS] = { 44 53 NULL, NULL, NULL, NULL, NULL, 45 NULL, NULL, NULL, NULL, NULL }; 54 NULL, NULL, NULL, NULL, NULL, 55 NULL, NULL, NULL, NULL, NULL, 56 NULL }; 46 57 47 58 int PIColorMap::NumberStandardColorMaps() … … 308 319 case CMAP_COLRV32 : 309 320 for( i=0; i<32; i++) { 310 if (i < 8) { 311 mycol.green = 15000+(i*5000); mycol.blue = 0; 312 mycol.red = 15000+(i*5000); } 321 if (i < 9) { 322 mycol.green = i*5000; mycol.blue = 0; 323 mycol.red = i*6000; } 324 else if (i < 15) { 325 mycol.green = 40000; 326 mycol.blue = 0; 327 mycol.red = 50000+(i-9)*1000; 328 } 313 329 else if (i < 21) { 314 mycol.green = 50000-(i-7)*5000; 315 if (mycol.green < 0) mycol.green = 0; 330 mycol.green = 40000-(i-15)*8000; 316 331 mycol.blue = 0; 317 mycol.red = 5 3535+(i-8)*1000; }332 mycol.red = 57535+(i-15)*1600; } 318 333 else { 319 334 mycol.green = 0; mycol.red = 65535; … … 388 403 break; 389 404 390 case CMAP_MIDAS_Pastel : // Les valeurs correspondent a je ne sais quel table MIDAS405 case CMAP_MIDAS_Pastel : // 391 406 case CMAP_MIDAS_Heat : // A faire pour CMAP_MIDAS_Pastel CMAP_MIDAS_Heat 392 407 case CMAP_MIDAS_Rainbow3 : // A faire pour Heat Rainbow3 BlueRed BlueWhite 393 408 case CMAP_MIDAS_BlueRed : // BlueRed -> idl11 394 409 case CMAP_MIDAS_BlueWhite : // BlueWhite -> blulut.lutlis 410 case CMAP_MIDAS_RedWhite : // rouge-rose-blanc je ne sais quelle table MIDAS ?? 395 411 { 396 staticfloat rgb_r[256] = {412 float rgb_r[256] = { 397 413 0, 0, 0.01961, 0.0549, 0.08627, 0.1098, 0.13725, 0.15686, 0.18039, 0.2, 398 414 0.21569, 0.23529, 0.25098, 0.26275, 0.28235, 0.29412, 0.30588, 0.31765, … … 427 443 0.98824, 0.99216, 0.99216, 0.99216, 0.99216, 0.99608, 0.99608, 0.99608, 428 444 0.99608, 1, 1 }; 429 staticfloat rgb_g[256] = {445 float rgb_g[256] = { 430 446 0, 0, 0, 0, 0.00392, 0.00392, 0.00392, 0.00392, 0.00392, 0.00784, 431 447 0.00784, 0.00784, 0.00784, 0.01176, 0.01176, 0.01176, 0.01176, 0.01176, … … 460 476 0.89804, 0.9098, 0.91765, 0.92941, 0.94118, 0.94902, 0.96078, 0.97255, 461 477 0.98039, 0.99216 }; 462 staticfloat rgb_b[256] = {478 float rgb_b[256] = { 463 479 0, 0, 0, 0, 0.00392, 0.00392, 0.00392, 0.00392, 0.00392, 0.00784, 464 480 0.00784, 0.00784, 0.00784, 0.01176, 0.01176, 0.01176, 0.01176, 0.01176, -
trunk/SophyaPI/PI/picmap.h
r1122 r1124 22 22 CMAP_COLRJ128 = 8, // 128 couleurs du rouge au jaune/blanc 23 23 CMAP_COLBR128 = 9, // 128 couleurs du bleu au rouge 24 CMAP_COL16 = 10, // 16 Couleurs Arcenciel25 24 26 // Tables de couleur importees de MIDAS 25 // Tables de couleur importees de MIDAS 256 couleurs 27 26 CMAP_MIDAS_Pastel = 101, // Bleu-Violet-Rouge-Jaune 28 27 CMAP_MIDAS_Heat = 102, // Noir-Rouge-Orange-Blanc 29 28 CMAP_MIDAS_Rainbow3 = 103, // Noir-Bleu-Vert-Jaune-Rouge-Violet-Blanc 30 29 CMAP_MIDAS_BlueRed = 104, // Bleu-Violet-Rouge 31 CMAP_MIDAS_BlueWhite = 105 // Noir-Bleu-Blanc 30 CMAP_MIDAS_BlueWhite = 105, // Noir-Bleu-Blanc 31 CMAP_MIDAS_RedWhite = 106, // Noir-Rouge-Rose-Blanc 32 33 // Table simple a 16 couleurs 34 CMAP_COL16 = 999 // 16 Couleurs Arcenciel 32 35 }; 33 36 -
trunk/SophyaPI/PI/pidrwtools.cc
r684 r1124 186 186 mOpt[1] = new PIOptMenu(this, "bwt-opt-1", bsx*1.75, bsy, cpx, cpy); 187 187 mOpt[1]->AppendItem("No.CMap", 200); 188 mOpt[1]->AppendItem("Grey32", 201); 189 mOpt[1]->AppendItem("GreyInv32", 202); 190 mOpt[1]->AppendItem("ColRJ32", 203); 191 mOpt[1]->AppendItem("ColBR32", 204); 192 mOpt[1]->AppendItem("ColRV32", 205); 193 mOpt[1]->AppendItem("Grey128", 206); 194 mOpt[1]->AppendItem("GreyInv128", 207); 195 mOpt[1]->AppendItem("ColRJ128", 208); 196 mOpt[1]->AppendItem("ColBR128", 209); 197 mOpt[1]->AppendItem("Col16", 210); 188 int kcc; 189 // Groupement des tables de couleurs 190 mCasc[0] = new PIMenu(mOpt[1]->Menu(), "PIStd-128Col"); 191 mCasc[1] = new PIMenu(mOpt[1]->Menu(), "MIDAS-CMap"); 192 193 int nsct1,nsct2,nsct3; 194 // D'abord les tables standard de PI 32 couleurs 195 nsct1 = 5; // Les 5 premieres tables 196 for(kcc=0; kcc<nsct1; kcc++) 197 mOpt[1]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 198 // Ensuite les tables standard de PI 128 couleurs 199 nsct2 = 9; // Les 4 tables suivantes 200 for(kcc=nsct1; kcc<nsct2; kcc++) 201 mCasc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 202 mOpt[1]->AppendPDMenu(mCasc[0]); 203 // Apres les tables importees de MIDAS 204 nsct3 = PIColorMap::NumberStandardColorMaps()-1; // Les reste jusqu'a l'avant derniere 205 for(kcc=nsct2; kcc<nsct3; kcc++) 206 mCasc[1]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 207 mOpt[1]->AppendPDMenu(mCasc[1]); 208 // Les tables qui restent ( Col16 , ... ) 209 for(kcc=nsct3; kcc<PIColorMap::NumberStandardColorMaps(); kcc++) 210 mOpt[1]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 211 198 212 mOpt[1]->SetValue(200); 199 213 mOpt[1]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); … … 316 330 delete mButcf[3]; 317 331 for(i=0; i<6; i++) delete mOpt[i]; 332 for(i=0; i<2; i++) delete mCasc[i]; 318 333 delete mNlb; 319 334 } … … 341 356 static PIFontSize fntsz[5] = { PI_NotDefFontSize, PI_NormalSizeFont, PI_SmallSizeFont, 342 357 PI_BigSizeFont, PI_HugeSizeFont }; 343 static CMapId cmap[11] = { CMAP_OTHER, CMAP_GREY32, CMAP_GREYINV32,344 CMAP_COLRJ32, CMAP_COLBR32, CMAP_COLRV32,345 CMAP_GREY128, CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128, CMAP_COL16 };346 358 347 359 /* --Methode-- */ … … 413 425 if (fc == cols[kk]) { mOpt[0]->SetValue(100+kk); break; } 414 426 CMapId cmi = dr->GetColMapId(); 415 for(kk=0; kk<11; kk++) 416 if (cmi == cmap[kk]) { mOpt[1]->SetValue(200+kk); break; } 427 if (cmi == CMAP_OTHER) mOpt[1]->SetValue(200); 428 else for(kk=0; kk<PIColorMap::NumberStandardColorMaps(); kk++) 429 if (cmi == PIColorMap::GetStandardColorMapId(kk)) { mOpt[1]->SetValue(201+kk); break; } 417 430 PIMarker mk = dr->GetMarker(); 418 431 for(kk=0; kk<12; kk++) … … 519 532 drw->SetColAtt(cols[k]); 520 533 k = mOpt[1]->GetValue()-200; 521 if ( (k < 0) || (k > 10) ) k = 0;522 drw->SetColMapId(cmap[k]);534 if (k == 0) drw->SetColMapId(CMAP_OTHER); 535 else drw->SetColMapId(PIColorMap::GetStandardColorMapId(k-1)); 523 536 k = mOpt[2]->GetValue()-300; 524 537 if ( (k < 0) || (k > 11) ) k = 0; -
trunk/SophyaPI/PI/pidrwtools.h
r537 r1124 42 42 // Pour couleur, fontes, etc 43 43 PIOptMenu* mOpt[6]; 44 PIMenu* mCasc[5]; 44 45 PILabel* mNlb; 45 46 PIButton* mButdr[2]; -
trunk/SophyaPI/PI/piimgtools.cc
r1122 r1124 150 150 mOptzc[0] = new PIOptMenu(this, "imglut-opt-3", bsx*1.75, bsy, cpx, cpy); 151 151 int kcc; 152 // D'abord les tables standard de PI 153 for(kcc=0; kcc<10; kcc++) 152 // Groupement des tables de couleurs 153 mCasc[0] = new PIMenu(mOptzc[0]->Menu(), "PIStd-128Col"); 154 mCasc[1] = new PIMenu(mOptzc[0]->Menu(), "MIDAS-CMap"); 155 156 int nsct1,nsct2,nsct3; 157 // D'abord les tables standard de PI 32 couleurs 158 nsct1 = 5; // Les 5 premieres tables 159 for(kcc=0; kcc<nsct1; kcc++) 154 160 mOptzc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 155 // Les tables ramenees de MIDAS 156 mCaszc[0] = new PIMenu(mOptzc[0]->Menu(), "MIDAS-CMap"); 157 for(kcc=10; kcc<PIColorMap::NumberStandardColorMaps(); kcc++) 158 mCaszc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 159 mOptzc[0]->Menu()->AppendPDMenu(mCaszc[0]); 161 // Ensuite les tables standard de PI 128 couleurs 162 nsct2 = 9; // Les 4 tables suivantes 163 for(kcc=nsct1; kcc<nsct2; kcc++) 164 mCasc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 165 mOptzc[0]->AppendPDMenu(mCasc[0]); 166 // Apres les tables importees de MIDAS 167 nsct3 = PIColorMap::NumberStandardColorMaps()-1; // Les reste jusqu'a l'avant derniere 168 for(kcc=nsct2; kcc<nsct3; kcc++) 169 mCasc[1]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 170 mOptzc[0]->AppendPDMenu(mCasc[1]); 171 // Les tables qui restent ( Col16 , ... ) 172 for(kcc=nsct3; kcc<PIColorMap::NumberStandardColorMaps(); kcc++) 173 mOptzc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(), 201+kcc); 160 174 161 175 mOptzc[0]->SetValue(203); … … 267 281 delete mOptzc[i]; 268 282 } 269 delete mCaszc[0];283 for(i=0; i<2; i++) delete mCasc[i]; 270 284 for(i=0; i<5; i++) delete mButsz[i]; 271 285 for(i=0; i<3; i++) delete mButcax[i]; -
trunk/SophyaPI/PI/piimgtools.h
r1122 r1124 38 38 // Pour la couleur et le zoom 39 39 PIOptMenu* mOptzc[2]; 40 PIMenu* mCas zc[2];40 PIMenu* mCasc[5]; 41 41 // Pour expand et compress 42 42 PIButton* mButsz[5]; -
trunk/SophyaPI/PI/pioptmenugen.h
r329 r1124 18 18 { mMen->AppendItem(nom, msg); } 19 19 20 virtual void AppendPDMenu(PIMenu* pdm) = 0; 21 20 22 virtual string GetValueStr() = 0; // Option choisie 21 23 virtual PIMessage GetValue() = 0; // Message correspondant a l option choisie -
trunk/SophyaPI/PI/pioptmenux.cc
r1122 r1124 80 80 81 81 /* --Methode-- */ 82 void PIOptMenuX::AppendPDMenu(PIMenu* pdm) 83 { 84 if (pdm == NULL) return; 85 Menu()->AppendPDMenu(pdm); 86 mPDMList.push_back(pdm); 87 } 88 89 /* --Methode-- */ 82 90 void PIOptMenuX::Process(PIMessage msg, PIMsgHandler* sender, void* data) 83 91 { … … 97 105 Arg warg[2]; 98 106 n=mMen->GetNumItem((char *)s.c_str()); 99 if (n < 0) return; 100 101 XtSetArg(warg[0], XmNmenuHistory, mMen->GetItemWdg(n)); 102 XtSetValues(XtWdg(), warg, 1); 103 mStext = s; 104 mSmsg = mMen->ItemMsg(n); 105 106 SetLabel(mStext); 107 107 if (n < 0) { // On verifie si c'est ds les PD Menu 108 list<PIMenu *>::iterator it; 109 for(it = mPDMList.begin(); it != mPDMList.end(); it++) 110 if ((n= (*it)->GetNumItem((char *)s.c_str())) >= 0) { 111 mStext = s; 112 mSmsg = (*it)->ItemMsg(n); 113 SetLabel(mStext); 114 break; 115 } 116 return; 117 } 118 else { 119 XtSetArg(warg[0], XmNmenuHistory, mMen->GetItemWdg(n)); 120 XtSetValues(XtWdg(), warg, 1); 121 mStext = s; 122 mSmsg = mMen->ItemMsg(n); 123 SetLabel(mStext); 124 } 108 125 return; 109 126 } … … 116 133 117 134 n=mMen->GetNumItemMsg(msg); 118 if (n < 0) return; 119 120 XtSetArg(warg[0], XmNmenuHistory, mMen->GetItemWdg(n)); 121 XtSetValues(XtWdg(), warg, 1); 122 mStext = mMen->ItemName(n); 123 mSmsg = msg; 124 SetLabel(mStext); 135 if (n < 0) { // On verifie si c'est ds les PD Menu 136 list<PIMenu *>::iterator it; 137 for(it = mPDMList.begin(); it != mPDMList.end(); it++) 138 if ((n= (*it)->GetNumItemMsg(msg)) >= 0) { 139 mStext = (*it)->ItemName(n); 140 mSmsg = msg; 141 SetLabel(mStext); 142 break; 143 } 144 return; 145 } 146 else { 147 XtSetArg(warg[0], XmNmenuHistory, mMen->GetItemWdg(n)); 148 XtSetValues(XtWdg(), warg, 1); 149 mSmsg = msg; 150 mStext = mMen->ItemName(n); 151 SetLabel(mStext); 152 } 125 153 return; 126 154 } -
trunk/SophyaPI/PI/pioptmenux.h
r329 r1124 3 3 4 4 #include "pisysdep.h" 5 #include <list> 5 6 #include "pioptmenugen.h" 7 6 8 #include PISTDWDG_H 7 9 … … 12 14 13 15 virtual void FinishCreate(); 16 17 virtual void AppendPDMenu(PIMenu* pdm); 14 18 15 19 virtual void Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL); … … 28 32 string mStext; 29 33 PIMessage mSmsg; 34 list<PIMenu*> mPDMList; 30 35 // SysDWdg mLabel; 31 36 GC mgc; -
trunk/SophyaPI/PI/piversion.h
r1034 r1124 2 2 #define PIVERSION_H_SEEN 3 3 4 #define PI_VERSIONNUMBER 2. 64 #define PI_VERSIONNUMBER 2.7 5 5 6 6 #endif
Note:
See TracChangeset
for help on using the changeset viewer.