Index: /issm/trunk/src/c/Bamgx/Mesh2.cpp
===================================================================
--- /issm/trunk/src/c/Bamgx/Mesh2.cpp	(revision 2800)
+++ /issm/trunk/src/c/Bamgx/Mesh2.cpp	(revision 2801)
@@ -146,9 +146,4 @@
 			int ap1 = PreviousEdge[a1];
 			int ap2 = PreviousEdge[a2];
-#ifdef DRAWING1
-			couleur(0);
-			t1->Draw();
-			t2->Draw();
-#endif
 #ifdef DEBUG1
 			t1->check();
@@ -185,14 +180,4 @@
 			t2->check();
 #endif
-#ifdef DRAWING1 
-			couleur(1);
-			t1->Draw();
-			t2->Draw();
-#endif 
-#ifdef DRAWING1
-			if(  CurrentTh)
-				CurrentTh->inquire();
-#endif
-
 		} // end swap 
 
@@ -574,24 +559,4 @@
 						NewItem(A,Metric(ba,v0,bb,v1));
 						return;
-						/*
-						   cerr << nbegin <<  det(vi,vj,b) << " deti= " << deti <<  " detj=" <<detj << endl;
-						   cerr << "SplitEdge on boucle A" << A << " B = " << B << endl;
-
-#ifdef DRAWING
-reffecran();
-Bh.Draw();
-penthickness(5);
-Move(A);
-Line(B);
-penthickness(1);
-
-Bh.inquire();
-penthickness(5);
-Move(A);
-Line(B);
-penthickness(1);
-Bh.inquire();
-#endif	
-MeshError(997);*/
 					}
 				} //  end while (t->det <0)
@@ -961,12 +926,4 @@
 				cout << " detvasasb =" <<  detvasasb << "detvbsasb = " <<  detvbsasb 
 					<< " " << pva << " " << pvb << " "  <<CurrentTh <<endl;
-#ifdef DRAWING1
-				reffecran();
-				CurrentTh->Draw();
-				penthickness(10);
-				pva->MoveTo();pvb->LineTo();
-				penthickness(1);
-				CurrentTh->inquire();
-#endif       
 			}
 			assert( ( (detvasasb <= 0) && (detvbsasb >= 0)) || ( (detvasasb >= 0) && (detvbsasb <= 0)));
@@ -993,9 +950,4 @@
 					<< " if1 = " << ((ndet1 >0) && (ndet2 >0)) 
 					<< " if2 = " << ((dets1 <=0 && dets2 <=0) || (dets2 >=0 && detsb >=0)) << endl;
-#ifdef DRAWING
-				couleur(0);
-				t1->Draw();
-				t2->Draw();
-#endif
 			}
 #endif
@@ -1005,10 +957,4 @@
 #ifdef DEBUG
 			if (ForDebugging) {
-#ifdef DRAWING
-				couleur(4);
-				t1->Draw();
-				t2->Draw();
-				rattente(1);
-#endif
 			}
 #endif
@@ -1081,8 +1027,4 @@
 			}
 
-#ifdef DRAWING1
-			a.MoveTo();b.LineTo();
-#endif
-
 			while (v2 != &b) {
 				TriangleAdjacent tc = Previous(Adj(tta));    
@@ -1128,21 +1070,4 @@
 							ForDebugging = 1;
 #endif
-#ifdef DRAWING1
-							if (  CurrentTh ) {
-								reffecran();
-								couleur(6);
-								CurrentTh->Draw();
-								couleur(1);
-								penthickness(10);
-								a.MoveTo();b.LineTo();
-								penthickness(1);
-								CurrentTh->inquire();
-								couleur(6);
-								l=0;
-								reffecran();
-								while (ks=SwapForForcingEdge(  va,  vb, tc, detss, det1,det2,NbSwap) && (l++ < 1000))
-									cerr << " " << CurrentTh->Number(tc.EdgeVertex(0))<<" " <<CurrentTh->Number(tc.EdgeVertex(1)) << " ";
-							}
-#endif	  
 							MeshError(990);
 						}
