[vtkusers] vtkMath in Tcl
David Gobbi
david.gobbi at gmail.com
Mon May 17 17:48:41 EDT 2010
On Mon, May 17, 2010 at 3:30 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Mon, May 17, 2010 at 5:22 PM, pablo p del castillo
> <pablodecastillo at yahoo.es> wrote:
>>
>> ##Find the squared distance between the points.
>> set squaredDistance [math Distance2BetweenPoints $p0 $p1]
>> puts $squaredDistance
>>
>> Pablo
>
> Does anyone know how to use it in tcl? Or even better, can anyone
> explain how we would look to see if it is or is not wrapped?
It is not wrapped in tcl, due to its signature:
double Distance2BetweenPoints(const double x[3], const double y[3])
The tcl wrappers can handle methods that have one array arg, but not
two. I'm not familiar enough with the tcl wrappers to know if there
is an easy way to list the methods (in Python, you can get the answer
quickly by doing help(vtkMath) or dir(vtkMath)).
So for Tcl if I need to know what methods are wrapped, I open the
wrapper file (e.g. vtkMathTcl.cxx) in a text editor:
Tcl_DStringAppendElement ( &dString, "New" );
Tcl_DStringAppendElement ( &dString, "GetClassName" );
Tcl_DStringAppendElement ( &dString, "IsA" );
Tcl_DStringAppendElement ( &dString, "NewInstance" );
Tcl_DStringAppendElement ( &dString, "SafeDownCast" );
Tcl_DStringAppendElement ( &dString, "Pi" );
Tcl_DStringAppendElement ( &dString, "DoubleTwoPi" );
Tcl_DStringAppendElement ( &dString, "DoublePi" );
Tcl_DStringAppendElement ( &dString, "RadiansFromDegrees" );
Tcl_DStringAppendElement ( &dString, "RadiansFromDegrees" );
Tcl_DStringAppendElement ( &dString, "DegreesFromRadians" );
Tcl_DStringAppendElement ( &dString, "DegreesFromRadians" );
#if !defined(VTK_LEGACY_REMOVE)
Tcl_DStringAppendElement ( &dString, "DegreesToRadians" );
#endif
#if !defined(VTK_LEGACY_REMOVE)
Tcl_DStringAppendElement ( &dString, "DoubleDegreesToRadians" );
#endif
#if !defined(VTK_LEGACY_REMOVE)
Tcl_DStringAppendElement ( &dString, "RadiansToDegrees" );
#endif
#if !defined(VTK_LEGACY_REMOVE)
Tcl_DStringAppendElement ( &dString, "DoubleRadiansToDegrees" );
#endif
Tcl_DStringAppendElement ( &dString, "Round" );
Tcl_DStringAppendElement ( &dString, "Round" );
Tcl_DStringAppendElement ( &dString, "Floor" );
Tcl_DStringAppendElement ( &dString, "Factorial" );
Tcl_DStringAppendElement ( &dString, "Binomial" );
Tcl_DStringAppendElement ( &dString, "RandomSeed" );
Tcl_DStringAppendElement ( &dString, "GetSeed" );
Tcl_DStringAppendElement ( &dString, "Random" );
Tcl_DStringAppendElement ( &dString, "Random" );
Tcl_DStringAppendElement ( &dString, "Gaussian" );
Tcl_DStringAppendElement ( &dString, "Gaussian" );
Tcl_DStringAppendElement ( &dString, "Norm" );
Tcl_DStringAppendElement ( &dString, "Norm" );
Tcl_DStringAppendElement ( &dString, "Normalize" );
Tcl_DStringAppendElement ( &dString, "Normalize" );
Tcl_DStringAppendElement ( &dString, "Norm2D" );
Tcl_DStringAppendElement ( &dString, "Norm2D" );
Tcl_DStringAppendElement ( &dString, "Normalize2D" );
Tcl_DStringAppendElement ( &dString, "Normalize2D" );
Tcl_DStringAppendElement ( &dString, "Determinant2x2" );
Tcl_DStringAppendElement ( &dString, "Determinant3x3" );
Tcl_DStringAppendElement ( &dString, "SolveCubic" );
Tcl_DStringAppendElement ( &dString, "SolveQuadratic" );
Tcl_DStringAppendElement ( &dString, "SolveLinear" );
Tcl_DStringAppendElement ( &dString, "RGBToHSV" );
Tcl_DStringAppendElement ( &dString, "RGBToHSV" );
Tcl_DStringAppendElement ( &dString, "HSVToRGB" );
Tcl_DStringAppendElement ( &dString, "HSVToRGB" );
Tcl_DStringAppendElement ( &dString, "UninitializeBounds" );
Tcl_DStringAppendElement ( &dString, "AreBoundsInitialized" );
Tcl_DStringAppendElement ( &dString, "GetScalarTypeFittingRange" );
Tcl_DStringAppendElement ( &dString, "SpiralPoints" );
Tcl_DStringAppendElement ( &dString, "Inf" );
Tcl_DStringAppendElement ( &dString, "NegInf" );
Tcl_DStringAppendElement ( &dString, "Nan" );
Tcl_DStringAppendElement ( &dString, "IsInf" );
Tcl_DStringAppendElement ( &dString, "IsNan" );
Ugly, I know, but the source code always speaks truth, while
documentation should always be treated with suspicion.
David
More information about the vtkusers
mailing list