Node

Methods

Methods Node klase pārstāv nosauktu elementu Aspose.3D skatu grafā. Katrs mezgls var saturēt vienu Entity (piemēram, Mesh vai Camera), uztur vecāku-bērna attiecības ar citiem mezgliem, un nes lokālu transformāciju. Mezgli ir galvenais veids, kā organizēt 3D objektus skatu hierarhijā.

import com.aspose.threed.Scene;
import com.aspose.threed.Node;

Scene scene = new Scene();

// Access the root node via getter
Node root = scene.getRootNode();

// Create a child node
Node child = root.createChildNode("my_node");

// Iterate child nodes via getter
for (Node node : root.getChildNodes()) {
    System.out.println(node.getName());
}

Methods

Methods Node konstruktors inicializē mezglu ar neobligātu nosaukumu.

NameTypeAccessDescription
assetInfoAssetInfoReadGets the asset info.
visiblebooleanReadGets the visible.
childNodesList<Node>ReadGets the child nodes.
entityEntityReadGets the entity.
excludedbooleanReadGets the excluded.
entitiesList<Entity>ReadGets the entities.
metaDatasList<CustomObject>ReadGets the meta datas.
materialsList<Material>ReadGets the materials.
materialMaterialReadGets the material.
parentNodeNodeReadGets the parent node.
transformTransformReadGets the transform.
globalTransformGlobalTransformReadGets the global transform.
boundingBoxBoundingBoxReadGets the bounding box.
sceneSceneReadGets the scene.
nameStringReadGets the name.
propertiesPropertyCollectionReadGets the properties.

Methods

Visas mezgla atribūti tiek piekļūti, izmantojot getter/setter metodes.

SignatureDescription
Node()Calls Node on this Node instance.
Node(name: String)Calls Node(name) on this Node instance.
Node(name: String, entity: Entity)Calls Node(name, entity) on this Node instance.
getAssetInfo()AssetInfoReturns the asset info.
setAssetInfo(value: AssetInfo)Sets the asset info value.
getVisible()booleanReturns the visible.
setVisible(value: boolean)Sets the visible value.
getChildNodes()List<Node>Returns the child nodes.
createChildNode()NodeCalls createChildNode on this Node instance.
createChildNode(name: String)NodeCalls createChildNode(name) on this Node instance.
createChildNode(entity: Entity)NodeCalls createChildNode(entity) on this Node instance.
createChildNode(name: String, entity: Entity)NodeCalls createChildNode(name, entity) on this Node instance.
createChildNode(name: String, entity: Entity, material: Material)NodeCalls createChildNode(name, entity, material) on this Node instance.
merge(other: Node)Calls merge(other) on this Node instance.
getEntity()EntityReturns the entity.
setEntity(value: Entity)Sets the entity value.
getExcluded()booleanReturns the excluded.
setExcluded(value: boolean)Sets the excluded value.
getEntities()List<Entity>Returns the entities.
getMetaDatas()List<CustomObject>Returns the meta datas.
getMaterials()List<Material>Returns the materials.
getMaterial()MaterialReturns the material.
setMaterial(value: Material)Sets the material value.
getParentNode()NodeReturns the parent node.
setParentNode(value: Node)Sets the parent node value.
getTransform()TransformReturns the transform.
getGlobalTransform()GlobalTransformReturns the global transform.
evaluateGlobalTransform(includeGeometricTransform: boolean)Matrix4Calls evaluateGlobalTransform(includeGeometricTransform) on this Node instance.
getChild(index: int)NodeCalls getChild(index) on this Node instance.
getChild(name: String)NodeCalls getChild(name) on this Node instance.
accept(visitor: NodeVisitor)booleanCalls accept(visitor) on this Node instance.
getBoundingBox()BoundingBoxReturns the bounding box.
addEntity(entity: Entity)Calls addEntity(entity) on this Node instance.
addChildNode(node: Node)Calls addChildNode(node) on this Node instance.
selectSingleObject(query: String)ObjectCalls selectSingleObject(query) on this Node instance.
selectObjects(query: String)ArrayList<Object>Calls selectObjects(query) on this Node instance.
toString()StringCalls toString on this Node instance.
addEntity(entity: Entity, material: Material)Calls addEntity(entity, material) on this Node instance.
SceneObject()Boolean operator allows you to apply Boolean operation on two IMeshConvertible instances.
getScene()SceneConstructor of BooleanOperator.
A3DObject()Parameterized Cylinder. It can also be used to represent a cone when one of radiusTop/radiusBottom is zero.
getName()StringThe segments of the curve.
setName(name: String)Constructs a CircleShape profile with specified radius.
getProperties()PropertyCollectionInitializes a new instance of Cylinder class.
findProperty(name: String)PropertyInitializes a new instance of the Bone class.
getProperty(name: String)ObjectGets the transform matrix of the node in current pose.
setProperty(name: String, value: Object)Gets the width segments.
removeProperty(name: String)booleanGets flip coordinate system of control points/normal during importing/exporting.

Methods

MethodsAtgriešanas tipsMethods
createChildNode(String name)NodeIzveido un pievieno jaunu bērna mezglu ar norādīto nosaukumu
createChildNode(String name, Entity entity)NodeIzveido bērna mezglu un piešķir tam vienību
addChildNode(Node node)voidPievieno esošu mezglu kā šī mezgla bērnu
getChild(String name)NodeAtrast tiešu bērna mezglu pēc nosaukuma
addEntity(Entity entity)voidPievieno papildu vienību šim mezglam
merge(Node node)voidApvieno cita mezgla bērnus un vienības šajā mezglā
evaluateGlobalTransform(boolean withGeometricTransform)Matrix4Atgriež pasaules telpas transformācijas matricu; padod true lai iekļautu ģeometriskos nobīdes
getBoundingBox()BoundingBoxStub šajā izdevumā — vienmēr atgriež sentinel BoundingBox (min = Double.MAX_VALUE, max = Double.MIN_VALUE). Ģeometrijas aprēķins netiek veikts.
getProperty(String name)ObjectIegūst īpašības vērtību pēc nosaukuma
findProperty(String name)PropertyAtrod īpašību pēc nosaukuma

Methods

Izveidojiet scēnu, pievienojiet Mesh mezglam un pārlūkojiet scēnas grafu:

import com.aspose.threed.Scene;
import com.aspose.threed.Node;
import com.aspose.threed.*;


Scene scene = new Scene();
Mesh mesh = new Mesh();
mesh.getControlPoints().add(new Vector4(0, 0, 0, 1));
mesh.getControlPoints().add(new Vector4(1, 0, 0, 1));
mesh.getControlPoints().add(new Vector4(0.5, 1, 0, 1));
mesh.createPolygon(0, 1, 2);

// Attach mesh to a child node
Node node = scene.getRootNode().createChildNode("triangle", mesh);

// Traverse child nodes using getter
for (Node child : scene.getRootNode().getChildNodes()) {
    Entity entity = child.getEntity();
    if (entity != null) {
        System.out.println("Node '" + child.getName() + "': " + entity.getClass().getSimpleName());
        System.out.println("  Excluded: " + child.getExcluded());
    }
}

Skatīt arī

 Latviešu