@@ -1577,15 +1502,4 @@
 								{
 									cout << " Pb swap the point s is on a edge =>swap " << iedge << " "  << *tt[izerodet] << endl;
-#ifdef DRAWING
-									if(  CurrentTh &&  withrgraphique) 
-									{
-										reffecran();
-
-										DrawMark(s.r);
-										CurrentTh->inquire();
-										DrawMark(s.r);
-										rattente(1); 
-									}      
-#endif
 								}
 								assert(rswap);
@@ -1597,10 +1511,4 @@
 							tt[2]->check();
 #endif
-#ifdef DRAWING1 
-							tt[0]->Draw();
-							tt[1]->Draw();
-							tt[2]->Draw();
-#endif
-
 		}
 
@@ -1665,12 +1573,4 @@
 						tcvi = FindTriangleContening(vi.i,dete);
 						cout << (*tcvi)[1] <<  (*tcvi)[2] << endl;
-#ifdef DRAWING1
-						inquire();
-						penthickness(5);
-						DrawMark(vi.r);
-						penthickness(1);
-						inquire();
-#endif
-
 						MeshError(1001,this);
 					}
@@ -1678,7 +1578,4 @@
 
 					quadtree->Add(vi);
-#ifdef DRAWING1
-					DrawMark(vi.r);
-#endif
 					assert (tcvi && tcvi->det >= 0) ;// internal 
 					Add(vi,tcvi,dete);
@@ -1758,13 +1655,4 @@
 							tcvj = FindTriangleContening(vj.i,dete);
 							cout << (*tcvj)[1] <<  (*tcvj)[2] << endl;
-#ifdef DRAWING1
-							inquire();
-							penthickness(5);
-							DrawMark(vj.r);
-							penthickness(1);
-
-							inquire();
-#endif
-
 							MeshError(1001,this);
 						}
@@ -1772,7 +1660,4 @@
 
 						quadtree->Add(vj);
-#ifdef DRAWING1
-						DrawMark(vj.r);
-#endif
 						assert (tcvj && tcvj->det >= 0) ;// internal 
 						Add(vj,tcvj,dete);
@@ -1787,8 +1672,4 @@
 					nbv = iv;
 			}
-
-#ifdef DRAWING1
-			inquire();
-#endif
 
 			for (i=nbvold;i<nbv;i++) 
@@ -1823,31 +1704,4 @@
 					}
 				if(NbErr) { 
-#ifdef DRAWING
-					Int4 kkk=0;
-					//  UnMarkUnSwapTriangle();
-					//  for (i=0;i<nbv;i++)
-					//  kkk += vertices[i].Optim(0);
-					if(verbosity>3)
-						cout << "    Nb of swap louche " << kkk << endl;
-					if(kkk) {
-						for (i=0;i<nbt;i++)
-							if (triangles[i].link) 
-							{
-								double dd =Det(triangles[i][1].r-triangles[i][0].r,triangles[i][2].r-triangles[i][0].r);
-								if(dd <=0) 
-								{
-									NbErr++;
-									cerr << " xxxdet triangle i " << i << " = " << triangles[i].det ;
-									cerr << " xxxdet triangle  " << dd ;
-									cerr << " xxxLes trois sommets " ;
-									cerr << Number(triangles[i][0]) << " "  << Number(triangles[i][1]) << " " 
-										<< Number(triangles[i][2]) << endl;
-									cerr << triangles[i][0].r << triangles[i][1].r << triangles[i][2].r << endl;
-									cerr << triangles[i][0].i << triangles[i][1].i << triangles[i][2].i << endl;
-								}
-							} }
-					inquire();
-#endif
-					//   MeshError(11);
 				}
 
@@ -1906,7 +1760,4 @@
 				nbtold = nbt;
 				nbvold = nbv;
-#ifdef DRAWING1  
-				inquire();
-#endif  
 
 				// default size of  IntersectionTriangle
@@ -1949,12 +1800,4 @@
 
 				}// for triangle   
-
-#ifdef DRAWING1
-				cout << "  -------------------------------------------- " << endl;
-				inquire();
-				reffecran();
-				Draw();
-				penthickness(2);
-#endif
 
 				if (!InsertNewPoints(nbvold,NbTSwap)) 
@@ -2043,8 +1886,4 @@
 				nbtold = nbt;
 				nbvold = nbv;
-#ifdef DRAWING1  
-				inquire();
-#endif  
-
 				// default size of  IntersectionTriangle
 
