public class PgBndConstraint extends PsObject
if (hasShape(FIX_STRAIGHT)) {
// m_start = start point on line;
// m_end = end point on line;
// m_dir = unit length direction of line;
// To compute the line:
for (j=0; j<bndLen; j++) {
v = (double)j / (double)(bndLen-1.);
m_vertex[j].blend(1.-v, p, v, q);
}
// To constrain the line:
for (j=0; j<bndLen; j++) {
m_vertex[j].projectPointToLine(m_vertex[j], m_start, m_dir);
}
} else if (hasShape(FIX_PLANE)) {
// m_start = start point of planar curve;
// m_end = end point of planar curve;
// m_dir = unit length normal of plane;
// m_startDir = direction along m_start may vary;
// m_endDir = direction along m_end may vary;
// m_startDir and m_endDir are addtn'l contraints depending on the adjacent boundaries
// Each vector determines a line along which the corresponding start and end point
// is allowed to vary. This is used if either of the two adjacent boundary curves
// is of type FIX_PLANE too.
// Both vectors might be null if boundary curve is closed.
// To compute the plane:
// To constrain the line:
for (j=0; j<bndLen; j++) {
m_vertex[j].projectPointToPlane(m_vertex[j], m_start, m_dir);
}
} else if (hasShape(FIX_CIRCLE)) {
// m_start = start point on circle;
// m_end = end point on circle;
// m_vec1 = mid point of circle;
// m_vec2 = orient, i.e. normal of circle;
// To compute the circle:
for (j=0; j<bndLen; j++) {
v = (double)j / (double)(bndLen-1.);
m_vertex[j].evalCircle(mid, orient, start, end, v);
}
// To constrain the circle:
radius = m_vec1.dist(m_start);
for (j=0; j<bndLen; j++) {
m_vertex[j].projectPointToCircle(m_vertex[j], m_vec1, m_vec2, radius);
}
} else if (hasShape(FIX_HELIX)) {
// m_start = start point on helix;
// m_end = end point on helix;
// m_vec1 = axis bottom of helix;
// m_vec2 = axis direction of helix;
// To compute the helix:
for (j=0; j<bndLen; j++) {
v = (double)j / (double)(bndLen-1.);
m_vertex[j].evalHelix(bot, axisDir, start, end, v);
}
else if (m_bndShapeBits[anInd].get(PgBndConstraint.FIX_SPLINE)) {
// m_start = start point on spline;
// m_end = end point on spline;
// m_vec1 = tangent of spline at start point;
// m_vec2 = tangent of spline at end point;
// To compute the spline:
for (j=0; j<bndLen; j++) {
v = (double)j / (double)(bndLen-1.);
m_vertex[j].evalSpline(m_vec1, m_vec2, m_start, m_end, v);
}
}
Modifier and Type | Field and Description |
---|---|
static int |
EDGE_CIRCLE |
static int |
EDGE_HELIX |
static int |
EDGE_SPLINE |
static int |
EDGE_STRAIGHT |
static int |
FIX_CIRCLE
Vertices are constrained to lie on a circle.
|
static int |
FIX_CURVE
Vertices are fixed, i.e.
|
static int |
FIX_HELIX
Vertices are constrained to lie on a helix.
|
static int |
FIX_PLANE
Vertices are constrained to a plane.
|
static int |
FIX_POLYGON
Vertices are constrained to lie on a polygon.
|
static int |
FIX_STRAIGHT
Vertices are constrained to a straight line.
|
static int |
FIX_THREAD
Distance between vertices is fixed, i.e. the thread of constant length.
|
PdVector |
m_dir
Unit direction of constraining line or unit normal of constraining plane.
|
PdVector |
m_end
End point of boundary, last vertex.
|
PdVector |
m_endDir
Special constraint for the last point of boundary, for example,
two adjacent planar curves force the common vertex to lie on the
straight line along which both plane intersect.
|
PdVector |
m_start
Start point of boundary, first vertex.
|
PdVector |
m_startDir
Special constraint for the first point of boundary, for example,
two adjacent planar curves force the common vertex to lie on the
straight line along which both plane intersect.
|
PdVector |
m_vec1
Additional control vertex, meaning depends on current shape.
|
PdVector |
m_vec2
Additional control vertex, meaning depends on current shape.
|
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
Constructor and Description |
---|
PgBndConstraint(int dim) |
Modifier and Type | Method and Description |
---|---|
boolean |
applyModelingMatrix(PdMatrix modelMatrix)
Multiply the modeling matrix to all vertices and vectors.
|
void |
clearShape(int aBit)
Remove shape constraint.
|
java.lang.Object |
clone()
Duplicate geometry by recursively cloning all instance variables
except inspector panels and lists of registered listeners.
|
void |
copy(PsObject object)
Copy argument object into this object by recursively copying all
instance variables.
|
int |
getDim()
Get dim of vertex constraints.
|
boolean |
hasShape(int aBit)
Check whether shape constraint is set.
|
void |
init()
Initializes and resets instance.
|
void |
setShape(java.util.BitSet shape)
Set shape constraint.
|
void |
setShape(int aBit)
Set shape constraint.
|
java.lang.String |
toString()
Create a multi-line string representation
with detailed information about all instance variables.
|
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, update, updatePanels
public static final int FIX_CURVE
public static final int FIX_STRAIGHT
public static final int FIX_PLANE
public static final int FIX_THREAD
public static final int EDGE_STRAIGHT
public static final int EDGE_CIRCLE
public static final int EDGE_HELIX
public static final int EDGE_SPLINE
public static final int FIX_CIRCLE
public static final int FIX_HELIX
public static final int FIX_POLYGON
public PdVector m_start
public PdVector m_end
public PdVector m_vec1
public PdVector m_vec2
public PdVector m_dir
public PdVector m_startDir
public PdVector m_endDir
public java.lang.Object clone()
null
.
Display list is not cloned but set to null. Method menu is cloned.
clone
in class PsObject
copy(PsObject)
public void copy(PsObject object)
copy
in class PsObject
PsObject.clone()
public boolean applyModelingMatrix(PdMatrix modelMatrix)
true
if operation was applied successfully.public void clearShape(int aBit)
PgBndConstraint
.public boolean hasShape(int aBit)
PgBndConstraint
.public void setShape(int aBit)
PgBndConstraint
.public void setShape(java.util.BitSet shape)
setShape(int)
public java.lang.String toString()
public int getDim()
"