Search in sources :

Example 16 with BMText

use of com.ardor3d.ui.text.BMText in project energy3d by concord-consortium.

the class Roof method drawLabels.

@Override
public int drawLabels(int printSequence) {
    for (final Spatial roofPartNode : roofPartsRoot.getChildren()) {
        if (roofPartNode.getSceneHints().getCullHint() != CullHint.Always) {
            final String text = "(" + (printSequence++ + 1) + ")";
            final BMText label = (BMText) ((Node) roofPartNode).getChild(3);
            label.getSceneHints().setCullHint(CullHint.Inherit);
            label.setText(text);
        }
    }
    return printSequence;
}
Also used : Spatial(com.ardor3d.scenegraph.Spatial) BMText(com.ardor3d.ui.text.BMText)

Example 17 with BMText

use of com.ardor3d.ui.text.BMText in project energy3d by concord-consortium.

the class HousePart method drawLabels.

public int drawLabels(int printSequence) {
    if (!isPrintable()) {
        return printSequence;
    }
    final String text = "(" + (printSequence++ + 1) + ")";
    final BMText label = fetchBMText(text, 0);
    final Vector3 offset;
    if (original == null) {
        offset = getNormal().multiply(0.5, null);
    } else {
        offset = new Vector3(0, labelOffset, 0);
    }
    root.getTransform().applyInverseVector(offset);
    offset.addLocal(getCenter());
    label.setTranslation(offset);
    return printSequence;
}
Also used : ReadOnlyVector3(com.ardor3d.math.type.ReadOnlyVector3) Vector3(com.ardor3d.math.Vector3) BMText(com.ardor3d.ui.text.BMText)

Aggregations

BMText (com.ardor3d.ui.text.BMText)17 OrientedBoundingBox (com.ardor3d.bounding.OrientedBoundingBox)10 Line (com.ardor3d.scenegraph.Line)9 BoundingBox (com.ardor3d.bounding.BoundingBox)8 ColorRGBA (com.ardor3d.math.ColorRGBA)7 Mesh (com.ardor3d.scenegraph.Mesh)7 Node (com.ardor3d.scenegraph.Node)7 Box (com.ardor3d.scenegraph.shape.Box)6 Vector3 (com.ardor3d.math.Vector3)5 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)5 OffsetState (com.ardor3d.renderer.state.OffsetState)5 CullHint (com.ardor3d.scenegraph.hint.CullHint)5 ReadOnlyColorRGBA (com.ardor3d.math.type.ReadOnlyColorRGBA)4 Spatial (com.ardor3d.scenegraph.Spatial)4 Cylinder (com.ardor3d.scenegraph.shape.Cylinder)4 BlendState (com.ardor3d.renderer.state.BlendState)2 CullState (com.ardor3d.renderer.state.CullState)2 AngleAnnotation (org.concord.energy3d.shapes.AngleAnnotation)2 PvModuleSpecs (org.concord.energy3d.simulation.PvModuleSpecs)2 ColladaImporter (com.ardor3d.extension.model.collada.jdom.ColladaImporter)1