Пример #1
0
  /**
   * Constructor
   *
   * @param state
   */
  public Grid(GridState state) {
    super(state.name);
    this.state = state;
    this.cellSize = state.size;
    this.color = state.color;
    this.lineWidth = state.lineWidth;
    offset = new Vector3();
    setLocation(state.location, false);

    lattice = new HiddenLine("_lattice", IndexMode.Lines);
    SpatialUtil.setPickHost(lattice, this);
    lattice.setColor(color);
    lattice.setModelBound(new BoundingBox());

    MaterialState ms = new MaterialState();
    ms.setColorMaterial(ColorMaterial.Emissive);
    ms.setColorMaterialFace(MaterialState.MaterialFace.FrontAndBack);
    ms.setEnabled(true);
    text = new Node("_text");
    text.getSceneHints().setLightCombineMode(LightCombineMode.Off);
    text.getSceneHints().setPickingHint(PickingHint.Pickable, false);
    text.setRenderState(ms);
    setLabelVisible(state.labelVisible);

    attachChild(lattice);
    attachChild(text);

    setVisible(state.visible);
    setPinned(state.pinned);

    state.setMapElement(this);
  }
Пример #2
0
 public void setHiddenDashed(boolean hiddenDashed) {
   lattice.enableDash(hiddenDashed);
 }
Пример #3
0
 @Override
 protected void enableHighlight(boolean enable) {
   lattice.highlight(enable, color);
 }
Пример #4
0
 /**
  * Set the line width.
  *
  * @param width
  */
 public void setLineWidth(float width) {
   lineWidth = width;
   lattice.setLineWidth(width);
   markDirty(DirtyType.RenderState);
 }
Пример #5
0
 /**
  * Set the color
  *
  * @param color
  */
 public void setColor(Color color) {
   this.color = color;
   lattice.setColor(color);
 }