.TH "SbClip" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbClip \- .PP The \fBSbClip\fP class is a generic polygon clipper class\&. .PP It is used by first adding all vertices in the polygon, and then clipping against any number of planes\&. If you need to supply additional information per vertex (e\&.g\&. texture coordinates), you should supply a callback in the constructor, and a pointer to your vertex structure in \fBaddVertex()\fP\&. For every new vertex created, the callback is called with the line being clipped, including the pointers to your vertex structures and the position of the new (clipped against some plane) vertex\&. You should then create a new vertex structure, calculate your data (e\&.g\&. a new texture coordinate) and return a pointer to this structure\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSbClip\fP (SbClipCallback *callback=NULL, void *userdata=NULL)" .br .ti -1c .RI "void \fBaddVertex\fP (const \fBSbVec3f\fP &v, void *vdata=NULL)" .br .ti -1c .RI "void \fBreset\fP (void)" .br .ti -1c .RI "void \fBclip\fP (const \fBSbPlane\fP &plane)" .br .ti -1c .RI "int \fBgetNumVertices\fP (void) const " .br .ti -1c .RI "void \fBgetVertex\fP (const int idx, \fBSbVec3f\fP &v, void **vdata=NULL) const " .br .ti -1c .RI "void * \fBgetVertexData\fP (const int idx) const " .br .in -1c .SH "Detailed Description" .PP The \fBSbClip\fP class is a generic polygon clipper class\&. .PP It is used by first adding all vertices in the polygon, and then clipping against any number of planes\&. If you need to supply additional information per vertex (e\&.g\&. texture coordinates), you should supply a callback in the constructor, and a pointer to your vertex structure in \fBaddVertex()\fP\&. For every new vertex created, the callback is called with the line being clipped, including the pointers to your vertex structures and the position of the new (clipped against some plane) vertex\&. You should then create a new vertex structure, calculate your data (e\&.g\&. a new texture coordinate) and return a pointer to this structure\&. Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2\&.1 API\&. .PP \fBSince:\fP .RS 4 Coin 2\&.0 .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SbClip::SbClip (SbClipCallback *callback = \fCNULL\fP, void *userdata = \fCNULL\fP)" A constructor\&. Supply a callback if you need to handle additional data per vertex\&. .SH "Member Function Documentation" .PP .SS "void SbClip::addVertex (const \fBSbVec3f\fP &v, void *vdata = \fCNULL\fP)" Adds a polygon vertex\&. \fIvdata\fP could be a pointer to your vertex structure\&. .SS "void SbClip::reset (void)" Resets the clipper\&. This should be called before adding any vertices when reusing an \fBSbClip\fP instance\&. .SS "void SbClip::clip (const \fBSbPlane\fP &plane)" Clip polygon against \fIplane\fP\&. This might change the number of vertices in the polygon\&. For each time a new vertex is created, the callback supplied in the constructor (if != NULL) is called with the line being clipped and the new vertex calculated\&. The callback should return a new void pointer to be stored by the clipper\&. .SS "int SbClip::getNumVertices (void) const" Returns the number of vertices in the polygon\&. .PP \fBSee Also:\fP .RS 4 \fBSbClip::getVertex()\fP .RE .PP .SS "void SbClip::getVertex (const intidx, \fBSbVec3f\fP &v, void **vdata = \fCNULL\fP) const" Returns the vertex at index \fIidx\fP\&. .PP \fBSee Also:\fP .RS 4 \fBSbClip::getNumVertices()\fP .RE .PP .SS "void * SbClip::getVertexData (const intidx) const" Return the vertex data at index \fIidx\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.