$search

edu::tum::cs::vis::model::util::Triangle Class Reference

Inheritance diagram for edu::tum::cs::vis::model::util::Triangle:
Inheritance graph
[legend]

List of all members.

Public Member Functions

boolean addNeighbor (Triangle neighbor, Lock lock)
boolean calculateNormalVector ()
void draw (PGraphics g, Color overrideColor)
float getArea ()
Point3f getCentroid ()
Vector3f getCornerarea ()
double getDihedralAngle (Triangle t)
Set< TrianglegetNeighbors ()
Vector3f getNormalVector ()
Point2f[] getTexPosition ()
boolean intersectsRay (Point3f p1, Point3f p2, Point3f intersectionPoint)
boolean intersectsRay (Point3f rayStart, Point3f rayEnd)
boolean isAdjacentNeighbor (Triangle tr)
boolean isDirectNeighbor (Triangle tr)
void removeNeighbor (Triangle n)
void setCornerarea (Vector3f cornerarea)
void setNeighbors (Set< Triangle > neighbors)
void setNormalVector (Vector3f normalVector)
void setTexPosition (Point2f[] texPosition)
 Triangle ()
void updateCentroid ()

Protected Attributes

Point3f centroid
Vector3f cornerarea = null
Set< Triangleneighbors = new HashSet<Triangle>(3)
Vector3f normalVector = null
Point2f texPosition []

Static Private Attributes

static Logger logger = Logger.getLogger(Triangle.class)
static final long serialVersionUID = -5164768039180386782L

Detailed Description

DrawObject which represents a triangle (object with 3 points).

Author:
Stefan Profanter

Definition at line 31 of file Triangle.java.


Constructor & Destructor Documentation

edu::tum::cs::vis::model::util::Triangle::Triangle (  )  [inline]

Initializes a triangle with given number of edges (Triangle: 3)

Definition at line 72 of file Triangle.java.


Member Function Documentation

boolean edu::tum::cs::vis::model::util::Triangle::addNeighbor ( Triangle  neighbor,
Lock  lock 
) [inline]

Add a neighbor to the neighbors list. If list contains already neighbor this method doesn't add it again. If not, the neighbor will be added and this instance will be added as a neighbor in the given neighbor instance.

Parameters:
neighbor neighbor to add.
Returns:
true if neighbor is really a neighbor of this triangle and it was successfully added.

Definition at line 86 of file Triangle.java.

boolean edu::tum::cs::vis::model::util::Triangle::calculateNormalVector (  )  [inline]

Calculate and set normal vector for triangle

Returns:
true if vector successfully calculated

Definition at line 282 of file Triangle.java.

void edu::tum::cs::vis::model::util::Triangle::draw ( PGraphics  g,
Color  overrideColor 
) [inline]

Draw the triangles onto the applet.

Parameters:
g Graphics to draw on
overrideColor overrides the color to draw

Definition at line 139 of file Triangle.java.

float edu::tum::cs::vis::model::util::Triangle::getArea (  )  [inline]

returns the area of the triangle in 3d space. Unit is the same as you draw the triangle.

Returns:
the area in drawing unit.

Definition at line 183 of file Triangle.java.

Point3f edu::tum::cs::vis::model::util::Triangle::getCentroid (  )  [inline]

Get centroid of triangle

Returns:
the centroid

Definition at line 208 of file Triangle.java.

Vector3f edu::tum::cs::vis::model::util::Triangle::getCornerarea (  )  [inline]

Get voronoi area of triangle

Returns:
the cornerarea

Definition at line 217 of file Triangle.java.

double edu::tum::cs::vis::model::util::Triangle::getDihedralAngle ( Triangle  t  )  [inline]

Calculates the angle between surface normal of this triangle and the given one. Angle is between 0 and PI (180°).

Parameters:
t counterpart triangle
Returns:
angle in radiant between 0 and PI

Definition at line 238 of file Triangle.java.

Set<Triangle> edu::tum::cs::vis::model::util::Triangle::getNeighbors (  )  [inline]

Get list of all direct neighbor triangles.

Returns:
list of triangles

Definition at line 226 of file Triangle.java.

Vector3f edu::tum::cs::vis::model::util::Triangle::getNormalVector (  )  [inline]

get normal vector of triangle

Returns:
the normalVector

Definition at line 250 of file Triangle.java.

Point2f [] edu::tum::cs::vis::model::util::Triangle::getTexPosition (  )  [inline]

Get position array for texture

Returns:
the texPosition

Definition at line 259 of file Triangle.java.

