.TH "SbClip" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbClip \- The \fBSbClip\fP class is a generic polygon clipper class\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSbClip\fP (SbClipCallback *callback=\fBNULL\fP, \fBvoid\fP *userdata=\fBNULL\fP)" .br .ti -1c .RI "\fBvoid\fP \fBaddVertex\fP (\fBconst\fP \fBSbVec3f\fP &v, \fBvoid\fP *\fBvdata\fP=\fBNULL\fP)" .br .ti -1c .RI "\fBvoid\fP \fBreset\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBclip\fP (\fBconst\fP \fBSbPlane\fP &plane)" .br .ti -1c .RI "int \fBgetNumVertices\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBgetVertex\fP (\fBconst\fP int idx, \fBSbVec3f\fP &v, \fBvoid\fP **\fBvdata\fP=\fBNULL\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP * \fBgetVertexData\fP (\fBconst\fP int idx) \fBconst\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSbClip\fP class is a generic polygon clipper class\&. 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\&. .br .PP Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor \fBv2\&.1\fP API\&. .br .PP \fBSince\fP .RS 4 Coin \fB2\&.0\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SbClip::SbClip (SbClipCallback * callback = \fC\fBNULL\fP\fP, \fBvoid\fP * userdata = \fC\fBNULL\fP\fP)" A constructor\&. Supply a callback if you need to handle additional data per vertex\&. .SH "Member Function Documentation" .PP .SS "\fBvoid\fP SbClip::addVertex (\fBconst\fP \fBSbVec3f\fP & v, \fBvoid\fP * vdata = \fC\fBNULL\fP\fP)" Adds a polygon vertex\&. \fIvdata\fP could be a pointer to your vertex structure\&. .SS "\fBvoid\fP SbClip::reset (\fBvoid\fP)" Resets the clipper\&. This should be called before adding any vertices when reusing an \fBSbClip\fP instance\&. .SS "\fBvoid\fP SbClip::clip (\fBconst\fP \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 (\fBvoid\fP) const" Returns the number of vertices in the polygon\&. .PP \fBSee also\fP .RS 4 \fBSbClip::getVertex()\fP .RE .PP .SS "\fBvoid\fP SbClip::getVertex (\fBconst\fP int idx, \fBSbVec3f\fP & v, \fBvoid\fP ** vdata = \fC\fBNULL\fP\fP) const" Returns the vertex at index \fIidx\fP\&. .PP \fBSee also\fP .RS 4 \fBSbClip::getNumVertices()\fP .RE .PP .SS "\fBvoid\fP * SbClip::getVertexData (\fBconst\fP int idx) const" Return the vertex data at index \fIidx\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.