public GeometryArray getGeomArray() { return ((GeometryArray) shape_.getGeometry()); }
public IndexedGeometryArray getTriangleArray() { return ((IndexedGeometryArray) shape_.getGeometry()); }
public void affiche() { //for (int i=0;i<10;i++) System.out.print(" "+next_figure_[i]); //System.out.println(); ((IndexedGeometryArray)shape_.getGeometry()).setCoordinates( 0, next_figure_); } }
public void setTextures(final int _texCoordSet, final TexCoord2f[] _tex) { ((GeometryArray) shape_.getGeometry()).setTextureCoordinates(_texCoordSet, 0, _tex); }
protected void setCouleurs(final Color4f[] _c) { ((GeometryArray) shape_.getGeometry()).setColors(0, _c); }
public Color4f getColorFor(final int _idxVertex) { final Color4f r = new Color4f(); ((GeometryArray) shape_.getGeometry()).getColor(_idxVertex, r); return r; }
/** * calcule la boitze englobante partir de la geometrie de l'objet. */ public void calculeBBox() { bbox_ = new BoundingBox(); final GeometryArray geometrie = (GeometryArray) shape_.getGeometry(); calculeBBox(geometrie); }
/** * colore l'objet d'une couleur unique. */ public boolean setCouleur(final Color _c) { if (shape_ == null || shape_.getGeometry() == null) { return false; } isColorUsed_ = true; final int nbPts = ((GeometryArray) shape_.getGeometry()).getVertexCount(); shape_.getAppearance().getColoringAttributes().setColor(new Color3f(_c)); final Color4f[] cs = new Color4f[nbPts]; Arrays.fill(cs, new Color4f(_c)); ((GeometryArray) shape_.getGeometry()).setColors(0, cs); return true; }
public boolean setCouleur(final Color _c) { if (nbExtPt_ > 0) { if (shape_ == null || shape_.getGeometry() == null) { return false; } isColorUsed_ = true; final IndexedLineArray indexedLineArray = ((IndexedLineArray) shape_.getGeometry()); final int nbPts = indexedLineArray.getVertexCount(); final int nbIndices = indexedLineArray.getIndexCount(); // MODIF AVA pour j3d1.2 Color3f couleur=new // Color3f((float)c.getRed()/255,(float)c.getGreen()/255,(float)c.getBlue()/255); // MODIF AVA pour j3d1.2 // shape_.getAppearance().getMaterial().setDiffuseColor(new Color3f(_c)); // shape_.getAppearance().getColoringAttributes().setColor(new Color3f(_c)); final Color4f[] cs = new Color4f[nbPts]; Arrays.fill(cs, new Color4f(_c)); final Color4f in = new Color4f(_c.brighter()); in.scale(0.6f); for (int i = nbExtPt_; i < cs.length; i++) { cs[i] = in; } ((GeometryArray) shape_.getGeometry()).setColors(0, cs); for (int i = 0; i < nbIndices; i++) { indexedLineArray.setColorIndex(i, i / 2); } } else { return super.setCouleur(_c); } return true; }
public boolean getRange(final CtuluRange _b) { final GeometryArray geometrie = (GeometryArray) shape_.getGeometry(); final int nbPt = geometrie.getVertexCount(); _b.setToNill(); final double[] vs = new double[3]; for (int i = 0; i < nbPt; i++) { geometrie.getCoordinate(i, vs); _b.expandTo(vs[2]); } return true; }
public void setPaletteCouleurPlages(final BPalettePlageInterface _newPlage) { isColorUsed_ = false; palette_ = new BPalettePlage(_newPlage.getPlages()); final GeometryArray geometrie = (GeometryArray) shape_.getGeometry(); final int nbPt = geometrie.getVertexCount(); final Color4f[] cs = new Color4f[nbPt]; final double[] vs = new double[3]; for (int i = 0; i < nbPt; i++) { geometrie.getCoordinate(i, vs); Color c = palette_.getColorFor(vs[2]); if (c == null) { c = new Color(1, 1, 1, 1); } cs[i] = new Color4f(c); } setCouleurs(cs); support_.firePropertyChange("paletteCouleur", null, palette_); }
public void actualise(long t) { double tps= (double)t / 1000; // System.out.println("temps :"+tps); double[] hauteurs= source_donnees_.getDonnees(tps); next_figure_= new Point3d[hauteurs.length]; // System.out.println("next : "+next_figure_.length+"; previous : "+((IndexedGeometryArray)shape_.getGeometry()).getVertexCount()); for (int i= 0; i < next_figure_.length; i++) { Point3d ancien= new Point3d(); ((IndexedGeometryArray)shape_.getGeometry()).getCoordinate(i, ancien); next_figure_[i]= new Point3d( ancien.x, ancien.y, hauteurs[i] /*/ ParametresVolumes.ECHELLE*/); } affiche(); } public void affiche() {