public class GeometryMergeFactory extends Object
doubleArrayArray
Attributes are supported
other attributes will be ignored with
two exceptions : FaceIndices and EdgeIndices
respectFaces respectEdges
you can control to have no faceAttributes or edgeAttributes in the
merged Geometry.
generateFaceNormals generateVertexNormals
you can fill the undefined holes of the Normal-Attributes defaultFaceAttributes defaultFaceAttributeValues
you can enrich partialy(not totaly) undefined Attributes with
default(per Attribute). This defaults can then be given per geometry
(as list) or vor all geomertys(a list with a single entry).
this defaults do not overwride allready defined Attributes,
and wil not be used if no geometry has this attribute.
importantFaceDefaultAttributes
you can later garante
that a defaultAttribute also is used if no geometry has this Attribute
(not yet implemented) TODO: merge only IndexedFaceSets of a SceneGraph
TODO: merge FaceSets and linesets seperate to avoid "holes" in the AttributeList and gather in the end
TODO: refactor to conform to the jReality factory pattern (use update() to regenerate current state).
if you wish also to combine duplicated vertex, edge, or face data.
Constructor and Description |
---|
GeometryMergeFactory() |
Modifier and Type | Method and Description |
---|---|
List<Attribute> |
getDefaultEdgeAttributes() |
List<List<double[]>> |
getDefaultEdgeAttributeValues() |
List<Attribute> |
getDefaultFaceAttributes() |
List<List<double[]>> |
getDefaultFaceAttributeValues() |
List<Attribute> |
getDefaultVertexAttributes() |
List<List<double[]>> |
getDefaultVertexAttributeValues() |
List<Attribute> |
getImportantEdgeDefaultAttributes() |
List<Attribute> |
getImportantFaceDefaultAttributes() |
List<Attribute> |
getImportantVertexDefaultAttributes() |
boolean |
isGenerateFaceNormals() |
boolean |
isGenerateVertexNormals() |
boolean |
isRespectEdges() |
boolean |
isRespectFaces() |
boolean |
isRespectVertices()
Deprecated.
use not yet implemented
|
IndexedFaceSet |
mergeGeometrySets(SceneGraphComponent cmp)
merges all IndexedFaceSets, IndexeedLineSets and PointSets
of the given SceneGraph to one IndexedFaceSet
Attention: several values can be set bevorhand
|
IndexedFaceSet |
mergeIndexedFaceSets(PointSet[] geo)
merges all IndexedFaceSets to one IndexedFaceSet
Attention: several values can be set bevorhand
|
IndexedFaceSet |
mergeIndexedFaceSets(SceneGraphComponent cmp)
merges all IndexedFaceSets, IndexeedLineSets and PointSets
of the given SceneGraph to one IndexedFaceSet
EdgeAttributes will be ignored.
|
IndexedLineSet |
mergeIndexedLineSets(IndexedLineSet[] ils)
merges all IndexeedLineSets to one IndexedLineSet
Attention: several values can be set bevorhand
|
IndexedLineSet |
mergeIndexedLineSets(SceneGraphComponent cmp)
merges all IndexedFaceSets, IndexeedLineSets and PointSets
of the given SceneGraph to one IndexedLineSet
FaceAttributes will be ignored.
|
PointSet |
mergePointSets(PointSet[] ps)
merges all PointSets to one PointSet
Attention: several values can be set bevorhand
|
PointSet |
mergePointSets(SceneGraphComponent cmp)
merges all IndexedFaceSets, IndexeedLineSets and PointSets
of the given SceneGraph to one PointSet
Face and Edge-Attributes will be ignored.
|
void |
setDefaultEdgeAttributes(List<Attribute> defaultAttributes,
List<List<double[]>> defaultAttributeValues)
see
setDefaultFaceAttributes |
void |
setDefaultFaceAttributes(List<Attribute> defaultAttributes,
List<List<double[]>> defaultAttributeValues)
Attributes which will be set to the given default,
if not yet supported in the geometry.
|
void |
setDefaultVertexAttributes(List<Attribute> defaultAttributes,
List<List<double[]>> defaultAttributeValues)
see
setDefaultFaceAttributes |
void |
setGenerateFaceNormals(boolean generateFaceNormals)
generates FaceNormals if not already given
|
void |
setGenerateVertexNormals(boolean generateVertexNormals)
generates VertexNormals if not already given
|
void |
setImportantEdgeDefaultAttributes(List<Attribute> importantEdgeDefaultAttributes) |
void |
setImportantFaceDefaultAttributes(List<Attribute> importantFaceDefaultAttributes)
default Attributes wich are defined will normaly not be used if
no Geometry supports them.
|
void |
setImportantVertexDefaultAttributes(List<Attribute> importantVertexDefaultAttributes) |
void |
setRespectEdges(boolean respectEdges)
Edge Attributes will not be ignored
|
void |
setRespectFaces(boolean respectFaces)
Face Attributes will not be ignored
|
void |
setRespectVertices(boolean respectVertices)
Deprecated.
use not yet implemented
|
public IndexedFaceSet mergeGeometrySets(SceneGraphComponent cmp)
RootNode
- public IndexedFaceSet mergeIndexedFaceSets(PointSet[] geo)
IndexedFaceSets
- to mergepublic IndexedLineSet mergeIndexedLineSets(IndexedLineSet[] ils)
IndexedLineSets
- to mergepublic PointSet mergePointSets(PointSet[] ps)
Pointsets
- to mergepublic IndexedFaceSet mergeIndexedFaceSets(SceneGraphComponent cmp)
RootNode
- public IndexedLineSet mergeIndexedLineSets(SceneGraphComponent cmp)
RootNode
- public PointSet mergePointSets(SceneGraphComponent cmp)
RootNode
- public void setDefaultFaceAttributes(List<Attribute> defaultAttributes, List<List<double[]>> defaultAttributeValues)
doubleArrayArray
Attributes !!defaultFaceAttributes
- list of default AttributesdefaultAttributeValues
- must have the same length.
Each entry can individualy have
- just a single entry (default for all is the same)
- multiple entrys (one for each geometry)
- null or empty (works like no default is given)public void setDefaultEdgeAttributes(List<Attribute> defaultAttributes, List<List<double[]>> defaultAttributeValues)
setDefaultFaceAttributes
public void setDefaultVertexAttributes(List<Attribute> defaultAttributes, List<List<double[]>> defaultAttributeValues)
setDefaultFaceAttributes
public void setImportantFaceDefaultAttributes(List<Attribute> importantFaceDefaultAttributes)
importantDefaultAttributes
- public void setImportantEdgeDefaultAttributes(List<Attribute> importantEdgeDefaultAttributes)
public void setImportantVertexDefaultAttributes(List<Attribute> importantVertexDefaultAttributes)
public void setGenerateFaceNormals(boolean generateFaceNormals)
generateVertexNormals
- public void setGenerateVertexNormals(boolean generateVertexNormals)
generateVertexNormals
- public void setRespectEdges(boolean respectEdges)
respectEdges
- public void setRespectFaces(boolean respectFaces)
respectEdges
- public void setRespectVertices(boolean respectVertices)
respectEdges
- public boolean isGenerateFaceNormals()
public boolean isGenerateVertexNormals()
public boolean isRespectEdges()
public boolean isRespectFaces()
public boolean isRespectVertices()