JavaView® v2.00.008

jv.geom
Class PgBndConstraint

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.geom.PgBndConstraint
All Implemented Interfaces:
java.lang.Cloneable, PsUpdateIf, java.io.Serializable

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:
		// 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);
		}
	}
	

Version:
28.08.98, 1.50 revised (kp) Direct access to instance variables reduced.
16.09.98, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
Serialized Form

Field Summary
static int EDGE_CIRCLE
           
static int EDGE_HELIX
           
static int EDGE_SPLINE
           
static int EDGE_STRAIGHT
           
static int FIX_CIRCLE
          Not yet supported by *bd files, new in Java version.
static int FIX_CURVE
          All of the following bits exactly match the octal bits in *.bd files, therfore do not modify the following bits.
static int FIX_HELIX
           
static int FIX_PLANE
           
static int FIX_POLYGON
           
static int FIX_STRAIGHT
           
static int FIX_THREAD
           
protected  int m_dim
          Dimension of vertices and vectors used as constraints.
 PdVector m_dir
           
 PdVector m_end
           
 PdVector m_endDir
           
protected static int m_numShapeBits
           
protected  java.util.BitSet m_shape
           
 PdVector m_start
           
 PdVector m_startDir
           
 PdVector m_vec1
           
 PdVector m_vec2
           
 
Fields inherited from class jv.object.PsObject
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS
 
Constructor Summary
PgBndConstraint(int dim)
           
 
Method Summary
 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 anObj)
          Copy argument object into this object by recursively copying all instance variables.
 boolean hasShape(int aBit)
          Check whether shape constraint is set.
 void init()
          Initializes and resets instance.
 void setShape(java.util.BitSet shape)
          Deprecated. Set individual bits using setShape(int).
 void setShape(int aBit)
          Set shape constraint.
 java.lang.String toString()
          Create a multi-line string representation with detailed information about all instance variables.
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, clearTag, clone, clone, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, update, updatePanels
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_dim

protected int m_dim
Dimension of vertices and vectors used as constraints.

FIX_CURVE

public static final int FIX_CURVE
All of the following bits exactly match the octal bits in *.bd files, therfore do not modify the following bits.

FIX_STRAIGHT

public static final int FIX_STRAIGHT

FIX_PLANE

public static final int FIX_PLANE

FIX_THREAD

public static final int FIX_THREAD

EDGE_STRAIGHT

public static final int EDGE_STRAIGHT

EDGE_CIRCLE

public static final int EDGE_CIRCLE

EDGE_HELIX

public static final int EDGE_HELIX

EDGE_SPLINE

public static final int EDGE_SPLINE

FIX_CIRCLE

public static final int FIX_CIRCLE
Not yet supported by *bd files, new in Java version.

FIX_HELIX

public static final int FIX_HELIX

FIX_POLYGON

public static final int FIX_POLYGON

m_numShapeBits

protected static final int m_numShapeBits

m_shape

protected java.util.BitSet m_shape

m_start

public PdVector m_start

m_end

public PdVector m_end

m_vec1

public PdVector m_vec1

m_vec2

public PdVector m_vec2

m_dir

public PdVector m_dir

m_startDir

public PdVector m_startDir

m_endDir

public PdVector m_endDir
Constructor Detail

PgBndConstraint

public PgBndConstraint(int dim)
Method Detail

init

public void init()
Initializes and resets instance.
Overrides:
init in class PsObject

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 to null. Tags of this object are not copied but maybe copied of subclasses.

Display list is not cloned but set to null. Method menu is cloned.

Overrides:
clone in class PsObject
See Also:
#copy(PgGeometry)

copy

public void copy(PsObject anObj)
Copy argument object into this object by recursively copying all instance variables.
Overrides:
copy in class PsObject
Following copied from class: jv.object.PsObject
See Also:
PsObject.clone()

clearShape

public void clearShape(int aBit)
Remove shape constraint. For possible shapes see PgBndConstraint.

hasShape

public boolean hasShape(int aBit)
Check whether shape constraint is set. For possible shapes see PgBndConstraint.

setShape

public void setShape(int aBit)
Set shape constraint. For possible shapes see PgBndConstraint.

setShape

public void setShape(java.util.BitSet shape)
Deprecated. Set individual bits using setShape(int).

Set shape constraint. TODO: do not use this method any more.

toString

public java.lang.String toString()
Create a multi-line string representation with detailed information about all instance variables.
Overrides:
toString in class PsObject

JavaView® v2.00.008

The software JavaView® is copyright protected. All Rights Reserved.