@@ -2129,7 +1968,4 @@
 
 
-#ifdef DRAWING1
-						penthickness(2); Move(A);Line(B);   penthickness(1);
-#endif
 						const Int4 NbvOld = nbv;
 						lIntTria.SplitEdge(Bh,A,B);
@@ -2213,10 +2049,4 @@
 									R2 VP = V10*s + V11*(1-s);
 									int sss = (c11-c10) >0 ? 1 : -1;
-#ifdef DRAWING1
-									penthickness(2);
-									Move((R2) vi0);
-									Line(VP);
-									penthickness(1);
-#endif
 									// find the 2 point by dichotomie
 									//cout << "   t =" << Number(t) << " c0 " << c0  ;
@@ -2260,8 +2090,4 @@
 
 
-#ifdef DRAWING1
-								Move(vertices[i0].r);
-								Line(vertices[i1].r);
-#endif
 #ifdef TRACETRIANGLE
 								if(trace) {
@@ -2304,9 +2130,4 @@
 										}
 #endif    
-#ifdef DRAWING1  
-										Move(vertices[i0].r);
-										Line(vertices[i1].r);
-										DrawMark(C);
-#endif		
 										// update the new point points of the list 
 										for  (ip0=i0;i0 != (ipp0 = vertices[ip0].ReferenceNumber);ip0=ipp0)
@@ -2317,12 +2138,4 @@
 						} // for (i0= ....
 				}// for triangle   
-
-#ifdef DRAWING1
-				cout << " -------------------------------------------- " << endl;
-				inquire();
-				reffecran();
-				Draw();
-				penthickness(2);
-#endif
 
 				// remove of all the double points
@@ -2338,13 +2151,7 @@
 						vertices[kkk] = vertices[i];
 						vertices[kkk].i = toI2(vertices[kkk].r);
-#ifdef DRAWING1
-						DrawMark(vertices[kkk]);
-#endif
 						vertices[kkk++].ReferenceNumber = 0;
 
 					} 
-#ifdef DRAWING1  
-				penthickness(1);
-#endif
 
 				// insertion part --- 
@@ -2377,7 +2184,4 @@
 
 						quadtree->Add(*vi); //
-#ifdef DRAWING1
-						DrawMark(vi->r);
-#endif
 						assert (tcvi->det >= 0) ;// internal 
 						Add(*vi,tcvi,dete),NbSwap += vi->Optim(1);          
@@ -2385,7 +2189,4 @@
 				}
 				cout << " Nb swap = " << NbSwap << " after " ;
-#ifdef DRAWING1
-				inquire();
-#endif
 
 				for (i=nbvold;i<nbv;i++) 
@@ -2514,7 +2315,4 @@
 						Add(*vi,tcvi,dete);
 						NbSwap += vi->Optim(1,0);
-#ifdef DRAWING1
-						inquire();
-#endif
 
 					}// fin de boucle en icount
@@ -2569,7 +2367,4 @@
 							<< "     Init Total Cpu Time = " << time3 - time0 << "s " << endl;
 
-#ifdef DRAWING1
-					inquire();
-#endif  
 					CurrentTh=OldCurrentTh;
 		}
@@ -2630,5 +2425,4 @@
 		{
 			long int verbosity=20;
-			//#define DRAWING1
 
 			if (verbosity >2)
@@ -2654,7 +2448,4 @@
 			for (Int4 itt=0;itt<nbt;itt++) 
 				triangles[itt].link=0; // par defaut pas de couleur
-#ifdef DRAWING1
-			reffecran();
-#endif
 
 			Int4  NbSubDomTot =0;
@@ -2665,8 +2456,4 @@
 					Int4 i = 0; // niveau de la pile 
 					t->link = t ; // sd forme d'un triangle cicular link
-#ifdef DRAWING1
-					t->Draw(NbSubDomTot-1);
-#endif
-
 
 					HeapTriangle[i] =t ; 
@@ -2684,7 +2471,4 @@
 								{ 
 									i++;
-#ifdef DRAWING1
-									ta->Draw(NbSubDomTot-1);
-#endif
 									ta->link = t->link ;  // on chaine les triangles
 									t->link = ta ;  // d'un meme sous domaine          
@@ -2751,19 +2535,10 @@
 							t = t1->link;
 							mark[it]=k;
-#ifdef DRAWING1  
-							t1->Draw(k);
-#endif
 							subdomains[k].head = t1;
 							// cout << " New -- " << Number(t1) << " " << it << endl;
 							do {// cout << " k " << k << " " << Number(t) << endl;
 								mark[Number(t)]=k;
-#ifdef DRAWING1  
-								t->Draw(k);
-#endif
 								t=t->link;
 							} while (t!=t1);
-#ifdef DRAWING1  
-							t1->Draw(k);
-#endif
 							mark[it]=k++;}
 							//    else if(mark[it] == -2 ) triangles[it].Draw(999);
@@ -2902,7 +2677,4 @@
 											kkk++;
 											assert(mark[Number(tt)]<0);
-#ifdef DRAWING1
-											tt->Draw(i);
-#endif
 											mark[Number(tt)]=i;
 											tt=tt->link;
@@ -2937,8 +2709,4 @@
 
 				}
