Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d
In directory sc8-pr-cvs1:/tmp/cvs-serv13994/h2d
Modified Files:
H2dBord.java H2dBordMutable.java
H2dBorderPerFrontierInterface.java H2dCLManagerAbstract.java
H2dCLManagerInterface.java H2dMaillageFrontiere.java
H2dParametres.java H2dProjectListener.java h2d_en.fr_txt
h2d_en.txt
Added Files:
H2dClListener.java
Removed Files:
H2dClChangeListener.java
Log Message:
Ajout du pattern command pour annuler des operations
--- NEW FILE: H2dClListener.java ---
/*
* @file H2dClChangeListener.java
* @creation 29 sept. 2003
* @modification $Date: 2003/10/29 11:41:27 $
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* @author deniger
* @version $Id: H2dClListener.java,v 1.1 2003/10/29 11:41:27 deniger Exp $
*/
public interface H2dClListener {
public void clChanged(H2dBord b,H2dBordType _old);
}
Index: H2dBord.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBord.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** H2dBord.java 10 Oct 2003 14:43:19 -0000 1.8
--- H2dBord.java 29 Oct 2003 11:41:27 -0000 1.9
***************
*** 9,16 ****
*/
package org.fudaa.dodico.h2d;
-
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.h2d.type.H2dBordType;
-
/**
* @author deniger
--- 9,14 ----
***************
*** 18,36 ****
*/
public class H2dBord {
!
H2dBordType type_;
! int idxDeb_;
! int idxFin_;
!
/**
* La frontiere concerne par ce bord (0 =frontiere externe)
*/
int IdxmaillageFrontiere_;
-
/**
*
*/
public H2dBord() {}
!
/**
*
--- 16,106 ----
*/
public class H2dBord {
! public static int INTERSECT_NULL= -1;
! public static int INTERSECT_PARTIEL= 0;
! public static int INTERSECT_INCLUDE_IN_BORD= 1;
! public static int INTERSECT_TOTAL= 2;
H2dBordType type_;
! protected int idxDeb_;
! protected int idxFin_;
! String name_;
/**
* La frontiere concerne par ce bord (0 =frontiere externe)
*/
int IdxmaillageFrontiere_;
/**
*
*/
public H2dBord() {}
! public H2dBord(H2dBord _b) {
! type_= _b.type_;
! idxDeb_= _b.idxDeb_;
! idxFin_= _b.idxFin_;
! name_= _b.name_;
! }
! public boolean isBeginIdxSelected(int _min, int _max) {
! return (
! ((_min <= _max) && ((_min <= idxDeb_) && (_max >= idxDeb_)))
! || ((_min > _max) && ((idxDeb_ >= _min) || (idxDeb_ <= _max))));
! }
! /**
! *@return -1 if no intersection
! * 0 if intersection partiel
! * 1 if the segment [_min,_max] is strictly included in this border
! * 2 if this border is included in the segment [_min,_max]
! *
! */
! public int isIntersectBy(int _min, int _max, int _nbPt) {
! if (isUnique())
! return INTERSECT_INCLUDE_IN_BORD;
! return isBordIntersectBy(idxDeb_, idxFin_, _min, _max, _nbPt);
! }
! public static int isBordIntersectBy(
! int _debBord,
! int _finBord,
! int _minSelect,
! int _maxSelect,
! int _nbPt) {
! if (_debBord == _finBord)
! return INTERSECT_INCLUDE_IN_BORD;
! int deb= _debBord;
! int fin= _finBord;
! if (deb == _nbPt)
! deb= 0;
! if (fin < 0)
! fin= _nbPt - 1;
! if (deb < fin) {
! if (_minSelect <= _maxSelect) {
! if ((_maxSelect < deb) || (_minSelect > fin))
! return INTERSECT_NULL;
! else if ((_minSelect <= deb) && (_maxSelect >= fin))
! return INTERSECT_TOTAL;
! else if ((_minSelect > deb) && (_maxSelect < fin))
! return INTERSECT_INCLUDE_IN_BORD;
! else
! return INTERSECT_PARTIEL;
! } else {
! if ((deb > _maxSelect) && (fin < _minSelect))
! return INTERSECT_NULL;
! else if ((fin <= _maxSelect) || (deb >= _minSelect))
! return INTERSECT_TOTAL;
! else
! return INTERSECT_PARTIEL;
! }
! } else {
! if (_minSelect <= _maxSelect) {
! if ((_minSelect > fin) && (_maxSelect < deb))
! return INTERSECT_NULL;
! else if ((_maxSelect < fin) || (_minSelect > deb))
! return INTERSECT_INCLUDE_IN_BORD;
! return INTERSECT_PARTIEL;
! } else {
! if ((_minSelect > deb) && (_maxSelect < fin))
! return INTERSECT_INCLUDE_IN_BORD;
! else if ((_minSelect <= deb) && (_maxSelect >= fin))
! return INTERSECT_TOTAL;
! return INTERSECT_PARTIEL;
! }
! }
! }
/**
*
***************
*** 39,50 ****
return type_;
}
!
! void setType(H2dBordType _type) {
type_= _type;
}
!
!
public String toString() {
! return "H2DBord boundary number"
+ IdxmaillageFrontiere_
+ " ["
--- 109,140 ----
return type_;
}
! protected void setType(H2dBordType _type) {
type_= _type;
}
! /**
! *
! */
! protected void setIdxDeb(int _i) {
! idxDeb_= _i;
! }
! /**
! *
! */
! protected void setIdxFin(int _i) {
! idxFin_= _i;
! }
! /**
! *
! */
! protected void setIdxmaillageFrontiere(int _i) {
! IdxmaillageFrontiere_= _i;
! }
! /**
! *
! */
public String toString() {
! return "H2DBord "
! + (name_ == null ? DodicoLib.EMPTY_STRING : name_)
! + "("
+ IdxmaillageFrontiere_
+ " ["
***************
*** 53,112 ****
+ idxFin_
+ "] type "
! + type_;
}
!
! public String getResume(){
! return H2dResource.getS("Bord de type {0}",type_.toString());
}
!
! public static final class BordIndexIterator{
private int nbPt_;
private H2dBord bd_;
private int indexEnCours_;
private int indexFinal_;
! public BordIndexIterator(){
}
!
! public BordIndexIterator(int _nbPt,H2dBord _b){
! set(_nbPt,_b);
! }
!
! public final void set(int _nbPt,H2dBord _b){
! nbPt_=_nbPt;
! bd_=_b;
! if(_b.isUnique()){
! indexEnCours_=0;
! indexFinal_=nbPt_-1;
! }
! else if(_b.idxDeb_>_b.idxFin_){
! indexEnCours_=_b.idxDeb_;
! indexFinal_=nbPt_+_b.idxFin_;
! }
! else
! {
! indexEnCours_=_b.idxDeb_;
! indexFinal_=_b.idxFin_;
}
}
!
! public boolean hasNext(){
! return indexEnCours_<=indexFinal_;
}
!
! public int next(){
! if(indexEnCours_>indexFinal_) throw new IllegalAccessError("end of iterator");
! int r=(indexEnCours_<nbPt_)?indexEnCours_:indexEnCours_-nbPt_;
indexEnCours_++;
! return r;
}
-
-
}
!
! public BordIndexIterator createIterator(int _nb){
! return new BordIndexIterator(_nb,this);
}
-
-
/**
*
--- 143,189 ----
+ idxFin_
+ "] type "
! + type_
! + ")";
}
! public String getResume() {
! return H2dResource.getS("Bord de type {0}", type_.toString());
}
! public static final class BordIndexIterator {
private int nbPt_;
private H2dBord bd_;
private int indexEnCours_;
private int indexFinal_;
! public BordIndexIterator() {}
! public BordIndexIterator(int _nbPt, H2dBord _b) {
! set(_nbPt, _b);
}
! public final void set(int _nbPt, H2dBord _b) {
! nbPt_= _nbPt;
! bd_= _b;
! if (_b.isUnique()) {
! indexEnCours_= 0;
! indexFinal_= nbPt_ - 1;
! } else if (_b.idxDeb_ > _b.idxFin_) {
! indexEnCours_= _b.idxDeb_;
! indexFinal_= nbPt_ + _b.idxFin_;
! } else {
! indexEnCours_= _b.idxDeb_;
! indexFinal_= _b.idxFin_;
}
}
! public boolean hasNext() {
! return indexEnCours_ <= indexFinal_;
}
! public int next() {
! if (indexEnCours_ > indexFinal_)
! throw new IllegalAccessError("end of iterator");
! int r= (indexEnCours_ < nbPt_) ? indexEnCours_ : indexEnCours_ - nbPt_;
indexEnCours_++;
! return r;
}
}
! public BordIndexIterator createIterator(int _nb) {
! return new BordIndexIterator(_nb, this);
}
/**
*
***************
*** 115,119 ****
return idxDeb_;
}
-
/**
* Bord unique si l'index de debut=index de fin.
--- 192,195 ----
***************
*** 122,126 ****
return idxDeb_ == idxFin_;
}
-
public boolean containsIdx(int _idx) {
return idxDeb_ == idxFin_
--- 198,201 ----
***************
*** 128,134 ****
: ((idxDeb_ < idxFin_)
? ((_idx >= idxDeb_) && (_idx <= idxFin_))
! : ((_idx >= 0) && (_idx <= idxFin_) && (_idx >= idxDeb_)));
}
-
/**
*
--- 203,208 ----
: ((idxDeb_ < idxFin_)
? ((_idx >= idxDeb_) && (_idx <= idxFin_))
! : ((_idx >= 0) && ((_idx <= idxFin_) || (_idx >= idxDeb_))));
}
/**
*
***************
*** 137,141 ****
return idxFin_;
}
-
/**
* Renvoie l'index de la frontiere concernee par ce bord.
--- 211,214 ----
***************
*** 144,159 ****
return IdxmaillageFrontiere_;
}
-
public int getNPointInBord(int _nbPoint) {
! if (idxFin_> idxDeb_)
! return idxFin_- idxDeb_+ 1;
else {
! return idxFin_
! + 1
! + _nbPoint
! - idxDeb_;
}
-
}
!
}
--- 217,261 ----
return IdxmaillageFrontiere_;
}
public int getNPointInBord(int _nbPoint) {
! if (idxFin_ > idxDeb_)
! return idxFin_ - idxDeb_ + 1;
else {
! return idxFin_ + 1 + _nbPoint - idxDeb_;
}
}
! public static int getNbPointInBord(int _min, int _max, int _nbPoint) {
! if (_max > _min)
! return _max - _min + 1;
! else {
! return _max + 1 + _nbPoint - _min;
! }
! }
! /**
! *
! */
! public String getName() {
! return name_;
! }
! public boolean containsZeroIndex() {
! if (isUnique())
! return true;
! else if (idxDeb_ < idxFin_)
! return idxDeb_ == 0;
! else
! return idxFin_ >= 0;
! }
! public boolean isFirst() {
! if (isUnique())
! return true;
! else if (idxDeb_ < idxFin_)
! return idxDeb_ == 0;
! else
! return idxFin_ > 0;
! }
! /**
! *
! */
! public void setName(String _string) {
! name_= _string;
! }
}
Index: H2dBordMutable.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBordMutable.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** H2dBordMutable.java 10 Oct 2003 14:43:19 -0000 1.4
--- H2dBordMutable.java 29 Oct 2003 11:41:27 -0000 1.5
***************
*** 1 ****
! /*
* @file H2dBordMutable.java
* @creation 20 août 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* @author deniger
* @version $Id$
*/
public class H2dBordMutable extends H2dBord {
/**
*
*/
public H2dBordMutable() {
super();
}
/**
*
*/
public void setIdxDeb(int _i) {
idxDeb_= _i;
}
/**
*
*/
public void setIdxFin(int _i) {
idxFin_= _i;
}
/**
*
*/
public void setIdxmaillageFrontiere(int _i) {
IdxmaillageFrontiere_= _i;
}
/**
*
*/
public void setType(H2dBordType _type) {
super.setType(_type);
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dBordMutable.java
* @creation 20 août 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* @author deniger
* @version $Id$
*/
public class H2dBordMutable extends H2dBord {
/**
*
*/
public H2dBordMutable() {
}
/**
*
*/
public void setIdxDeb(int _i) {
idxDeb_= _i;
}
/**
*
*/
public void setIdxFin(int _i) {
idxFin_= _i;
}
/**
*
*/
public void setIdxmaillageFrontiere(int _i) {
IdxmaillageFrontiere_= _i;
}
/**
*
*/
public void setType(H2dBordType _type) {
super.setType(_type);
}
}
\ No newline at end of file
Index: H2dBorderPerFrontierInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBorderPerFrontierInterface.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dBorderPerFrontierInterface.java 6 Oct 2003 07:43:02 -0000 1.2
--- H2dBorderPerFrontierInterface.java 29 Oct 2003 11:41:27 -0000 1.3
***************
*** 16,20 ****
public int getNbBord();
! public H2dBord getBord(int _i);
}
--- 16,23 ----
public int getNbBord();
! public H2dBord getBord(int _idxBord);
! public H2dBord getBordContainingIdx(int _indexToSearch);
! public H2dConditionLimite getCl(int _idxOnThisFrontier);
! public int getNbPt();
}
Index: H2dCLManagerAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dCLManagerAbstract.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dCLManagerAbstract.java 10 Oct 2003 14:43:19 -0000 1.3
--- H2dCLManagerAbstract.java 29 Oct 2003 11:41:27 -0000 1.4
***************
*** 20,24 ****
protected H2dMaillage maillage_;
protected H2dBorderPerFrontierInterface[] bordByFrontier_;
! private ArrayList listeners_;
protected H2dCLManagerAbstract(
H2dMaillage _m,
--- 20,29 ----
protected H2dMaillage maillage_;
protected H2dBorderPerFrontierInterface[] bordByFrontier_;
! protected ArrayList listeners_;
! protected H2dCLManagerAbstract(
! H2dMaillage _m) {
! maillage_= _m;
! }
!
protected H2dCLManagerAbstract(
H2dMaillage _m,
***************
*** 50,90 ****
return r;
}
! /**
! * Return the liquid boundary number _i (or null if not).
! */
! public H2dBord getLiquidBoundary(int _i) {
! int n= bordByFrontier_.length;
! int r= -1;
! for (int i= 0; i < n; i++) {
! H2dBorderPerFrontierInterface bordBound= bordByFrontier_[i];
! int nbBord= bordBound.getNbBord();
! for (int j= 0; j < nbBord; j++) {
! if (bordBound.getBord(j).getType().isLiquide()) {
! r++;
! }
! if (r == _i)
! return bordBound.getBord(j);
! }
! }
! return null;
! }
! public int getIdxLiquidBord(H2dBord _b) {
! if (!_b.getType().isLiquide())
! return -1;
! int n= bordByFrontier_.length;
! int r= -1;
! for (int i= 0; i < n; i++) {
! H2dBorderPerFrontierInterface bordBound= bordByFrontier_[i];
! int nbBord= bordBound.getNbBord();
! for (int j= 0; j < nbBord; j++) {
! if (bordBound.getBord(j) == _b) {
! return ++r;
! } else if (bordBound.getBord(j).getType().isLiquide()) {
! r++;
! }
! }
! }
! return -1;
! }
/**
* Renvoie le nombre de bord elementaire contenu par ce manager.
--- 55,59 ----
return r;
}
!
/**
* Renvoie le nombre de bord elementaire contenu par ce manager.
***************
*** 109,113 ****
*
*/
! public final H2dBord getBordFromIdxGeneral(int _idxGeneral) {
int n= bordByFrontier_.length;
int shiftL= 0;
--- 78,82 ----
*
*/
! public final H2dBord getBord(int _idxGeneral) {
int n= bordByFrontier_.length;
int shiftL= 0;
***************
*** 136,164 ****
protected void setBordType(H2dBord _b,H2dBordType _type){
_b.setType(_type);
}
protected void fireCLChange(H2dBord _b,H2dBordType _old){
for(Iterator it=listeners_.iterator();it.hasNext(); ){
! ((H2dClChangeListener)it.next()).clChanged(_b, _old);
! }
! }
! /**
! *
! */
! public void addClChangedListener(H2dClChangeListener _l) {
! if (listeners_ == null) {
! listeners_= new ArrayList(10);
! listeners_.add(_l);
! } else if (!listeners_.contains(_l)) {
! listeners_.add(_l);
}
}
! /**
! *
! */
! public void removeClChangedListener(H2dClChangeListener _l) {
! if (listeners_ != null)
! listeners_.remove(_l);
! }
}
--- 105,119 ----
protected void setBordType(H2dBord _b,H2dBordType _type){
+ H2dBordType old=_b.getType();
_b.setType(_type);
+ fireCLChange(_b,old);
}
protected void fireCLChange(H2dBord _b,H2dBordType _old){
for(Iterator it=listeners_.iterator();it.hasNext(); ){
! ((H2dClListener)it.next()).clChanged(_b, _old);
}
}
!
!
}
Index: H2dCLManagerInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dCLManagerInterface.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dCLManagerInterface.java 6 Oct 2003 07:43:02 -0000 1.2
--- H2dCLManagerInterface.java 29 Oct 2003 11:41:27 -0000 1.3
***************
*** 39,49 ****
* Renvoie le bord d'index general donne.
*/
! public H2dBord getBordFromIdxGeneral(int _idxGeneral);
- /**
- * Renvoie le point d'indice frontiere <code>_idxPtSurFrontiere</code>
- * de la frontiere d'indice <code>_idxFrontiere</code>.
- */
- public H2dPoint getPoint(int _idxFrontiere, int _idxPtSurFrontiere);
/**
--- 39,44 ----
* Renvoie le bord d'index general donne.
*/
! public H2dBord getBord(int _idxGeneral);
/**
***************
*** 54,58 ****
public H2dMaillage getMaillage();
! public void addClChangedListener(H2dClChangeListener _l);
! public void removeClChangedListener(H2dClChangeListener _l);
}
--- 49,53 ----
public H2dMaillage getMaillage();
! // public void addClChangedListener(H2dClChangeListener _l);
! // public void removeClChangedListener(H2dClChangeListener _l);
}
Index: H2dMaillageFrontiere.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dMaillageFrontiere.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** H2dMaillageFrontiere.java 8 Oct 2003 11:53:08 -0000 1.5
--- H2dMaillageFrontiere.java 29 Oct 2003 11:41:27 -0000 1.6
***************
*** 1 ****
! /*
* @file H2dMaillageBord.java
* @creation 30 juin 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d;
import gnu.trove.TIntArrayList;
import gnu.trove.TIntIntIterator;
import gnu.trove.TIntIterator;
import java.util.List;
import org.fudaa.dodico.commun.DodicoIntIterator;
import org.fudaa.dodico.commun.DodicoLib;
import sun.security.action.GetPropertyAction;
/**
* @author deniger
* @version $Id$
*/
public class H2dMaillageFrontiere {
protected int[][] bords_;
/**
*
*/
public H2dMaillageFrontiere(List _l) {
int n= _l.size();
if (n > 0) {
bords_= new int[n][];
_l.toArray(bords_);
} else
bords_= new int[0][];
}
public H2dMaillageFrontiere(int[] _l) {
bords_= new int[1][];
bords_[0]= _l;
}
public FrontiereIdxIterator getFrontierIterator(){
return new FrontiereIdxIterator();
}
public class FrontiereIdxIterator implements DodicoIntIterator{
int bordIdx_;
int ptIdx_;
int frontierIdx=-1;
FrontiereIdxIterator(){
}
public boolean hasNext(){
return bordIdx_<bords_.length-1?true:(bordIdx_==bords_.length-1?ptIdx_<bords_[bordIdx_].length:false);
}
/**
* After calling next(), you can use this method to know the current boundary numbering.
*/
public int getBoundaryIdx(){
return frontierIdx;
}
/**
* Return the next index in the general numbering.
*/
public int next(){
int r=bords_[bordIdx_][ptIdx_++];
frontierIdx++;
if(ptIdx_==bords_[bordIdx_].length)
{
bordIdx_++;
ptIdx_=0;
}
return r;
}
}
/**
* Return [ frontier index, point index in the frontier] from the general index.
*/
public int[] getIdxFrontierIdxPtInFrontier(int _IdxGeneralPt) {
for (int i= 0; i < bords_.length; i++) {
int n= bords_[i].length;
for (int j= 0; j < n; j++) {
if (bords_[i][j] == _IdxGeneralPt)
return new int[] { i, j };
}
}
return null;
}
/**
* Return the general index from the index on the frontier.
*/
public final int getIdxGeneral(int _idxOnFrontier) {
int n= bords_.length;
int shiftL= 0;
for (int i= 0; i < n; i++) {
if (_idxOnFrontier < (shiftL + bords_[i].length)) {
return bords_[i][_idxOnFrontier - shiftL];
} else {
shiftL += bords_[i].length;
}
}
return -1;
}
/**
* Renvoie le nombre total de points des frontieres.
*/
public int getNbTotalPt() {
int r= 0;
for (int i= bords_.length - 1; i >= 0; i--) {
r += bords_[i].length;
}
return r;
}
/**
* Permet de verifier si les indices de bords
* sont dans le meme ordre que celui donne
* par _ipobo.
*/
public boolean isSame(int[] _ipobo) {
if (_ipobo == null)
return false;
int nBI= bords_.length;
int indexIpobo= 0;
int nbFI;
for (int i= 0; i < nBI; i++) {
nbFI= bords_[i].length;
for (int j= 0; j < nbFI; j++) {
if (_ipobo[indexIpobo + j] != bords_[i][j]) {
System.out.println("Error intern");
return false;
}
}
indexIpobo += nbFI;
}
return true;
}
/**
* Renvoie les bords sous forme d'un tableau ( conforme tableau ipobo
* de telemac/serafin).
*/
public int[] getArray() {
int[] r=new int[getNbTotalPt()];
for(FrontiereIdxIterator it=new FrontiereIdxIterator();it.hasNext();){
int i=it.next();
r[it.getBoundaryIdx()]=i;
}
return r;
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord principal
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordPrinc() {
return DodicoLib._printObject(bords_[0], true);
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord interne d'indice _id
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordInterne(int _id) {
return DodicoLib._printObject(bords_[_id + 1], true);
}
public String toString() {
return "H2dMaillageFrontiere main frontier["
+ bords_[0].length
+ "] intern frontier ["
+ getNbFrontierIntern()
+ "]";
}
public void printFullString(){
System.out.println("extern "+DodicoLib._printObject(bords_[0],true));
if(getNbFrontierIntern()>0){
int n=getNbFrontierIntern();
for(int i=0;i<n;i++){
System.out.println("intern "+i+ DodicoLib._printObject(bords_[i+1],true));
}
}
}
public H2dPoint[] getMinMax(H2dMaillage _mail, int _idxFrontier) {
int[] bordIdx= bords_[_idxFrontier];
int i0= bordIdx[0];
H2dPoint pt= _mail.pts_[i0];
H2dPointMutable pMin= new H2dPointMutable(pt);
H2dPointMutable pMax= new H2dPointMutable(pt);
int nb= bordIdx.length - 1;
for (int i= nb; i >= 1; i--) {
pt= _mail.pts_[bordIdx[i]];
if (pt.x_ < pMin.x_)
pMin.x_= pt.x_;
if (pt.y_ < pMin.y_)
pMin.y_= pt.y_;
if (pt.z_ < pMin.z_)
pMin.z_= pt.z_;
if (pt.x_ > pMax.x_)
pMax.x_= pt.x_;
if (pt.y_ > pMax.y_)
pMax.y_= pt.y_;
if (pt.z_ > pMax.z_)
pMax.z_= pt.z_;
}
return new H2dPoint[] { pMin, pMax };
}
public int getNbFrontierIntern() {
return bords_.length - 1;
}
public int getNbFrontier() {
return bords_.length;
}
public int getBordPrincPointIdx(int _idx) {
return bords_[0][_idx];
}
/**
* Return the general index for the point <code>_idxPtInFrontier</code>
* in the frontier <code>_idxFrontier</code>
*/
public int getIdx(int _idxFrontier, int _idxPt) {
return bords_[_idxFrontier][_idxPt];
}
public int getNbPt(int _idxFrontier) {
return bords_[_idxFrontier].length;
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dMaillageBord.java
* @creation 30 juin 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d;
import java.util.List;
import org.fudaa.dodico.commun.DodicoIntIterator;
import org.fudaa.dodico.commun.DodicoLib;
/**
* @author deniger
* @version $Id$
*/
public class H2dMaillageFrontiere {
protected int[][] bords_;
/**
*
*/
public H2dMaillageFrontiere(List _l) {
int n= _l.size();
if (n > 0) {
bords_= new int[n][];
_l.toArray(bords_);
} else
bords_= new int[0][];
}
public H2dMaillageFrontiere(int[] _l) {
bords_= new int[1][];
bords_[0]= _l;
}
public FrontiereIdxIterator getFrontierIterator() {
return new FrontiereIdxIterator();
}
/**
* Return [ frontier index, point index in the frontier] from the general index.
*/
public int[] getIdxFrontierIdxPtInFrontierFromGlobal(int _idx) {
for (int i= 0; i < bords_.length; i++) {
int n= bords_[i].length;
for (int j= 0; j < n; j++) {
if (bords_[i][j] == _idx)
return new int[] { i, j };
}
}
return null;
}
public boolean getIdxFrontierIdxPtInFrontierFromFrontier(
int _idxOnFrontier,
int[] _idxFridxPt) {
int n= bords_.length;
int shiftL= 0;
for (int i= 0; i < n; i++) {
if (_idxOnFrontier < (shiftL + bords_[i].length)) {
_idxFridxPt[0]= i;
_idxFridxPt[1]= _idxOnFrontier - shiftL;
return true;
} else {
shiftL += bords_[i].length;
}
}
return false;
}
/**
* Return the general index from the index on the frontier.
*/
public final int getIdxGeneral(int _idxOnFrontier) {
int n= bords_.length;
int shiftL= 0;
for (int i= 0; i < n; i++) {
if (_idxOnFrontier < (shiftL + bords_[i].length)) {
return bords_[i][_idxOnFrontier - shiftL];
} else {
shiftL += bords_[i].length;
}
}
return -1;
}
/**
* Renvoie le nombre total de points des frontieres.
*/
public int getNbTotalPt() {
int r= 0;
for (int i= bords_.length - 1; i >= 0; i--) {
r += bords_[i].length;
}
return r;
}
/**
* Permet de verifier si les indices de bords
* sont dans le meme ordre que celui donne
* par _ipobo.
*/
public boolean isSame(int[] _ipobo) {
if (_ipobo == null)
return false;
int nBI= bords_.length;
int indexIpobo= 0;
int nbFI;
for (int i= 0; i < nBI; i++) {
nbFI= bords_[i].length;
for (int j= 0; j < nbFI; j++) {
if (_ipobo[indexIpobo + j] != bords_[i][j]) {
System.out.println("Error intern");
return false;
}
}
indexIpobo += nbFI;
}
return true;
}
/**
* Renvoie les bords sous forme d'un tableau ( conforme tableau ipobo
* de telemac/serafin).
*/
public int[] getArray() {
int[] r= new int[getNbTotalPt()];
for (FrontiereIdxIterator it= new FrontiereIdxIterator(); it.hasNext();) {
int i= it.next();
r[it.getBoundaryIdx()]= i;
}
return r;
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord principal
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordPrinc() {
return DodicoLib._printObject(bords_[0], true);
}
/**
* Renvoie une chaine de caractere decrivant les indices
* du bord interne d'indice _id
* @see org.fudaa.dodico.commun.DodicoLib#_printObject(Object, boolean)
*/
public String getDescBordInterne(int _id) {
return DodicoLib._printObject(bords_[_id + 1], true);
}
public String toString() {
return "H2dMaillageFrontiere main frontier["
+ bords_[0].length
+ "] intern frontier ["
+ getNbFrontierIntern()
+ "]";
}
public void printFullString() {
System.out.println("extern " + DodicoLib._printObject(bords_[0], true));
if (getNbFrontierIntern() > 0) {
int n= getNbFrontierIntern();
for (int i= 0; i < n; i++) {
System.out.println(
"intern " + i + DodicoLib._printObject(bords_[i + 1], true));
}
}
}
public H2dPoint[] getMinMax(H2dMaillage _mail, int _idxFrontier) {
int[] bordIdx= bords_[_idxFrontier];
int i0= bordIdx[0];
H2dPoint pt= _mail.pts_[i0];
H2dPointMutable pMin= new H2dPointMutable(pt);
H2dPointMutable pMax= new H2dPointMutable(pt);
int nb= bordIdx.length - 1;
for (int i= nb; i >= 1; i--) {
pt= _mail.pts_[bordIdx[i]];
if (pt.x_ < pMin.x_)
pMin.x_= pt.x_;
if (pt.y_ < pMin.y_)
pMin.y_= pt.y_;
if (pt.z_ < pMin.z_)
pMin.z_= pt.z_;
if (pt.x_ > pMax.x_)
pMax.x_= pt.x_;
if (pt.y_ > pMax.y_)
pMax.y_= pt.y_;
if (pt.z_ > pMax.z_)
pMax.z_= pt.z_;
}
return new H2dPoint[] { pMin, pMax };
}
public int getNbFrontierIntern() {
return bords_.length - 1;
}
public int getNbFrontier() {
return bords_.length;
}
public int getBordPrincPointIdx(int _idx) {
return bords_[0][_idx];
}
/**
* Return the general index for the point <code>_idxPtInFrontier</code>
* in the frontier <code>_idxFrontier</code>
*/
public int getIdx(int _idxFrontier, int _idxPt) {
return bords_[_idxFrontier][_idxPt];
}
public int getNbPt(int _idxFrontier) {
return bords_[_idxFrontier].length;
}
public class FrontiereIdxIterator implements DodicoIntIterator {
int bordIdx_;
int ptIdx_;
int frontierIdx= -1;
FrontiereIdxIterator() {}
public boolean hasNext() {
return ((bordIdx_ < bords_.length - 1)
? true
: ((bordIdx_ == bords_.length - 1)
? (ptIdx_ < bords_[bordIdx_].length)
: false));
}
/**
* After calling next(), you can use this method to know the current boundary numbering.
*/
public int getBoundaryIdx() {
return frontierIdx;
}
/**
* Return the next index in the general numbering.
*/
public int next() {
int r= bords_[bordIdx_][ptIdx_++];
frontierIdx++;
if (ptIdx_ == bords_[bordIdx_].length) {
bordIdx_++;
ptIdx_= 0;
}
return r;
}
}
}
\ No newline at end of file
Index: H2dParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dParametres.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** H2dParametres.java 10 Oct 2003 14:43:19 -0000 1.8
--- H2dParametres.java 29 Oct 2003 11:41:27 -0000 1.9
***************
*** 1 ****
! /*
* @file TrProjetH2d.java
* @creation 20 mars 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoCasFileFormatVersionAbstract;
import org.fudaa.dodico.dico.DicoParams;
/**
*
* @author deniger
* @version $Id$
*/
public abstract class H2dParametres {
private H2dMaillage maillage_;
private DicoParams dicoParams_;
private H2dCLManagerInterface clMng_;
private H2dProjectListener listener_;
protected H2dParametres(DicoParams _dico) {
dicoParams_= _dico;
}
public final H2dMaillage getMaillage() {
return maillage_;
}
public void setProjectListener(H2dProjectListener _l) {
if (listener_ != null) {
if (clMng_ != null)
clMng_.removeClChangedListener(listener_);
if (dicoParams_ != null)
dicoParams_.removeModelListener(listener_);
}
if (_l != null) {
if (clMng_ != null)
clMng_.addClChangedListener(_l);
if (dicoParams_ != null)
dicoParams_.addModelListener(_l);
}
listener_=_l;
}
public final void setMaillage(
H2dMaillage _m,
ProgressionInterface _inter,
DodicoAnalyze.Editor _analyze) {
if (DodicoLib.DEBUG)
System.out.println("H2d setMaillage");
if (maillage_ != null) {
if (_analyze != null)
_analyze.addFatalError(H2dResource.getS("Maillage déjà spécifié"));
new Throwable().printStackTrace();
return;
}
maillage_= _m;
if (_m.getPtsFrontiere() == null) {
_m.computeBord(_inter);
}
}
public int getNPointInBord(H2dBord _b) {
int deb= _b.getIdxDeb();
int fin= _b.getIdxFin();
if (fin > deb)
return fin - deb + 1;
else {
return fin
+ 1
+ maillage_.getPtsFrontiere().getNbPt(_b.getIdxFrontiere())
- deb;
}
}
public DicoParams getDicoParams() {
return dicoParams_;
}
public DicoCasFileFormatVersionAbstract getVersion() {
return dicoParams_.getDicoFileFormatVersion();
}
public H2dCLManagerInterface getCLManager() {
return clMng_;
}
public void setClManager(H2dCLManagerInterface _clMng) {
clMng_= _clMng;
if(listener_!=null){
clMng_.addClChangedListener(listener_);
}
}
public abstract DodicoPermanentList getBordList();
}
\ No newline at end of file
--- 1 ----
! /*
* @file TrProjetH2d.java
* @creation 20 mars 2003
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.h2d;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoCasFileFormatVersionAbstract;
import org.fudaa.dodico.dico.DicoParams;
/**
*
* @author deniger
* @version $Id$
*/
public abstract class H2dParametres {
protected H2dMaillage maillage_;
protected DicoParams dicoParams_;
protected H2dParametres(DicoParams _dico) {
dicoParams_= _dico;
}
public final H2dMaillage getMaillage() {
return maillage_;
}
public final void setMaillage(
H2dMaillage _m,
ProgressionInterface _inter,
DodicoAnalyze.Editor _analyze) {
if (DodicoLib.DEBUG)
System.out.println("H2d setMaillage");
if (maillage_ != null) {
if (_analyze != null)
_analyze.addFatalError(H2dResource.getS("Maillage déjà spécifié"));
new Throwable().printStackTrace();
return;
}
maillage_= _m;
if (_m.getPtsFrontiere() == null) {
_m.computeBord(_inter);
}
}
public int getNPointInBord(H2dBord _b) {
int deb= _b.getIdxDeb();
int fin= _b.getIdxFin();
if (fin > deb)
return fin - deb + 1;
else {
return fin
+ 1
+ maillage_.getPtsFrontiere().getNbPt(_b.getIdxFrontiere())
- deb;
}
}
public DicoParams getDicoParams() {
return dicoParams_;
}
public DicoCasFileFormatVersionAbstract getVersion() {
return dicoParams_.getDicoFileFormatVersion();
}
public abstract H2dCLManagerInterface getCLManager();
public abstract DodicoPermanentList getBordList();
}
\ No newline at end of file
Index: H2dProjectListener.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dProjectListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dProjectListener.java 8 Oct 2003 12:14:47 -0000 1.1
--- H2dProjectListener.java 29 Oct 2003 11:41:27 -0000 1.2
***************
*** 15,17 ****
* @version $Id$
*/
! public interface H2dProjectListener extends H2dClChangeListener,DicoParamsListener{}
--- 15,17 ----
* @version $Id$
*/
! public interface H2dProjectListener extends H2dClListener,DicoParamsListener{}
Index: h2d_en.fr_txt
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/h2d_en.fr_txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** h2d_en.fr_txt 10 Oct 2003 14:43:19 -0000 1.4
--- h2d_en.fr_txt 29 Oct 2003 11:41:27 -0000 1.5
***************
*** 201,203 ****
Les_paramètres_du_fichiers_dico_ne_correspondent_pas_à_un_projet_hydraulique_2D=The_dictionnary_parameters_are_not_suitable_for_a_2D_hydraulic_project
{0}_n'est_pas_un_mot-clé_contenant_des_réels={0}_is_not_a_keyword_for_real
! Bord_de_type_{0}=The_boundary's_type_is_{0}
\ No newline at end of file
--- 201,206 ----
Les_paramètres_du_fichiers_dico_ne_correspondent_pas_à_un_projet_hydraulique_2D=The_dictionnary_parameters_are_not_suitable_for_a_2D_hydraulic_project
{0}_n'est_pas_un_mot-clé_contenant_des_réels={0}_is_not_a_keyword_for_real
! Bord_de_type_{0}=The_boundary's_type_is_{0}
! Le_mot-clé_{0}_doit_contenir_{1}_champs_(soit_le_nombre_de_frontières_liquides)=The_keyword_{0}_must_contains_{1}_fields_(_the_number_of_liquid_boundaries)
! Les_indices_de_points_de_bords_sont_incorrects=The_boundary_indices_are_not_valids
! Le_traceur_n'est_pas_homogène_sur_le_même_bord_(point_{0}_dans_la_numérotation_des_points_de_bords)=The_tracer_is_not_homogenous_for_the_entire_border(point_{0}_in_the_boundary_point_numbering)
\ No newline at end of file
Index: h2d_en.txt
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/h2d_en.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** h2d_en.txt 10 Oct 2003 14:43:19 -0000 1.3
--- h2d_en.txt 29 Oct 2003 11:41:27 -0000 1.4
***************
*** 202,203 ****
--- 202,206 ----
{0}_n'est_pas_un_mot-cl\u00e9_contenant_des_r\u00e9els={0}_is_not_a_keyword_for_real
Bord_de_type_{0}=The_boundary's_type_is_{0}
+ Le_mot-cl\u00e9_{0}_doit_contenir_{1}_champs_(soit_le_nombre_de_fronti\u00e8res_liquides)=The_keyword_{0}_must_contains_{1}_fields_(_the_number_of_liquid_boundaries)
+ Les_indices_de_points_de_bords_sont_incorrects=The_boundary_indices_are_not_valids
+ Le_traceur_n'est_pas_homog\u00e8ne_sur_le_m\u00eame_bord_(point_{0}_dans_la_num\u00e9rotation_des_points_de_bords)=The_tracer_is_not_homogenous_for_the_entire_border(point_{0}_in_the_boundary_point_numbering)
--- H2dClChangeListener.java DELETED ---
|