jv.geom
Class PgBndConstraint
- java.lang.Object
-
- jv.object.PsObject
-
- jv.geom.PgBndConstraint
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf
public class PgBndConstraint extends PsObject
Descriptor for boundary constraints used in variational problems. The member variables have different meanings depending on the shape of the boundary curve. The following describes their meaning and shows how to generate a curve for given constraints.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); } }- See Also:
- Serialized Form
- Author:
- Konrad Polthier
- Version:
- 12.03.02, 1.60 revised (kp) Allow startDir and endDir to be null.
28.08.98, 1.50 revised (kp) Direct access to instance variables reduced.
16.09.98, 1.00 created (kp)
-
-
Field Summary
Fields Modifier and Type Field and Description static intEDGE_CIRCLEstatic intEDGE_HELIXstatic intEDGE_SPLINEstatic intEDGE_STRAIGHTstatic intFIX_CIRCLEVertices are constrained to lie on a circle.static intFIX_CURVEVertices are fixed, i.e.static intFIX_HELIXVertices are constrained to lie on a helix.static intFIX_PLANEVertices are constrained to a plane.static intFIX_POLYGONVertices are constrained to lie on a polygon.static intFIX_STRAIGHTVertices are constrained to a straight line.static intFIX_THREADDistance between vertices is fixed, i.e. the thread of constant length.PdVectorm_dirUnit direction of constraining line or unit normal of constraining plane.PdVectorm_endEnd point of boundary, last vertex.PdVectorm_endDirSpecial 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.PdVectorm_startStart point of boundary, first vertex.PdVectorm_startDirSpecial 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.PdVectorm_vec1Additional control vertex, meaning depends on current shape.PdVectorm_vec2Additional control vertex, meaning depends on current shape.-
Fields inherited from class jv.object.PsObject
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 Summary
Constructors Constructor and Description PgBndConstraint(int dim)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanapplyModelingMatrix(PdMatrix modelMatrix)Multiply the modeling matrix to all vertices and vectors.voidclearShape(int aBit)Remove shape constraint.java.lang.Objectclone()Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.voidcopy(PsObject object)Copy argument object into this object by recursively copying all instance variables.intgetDim()Get dim of vertex constraints.booleanhasShape(int aBit)Check whether shape constraint is set.voidinit()Initializes and resets instance.voidsetShape(java.util.BitSet shape)Set shape constraint.voidsetShape(int aBit)Set shape constraint.java.lang.StringtoString()Create a multi-line string representation with detailed information about all instance variables.-
Methods inherited from class jv.object.PsObject
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
-
-
-
-
Field Detail
-
FIX_CURVE
public static final int FIX_CURVE
Vertices are fixed, i.e. Dirichlet conditions.- See Also:
- Constant Field Values
-
FIX_STRAIGHT
public static final int FIX_STRAIGHT
Vertices are constrained to a straight line.- See Also:
- Constant Field Values
-
FIX_PLANE
public static final int FIX_PLANE
Vertices are constrained to a plane.- See Also:
- Constant Field Values
-
FIX_THREAD
public static final int FIX_THREAD
Distance between vertices is fixed, i.e. the thread of constant length.- See Also:
- Constant Field Values
-
EDGE_STRAIGHT
public static final int EDGE_STRAIGHT
- See Also:
- Constant Field Values
-
EDGE_CIRCLE
public static final int EDGE_CIRCLE
- See Also:
- Constant Field Values
-
EDGE_HELIX
public static final int EDGE_HELIX
- See Also:
- Constant Field Values
-
EDGE_SPLINE
public static final int EDGE_SPLINE
- See Also:
- Constant Field Values
-
FIX_CIRCLE
public static final int FIX_CIRCLE
Vertices are constrained to lie on a circle. Not yet supported by *bd files and JavaView.- See Also:
- Constant Field Values
-
FIX_HELIX
public static final int FIX_HELIX
Vertices are constrained to lie on a helix. Not yet supported by *bd files and JavaView.- See Also:
- Constant Field Values
-
FIX_POLYGON
public static final int FIX_POLYGON
Vertices are constrained to lie on a polygon. Not yet supported by *bd files and JavaView.- See Also:
- Constant Field Values
-
m_start
public PdVector m_start
Start point of boundary, first vertex.
-
m_end
public PdVector m_end
End point of boundary, last vertex.
-
m_vec1
public PdVector m_vec1
Additional control vertex, meaning depends on current shape.
-
m_vec2
public PdVector m_vec2
Additional control vertex, meaning depends on current shape.
-
m_dir
public PdVector m_dir
Unit direction of constraining line or unit normal of constraining plane.
-
m_startDir
public 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. If this instance variable is null, then there is no constraint.
-
m_endDir
public 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. If this instance variable is null, then there is no constraint.
-
-
Method Detail
-
clone
public java.lang.Object clone()
Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners. The parent relationship is maintained only within this class but not to external classes. In general, all links of the clone to external objects are set tonull.Display list is not cloned but set to null. Method menu is cloned.
- Overrides:
clonein classPsObject- See Also:
copy(PsObject)- Version:
- 21.10.00, 1.10 revised (kp) Missing cloning of method menu added.
05.07.00, 1.00 created (kp)
-
copy
public void copy(PsObject object)
Copy argument object into this object by recursively copying all instance variables.- Overrides:
copyin classPsObject- See Also:
PsObject.clone()
-
applyModelingMatrix
public boolean applyModelingMatrix(PdMatrix modelMatrix)
Multiply the modeling matrix to all vertices and vectors. The modeling matrix of this geometry is set to the identity matrix.- Returns:
trueif operation was applied successfully.- Since:
- JavaView 2.36
- Version:
- 04.09.02, 1.00 created (kp)
-
clearShape
public void clearShape(int aBit)
Remove shape constraint. For possible shapes seePgBndConstraint.
-
hasShape
public boolean hasShape(int aBit)
Check whether shape constraint is set. For possible shapes seePgBndConstraint.
-
setShape
public void setShape(int aBit)
Set shape constraint. For possible shapes seePgBndConstraint.
-
setShape
public void setShape(java.util.BitSet shape)
Set shape constraint. If possible assign individual bits using setShape(int).- See Also:
setShape(int)
-
toString
public java.lang.String toString()
Create a multi-line string representation with detailed information about all instance variables.
-
getDim
public int getDim()
Get dim of vertex constraints.
-
-
"