本文整理匯總了Java中gov.nasa.worldwind.Locatable類的典型用法代碼示例。如果您正苦於以下問題:Java Locatable類的具體用法?Java Locatable怎麽用?Java Locatable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Locatable類屬於gov.nasa.worldwind包,在下文中一共展示了Locatable類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doPick
import gov.nasa.worldwind.Locatable; //導入依賴的package包/類
@Override
protected void doPick(DrawContext dc, java.awt.Point pickPoint) {
this.pickSupport.clearPickList();
this.pickSupport.beginPicking(dc);
for (Renderable renderable : getRenderables()) {
// If the caller has specified their own Iterable,
// then we cannot make any guarantees about its contents.
if (renderable != null) {
float[] inColor = new float[4];
dc.getGL().glGetFloatv(GL2.GL_CURRENT_COLOR, inColor, 0);
java.awt.Color color = dc.getUniquePickColor();
dc.getGL().getGL2().glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
renderable.render(dc);
dc.getGL().getGL2().glColor4fv(inColor, 0);
if (renderable instanceof Locatable) {
this.pickSupport.addPickableObject(color.getRGB(), renderable,
((Locatable) renderable).getPosition(), false);
} else {
this.pickSupport.addPickableObject(color.getRGB(), renderable);
}
}
}
this.pickSupport.resolvePick(dc, pickPoint, this);
this.pickSupport.endPicking(dc);
}