|
From: <chr...@us...> - 2010-06-02 16:00:27
|
Revision: 5761
http://fudaa.svn.sourceforge.net/fudaa/?rev=5761&view=rev
Author: chrisc83
Date: 2010-06-02 16:00:17 +0000 (Wed, 02 Jun 2010)
Log Message:
-----------
Version de tests!!!
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2010-05-31 22:54:59 UTC (rev 5760)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrIsoLayerDefault.java 2010-06-02 16:00:17 UTC (rev 5761)
@@ -728,6 +728,7 @@
final GrBoite _clipReel) {
System.out.println("Start TrIsoLayerDefault.paintDonnees");
long currentTime = System.currentTimeMillis();
+
if (namePalette_ == null) {
updateLegende();
}
@@ -740,7 +741,6 @@
TraceIsoInterface isos = null;
// TrIsoTraceSurface isos = null;
final boolean isElement = getIsoModelAbstract().isCurrentDataElementType();
- System.out.println(isElement);
boolean keepAntialias = false;
TrPostModelInterface modelToUse = getIsoModelAbstract();
if (traceIsoLine_) {
@@ -770,6 +770,15 @@
final int n = modelToUse.getNbElt();
final GrPolygone poly = new GrPolygone();
final GrBoite b = new GrBoite();
+
+ /*******************************************************************************/
+ /** D\xE9claration variables utilis\xE9es par algo optimisation par centre \xE9l\xE9ments **/
+ /*******************************************************************************/
+ GrPoint ptCenter = new GrPoint();
+ final int width = this.getSize().width;
+ int count = 0;
+ CtuluListSelection alreadyExist = new CtuluListSelection();
+
for (i = 0; i < n; i++) {
// le test sur la condition se fait dans le modele
if (!modelToUse.polygone(poly, i, false)) {
@@ -779,6 +788,53 @@
if (!_clipReel.intersectXY(b)) {
continue;
}
+
+ /******************************************************/
+ /** D\xE9but code algo optimisation par centre \xE9l\xE9ments **/
+ /******************************************************/
+ poly.centre(ptCenter);
+// System.out.print("X : " + ptCenter.x_ + ", Y : " + ptCenter.y_);
+ ptCenter.autoApplique(_versEcran);
+// System.out.println(", X : " + ptCenter.x_ + ", Y : " + ptCenter.y_);
+ int idx = (width * ((int)ptCenter.y_)) + ((int)ptCenter.x_);
+// System.out.println("id : " + idx);
+
+ if (alreadyExist.isSelected(idx))
+ {
+ count++;
+ continue;
+ }
+ else
+ {
+ alreadyExist.add(idx);
+
+ //TODO rapide n'est jamais \xE0 true, car si il doit l'\xEAtre on passe dans la m\xE9thode m\xE8re.
+ if (rapide)
+ {
+ int idx2;
+ final int height = this.getSize().height;
+
+ for (int j = ((int)ptCenter.x_) - 1; j < (((int)ptCenter.x_) + 2); j++)
+ {
+ for (int k = ((int)ptCenter.y_) - 1; k < (((int)ptCenter.y_) + 2); k++)
+ {
+ if ((j >= 0) && (j < width) && (k >= 0) && (k < height))
+ {
+ idx2 = (width * k) + j;
+
+ if (idx2 != idx)
+ {
+ alreadyExist.add(idx2);
+ }
+ }
+ }
+ }
+ }
+ }
+ /****************************************************/
+ /** Fin code algo optimisation par centre \xE9l\xE9ments **/
+ /****************************************************/
+
// Trace des isosurfaces / Isolignes (dans la couleur du fond si les isocouleurs sont
// tracees).
if (isElement && !traceIsoLine_) {
@@ -805,6 +861,8 @@
currentTime = System.currentTimeMillis() - currentTime;
System.out.println("Stop TrIsoLayerDefault.paintDonnees");
System.out.println("Dur\xE9e : " + currentTime);
+ System.out.println("isElement : " + isElement);
+ System.out.println("Nb ... : " + n + ", non affich\xE9 : " + count);
}
protected void updateEltAdapter() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|