-
-#ifdef DRAWING1
-				inquire();
-#endif
 				NbOutT=0;
 				for (it=0;it<nbt;it++) 
@@ -2948,9 +2716,4 @@
 				if (verbosity> 2)
 					cout << " Nb of Sub borned Domain  = " <<  NbSubDomTot << " NbOutTriangles = " << NbOutT <<endl;
-#ifdef DRAWING1
-				inquire();
-#endif
-
-				//#undef DRAWING1
 
 
@@ -3267,5 +3030,4 @@
 		void Triangles::GeomToTriangles1(Int4 inbvx,int KeepBackVertices) 
 		{ 
-			//#define DRAWING1
 			Gh.NbRef++;// add a ref to Gh
 
@@ -3296,10 +3058,4 @@
 			PreInit(inbvx);
 			BTh.SetVertexFieldOn();
-#ifdef DRAWING
-			if (withrgraphique)
-			{ BTh.InitDraw();
-				reffecran(); 
-				CurrentTh = this;}
-#endif
 				int * bcurve = new int[Gh.NbOfCurves]; // 
 
@@ -3542,10 +3298,4 @@
 													PreviousNewEdge->adj[1] =  e;
 												PreviousNewEdge = e;
-#ifdef DRAWING1
-												e->Draw();
-												//         A0->Draw();
-												A1->m.Draw(*A1);
-												A1->Draw(Number(A1));
-#endif
 												A0=A1;
 												sNew += Lstep;
@@ -3592,14 +3342,5 @@
 										PreviousNewEdge->adj[1] =  e;
 									PreviousNewEdge = e;
-									//		      cout << "Last new edge " << nbe << " " << " on " << Gh.Number(pe->on) 
-									//   << " of curve =" <<pe->on->CurveNumber <<endl;
-
-
-#ifdef DRAWING1 
-									e->Draw();
-									A1->Draw();
-									A0->Draw();
-									//                      inquire();
-#endif
+
 									assert(i==NbCreatePointOnCurve);
 
@@ -3657,27 +3398,10 @@
 
 
-#ifdef DRAWING1
-				reffecran();
-				InitDraw();
-				Draw();
-				inquire();
-#endif
-
 				Insert();
 				ForceBoundary();
 				FindSubDomain();
 
-#ifdef DRAWING1
-				reffecran();
-				Draw();
-				inquire();
-#endif
-				// NewPointsOld(*this) ;
-				//  BTh.ReMakeTriangleContainingTheVertex(); //  FH change => put in NewPoints
-				//  for (Int4 iv=0;iv<BTh.nbv;iv++)
-				//    BTh[iv].i = toI2(BTh[iv].r);
 				NewPoints(BTh,KeepBackVertices) ;
 				CurrentTh = 0;
-				//#undef  DRAWING1 
 		}
 
@@ -3689,10 +3413,4 @@
 			Int4 i,NbOfCurves=0,NbNewPoints,NbEdgeCurve;
 			Real8 lcurve, lstep,s;
-#ifdef DRAWING
-			if (withrgraphique)
-			{
-				Gh.InitDraw() ;
-				CurrentTh = this; }
-#endif
 
 				R2 AB;
