- All Implemented Interfaces:
Transformation,VertexSequence.Vertex,Renderable,Manageable,PersistenceCapable,Shareable,UserFields,XObject,TurtleModifier,Map,Serializable
Class representing an MTG.
Contents are in HashMap retrievable by keys specified in section "//MTGNode contents" of MTGKeys.java.
- Since:
- 2012-02-01
- Author:
- yong
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.grogra.turtle.F
F.Pattern, F.Pattern2, F.Pattern3Nested classes/interfaces inherited from class de.grogra.graph.impl.Node
Node.AccessorBridge, Node.FieldAttributeAccessor, Node.NType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Node.NTypestatic final Node.NType.Fieldprotected PolygonMeshprotected intstatic final Node.NType.FieldFields inherited from class de.grogra.mtg.MTGNode
AA, AA$FIELD, Alpha, Alpha$FIELD, Azimut, Azimut$FIELD, BB, BB$FIELD, BotDia, BotDia$FIELD, Category, Category$FIELD, CC, CC$FIELD, DAB, DAB$FIELD, DAC, DAC$FIELD, dataFlag, dataFlag$FIELD, DBC, DBC$FIELD, DirectionPrimary, DirectionPrimary$FIELD, L1, L1$FIELD, L2, L2$FIELD, L3, L3$FIELD, Length, Length$FIELD, mtgClass, mtgClass$FIELD, mtgClassID, mtgClassID$FIELD, mtgID, mtgID$FIELD, mtgScale, mtgScale$FIELD, Order, Order$FIELD, Position, Position$FIELD, stdAttFlag, stdAttFlag$FIELD, TopDia, TopDia$FIELD, XX, XX$FIELD, YY, YY$FIELD, ZZ, ZZ$FIELDFields inherited from class de.grogra.turtle.F
color, color$FIELD, diameter, diameter$FIELD, length, length$FIELDFields inherited from class de.grogra.turtle.Shoot
localRegisters$FIELDFields inherited from class de.grogra.imp3d.objects.AxisBase
SCALE_V_MASK, scaleV$FIELD, USED_BITSFields inherited from class de.grogra.imp3d.objects.ShadedNull
INFINITE_MASK, interior, interior$FIELD, renderAsWireframe, renderAsWireframe$FIELD, shader, shader$FIELD, treatedAsInfinite$FIELDFields inherited from class de.grogra.imp3d.objects.Null
transform, transform$FIELD, TRANSFORMING_MASK, transforming$FIELDFields inherited from class de.grogra.graph.impl.Node
ADDITIONAL_FIELDS, bits, DELETED, EXTENT_BIT, EXTENT_MASK, extentIndex$FIELD, extentTail$FIELD, HAS_OBSERVERS, IS_INTERPRETIVE, isInterpretive$FIELD, LAST_EXTENT_INDEX, layer$FIELD, MARK, mark$FIELD, MAX_RESOLUTION, MIME_TYPE, MIN_RESOLUTION, MIN_UNUSED_SPECIAL_OF_SOURCE, MIN_UNUSED_SPECIAL_OF_TARGET, name$FIELD, RESOLUTION_BIT, RESOLUTION_MASK, resolution$FIELDFields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeBenchmark(Vector3d ori, Vector3d u, Vector3d v, Vector3d w) intclassScale(String classSymbol) Returns scale of a given classint[]classSymbolsToClassIndices(String[] classSymbols) intclassSymbolToClassIndex(String classSymbol) combinePriSecRotation(double x, double y, double z, double x2, double y2, double z2) intcompoFather(int nodeIndex) Nodes - Returns refinement father of the specified node.compoFather(MTGNode node) Nodes - Returns refinement father of the specified node.int[]compoSonsIds(int nodeIndex) Nodes - Returns refinement sons of the specified node.int[]compoSonsIds(int nodeIndex, int scale) Returns compositional sons of a node, given that the compositional sons are of a lower scale than the given scale.voidvoiddraw(Object object, boolean asNode, RenderState rs) intedgeType(int sourceIndex, int targetIndex) Nodes - Get the edge bits (int) between a source node and a target node.intfindLocalTopoRoot(int startv, int etype) Find root(first node) of the compositional group node 'startv' belongs to.Branches - Get the branches or plant frame.intBranches - Get number of branches.Classes - Returns information of MTG classes defined.getData()Features - Returns information of MTG features defined.intNodes - Returns index of MTGNode given its instance.getNode(int nodeIndex) Nodes - Returns MTGNode instance given its index.protected Node.NTypeThis method returns theNode.NTypewhich describes the managed fields of the class of this node.intPlant - Gets the number of plants recognized in this MTG so far.int[]getRootIds(int scale) Obtain a list of indices of root nodes refined the specified node.MTGNode[]getRoots(int scale) intgetScale(int nodeIndex) Nodes - Returns scale of node at index specified.intNumber of successor or branch edges from a start node to an end node.voidPlant - Increment the counter for the number of plants specified in this MTG.intmtgType()Coordinates - Get the MTG geometric reference system type.protected NodeThis method returns a new instance of the class of this node.intpathLength(int father, int vertex, int edge) voidplantFrame(int scale, double dist) Computes the frame of the plant at the specified scale.voidplantFrameDelete(int scale) voidRefreshes cached node list.voidRemoves inter-scale topological relations (i.e. successor and branching edges).searchForElement(int nodeIndex) Branches - Returns branch element that corresponds to the node of the given index.voidsetData(MTGNodeData data) voidsetElevationAzimuth(Vector3d vec, double ele, double azi) voidvoidsetPolygons(PolygonMesh mesh) inttopoFather(int nodeIndex, int edgeType) Nodes - Returns index of node that is topological father of node specified by input nodeIndex.int[]topoSons(int nodeIndex, int edgeType) Nodes - For usage by root MTG node.Methods inherited from class de.grogra.mtg.MTGNode
compoFather, compoSons, compoSonsCount, compoSonsIds, copyStdAttributes, findAdjacentMTG, getLength, getOrder, getType, hasAA, hasAlpha, hasAzimut, hasBB, hasBotDia, hasCategory, hasCC, hasDAB, hasDAC, hasDBC, hasDirectionPrimary, hasL1, hasL2, hasL3, hasLength, hasOrder, hasPosition, hasStdAtt, hasTopDia, hasXX, hasYY, hasZZ, height, order, setDirectoryPrimary, setStdAttFlagOff, setStdAttFlagOn, topoSonNodes, topoSonsMethods inherited from class de.grogra.turtle.F
getFloat, getInt, getLength, getSurfaceArea, getVolumeMethods inherited from class de.grogra.turtle.Shoot
execute, getBoolean, getLocalRegisters, getObject, getSymbolColor, getVertexTransformation, setLocalRegistersMethods inherited from class de.grogra.turtle.TurtleStep
getDouble, postTransformMethods inherited from class de.grogra.imp3d.objects.ShadedNull
getInterior, getShader, isRenderAsWireframe, isTreatedAsInfinite, setBackShader, setColor, setColor, setFrontShader, setInterior, setMaterial, setRenderAsWireframe, setShader, setShaders, setTreatedAsInfiniteMethods inherited from class de.grogra.imp3d.objects.Null
getLocalTransformation, getTransform, getTranslation, isTransforming, preTransform, setRotation, setScale, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransforming, setTranslationMethods inherited from class de.grogra.graph.impl.Node
addEdgeBitsTo, addReference, appendBranchNode, appendBranchNode, appendReferencesTo, clone, clone, cloneGraph, dump, dumpTree, dup, dupFrom, dupnew, dupUnmanagedFields, edgeChanged, fieldModified, findAdjacent, findRefinementType, get, getAccessor, getAccessor, getAttributes, getAxisParent, getBranch, getBranchLength, getBranchNode, getBranchTail, getByte, getChar, getCommonAncestor, getCurrentGraphState, getDirectChildCount, getEdgeAttributeAccessor, getEdgeAttributes, getEdgeBitsTo, getEdgeTo, getExtentIndex, getFirst, getFirstEdge, getGraph, getId, getIgnored, getIndex, getInstantiator, getLayer, getLong, getManageableType, getName, getNeighbor, getNext, getNType, getOrCreateEdgeTo, getOrNull, getPersistenceManager, getPredecessor, getProvider, getResolution, getShort, getSource, getStamp, getSuccessor, getSymbol, getTarget, getTransaction, getUserField, getUserFieldCount, getXClass, getXData, hasName, initProvider, initXClass, insertBranchNode, insertBranchNode, instantiateGraph, isAncestorOf, isDirection, isEncoarseOf, isManagingInstance, isMarked, isRoot, isSource, isTarget, manageableReadResolve, manageableWriteReplace, paramString, removeAll, removeEdgeBitsTo, removeFromChain, removeFromChain, removeReference, setBranch, setBranch, setExtentIndex, setGraphForDeserialization, setIgnored, setLayer, setMark, setName, setResolution, setSuccessor, setSuccessor, specialEdgeAdded, specialEdgeRefModified, specialEdgeRemoved, toString, writeReplaceMethods inherited from class de.grogra.graph.impl.Edge
addEdgeBits, getBitMark, getEdgeBits, getEdgeKeys, getObjectMark, getSpecialEdgeDescriptor, parseEdgeKeys, remove, removeEdgeBits, setBitMark, setEdgeBits, setObjectMark, testEdgeBitsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.grogra.persistence.PersistenceCapable
getBitMark, getObjectMark, setBitMark, setObjectMark
-
Field Details
-
polygons
-
visibleSides
protected int visibleSides -
$TYPE
-
dist$FIELD
-
visibleSides$FIELD
-
-
Constructor Details
-
MTGRoot
public MTGRoot()
-
-
Method Details
-
getNTypeImpl
Description copied from class:NodeThis method returns theNode.NTypewhich describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.- Overrides:
getNTypeImplin classMTGNode- Returns:
- type describing the managed fields of the class of this node
-
newInstance
Description copied from class:NodeThis method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.- Overrides:
newInstancein classMTGNode- Returns:
- new instance of class of this node
-
setPolygons
-
getPolygons
-
getObject
-
setObject
-
getData
-
setData
-
deleteNodeList
public void deleteNodeList() -
refreshNodeIndices
Refreshes cached node list. At the same time reassigns id to the nodes. The plant frame computation is dependent on the cached node list and id of the nodes. This cached list is cleared from memory at the end of method plantFrame.- Throws:
MTGError.MTGPlantFrameException
-
removeInterScaleTopoRelations
Removes inter-scale topological relations (i.e. successor and branching edges).- Throws:
MTGError.MTGPlantFrameException
-
combinePriSecRotation
public Matrix4d combinePriSecRotation(double x, double y, double z, double x2, double y2, double z2) -
plantFrameDelete
public void plantFrameDelete(int scale) -
plantFrame
Computes the frame of the plant at the specified scale. For a static situation only. The frame of the plant is a collection of branches. The branch elements contain a top diameter, bottom diameter, length, positional coordinates and directional coordinates. Root nodes are nodes without topological parents, i.e. no father node with successor or branching edge to them.- Parameters:
scale-- Throws:
MTGError.MTGPlantFrameException
-
findLocalTopoRoot
Find root(first node) of the compositional group node 'startv' belongs to.- Parameters:
startv-etype-- Returns:
- Throws:
MTGError.MTGPlantFrameException
-
pathLength
public int pathLength(int father, int vertex, int edge) -
mtgType
Coordinates - Get the MTG geometric reference system type.- Returns:
- MTG Type
- Throws:
MTGError.MTGPlantFrameException
-
getBranchesCount
public int getBranchesCount()Branches - Get number of branches.- Returns:
- Number of branches
-
searchForElement
Branches - Returns branch element that corresponds to the node of the given index.- Parameters:
nodeIndex-- Returns:
- MTGBranchElement
-
getBranches
Branches - Get the branches or plant frame.- Returns:
- List of branches.
-
incrementPlantCount
Plant - Increment the counter for the number of plants specified in this MTG.- Throws:
MTGError.MTGPlantFrameException
-
getPlantCount
Plant - Gets the number of plants recognized in this MTG so far.- Returns:
- Number of plants recognized in this MTG so far.
- Throws:
MTGError.MTGPlantFrameException
-
height
Number of successor or branch edges from a start node to an end node.- Parameters:
startNodeId-endNodeId-- Returns:
- Throws:
MTGError.MTGPlantFrameException
-
getRoots
- Throws:
MTGError.MTGPlantFrameException
-
getRootIds
Obtain a list of indices of root nodes refined the specified node.- Parameters:
scale-- Returns:
- List if indices of root nodes.
- Throws:
MTGError.MTGPlantFrameException
-
getClassesInfo
Classes - Returns information of MTG classes defined.- Returns:
- List of class information
- Throws:
MTGError.MTGPlantFrameException
-
getFeaturesInfo
Features - Returns information of MTG features defined.- Returns:
- List of feature information.
- Throws:
MTGError.MTGPlantFrameException
-
getNode
Nodes - Returns MTGNode instance given its index.- Parameters:
nodeIndex-- Returns:
- MTGNode at specified index
-
getIndex
Nodes - Returns index of MTGNode given its instance.- Parameters:
node-- Returns:
- index of node.
-
edgeType
public int edgeType(int sourceIndex, int targetIndex) Nodes - Get the edge bits (int) between a source node and a target node.- Parameters:
sourceIndex-targetIndex-- Returns:
- edge type
-
topoFather
public int topoFather(int nodeIndex, int edgeType) Nodes - Returns index of node that is topological father of node specified by input nodeIndex.- Parameters:
nodeIndex-edgeType-- Returns:
- index of topological father node
-
topoSons
public int[] topoSons(int nodeIndex, int edgeType) Nodes - For usage by root MTG node. To find the topological sons of the node found in list of nodes at specified nodeIndex.- Parameters:
nodeIndex-edgeType-- Returns:
- indices of topological son nodes.
-
compoFather
public int compoFather(int nodeIndex) Nodes - Returns refinement father of the specified node.- Parameters:
nodeIndex-- Returns:
- index of refinement father node.
-
compoFather
Nodes - Returns refinement father of the specified node.- Parameters:
nodeIndex-- Returns:
- index of refinement father node.
-
compoSonsIds
Returns compositional sons of a node, given that the compositional sons are of a lower scale than the given scale.- Parameters:
nodeIndex-scale-- Returns:
- Throws:
MTGError.MTGPlantFrameException
-
compoSonsIds
public int[] compoSonsIds(int nodeIndex) Nodes - Returns refinement sons of the specified node.- Parameters:
nodeIndex-- Returns:
- indices of refinement son nodes.
-
getScale
Nodes - Returns scale of node at index specified.- Parameters:
nodeIndex-- Returns:
- Scale of node.
- Throws:
MTGError.MTGPlantFrameException
-
classSymbolToClassIndex
-
classScale
Returns scale of a given class- Parameters:
classSymbol-- Returns:
-
classSymbolsToClassIndices
-
draw
- Specified by:
drawin interfaceRenderable
-
setElevationAzimuth
-
changeBenchmark
-