use of artisynth.core.modelbase.CompositeComponent in project artisynth_core by artisynth.
the class SelectionPopup method isVisible.
private boolean isVisible(RenderableComponent rcomp) {
RenderProps props = rcomp.getRenderProps();
if (props != null) {
return props.isVisible();
}
CompositeComponent parent = rcomp.getParent();
if (parent instanceof RenderableComponentList) {
return ((RenderableComponentList<?>) parent).rendersSubComponents();
}
return false;
}
use of artisynth.core.modelbase.CompositeComponent in project artisynth_core by artisynth.
the class CollisionManager method getExternallyCollidableBodies.
private static void getExternallyCollidableBodies(List<CollidableBody> list, ModelComponent mc) {
if (mc instanceof CompositeComponent) {
CompositeComponent comp = (CompositeComponent) mc;
for (int i = 0; i < comp.numComponents(); i++) {
ModelComponent c = comp.get(i);
if (c instanceof Collidable) {
Collidable col = (Collidable) c;
if (isCollidableBody(col) && isExternallyCollidable(col)) {
list.add((CollidableBody) c);
}
}
getExternallyCollidableBodies(list, c);
}
}
}
use of artisynth.core.modelbase.CompositeComponent in project artisynth_core by artisynth.
the class CollisionManager method getInternallyCollidableBodies.
private static void getInternallyCollidableBodies(List<CollidableBody> list, ModelComponent mc) {
if (mc instanceof CompositeComponent) {
CompositeComponent comp = (CompositeComponent) mc;
for (int i = 0; i < comp.numComponents(); i++) {
ModelComponent c = comp.get(i);
if (c instanceof Collidable) {
Collidable col = (Collidable) c;
if (isCollidableBody(col) && isInternallyCollidable(col)) {
list.add((CollidableBody) c);
}
}
getInternallyCollidableBodies(list, c);
}
}
}
use of artisynth.core.modelbase.CompositeComponent in project artisynth_core by artisynth.
the class AuxMaterialElementDesc method write.
public void write(PrintWriter pw, NumberFormat fmt, Object ref) throws IOException {
CompositeComponent ancestor = ComponentUtils.castRefToAncestor(ref);
pw.print("[ ");
IndentingPrintWriter.addIndentation(pw, 2);
printElementReference(pw, ancestor);
pw.println("");
getAllPropertyInfo().writeNonDefaultProps(this, pw, fmt);
IndentingPrintWriter.addIndentation(pw, -2);
pw.println("]");
}
use of artisynth.core.modelbase.CompositeComponent in project artisynth_core by artisynth.
the class NumericProbeEditor method getFullPropPath.
/**
* returns the full string path of a property by going up the hierachy and
* finding all its parent properties (if any) and component path.
*/
protected String getFullPropPath(Property prop) {
String compPath = prop.getName();
ModelComponent root = myMain.getRootModel();
Object host = prop.getHost();
// System.out.println("Looking for parent path...");
if (host instanceof CompositeProperty) {
while (host instanceof CompositeProperty) {
String name = ((CompositeProperty) host).getPropertyInfo().getName();
// System.out.println(name);
compPath = name + "." + compPath;
host = ((CompositeProperty) host).getPropertyHost();
}
String baseComp = ComponentUtils.getPathName((CompositeComponent) root, (ModelComponent) host);
compPath = baseComp + ComponentUtils.componentPropertySeparator + compPath;
} else {
compPath = ComponentUtils.getPathName((CompositeComponent) root, (ModelComponent) prop.getHost());
compPath += ComponentUtils.componentPropertySeparator + prop.getName();
}
// System.out.println("found component base path: "+compPath);
return compPath;
}
Aggregations