Property — Aspose.3D FOSS for Java
Enumerations
Property egyetlen névvel ellátott, típusú metaadatmezőt képvisel, amely bármilyen A3DObject (beleértve Node, Mesh, AnimationClip, stb.). A tulajdonságok a PropertyCollection által visszaadott obj.getProperties(). A tulajdonságokat olvashatja, írhatja és felsorolhatja, hogy felhasználó által definiált adatokat tároljon a jelenet elemei mellett.
Enumerations: com.aspose.threed
import com.aspose.threed.Property;Enumerations
Property az objektumok általában nem közvetlenül az alkalmazáskód által kerülnek létrehozásra. Őket a következő hívásával hozhatja létre A3DObject.getProperty() vagy megtalálható a A3DObject.findProperty().
| Enumerations | Enumerations | Enumerations |
|---|---|---|
name | String | Tulajdonság neve |
value | Object | Kezdeti érték (opcionális) |
Enumerations
| Enumerations | Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|---|
name | String | getName() | – | Csak olvasható név a tulajdonságnak |
value | Object | getValue() | setValue(Object) | Aktuális érték; olvasható és írható |
valueType | Class<?> | getValueType() | – | Java Class az aktuális érték |
Enumerations
| Enumerations | Visszatérési típus | Enumerations |
|---|---|---|
getExtra(String name) | Object | Lekéri egy névvel ellátott extra metaadatmezőt, amely ezen a tulajdonságon van tárolva |
setExtra(String name, Object value) | void | Beállít egy névvel ellátott extra metaadatmezőt |
getBindPoint(AnimationNode anim, boolean create) | BindPoint | Visszaadja az animáció kötési pontját ehhez a tulajdonsághoz a megadott AnimationNode; pass true létrehozni egyet, ha hiányzik |
getKeyframeSequence(AnimationNode anim, boolean create) | KeyframeSequence | Visszaadja a kulcskocka sorozatot ehhez a tulajdonsághoz a megadott AnimationNode |
Enumerations
import com.aspose.threed.Scene;
import com.aspose.threed.Node;
import com.aspose.threed.Property;
import com.aspose.threed.PropertyCollection;
Scene scene = new Scene();
Node node = scene.getRootNode().createChildNode("tagged_node");
// Access the property collection
PropertyCollection props = node.getProperties();
// Get a property by name (read raw value)
Object val = node.getProperty("name");
System.out.println(val); // "tagged_node"
// Find a property object
Property prop = node.findProperty("name");
if (prop != null) {
System.out.println(prop.getName()); // "name"
System.out.println(prop.getValue()); // "tagged_node"
System.out.println(prop.getValueType()); // class java.lang.String
}
// Enumerate all properties
for (Property p : props) {
System.out.println(" " + p.getName() + " = " + p.getValue());
}
// Store a custom value on a property (extra metadata)
if (prop != null) {
prop.setExtra("ui_label", "Scene Origin Node");
Object label = prop.getExtra("ui_label");
System.out.println(label); // "Scene Origin Node"
}