objects
Class EuHalf

java.lang.Object
  |
  +--objects.EuObject
        |
        +--objects.EuParametrized
              |
              +--objects.EuLine
                    |
                    +--objects.EuHalf
All Implemented Interfaces:
java.lang.Cloneable

public class EuHalf
extends EuLine

An instance of this class represents a half-line, represented as a line using EuLine, along with an endpoint and a direction.


Field Summary
 fundamentals.EuReal inParameter
          The parameter at which the half-line begins.
 
Fields inherited from class objects.EuLine
generator
 
Fields inherited from class objects.EuParametrized
anchor
 
Fields inherited from class objects.EuObject
infoHash, provenience, scaledown
 
Constructor Summary
EuHalf()
          Contructor for dummy object
EuHalf(double x, double y, double deltax, double deltay, double t, int direction)
          The constructor does initialization.
EuHalf(objects.EuPoint p1, objects.EuPoint p2)
          The halfline is instantiated through the two given points, with p1 as endpoint
 
Method Summary
 fundamentals.EuVector anInnerPoint()
          Describe anInnerPoint method here.
 fundamentals.EuVector atEnd()
          Describe atEnd method here.
 boolean castIdentical(objects.EuObject other)
          See if passed object can be cast to the present one.
 double closestParameter(double x, double y)
          Find the parameter value which yields the closest point to a given one.
 objects.plotCollection computeClip(fundamentals.mouseInfo info)
          Compute the visible portion of the object as a collection of arcs, intervals or points.
 int getDirection()
          Describe getDirection method here.
 boolean interiorContains(fundamentals.EuVector point)
          See if passed point lies inside the half-line.
protected  fundamentals.EuVector invisibleRandomPoint(fundamentals.mouseInfo info, java.util.Random croupier)
          Chooses a sensible point on the half line when the half line is invisible.
 boolean isFull()
          Describe isFull method here.
 boolean overlaps(objects.EuObject other)
          See if objects overlap.
 java.lang.String params()
          Describe params method here.
 void passArguments(fundamentals.EuArguments args)
          Describe passArguments method here.
 java.lang.String toNaturalLanguage(int language, boolean determined)
          Describe toNaturalLanguage method here.
 java.lang.String toString()
          Describe toString method here.
 char typeName()
          Describe typeName method here.
 
Methods inherited from class objects.EuLine
atParameter, cloneMe, closestParameterOnLine, confusionDistance, nameDisplacementAngle, nameParameter, onSameLine, superIdentical
 
Methods inherited from class objects.EuParametrized
atParameter, atParameter, closestParameter, closureContains, distance, matchingPair, nameLocation, randomPoint
 
Methods inherited from class objects.EuObject
cloneObject, draw, equals, getClip, isVisible, mouseVicinity, mouseVicinity, toPs
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inParameter

public fundamentals.EuReal inParameter
The parameter at which the half-line begins.

Constructor Detail

EuHalf

public EuHalf(double x,
              double y,
              double deltax,
              double deltay,
              double t,
              int direction)
       throws DesignException,
              UserException
The constructor does initialization. A zero generator vector or a zero sign gives a LeaRuntimeException

Parameters:
x - the first coordinate of anchor
y - the second coordinate of anchor
deltax - the first coordinate of generator
deltay - the second coordinate of generator
t - the parameter of the endpoint
direction - the direction (direction)
Throws:
DesignException - if an error occurs
UserException - if an error occurs

EuHalf

public EuHalf()
Contructor for dummy object


EuHalf

public EuHalf(objects.EuPoint p1,
              objects.EuPoint p2)
       throws UserException
The halfline is instantiated through the two given points, with p1 as endpoint

Parameters:
p1 - an EuPoint value
p2 - an EuPoint value
Throws:
UserException - if an error occurs
Method Detail

atEnd

public fundamentals.EuVector atEnd()
Describe atEnd method here.

Returns:
The point at the end of the half-line

computeClip

public objects.plotCollection computeClip(fundamentals.mouseInfo info)
                                   throws UserException
Compute the visible portion of the object as a collection of arcs, intervals or points.

Overrides:
computeClip in class EuLine
Parameters:
info - information used in scaling and positioning the object
Returns:
a plotCollection value
Throws:
UserException - if an error occurs

invisibleRandomPoint

protected fundamentals.EuVector invisibleRandomPoint(fundamentals.mouseInfo info,
                                                     java.util.Random croupier)
Chooses a sensible point on the half line when the half line is invisible.

Overrides:
invisibleRandomPoint in class EuLine
Parameters:
info - a mouseInfo value
croupier - a Random value
Returns:
an EuVector value

anInnerPoint

public fundamentals.EuVector anInnerPoint()
Describe anInnerPoint method here.

Returns:
an EuVector value

castIdentical

public boolean castIdentical(objects.EuObject other)
See if passed object can be cast to the present one.

Overrides:
castIdentical in class EuLine
Parameters:
other - an EuObject value
Returns:
true if passed object is a EuLine which is identical to this one @param other the object being compared to the present one

closestParameter

public double closestParameter(double x,
                               double y)
Find the parameter value which yields the closest point to a given one.

Overrides:
closestParameter in class EuLine
Parameters:
x - The first coordinate of the given point
y - The second coordinate of the given point
Returns:
The parameter

overlaps

public boolean overlaps(objects.EuObject other)
See if objects overlap.

Overrides:
overlaps in class EuLine
Parameters:
other - an EuObject value
Returns:
true if passed object is a EuLine, EuHalf or EuInterval which overlaps with this one @param other the object being compared to the present one

interiorContains

public boolean interiorContains(fundamentals.EuVector point)
See if passed point lies inside the half-line.

Overrides:
interiorContains in class EuParametrized
Parameters:
point - an EuVector value
Returns:
true if passed point lies on the half-line. @param point the point being compared to the present half-line

typeName

public char typeName()
Describe typeName method here.

Overrides:
typeName in class EuLine
Returns:
H

isFull

public boolean isFull()
Describe isFull method here.

Overrides:
isFull in class EuLine
Returns:
false since the item is not of subtype A_RADIUS, A_POINT, A_LINE, A_CIRCLE

getDirection

public int getDirection()
Describe getDirection method here.

Returns:
an int value

params

public java.lang.String params()
Describe params method here.

Overrides:
params in class EuLine
Returns:
A technical specification of parameters associated to the object

toString

public java.lang.String toString()
Describe toString method here.

Overrides:
toString in class EuLine
Returns:
A technical specification of the object

passArguments

public void passArguments(fundamentals.EuArguments args)
Describe passArguments method here.

Overrides:
passArguments in class EuLine
Parameters:
args - an EuArguments value

toNaturalLanguage

public java.lang.String toNaturalLanguage(int language,
                                          boolean determined)
Describe toNaturalLanguage method here.

Overrides:
toNaturalLanguage in class EuLine
Parameters:
language - an int value
determined - a boolean value
Returns:
a String value