|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.piece.FaceRenderFlat
public class FaceRenderFlat
Brep
face rendering - flat shading.
Nested Class Summary | |
---|---|
protected static class |
FaceRenderFlat.EdgeComparator
Edge comparator for actual edge list: [ x ]. |
protected static class |
FaceRenderFlat.PolyEdge
Polygon edge. |
Field Summary | |
---|---|
protected java.util.TreeSet<FaceRenderFlat.PolyEdge> |
actual
Tmp: actual edge list sorted by [ x ] . |
protected int |
attrColor
Actual face-color attribute. |
protected int |
attrCoords
Actual projected-coordinate attribute. |
protected java.util.TreeSet<FaceRenderFlat.PolyEdge> |
backup
Tmp: edge list for the next line. |
protected static java.lang.String |
CATEGORY
Object category. |
protected double[] |
color
Tmp: face color ( double format). |
protected float[] |
colorF
Tmp: face color ( float format). |
protected java.lang.String |
colorName
Name of face-color attribute. |
protected java.lang.String |
coordsName
Name of projected-coordinate attribute. |
protected int |
counter
Fill-counter for fill-outside mode. |
protected Brep |
data
Accelerator: input B-rep database. |
protected static double[] |
DEFAULT_COLOR
Color used if no face-color attribute is defined. |
protected static FaceRenderFlat.EdgeComparator |
eComparator
Single comparator instance. |
protected java.util.TreeSet<FaceRenderFlat.PolyEdge> |
input
Tmp: input edge set sorted by [ y0 ] . |
protected int |
lastCtx
Last used context (for attribute caches). |
protected int |
lastFace
Last used face id (for repetitive calls of fillHLine(int, int, int, int, int) ). |
protected BitMaskCore |
mask
Accelerator: bitmask object (can be null ). |
protected RasterGraphics |
output
Accelerator: raster graphics output object. |
static RegPiece |
reg
Static registration instance for this class. |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
protected double[][] |
vc
Tmp: vertex coordinates for one edge. |
protected int[] |
vert
Tmp: vertex handles for one face. |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.FaceRender |
---|
FACE_COLOR, FACE_NORMAL, FACE_SOLID, FACE_TEXTURE, PROJECTED_COORDS, VERTEX_COLOR, VERTEX_NORMAL, VERTEX_TEXTURE |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
FaceRenderFlat()
|
Method Summary | |
---|---|
protected boolean |
accelerators(int ctx,
int face,
boolean maskNeeded)
Prepare acelerators, returns true if failed. |
protected int |
commonFill(int ctx,
int face,
boolean inside)
Fills the given face, common routine for both inside- and outside- fill modes. |
void |
fillHLine(int ctx,
int face,
int x1,
int x2,
int y)
Fills the horizontal line from the given polygonal face. |
void |
fillInside(int ctx,
int face)
Fills the given polygonal face. |
int |
fillOutside(int ctx,
int face)
Fills the given polygonal face. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
protected void |
hLineInside(int y,
FaceRenderFlat.PolyEdge e1,
FaceRenderFlat.PolyEdge e2)
Render horizontal segment (H-line) from [ e1.x, y ] to [ e2.x, y ] . |
protected void |
hLineOutside(int y,
FaceRenderFlat.PolyEdge e1,
FaceRenderFlat.PolyEdge e2)
Render horizontal segment (H-line) from [ e1.x, y ] to [ e2.x, y ] . |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit |
Field Detail |
---|
protected int lastCtx
protected java.lang.String colorName
protected int attrColor
protected java.lang.String coordsName
protected int attrCoords
protected Brep data
protected RasterGraphics output
protected BitMaskCore mask
null
).
protected int counter
protected int lastFace
fillHLine(int, int, int, int, int)
).
protected static final double[] DEFAULT_COLOR
protected int[] vert
protected double[][] vc
protected float[] colorF
float
format).
protected double[] color
double
format).
protected java.util.TreeSet<FaceRenderFlat.PolyEdge> input
[ y0 ]
.
protected java.util.TreeSet<FaceRenderFlat.PolyEdge> actual
[ x ]
.
protected java.util.TreeSet<FaceRenderFlat.PolyEdge> backup
protected static final FaceRenderFlat.EdgeComparator eComparator
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
Constructor Detail |
---|
public FaceRenderFlat()
Method Detail |
---|
protected boolean accelerators(int ctx, int face, boolean maskNeeded)
true
if failed.
protected void hLineInside(int y, FaceRenderFlat.PolyEdge e1, FaceRenderFlat.PolyEdge e2)
[ e1.x, y ]
to [ e2.x, y ]
.
For inside-fill mode.
protected void hLineOutside(int y, FaceRenderFlat.PolyEdge e1, FaceRenderFlat.PolyEdge e2)
[ e1.x, y ]
to [ e2.x, y ]
.
For outside-fill mode.
protected int commonFill(int ctx, int face, boolean inside)
accelerators(int, int, boolean)
call!
public void fillInside(int ctx, int face)
BitMaskCore
(fills the whole face if no BitMaskCore
is used).
fillInside
in interface FaceRender
ctx
- Handle to a context to draw from.face
- Handle of the face (in the associated Brep
scene).BitMaskCore
,
Brep
public void fillHLine(int ctx, int face, int x1, int x2, int y)
fillHLine
in interface FaceRender
ctx
- Handle to a context to draw from.face
- Handle of the face (in the associated Brep
scene).x1
- X coordinate of the starting pixel.x2
- X coordinate of the first pixel after the line.y
- Common Y coordinate of the line.Brep
public int fillOutside(int ctx, int face)
BitMaskCore
. Sets the drawn pixels afterwards.
fillOutside
in interface FaceRender
ctx
- Handle to a context to draw from.face
- Handle of the face (in the associated Brep
scene).
BitMaskCore
,
Brep
public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class DefaultProperty
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class DefaultProperty
key
- Key string.
null
.public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |