JavaView© v3.95.000

jv.vecmath
Class PdBaryDir

java.lang.Object
  extended byjv.vecmath.P_Vector
      extended byjv.vecmath.PdBaryDir
All Implemented Interfaces:
java.io.Serializable

public class PdBaryDir
extends P_Vector

Barycentric tangent vector of arbitrary dimension, sum of entries must be 0. Internal array length is equal to barycentric dimension.

See Also:
Serialized Form

Field Summary
 double[] m_data
          Array with barycentric coordinates, sum of entries must be 1.
static PdBaryDir[] TRIANGLE_EDGE
          Positive oriented edges.
 
Constructor Summary
PdBaryDir()
          Construct empty class with zero size.
PdBaryDir(double x, double y)
          Construct class with dimension=2 and given initial values.
PdBaryDir(double x, double y, double z)
          Construct class with dimension=3 and given initial values.
PdBaryDir(double x, double y, double z, double w)
          Construct class with dimension=4 and given initial values.
PdBaryDir(int aSize)
          Construct class with given dimension.
 
Method Summary
 java.lang.Object clone()
          Duplicate vector and data array.
 void copy(PdBaryDir vec)
          Copies argument vector into 'this', and possibly adjusts size of 'this'.
 void copyArray(PdBaryDir vec)
          Copies only data (no flags) of argument vector into 'this', and possibly adjusts size of 'this'.
static PdBaryDir copyNew(PdBaryDir v)
          Create a new vector as clone of argument vector.
static PdBaryDir getBaryDir(PdBaryDir baryout, PdVector dir, PdVector v0, PdVector v1, PdVector v2)
          Get barycentric direction in triangle given by points.
static PdBaryDir getBaryDir(PdBaryDir baryout, PdVector dir, PdVector v0, PdVector v1, PdVector v2, PdVector temp)
          Get barycentric direction in triangle given by points.
 int getSize()
          Get dimension of barycentric vector.
static PdVector getVector(PdVector p, PdBaryDir bary, PdVector v0, PdVector v1, PdVector v2)
          Get vector from barycentric direction in a triangle.
 void multScalar(double scalar)
          Multiply all components with scalar.
 int setSize(int aSize)
          Set dimension of barycentric vector, i.e. length of its data array.
 void setZero()
          Set all entries to a constant zero value.
 void sub(PdBary x, PdBary y)
          Compute this = x-y.
 java.lang.String toShortString()
          Create a single-line string representation of the vector components and attributes.
 java.lang.String toString()
          Create a multi-line string representation with detailed information about all instance variables.
 void validate()
          Check sum of barycentric coordinates, and adjust if sum is not zero.
 
Methods inherited from class jv.vecmath.P_Vector
clearTag, clone, clone, copy, getBits, getDetail, getName, getURL, hasTag, invert, setDetail, setName, setTag, setURL
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRIANGLE_EDGE

public static final PdBaryDir[] TRIANGLE_EDGE
Positive oriented edges. Index is the local index of opposite vertex to edge.


m_data

public double[] m_data
Array with barycentric coordinates, sum of entries must be 1. Length is equal to barycentric dimension.

Constructor Detail

PdBaryDir

public PdBaryDir()
Construct empty class with zero size.


PdBaryDir

public PdBaryDir(int aSize)
Construct class with given dimension.


PdBaryDir

public PdBaryDir(double x,
                 double y)
Construct class with dimension=2 and given initial values.


PdBaryDir

public PdBaryDir(double x,
                 double y,
                 double z)
Construct class with dimension=3 and given initial values.


PdBaryDir

public PdBaryDir(double x,
                 double y,
                 double z,
                 double w)
Construct class with dimension=4 and given initial values.

Method Detail

setZero

public void setZero()
Set all entries to a constant zero value.


toString

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

Overrides:
toString in class P_Vector
See Also:
toShortString()

toShortString

public java.lang.String toShortString()
Create a single-line string representation of the vector components and attributes.

See Also:
toString()

clone

public java.lang.Object clone()
Duplicate vector and data array. Method just returns result of copyNew(PdBaryDir).

See Also:
copyNew(PdBaryDir)

copyNew

public static PdBaryDir copyNew(PdBaryDir v)
Create a new vector as clone of argument vector.

Parameters:
v - source vector to clone

copy

public void copy(PdBaryDir vec)
Copies argument vector into 'this', and possibly adjusts size of 'this'.

Parameters:
vec - the vector to be copied

copyArray

public void copyArray(PdBaryDir vec)
Copies only data (no flags) of argument vector into 'this', and possibly adjusts size of 'this'.

Parameters:
vec - the vector to be copied

getSize

public int getSize()
Get dimension of barycentric vector.


setSize

public int setSize(int aSize)
Set dimension of barycentric vector, i.e. length of its data array.

Parameters:
aSize - new number of components of vector
Returns:
new number of components of vector

validate

public void validate()
Check sum of barycentric coordinates, and adjust if sum is not zero.


multScalar

public void multScalar(double scalar)
Multiply all components with scalar.


getVector

public static PdVector getVector(PdVector p,
                                 PdBaryDir bary,
                                 PdVector v0,
                                 PdVector v1,
                                 PdVector v2)
Get vector from barycentric direction in a triangle.

Parameters:
p - output, may be null; a new vector is returned in this case
Returns:
World-representation of bary. Same as p if that is not null.

getBaryDir

public static PdBaryDir getBaryDir(PdBaryDir baryout,
                                   PdVector dir,
                                   PdVector v0,
                                   PdVector v1,
                                   PdVector v2)
Get barycentric direction in triangle given by points.

Parameters:
baryout - output, may be null; a new barycentric vector is returned in this case
Returns:
Barycentric representation of dir. Same as baryout if that is not null.
Since:
JavaView 2.49.007

getBaryDir

public static PdBaryDir getBaryDir(PdBaryDir baryout,
                                   PdVector dir,
                                   PdVector v0,
                                   PdVector v1,
                                   PdVector v2,
                                   PdVector temp)
Get barycentric direction in triangle given by points.

Parameters:
baryout - may be null; a new barycentric vector is returned in this case
temp - used as buffer, may be null (is allocated automatically in this case)
Returns:
Barycentric representation of dir. Same as baryout if that is not null.
Since:
JavaView 2.49.007

sub

public void sub(PdBary x,
                PdBary y)
Compute this = x-y.


JavaView© v3.95.000

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