|
From: <de...@us...> - 2003-09-02 09:01:09
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data
In directory sc8-pr-cvs1:/tmp/cvs-serv12326/data
Modified Files:
TrCalqueMaillage.java
Added Files:
TrCalqueBord.java TrModeleBord.java
Log Message:
Support des bords dans les calques
--- NEW FILE: TrCalqueBord.java ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: TrModeleBord.java ---
(This appears to be a binary file; contents omitted.)
Index: TrCalqueMaillage.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/data/TrCalqueMaillage.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrCalqueMaillage.java 22 Aug 2003 16:02:24 -0000 1.1
--- TrCalqueMaillage.java 2 Sep 2003 09:00:36 -0000 1.2
***************
*** 37,62 ****
* @version $Id$
*/
! public class TrCalqueMaillage extends ZCalqueAffichageDonnees
!
! {
H2dMaillage mail_;
ZCalquePoint cqPt_;
/**
* @param _pts
* @param _elts
*/
! public TrCalqueMaillage(H2dMaillage _maill)
! {
setName("Maillage");
! mail_=_maill;
! cqPt_=new ZCalquePoint(new ModelePoint());
cqPt_.setName("Points");
add(cqPt_);
! BCalque p=new ZCalquePolygone(new ModelePolygone());
! p.setName("polygone");
! add(p);
! p=new ZCalqueLongPolygone(new ModeleBord());
! p.setName("bord");
! add(p);
}
--- 37,65 ----
* @version $Id$
*/
! public class TrCalqueMaillage extends ZCalqueAffichageDonnees {
H2dMaillage mail_;
ZCalquePoint cqPt_;
+ ZCalquePolygone cqPoly_;
+ ZCalqueLongPolygone cqBord_;
/**
* @param _pts
* @param _elts
*/
! public TrCalqueMaillage(H2dMaillage _maill) {
setName("Maillage");
! setDestructible(false);
! mail_= _maill;
! cqPt_= new ZCalquePoint(new ModelePoint());
cqPt_.setName("Points");
+ cqPt_.setDestructible(false);
add(cqPt_);
! cqPoly_= new ZCalquePolygone(new ModelePolygone());
! cqPoly_.setDestructible(false);
! cqPoly_.setName("polygone");
! add(cqPoly_);
! cqBord_= new ZCalqueLongPolygone(new ModeleBord());
! cqBord_.setDestructible(false);
! cqBord_.setName("bord");
! add(cqBord_);
}
***************
*** 64,100 ****
*
*/
! public GrBoite getDomaine()
! {
! GrBoite b = new GrBoite();
! H2dPoint pt=mail_.getMinPoint();
! b.o = new GrPoint(pt.getX(), pt.getY(), pt.getZ());
! pt=mail_.getMaxPoint();
! b.e = new GrPoint(pt.getX(), pt.getY(), pt.getZ());
! return b;
}
! public ZModelePoint getModelePoint()
! {
return new ModelePoint();
}
! public ZModelePolygone getModelePolygone()
! {
return new ModelePolygone();
}
!
! public ZModeleLongPolygone getModeleBord()
! {
return new ModeleBord();
}
! private class ModelePoint implements ZModelePoint
! {
/**
*
*/
! public boolean point(GrPoint _p, int _i)
! {
return TrCalqueMaillage.this.point(_p, _i);
}
--- 67,103 ----
*
*/
! public GrBoite getDomaine() {
! return getDomaine(mail_);
}
+
+ public static GrBoite getDomaine(H2dMaillage _m) {
+ GrBoite b= new GrBoite();
+ H2dPoint pt= _m.getMinPoint();
+ b.o= new GrPoint(pt.getX(), pt.getY(), pt.getZ());
+ pt= _m.getMaxPoint();
+ b.e= new GrPoint(pt.getX(), pt.getY(), pt.getZ());
+ return b;
+ }
+
+
! public ZModelePoint getModelePoint() {
return new ModelePoint();
}
! public ZModelePolygone getModelePolygone() {
return new ModelePolygone();
}
!
! public ZModeleLongPolygone getModeleBord() {
return new ModeleBord();
}
! private class ModelePoint implements ZModelePoint {
/**
*
*/
! public boolean point(GrPoint _p, int _i) {
return TrCalqueMaillage.this.point(_p, _i);
}
***************
*** 103,108 ****
*
*/
! public GrBoite getDomaine()
! {
return TrCalqueMaillage.this.getDomaine();
}
--- 106,110 ----
*
*/
! public GrBoite getDomaine() {
return TrCalqueMaillage.this.getDomaine();
}
***************
*** 111,116 ****
*
*/
! public int getNombre()
! {
return TrCalqueMaillage.this.mail_.getPtsNb();
}
--- 113,117 ----
*
*/
! public int getNombre() {
return TrCalqueMaillage.this.mail_.getPtsNb();
}
***************
*** 119,124 ****
*
*/
! public Object getObject(int _ind)
! {
throw new UnsupportedOperationException("methode non implantée");
}
--- 120,124 ----
*
*/
! public Object getObject(int _ind) {
throw new UnsupportedOperationException("methode non implantée");
}
***************
*** 126,138 ****
}
! protected class ModelePolygone implements ZModelePolygone
! {
!
/**
*
*/
! public boolean polygone(GrPolygone _p, int _i)
! {
return TrCalqueMaillage.this.polygone(_p, _i);
}
--- 126,135 ----
}
! protected class ModelePolygone implements ZModelePolygone {
/**
*
*/
! public boolean polygone(GrPolygone _p, int _i) {
return TrCalqueMaillage.this.polygone(_p, _i);
}
***************
*** 141,146 ****
*
*/
! public GrBoite getDomaine()
! {
return TrCalqueMaillage.this.getDomaine();
}
--- 138,142 ----
*
*/
! public GrBoite getDomaine() {
return TrCalqueMaillage.this.getDomaine();
}
***************
*** 149,154 ****
*
*/
! public int getNombre()
! {
return TrCalqueMaillage.this.mail_.getEltNb();
}
--- 145,149 ----
*
*/
! public int getNombre() {
return TrCalqueMaillage.this.mail_.getEltNb();
}
***************
*** 157,162 ****
*
*/
! public Object getObject(int _ind)
! {
throw new UnsupportedOperationException("methode non implantée");
}
--- 152,156 ----
*
*/
! public Object getObject(int _ind) {
throw new UnsupportedOperationException("methode non implantée");
}
***************
*** 165,209 ****
*
*/
! public int nbPoints(int i)
! {
return TrCalqueMaillage.this.getNbPointsForElt(i);
}
}
!
! public int getNbPointsForElt(int _indexElt)
! {
return mail_.getElement(_indexElt).getPtNb();
!
}
! public static void initGrPoint(H2dPoint _pt, GrPoint _ptToinit)
! {
! _ptToinit.x = _pt.getX();
! _ptToinit.y = _pt.getY();
! _ptToinit.z = _pt.getZ();
}
public static void initGrPolygone(
! H2dMaillage _ma,
H2dElement _pt,
! GrPolygone _ptToinit)
! {
! int n = _pt.getPtNb();
! if (_ptToinit.nombre() != n)
! {
_ptToinit.sommets.setSize(n);
}
GrPoint grpt;
H2dPoint hpt;
! for (int i = 0; i < n; i++)
! {
! hpt = _ma.getPt(_pt.getPtIndex()[i]);
! grpt = _ptToinit.sommets.renvoie(i);
if (grpt != null)
initGrPoint(hpt, grpt);
! else
! {
! grpt = new GrPoint(hpt.getX(), hpt.getY(), hpt.getZ());
_ptToinit.sommets.remplace(grpt, i);
}
--- 159,196 ----
*
*/
! public int nbPoints(int i) {
return TrCalqueMaillage.this.getNbPointsForElt(i);
}
}
!
! public int getNbPointsForElt(int _indexElt) {
return mail_.getElement(_indexElt).getPtNb();
!
}
! public static void initGrPoint(H2dPoint _pt, GrPoint _ptToinit) {
! _ptToinit.x= _pt.getX();
! _ptToinit.y= _pt.getY();
! _ptToinit.z= _pt.getZ();
}
public static void initGrPolygone(
! H2dMaillage _ma,
H2dElement _pt,
! GrPolygone _ptToinit) {
! int n= _pt.getPtNb();
! if (_ptToinit.nombre() != n) {
_ptToinit.sommets.setSize(n);
}
GrPoint grpt;
H2dPoint hpt;
! for (int i= 0; i < n; i++) {
! hpt= _ma.getPt(_pt.getPtIndex()[i]);
! grpt= _ptToinit.sommets.renvoie(i);
if (grpt != null)
initGrPoint(hpt, grpt);
! else {
! grpt= new GrPoint(hpt.getX(), hpt.getY(), hpt.getZ());
_ptToinit.sommets.remplace(grpt, i);
}
***************
*** 211,250 ****
}
!
! private class ModeleBord implements ZModeleLongPolygone
! {
!
private TIntObjectHashMap indexMinMax_;
!
! public ModeleBord()
! {
! int n=mail_.getPtsFrontiere().getBordInternNb();
! if(n>0)
! {
! indexMinMax_=new TIntObjectHashMap(n);
! for(int i=0;i<n;i++)
! {
! indexMinMax_.put(i,mail_.getMinMaxPointFrontiere(i));
}
}
}
!
! /**
! *
! */
! public GrBoite getDomaineForPolygoneIdx(int _idx)
! {
! if(_idx==0) return TrCalqueMaillage.this.getDomaine();
! if(indexMinMax_==null)
! {
System.err.println("Prob !!!");
return null;
! }
! else
! {
! H2dPoint[] minMax=(H2dPoint[])indexMinMax_.get(_idx-1);
! GrBoite r=new GrBoite();
! r.o=new GrPoint();
! r.e=new GrPoint();
initGrPoint(minMax[0], r.o);
initGrPoint(minMax[1], r.e);
--- 198,230 ----
}
!
! private class ModeleBord implements ZModeleLongPolygone {
!
private TIntObjectHashMap indexMinMax_;
!
! public ModeleBord() {
! int n= mail_.getPtsFrontiere().getBordInternNb();
! if (n > 0) {
! indexMinMax_= new TIntObjectHashMap(n);
! for (int i= 0; i < n; i++) {
! indexMinMax_.put(i, mail_.getMinMaxPointFrontiere(i));
}
}
}
!
! /**
! *
! */
! public GrBoite getDomaineForPolygoneIdx(int _idx) {
! if (_idx == 0)
! return TrCalqueMaillage.this.getDomaine();
! if (indexMinMax_ == null) {
System.err.println("Prob !!!");
return null;
! } else {
! H2dPoint[] minMax= (H2dPoint[])indexMinMax_.get(_idx - 1);
! GrBoite r= new GrBoite();
! r.o= new GrPoint();
! r.e= new GrPoint();
initGrPoint(minMax[0], r.o);
initGrPoint(minMax[1], r.e);
***************
*** 257,262 ****
*
*/
! public int getNbPointForPolygoneIdx(int _idx)
! {
return TrCalqueMaillage.this.mail_.getPtsFrontiere().getPtNbForBord(_idx);
}
--- 237,241 ----
*
*/
! public int getNbPointForPolygoneIdx(int _idx) {
return TrCalqueMaillage.this.mail_.getPtsFrontiere().getPtNbForBord(_idx);
}
***************
*** 265,270 ****
*
*/
! public int getPolygoneNb()
! {
return TrCalqueMaillage.this.mail_.getPtsFrontiere().getBordNb();
}
--- 244,248 ----
*
*/
! public int getPolygoneNb() {
return TrCalqueMaillage.this.mail_.getPtsFrontiere().getBordNb();
}
***************
*** 273,279 ****
*
*/
! public boolean point(GrPoint _p, int _polygoneIdx, int _pointIdx)
! {
! H2dPoint pt=mail_.getPt(TrCalqueMaillage.this.mail_.getPtsFrontiere().getPtIdxForBord(_polygoneIdx,_pointIdx));
initGrPoint(pt, _p);
return true;
--- 251,260 ----
*
*/
! public boolean point(GrPoint _p, int _polygoneIdx, int _pointIdx) {
! H2dPoint pt=
! mail_.getPt(
! TrCalqueMaillage.this.mail_.getPtsFrontiere().getPtIdxForBord(
! _polygoneIdx,
! _pointIdx));
initGrPoint(pt, _p);
return true;
***************
*** 283,288 ****
*
*/
! public GrBoite getDomaine()
! {
return TrCalqueMaillage.this.getDomaine();
}
--- 264,268 ----
*
*/
! public GrBoite getDomaine() {
return TrCalqueMaillage.this.getDomaine();
}
***************
*** 291,296 ****
*
*/
! public int getNombre()
! {
return TrCalqueMaillage.this.mail_.getPtsFrontiere().getBordNb();
}
--- 271,275 ----
*
*/
! public int getNombre() {
return TrCalqueMaillage.this.mail_.getPtsFrontiere().getBordNb();
}
***************
*** 299,314 ****
*
*/
! public Object getObject(int _ind)
! {
return null;
}
! }
/**
*
*/
! public boolean point(GrPoint _p, int _i)
! {
initGrPoint(mail_.getPt(_i), _p);
return true;
--- 278,291 ----
*
*/
! public Object getObject(int _ind) {
return null;
}
! }
/**
*
*/
! public boolean point(GrPoint _p, int _i) {
initGrPoint(mail_.getPt(_i), _p);
return true;
***************
*** 318,323 ****
*
*/
! public boolean polygone(GrPolygone _poly, int _i)
! {
initGrPolygone(this.mail_, mail_.getElement(_i), _poly);
return true;
--- 295,299 ----
*
*/
! public boolean polygone(GrPolygone _poly, int _i) {
initGrPolygone(this.mail_, mail_.getElement(_i), _poly);
return true;
***************
*** 345,349 ****
*/
public EbliListeSelection selection(GrPolygone _poly, boolean _partiel) {
! return cqPt_.selection(_poly,_partiel);
}
--- 321,345 ----
*/
public EbliListeSelection selection(GrPolygone _poly, boolean _partiel) {
! return cqPt_.selection(_poly, _partiel);
! }
!
! private boolean polyOldValue= true;
!
! /**
! *
! */
! public void setRapide(boolean _v) {
! if (rapide_ != _v) {
! boolean vp= rapide_;
! rapide_= _v;
! cqPt_.setRapide(_v);
! cqBord_.setRapide(_v);
! if (_v) {
! polyOldValue= cqPoly_.isVisible();
! cqPoly_.setVisible(false);
! } else
! cqPoly_.setVisible(polyOldValue);
! firePropertyChange("ajustement", vp, rapide_);
! }
}
|