boolean edu::tum::cs::vis::model::util::Triangle::intersectsRay ( Point3f  p1,
Point3f  p2,
Point3f  intersectionPoint 
) [inline]

Checks if this triangle intersects with the given ray (rayStart, rayEnd). Not only the segment between rayStart and rayEnd is checked but the whole ray from -infinity to +infinity.

Copyright 2001, softSurfer (www.softsurfer.com) This code may be freely used and modified for any purpose providing that this copyright notice is included with it. SoftSurfer makes no warranty for this code, and cannot be held liable for any real or imagined damage resulting from its use. Users of this code must verify correctness for their application.

Parameters:
p1 start point of the ray
p2 end point of the ray
intersectionPoint will be set to the intersection point. Set to null to ignore.
Returns:
true if triangle intersects ray

Definition at line 336 of file Triangle.java.

boolean edu::tum::cs::vis::model::util::Triangle::intersectsRay ( Point3f  rayStart,
Point3f  rayEnd 
) [inline]

Checks if this triangle intersects with the given ray (rayStart, rayEnd). Not only the segment between rayStart and rayEnd is checked but the whole ray from -infinity to +infinity.

Parameters:
rayStart start point of the ray
rayEnd end point of the ray
Returns:
true if triangle intersects ray

Definition at line 273 of file Triangle.java.

boolean edu::tum::cs::vis::model::util::Triangle::isAdjacentNeighbor ( Triangle  tr  )  [inline]

Checks if tr is an adjacent neighbor which means that at least 2 vertices of both triangles must be not only the same coordinates but also the same object.

Parameters:
tr triangle to check if it is a neighbor
Returns:
true if tr is a neighbor

Definition at line 456 of file Triangle.java.

boolean edu::tum::cs::vis::model::util::Triangle::isDirectNeighbor ( Triangle  tr  )  [inline]

Checks if tr is a direct neighbor which means that at least 2 vertices of both triangles must be at the same coordinate.

Parameters:
tr triangle to check if it is a neighbor
Returns:
true if tr is a neighbor

Definition at line 421 of file Triangle.java.

void edu::tum::cs::vis::model::util::Triangle::removeNeighbor ( Triangle  n  )  [inline]

Removes the given triangle from the neighbor relation of this triangle. This triangle is also removed from n's neighbor list.

Parameters:
n neighbor to remove

Definition at line 118 of file Triangle.java.

void edu::tum::cs::vis::model::util::Triangle::setCornerarea ( Vector3f  cornerarea  )  [inline]
Parameters:
cornerarea the cornerarea to set

Definition at line 487 of file Triangle.java.

void edu::tum::cs::vis::model::util::Triangle::setNeighbors ( Set< Triangle neighbors  )  [inline]

Set the list of direct neighbor triangles.

Parameters:
neighbors triangles list.

Definition at line 497 of file Triangle.java.

void edu::tum::cs::vis::model::util::Triangle::setNormalVector ( Vector3f  normalVector  )  [inline]

Set normal vector of triangle

Parameters:
normalVector the normalVector to set

Definition at line 507 of file Triangle.java.

void edu::tum::cs::vis::model::util::Triangle::setTexPosition ( Point2f[]  texPosition  )  [inline]

set texture position array for texture of triangle

Parameters:
texPosition * the texPosition to set

Definition at line 517 of file Triangle.java.

void edu::tum::cs::vis::model::util::Triangle::updateCentroid (  )  [inline]

Recalculates the and centroid. Called automatically when calling setPosition. If you modify the position array directly, call this afterwards.

Reimplemented from edu::tum::cs::vis::model::util::DrawObject.

Definition at line 522 of file Triangle.java.


Member Data Documentation

Centroid of triangle

Definition at line 61 of file Triangle.java.

Voronoi area of triangle

Definition at line 56 of file Triangle.java.

Logger edu::tum::cs::vis::model::util::Triangle::logger = Logger.getLogger(Triangle.class) [static, private]

log4j logger

Definition at line 41 of file Triangle.java.

List of all direct neighbor triangles

Definition at line 66 of file Triangle.java.

Triangles may have normal vector

Definition at line 51 of file Triangle.java.

final long edu::tum::cs::vis::model::util::Triangle::serialVersionUID = -5164768039180386782L [static, private]

auto generated

Reimplemented from edu::tum::cs::vis::model::util::DrawObject.

Definition at line 36 of file Triangle.java.

Texture-Points

Definition at line 46 of file Triangle.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


knowrob_cad_parser
Author(s): Stefan Profanter
autogenerated on Tue Mar 5 12:15:34 2013