public class FatIndexedFaceSetFactory extends Object
IndexedFaceSet
. This factory makes out of one IndexedFaceSet
two IndexedFaceSet
s, top and bottom, by moving the given IndexedFaceSet
along its
vertex normals "up" and "down" (in this process the length of the vertex normals
is not normalized). It may also generate IndexedFaceSet
s for the
boundary. All vertex, edges, and face attributes of the given IndexedFaceSet
are
copied to the top and bottom
IndexedFaceSet
s. For the boundary this must be handled elsewhere.
The ThickenedSurfaceFactory
also fattens a given IndexedFaceSet
, but
puts everything into one IndexedFaceSet
. It is also not flexible at the
boundary. On the other hand, the ThickenedSurfaceFactory
can make holes into the face, which is not possible with
the FatIndexedFaceSetFactory
.
ThickenedSurfaceFactory
Constructor and Description |
---|
FatIndexedFaceSetFactory() |
Modifier and Type | Method and Description |
---|---|
SceneGraphComponent |
getAllInOneSceneGraphComponent()
Returns all components of the fat indexed face set as children of one
SceneGraphComponent . |
IndexedFaceSet |
getBottomIFS()
The returned reference is final.
|
IndexedFaceSetFactory |
getBottomIFSF()
The returned reference is final.
|
SceneGraphComponent |
getBottomSGC()
The returned reference is final.
|
List<IndexedFaceSetFactory> |
getBoundaryIFSFs()
The returned reference is final.
|
List<IndexedFaceSet> |
getBoundaryIFSs()
The returned reference is final.
|
List<int[]> |
getBoundaryIndices() |
List<SceneGraphComponent> |
getBoundarySGCs()
The returned reference is final.
|
double |
getFatness() |
IndexedFaceSet |
getInputIFS() |
IndexedFaceSet |
getTopIFS()
The returned reference is final.
|
IndexedFaceSetFactory |
getTopIFSF()
The returned reference is final.
|
SceneGraphComponent |
getTopSGC()
The returned reference is final.
|
void |
initBoundary(int expectedNbOfBoundaryComponents)
Use this method to initialize the lists returned by
getBoundaryIFSFs() , getBoundaryIFSs() , and
getBoundarySGCs() . |
boolean |
isGenerateBoundaryIndices() |
void |
setBoundaryIndices(List<int[]> boundaryIndices)
Determines the boundary components.
|
void |
setFatness(double fatness)
The vertex coordinates of the top and bottom
IndexedFaceSet s
are obtained by adding ±½fatness times the vertex normal
to the given vertex. |
void |
setGenerateBoundaryIndices(boolean generateBoundaryIndices)
Set to true, when the factory should detect the boundary edges.
|
void |
setInputIFS(IndexedFaceSet inputIFS)
The
IndexedFaceSet to be fattened. |
void |
update()
Call this to generate the first time or update the components of the fat indexed face set
whenever ingredients - in particular the input index face set - change.
|
public IndexedFaceSet getInputIFS()
public void setInputIFS(IndexedFaceSet inputIFS)
IndexedFaceSet
to be fattened.inputIFS
- public double getFatness()
public void setFatness(double fatness)
IndexedFaceSet
s
are obtained by adding ±½fatness
times the vertex normal
to the given vertex.fatness
- public boolean isGenerateBoundaryIndices()
public void setGenerateBoundaryIndices(boolean generateBoundaryIndices)
IndexedFaceSet
that does only occur once in the list of face indices
of the IndexedFaceSet
, i.e., has only one adjacent face.
A boundary component is either closed or starts and ends at vertices,
that only have two adjacent edges. This leads to correct, i.e., four,
boundary components in the case of IndexedFaceSet
s produced
by a QuadMeshFactory
.generateBoundaryIndices
- public List<int[]> getBoundaryIndices()
public void setBoundaryIndices(List<int[]> boundaryIndices)
boundaryIndices
- of boundary components. Each entry is an int array, where
consecutive indices describe an edge (they point to the start and end vertices of that edge).public void initBoundary(int expectedNbOfBoundaryComponents)
getBoundaryIFSFs()
, getBoundaryIFSs()
, and
getBoundarySGCs()
. This is useful when boundary components are to be generated, the number of boundary
components is known, but one wants to set properties e.g. of the IndexedFaceSetFactory
that
generates a boundary component before update()
is called. Otherwise it is not necessary to call this
method. Then the boundary components are initialized when update()
is called.expectedNbOfBoundaryComponents
- public IndexedFaceSet getTopIFS()
public IndexedFaceSet getBottomIFS()
public List<IndexedFaceSet> getBoundaryIFSs()
public IndexedFaceSetFactory getTopIFSF()
public IndexedFaceSetFactory getBottomIFSF()
public List<IndexedFaceSetFactory> getBoundaryIFSFs()
public SceneGraphComponent getTopSGC()
SceneGraphComponent
with the top indexed face set as geometry.public SceneGraphComponent getBottomSGC()
SceneGraphComponent
with the bottom indexed face set as geometry.public List<SceneGraphComponent> getBoundarySGCs()
SceneGraphComponent
s with the
boundary indexed face sets as geometry.public SceneGraphComponent getAllInOneSceneGraphComponent()
SceneGraphComponent
.public void update()
UnsupportedOperationException
- when the input index face set (setInputIFS(IndexedFaceSet)
)
is null, has no faces or no vertex normals.