@@ -3731,7 +3449,4 @@
 				// generation of the curves
 				assert(! edges);
-#ifdef DRAWING1
-				reffecran();
-#endif
 				// 2 step 
 				// --step=0 to compute the number of edges + alloc at end
@@ -3774,7 +3489,4 @@
 												edges[nbe].adj[0] = 0;
 												edges[nbe].adj[1] = 0;
-#ifdef DRAWING1
-												edges[nbe].Draw();
-#endif
 												nbe++;}
 									}
@@ -3879,8 +3591,4 @@
 														if(PreviousNewEdge)
 															PreviousNewEdge->adj[1] = &edges[nbe];
-#ifdef DRAWING1
-														vb->Draw();
-														edges[nbe].Draw();
-#endif
 														PreviousNewEdge = edges + nbe;
 														nbe++;
@@ -3936,8 +3644,4 @@
 												PreviousNewEdge->adj[1] = & edges[nbe];
 
-
-#ifdef DRAWING1
-											edges[nbe].Draw();
-#endif
 											nbe++;}
 										else
@@ -3965,20 +3669,8 @@
 				} // for (step=0;step<2;step++)
 
-#ifdef DRAWING1
-				reffecran();
-				InitDraw();
-				Draw();
-				inquire();
-#endif
-
 				Insert();
 				ForceBoundary();
 				FindSubDomain();
 
-#ifdef DRAWING1
-				reffecran();
-				Draw();
-				inquire();
-#endif
 				// NewPointsOld(*this) ;
 				NewPoints(*this,0) ;
@@ -4497,41 +4189,4 @@
 			}
 
-		/** -- old with a bug we loss some time last swap
-
-		  Int4  Triangle::Optim(Int2 i,int koption)
-		  {
-		// turn in the positif sens around vertex s  
-		register  Int4 NbSwap =0;
-		register Vertex * s  = ns[i];
-		register Triangle * tbegin=0 , *t = this , *ttc;
-		register int k=0,j = EdgesVertexTriangle[i][0],jc;
-		tbegin=t;
-		do {
-		k++; 
-#ifdef DEBUG
-assert( s == & (*t)[VerticesOfTriangularEdge[j][1]] );
-#endif
-#ifdef DRAWING1 
-t->Draw();
-DrawMark( s->r);
-#endif
-ttc =  t->at[j];
-jc = NextEdge[t->aa[j]&3];
-cout << *t << " " <<  VerticesOfTriangularEdge[j][1] << "\n\t try swap " << * ttc << " " << jc ;
-while ( ttc->swap(jc,koption)) {
-NbSwap++,assert(k++<20000);
-ttc =  t->at[j];
-jc = NextEdge[t->aa[j]&3];
-cout << "\n\t s  " <<  *ttc << " " << jc << endl;
-}
-cout << endl;
-t = ttc;
-j = NextEdge[jc];
-assert(k<20000);
-} while ( (tbegin != t)); 
-
-return NbSwap;
-}
-*/
 Int4  Triangle::Optim(Int2 i,int koption)
 {
@@ -4626,13 +4281,4 @@
 		cout << "      MakeQuadTree" << endl;
 	if (  !quadtree )  quadtree = new QuadTree(this);
-
-
-#ifdef DRAWING1
-	quadtree->Draw();
-	rattente(1);
-	reffecran();
-	quadtree->Draw();
-	rattente(1);
-#endif
 
 }
@@ -4731,12 +4377,4 @@
 					R2 PQ = vQ.r - vP.r;
 					Real8 l = log(LengthInterpole(vP,vQ,PQ));
-#ifdef DRAWING2             
-					if (l>1.4)  {
-						penthickness(3);
-						vP.MoveTo(),vQ.LineTo();
-						penthickness(1);
-						cout << "   l = " << l << Number(vP) << " edge = " << Number(vQ) << endl;
-					}
-#endif             
 					nbedges++;
 					k = (int) ((l - lmin)*delta);
@@ -5052,7 +4690,4 @@
 		}
 		assert(a>= vertices && a < vertices+nbv);
-#ifdef DRAWING1 
-		a->Draw();
-#endif 
 		//  int k=0;
 		t = a->t;
@@ -5083,8 +4718,4 @@
 		assert( kkkk++ < 2000 ); 
 		j= OppositeVertex[jj];
