version 3.3

VRS::Facet Class Reference

#include <vrs/facet.h>

Inheritance diagram for VRS::Facet:

VRS::Shape VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Types

enum  WindingRule {
  FirstWindingRule, Odd, NonZero, Positive,
  Negative, AbsGreaterOne, LastWindingRule
}
enum  EdgeFlagAttitude {
  FirstEdgeFlagAttitude, NoForce, ForceGeneration, ForceNoGeneration,
  LastEdgeFlagAttitude
}
enum  Category {
  NotConvex = 1, NotConvexDegenerate = 2, ConvexDegenerate = 3, ConvexCCW = 4,
  ConvexCW = 5
}

Public Member Functions

 VRS_SERIALIZABLE_CLASS_ENUM (WindingRule)
 VRS_SERIALIZABLE_CLASS_ENUM (EdgeFlagAttitude)
 Facet (Iterator< Vector > *boundaryVertices=NULL, Iterator< Vector > *boundaryNormals=NULL, Iterator< Vector > *boundaryTexture=NULL, Iterator< Color > *boundaryColors=NULL, WindingRule windingRule=Facet::Odd, EdgeFlagAttitude edgeFlagAttitude=Facet::NoForce)
void setEdgeFlagAttitude (EdgeFlagAttitude edgeFlagAttitude)
EdgeFlagAttitude getEdgeFlagAttitude () const
void setWindingRule (WindingRule windingRule)
WindingRule getWindingRule () const
void insertLoop (unsigned int position, Iterator< Vector > *vertex=NULL, Iterator< Vector > *normals=NULL, Iterator< Vector > *texture=NULL, Iterator< Color > *color=NULL)
void removeLoop (unsigned int loop)
unsigned int loops () const
Iterator< Vector > * vertexLoop (unsigned int loop) const
Iterator< Vector > * normalLoop (unsigned int loop) const
Iterator< Vector > * textureLoop (unsigned int loop) const
Iterator< Color > * colorLoop (unsigned int loop) const
Category category () const
Vector normal () const
 Calculates the polygon normal.
virtual Bounds boundingBox () const
 Shapes define their bounding box in model coordinates.
virtual void modified ()
 VRS_TYPEINFO (Facet, Shape)
 VRS_SERIALIZABLE (Facet)

Classes

struct  Loop


Detailed Description

General Polygon with Multiple Boundary Loops. A Facet defines a generic polygon that must consist of one outer boundary loop and possibly some inner loops. The latter define holes that are subtracted from the polygon defined by the outer loop.

If the FaceStyle attribute has the default value (CounterClockwise), then vertices of the outer boundary loop must be given counterclockwise for a normal generation that matches the left-handed coordinate system in VRS. This means for example that if the viewer is looking to the positive z-axis and the facet shall face to the the viewer (such that an implicit normal (0, 0, -1) is calculated), you have to specify the vertices of the outer boundary loop in counterclockwise order.


Member Enumeration Documentation

Enumerator:
FirstWindingRule 
Odd 
NonZero 
Positive 
Negative 
AbsGreaterOne 
LastWindingRule 

Enumerator:
FirstEdgeFlagAttitude 
NoForce 
ForceGeneration 
ForceNoGeneration 
LastEdgeFlagAttitude 

Enumerator:
NotConvex 
NotConvexDegenerate 
ConvexDegenerate 
ConvexCCW 
ConvexCW 


Constructor & Destructor Documentation

VRS::Facet::Facet ( Iterator< Vector > *  boundaryVertices = NULL,
Iterator< Vector > *  boundaryNormals = NULL,
Iterator< Vector > *  boundaryTexture = NULL,
Iterator< Color > *  boundaryColors = NULL,
WindingRule  windingRule = Facet::Odd,
EdgeFlagAttitude  edgeFlagAttitude = Facet::NoForce 
)


Member Function Documentation

VRS::Facet::VRS_SERIALIZABLE_CLASS_ENUM ( WindingRule   ) 

VRS::Facet::VRS_SERIALIZABLE_CLASS_ENUM ( EdgeFlagAttitude   ) 

void VRS::Facet::setEdgeFlagAttitude ( EdgeFlagAttitude  edgeFlagAttitude  ) 

EdgeFlagAttitude VRS::Facet::getEdgeFlagAttitude (  )  const

void VRS::Facet::setWindingRule ( WindingRule  windingRule  ) 

WindingRule VRS::Facet::getWindingRule (  )  const

void VRS::Facet::insertLoop ( unsigned int  position,
Iterator< Vector > *  vertex = NULL,
Iterator< Vector > *  normals = NULL,
Iterator< Vector > *  texture = NULL,
Iterator< Color > *  color = NULL 
)

void VRS::Facet::removeLoop ( unsigned int  loop  ) 

unsigned int VRS::Facet::loops (  )  const

A facet is specified by at least one vertex loop. The first loop describes the boundary polygon. All other loops describe inner loops, i.e., holes in the polygon. A loop's vertices are given by the vertex iterator. Colors, texture, and normals are managed in the same way, these iterators are optional.

Iterator<Vector>* VRS::Facet::vertexLoop ( unsigned int  loop  )  const

Iterator<Vector>* VRS::Facet::normalLoop ( unsigned int  loop  )  const

Iterator<Vector>* VRS::Facet::textureLoop ( unsigned int  loop  )  const

Iterator<Color>* VRS::Facet::colorLoop ( unsigned int  loop  )  const

Returns the iterators for the data of a given loop. If the data is not available, NULL is returned.

Category VRS::Facet::category (  )  const

Returns the category of the facet's outer loop: `ConvexCW': It is convex and the vertices form a clockwise oriented polygon. `ConvexCCW': It is convex and the vertices form a counterclockwise oriented polygon. `ConvexDegenerated': All vertices are on the same line, but they are monotonically increasing and decreasing (lexicographic order). `NotConvexDegenerated': The facet is not convex, and its vertices are on the same line, but they are not monotonically increasing and decreasing. `NotConvex': The facet is not degenerated and not convex.

WARNING: seems to have bugs, i.e., cannot distinguish between NotConvexDegenerate and ConvexDegenerate resp. ConvexCCW and ConvexCW.

Vector VRS::Facet::normal (  )  const

Calculates the polygon normal.

The direction of the normal is chosen so that it points into the half space from which the outer loop appears counterclockwise.

virtual Bounds VRS::Facet::boundingBox (  )  const [virtual]

Shapes define their bounding box in model coordinates.

Implements VRS::Shape.

virtual void VRS::Facet::modified (  )  [virtual]

Reimplemented from VRS::SharedObj.

VRS::Facet::VRS_TYPEINFO ( Facet  ,
Shape   
)

VRS::Facet::VRS_SERIALIZABLE ( Facet   ) 


The documentation for this class was generated from the following file:

Generated on Mon May 21 06:00:17 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact