[vtkusers] upgraded vtkGLUTesselator

Malcolm Drummond malcolm at geovision.co.za
Mon Jan 27 12:02:06 EST 2003


Hi

Sorry to use attachments like this ... I don't have a web-site yet.

I've updated the code for the vtkGLUTesselatorTriangleFilter as recommended for GLU 1.2/1.3. I've also added methods to set Tolerance and WindingMethod (the latter has convenience methods to enable use when scripting). I've attached the code with scripts for the self-intersecting star example from the OpenGL Programming Guide.  

If it meets your standards (and backward compatability to GLU 1.0/1.1 is not a big issue) please check it in.

I plan to add a method allowing use of the BoundaryOnly property soon.

A question - What is the preferred approach when using Set/Get Macros on non-standard types defined outside of VTK? I have the following ...

// Description:
// Set WindingRule property. Can be any of GLU_TESS_WINDING_ODD, GLU_TESS_WINDING_NONZERO,
// GLU_TESS_WINDING_POSITIVE, GLU_TESS_WINDING_NEGATIVE or GLU_TESS_WINDING_ABS_GEQ_TWO.
// Default is GLU_TESS_WINDING_ODD.
vtkSetMacro(WindingRule,GLenum);
vtkGetMacro(WindingRule,GLenum);

// Description:
// Convenience methods to set the WindingRule property
void SetWindingRuleToOdd() {this->SetWindingRule(GLU_TESS_WINDING_ODD);}
void SetWindingRuleToNonZero() {this->SetWindingRule(GLU_TESS_WINDING_NONZERO);}
void SetWindingRuleToPositive() {this->SetWindingRule(GLU_TESS_WINDING_POSITIVE);}
void SetWindingRuleToNegative() {this->SetWindingRule(GLU_TESS_WINDING_NEGATIVE);}
void SetWindingRuleToAbsGEqTwo() {this->SetWindingRule(GLU_TESS_WINDING_ABS_GEQ_TWO);}

... now, while I can set WindingRule using the convenience methods under python/tcl, I can't get the current value as the wrapping parser skipped the Set and Get Macros (because of GLenum). Should I replace GLenum here with something the wrapper likes, or should I provide something like GetWindingRuleAsString and return eg. 'GLU_TESS_WINDING_ODD'.

Thanks
Malcolm Drummond
GeoVision cc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030127/f88e567e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poly_tess.tcl
Type: application/octet-stream
Size: 1473 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030127/f88e567e/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: star_tess.py
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030127/f88e567e/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: star_tess.tcl
Type: application/octet-stream
Size: 1147 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030127/f88e567e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkGLUTesselatorTriangleFilter.cxx
Type: application/octet-stream
Size: 8229 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030127/f88e567e/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkGLUTesselatorTriangleFilter.h
Type: application/octet-stream
Size: 3664 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030127/f88e567e/attachment-0003.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: poly_tess.py
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030127/f88e567e/attachment-0001.txt>


More information about the vtkusers mailing list