-
-#ifdef DRAWING1
-		t->Draw();
-#endif 
 		dete[j] = detop;  //det(*b,*s1,*s2);
 		jn = NextVertex[j];
Index: /issm/trunk/src/c/Bamgx/Mesh2.h
===================================================================
--- /issm/trunk/src/c/Bamgx/Mesh2.h	(revision 2800)
+++ /issm/trunk/src/c/Bamgx/Mesh2.h	(revision 2801)
@@ -40,7 +40,4 @@
 #include <unistd.h>
 #endif
-#ifdef  DRAWING
-#include "rgraph.hpp"
-#endif
 
 extern int SHOW;
@@ -90,10 +87,4 @@
  {return a<0 ? Pi + a :a - Pi ;}
  
-#ifdef DRAWING
-extern Real4  xGrafCoef,yGrafCoef,xGrafOffSet,yGrafOffSet;
-extern R2 GrafPMin,GrafPMax;
-extern Real8 Grafh;
-#endif
-
 Icoor2 inline det(const I2 &a,const I2 & b,const I2 &c)
 {
@@ -157,19 +148,4 @@
                                      r = (x*i + y*j) >=0;}
                                    return r;}
-#ifdef DRAWING
- void  Draw() {
-                         if (dir!= MaxICoor) {
-                                     Icoor2 x(dir/2),y1(MaxICoor/2-Abs(x)),y(dir%2?-y1:y1);
-                                     R2 D(x,y);
-                                     double eps = Grafh/Norme2(D)/20;
-                                     D = D*eps;
-                                     rmoveto(D.x,D.y);
-                                    }
-  }
-#endif                                   
-                                   
-      
-                              
-  
 };
 /////////////////////////////////////////////////////////////////////////////////////
@@ -203,10 +179,4 @@
   {f << "(" << v.i  << "," << v.r << MatVVP2x2(v.m) << ")" ;   return f;}
   inline void Set(const Vertex & rec,const Triangles &,Triangles &);
-  
-#ifdef DRAWING
-  void  Draw(Int4 =-1) const ;
-  void MoveTo() const  {    rmoveto(r.x,r.y);  }
-  void LineTo() const {    rlineto(r.x,r.y);  }
-#endif  
 };
 
@@ -282,7 +252,4 @@
   inline void Set(const Triangles &,Int4,Triangles &);
   
-#ifdef DRAWING
-  void  Draw(Int4 = -1) const ;
-#endif
 }; // end of Edge class 
 
@@ -352,8 +319,4 @@
   inline void Set(const GeometricalEdge & rec,const Geometry & Th ,Geometry & ThNew);
 
-#ifdef DRAWING 
-  void Draw(Int4  =-1);
-#endif
-  
 };
   
@@ -493,10 +456,4 @@
   void inline checka(Int1 a); 
   void inline check();
-#endif
-
-#ifdef DRAWING
-  void  Draw(Int4 i=-1) const;
-  int swapDRAW(Int2 a1);
-
 #endif
 
@@ -1428,31 +1385,4 @@
 #endif
 
-
-
-
-#ifdef DRAWING 
-extern Real4 xGrafCoef,yGrafCoef,xGrafOffSet,yGrafOffSet; // R2 -> I2 transform
-extern R2 Gpmin,Gpmax;
-//extern Real8 Gh;
-// cf routine ILineTo IMoveto
-
-extern void  IMoveTo(long i,long j);
-extern void  ILineTo(long i,long j);
-extern char Getxyc(long &i,long &j);
-extern void Draw(float ,float );
-extern void Draw(long ,long );
-extern void DrawMark(R2 r);
-//inline void DrawMark(D2 r) {DrawMark(R2(r.x,r.y));}
-inline void Move(I2 x) {IMoveTo(x.x,x.y);}
-inline void Move(R2 x) {rmoveto(x.x,x.y);}
-//inline void Move(D2 x) {rmoveto(x.x,x.y);}
-inline void Line(I2 x){ILineTo(x.x,x.y);}
-inline void Line(R2 x) {rlineto(x.x,x.y);}
-//inline void Line(D2 x) {rlineto(x.x,x.y);}
+}
 #endif
-
-}
-
-
-#endif
-
