Ejemplo n.º 1
0
  public void outputContext(PrintWriter printStream, String indentString) {
    AppearanceNode appearance = getAppearanceNodes();
    if (appearance != null) {
      if (appearance.isInstanceNode() == false) {
        String nodeName = appearance.getName();
        if (nodeName != null && 0 < nodeName.length())
          printStream.println(
              indentString + "\t" + "appearance DEF " + appearance.getName() + " Appearance {");
        else printStream.println(indentString + "\t" + "appearance Appearance {");
        appearance.outputContext(printStream, indentString + "\t");
        printStream.println(indentString + "\t" + "}");
      } else printStream.println(indentString + "\t" + "appearance USE " + appearance.getName());
    }

    Node geonode = getGeometry3DNode();
    if (geonode != null) {
      if (geonode.isInstanceNode() == false) {
        String nodeName = geonode.getName();
        if (nodeName != null && 0 < nodeName.length())
          printStream.println(
              indentString
                  + "\t"
                  + "geometry DEF "
                  + geonode.getName()
                  + " "
                  + geonode.getTypeString()
                  + " {");
        else
          printStream.println(indentString + "\t" + "geometry " + geonode.getTypeString() + " {");
        geonode.outputContext(printStream, indentString + "\t");
        printStream.println(indentString + "\t" + "}");
      } else printStream.println(indentString + "\t" + "geometry USE " + geonode.getName());
    }
  }
Ejemplo n.º 2
0
 public boolean isChildNodeType(Node node) {
   if (node.isAppearanceNode() || node.isGeometry3DNode()) return true;
   else return false;
 }
Ejemplo n.º 3
0
 public Geometry3DNode getGeometry3D() {
   for (Node node = getChildNodes(); node != null; node = node, next()) {
     if (node.isGeometry3DNode()) return (Geometry3DNode) node;
   }
   return null;
 }