From: Frederic D. <de...@us...> - 2004-06-11 16:39:57
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/controle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6565/src/org/fudaa/fudaa/meshviewer/controle Modified Files: MvCheckNodeLayer.java MvCheckElementLayer.java Log Message: Index: MvCheckNodeLayer.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvCheckNodeLayer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MvCheckNodeLayer.java 5 May 2004 12:42:36 -0000 1.1 --- MvCheckNodeLayer.java 11 Jun 2004 16:39:46 -0000 1.2 *************** *** 1,4 **** ! /* ! * @file MvCheckNodeLayer.java * @creation 10 févr. 2004 * @modification $Date$ --- 1,3 ---- ! /** * @creation 10 févr. 2004 * @modification $Date$ *************** *** 36,43 **** /** ! * */ public String getTitle() { ! return ((MvCheckNodeModel)modele_).getDesc(); } --- 35,42 ---- /** ! * @see org.fudaa.ebli.calque.BCalque#getTitle() */ public String getTitle() { ! return ((MvCheckNodeModel) modele_).getDesc(); } *************** *** 45,102 **** * @param _g */ ! public void paintComponent(Graphics _g) { ! MvCheckNodeModel model= (MvCheckNodeModel)modele_; ! int nbPtErr= model.getNbPtWithError(); ! if ((nbPtErr <= 0) && isSelectionEmpty()) ! return; ! GrBoite clip= getClipReel(_g); ! GrBoite domaine= modele_.getDomaine(); //Si le domaine des polys n'est pas dans le domaine d'affichage on arrete ! if (!domaine.intersectXY(clip)) { ! return; ! } ! GrMorphisme versEcran= getVersEcran(); ! boolean attenue= isAttenue(); ! boolean rapide= isRapide(); ! Color foreground= getForeground(); ! Icon icone= getIcone(); if (attenue) { ! foreground= attenueCouleur(foreground); ! icone= attenueIcone(icone); } ! GrPoint p= new GrPoint(); _g.setColor(foreground); ! for (int i= nbPtErr - 1; i >= 0; i--) { modele_.point(p, model.getPtIdxWithError(i)); ! if (!clip.contientXY(p)) ! continue; p.autoApplique(versEcran); ! icone.paintIcon(this, _g, (int)p.x, (int)p.y); ! } ! if ((!rapide) && (!isSelectionEmpty())) { ! initIconeSelection(); ! initCouleurSelection(); ! Color cs= couleurSelection(); ! Icon ic= iconeSelection(); ! if (attenue) { ! cs= attenueCouleur(cs); ! ic= attenueIcone(ic); ! } ! _g.setColor(cs); ! int nb= selection_.getMaxIndex(); ! int max= modele_.getNombre(); ! if (nb >= max) ! nb= max - 1; ! for (int i= selection_.getMinIndex(); i <= nb; i++) { ! if (selection_.isSelected(i)) { ! modele_.point(p, i); ! if (clip.contientXY(p)) { ! p.autoApplique(versEcran); ! ic.paintIcon(this, _g, (int)p.x, (int)p.y); ! } ! } ! } } } ! } --- 44,72 ---- * @param _g */ ! public void paintDonnees(Graphics _g) { ! MvCheckNodeModel model = (MvCheckNodeModel) modele_; ! int nbPtErr = model.getNbPtWithError(); ! if ((nbPtErr <= 0) && isSelectionEmpty()) return; ! GrBoite clip = getClipReel(_g); ! GrBoite domaine = modele_.getDomaine(); //Si le domaine des polys n'est pas dans le domaine d'affichage on arrete ! if (!domaine.intersectXY(clip)) { return; } ! GrMorphisme versEcran = getVersEcran(); ! boolean attenue = isAttenue(); ! Color foreground = getForeground(); ! Icon icone = getIcone(); if (attenue) { ! foreground = attenueCouleur(foreground); ! icone = attenueIcone(icone); } ! GrPoint p = new GrPoint(); _g.setColor(foreground); ! for (int i = nbPtErr - 1; i >= 0; i--) { modele_.point(p, model.getPtIdxWithError(i)); ! if (!clip.contientXY(p)) continue; p.autoApplique(versEcran); ! icone.paintIcon(this, _g, (int) p.x, (int) p.y); } } ! } \ No newline at end of file Index: MvCheckElementLayer.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/meshviewer/controle/MvCheckElementLayer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MvCheckElementLayer.java 5 May 2004 12:42:36 -0000 1.1 --- MvCheckElementLayer.java 11 Jun 2004 16:39:46 -0000 1.2 *************** *** 1,4 **** ! /* ! * @file MvCheckElementLayer.java * @creation 10 févr. 2004 * @modification $Date$ --- 1,3 ---- ! /** * @creation 10 févr. 2004 * @modification $Date$ *************** *** 13,18 **** import java.awt.Graphics2D; - import javax.swing.Icon; - import org.fudaa.ebli.geometrie.GrBoite; import org.fudaa.ebli.geometrie.GrMorphisme; --- 12,15 ---- *************** *** 20,24 **** import org.fudaa.ebli.geometrie.GrPolygone; import org.fudaa.ebli.trace.TraceIcone; - import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceSurface; import org.fudaa.fudaa.meshviewer.layer.MvElementLayer; --- 17,20 ---- *************** *** 30,141 **** */ public class MvCheckElementLayer extends MvElementLayer { TraceSurface ts_; public MvCheckElementLayer(MvCheckElementModel _m) { super(_m); setBackground(Color.red); ! icone_=new TraceIcone(TraceIcone.CROIX,5); } private MvCheckElementModel getM() { ! return (MvCheckElementModel)modele_; } - - /** * @param _g */ ! public void paintComponent(Graphics _g) { ! if ((modele_ == null) || (modele_.getNombre() <= 0)) ! return; ! MvCheckElementModel m= getM(); ! int nbElt= m.getNbEltWithError(); ! if ((nbElt <= 0) && (isSelectionEmpty())) ! return; ! GrBoite clip= getClipReel(_g); ! GrBoite domaine= modele_.getDomaine(); ! if (!domaine.intersectXY(clip)) { ! return; ! } ! GrMorphisme versEcran= getVersEcran(); ! boolean attenue= isAttenue(); ! boolean rapide= isRapide(); ! Color background= getBackground(); ! if (attenue) ! background= attenueCouleur(background); ! GrPolygone p= new GrPolygone(); ! GrBoite bPoly= new GrBoite(); //utilse uniquement pour dessiner la croix afin de voir //facilement les elements detectes. ! GrPoint centre=new GrPoint(); ! if (ts_ == null) ! ts_= new TraceSurface((Graphics2D)_g); ! else ! ts_.setGraphics((Graphics2D)_g); ts_.setCouleurFond(background); ! ((TraceIcone)icone_).couleur(background); ! for (int i= nbElt - 1; i >= 0; i--) { modele_.polygone(p, m.getEltIdxWithError(i)); p.boite(bPoly); //Si la boite du polygone n'est pas dans la boite d'affichage on passe ! if (bPoly.intersectionXY(clip) == null) ! continue; ! int nbPoints= p.sommets.nombre(); ! if (nbPoints <= 0) ! continue; p.autoApplique(versEcran); p.centre(centre); ! icone_.paintIcon(this, _g,(int) centre.x, (int)centre.y); ts_.remplitPolygone(p.polygon()); } - if ((!rapide) && (!isSelectionEmpty())) { - if (tlSelection_ == null) - tlSelection_= new TraceLigne((Graphics2D)_g); - else - tlSelection_.graphics((Graphics2D)_g); - initIconeSelection(); - initCouleurSelection(); - Color cs= couleurSelection(); - Icon ic= iconeSelection(); - if (attenue) { - cs= attenueCouleur(cs); - ic= attenueIcone(ic); - } - _g.setColor(cs); - tlSelection_.setCouleur(cs); - //tlSelection_.setEpaisseur(2f); - int nb= selection_.getMaxIndex(); - for (int i= nb; i >= 0; i--) { - if (!selection_.isSelected(i)) - continue; - modele_.polygone(p, i); - if (clip.intersectXY(p.boite())) { - p.autoApplique(versEcran); - int nbPoints= p.nombre(); - GrPoint ptOri= p.sommets.renvoie(0); - GrPoint ptDest; - for (int j= nbPoints - 1; j >= 0; j--) { - //le point de dest est initialise - ptDest= p.sommets.renvoie(j); - ic.paintIcon(this, _g, (int)ptDest.x, (int)ptDest.y); - tlSelection_.dessineTrait(ptOri.x, ptOri.y, ptDest.x, ptDest.y); - ptOri= ptDest; - } - } - } - } } /** ! * */ public String getTitle() { return getM().getDesc(); } - - /** ! * */ public void fillWithInfo(InfoData _m) { --- 26,92 ---- */ public class MvCheckElementLayer extends MvElementLayer { + TraceSurface ts_; + + /** + * @param _m le modele correspondant + */ public MvCheckElementLayer(MvCheckElementModel _m) { super(_m); setBackground(Color.red); ! icone_ = new TraceIcone(TraceIcone.CROIX, 5); } private MvCheckElementModel getM() { ! return (MvCheckElementModel) modele_; } /** * @param _g */ ! public void paintDonnees(Graphics _g) { ! if ((modele_ == null) || (modele_.getNombre() <= 0)) return; ! MvCheckElementModel m = getM(); ! int nbElt = m.getNbEltWithError(); ! if ((nbElt <= 0) && (isSelectionEmpty())) return; ! GrBoite clip = getClipReel(_g); ! GrBoite domaine = modele_.getDomaine(); ! if (!domaine.intersectXY(clip)) { return; } ! GrMorphisme versEcran = getVersEcran(); ! boolean attenue = isAttenue(); ! Color background = getBackground(); ! if (attenue) background = attenueCouleur(background); ! GrPolygone p = new GrPolygone(); ! GrBoite bPoly = new GrBoite(); //utilse uniquement pour dessiner la croix afin de voir //facilement les elements detectes. ! GrPoint centre = new GrPoint(); ! if (ts_ == null) ts_ = new TraceSurface((Graphics2D) _g); ! else ts_.setGraphics((Graphics2D) _g); ts_.setCouleurFond(background); ! ((TraceIcone) icone_).couleur(background); ! for (int i = nbElt - 1; i >= 0; i--) { modele_.polygone(p, m.getEltIdxWithError(i)); p.boite(bPoly); //Si la boite du polygone n'est pas dans la boite d'affichage on passe ! if (bPoly.intersectionXY(clip) == null) continue; ! int nbPoints = p.sommets.nombre(); ! if (nbPoints <= 0) continue; p.autoApplique(versEcran); p.centre(centre); ! icone_.paintIcon(this, _g, (int) centre.x, (int) centre.y); ts_.remplitPolygone(p.polygon()); } } /** ! * @see org.fudaa.ebli.calque.BCalque#getTitle() */ public String getTitle() { return getM().getDesc(); } /** ! * @see org.fudaa.fudaa.meshviewer.layer.MvLayer#fillWithInfo(org.fudaa.fudaa.meshviewer.layer.MvPanelInfo.InfoData) */ public void fillWithInfo(InfoData _m) { *************** *** 143,145 **** } ! } --- 94,96 ---- } ! } \ No newline at end of file |