This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
""" | |
Usage: python bracefix.py [--test] <file1> [<file2> ...] | |
This script takes old-style "Whitesmiths" indented VTK source files as | |
input, and re-indents the braces according to the new VTK style. | |
Only the brace indentation is modified. | |
If called with the --test option, then it will print an error message | |
for each file that it would modify, but it will not actually modify the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Clip a line segment defined by endpoints at p1[3], p2[3] by a | |
// collection of n planes defined by the equation ax+by+cz+d=0. | |
// The parametric coordinates t1,t2 of new endpoints are returned, | |
// as well as the indices i1,i2 of the entry and exit planes for the line. | |
// Result values of -1 for i1 or i2 signify that the line was not clipped | |
// at the p1 end or the p2 end respectively. The function return value | |
// will be 0 if the whole line segment lies outside, or 1 if the line | |
// segment lies fully or partially inside the planes. | |
int clipLineWithPlanes(const double p1[3], const double p2[3], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is a simple class that can catch errors from VTK objects. | |
""" | |
import vtk | |
class ErrorObserver: | |
def __init__(self): | |
self.__ErrorOccurred = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!ARBfp1.0 | |
# This is a short fragment program for bicubic texture interpolation. | |
# It takes one parameter, a vector that gives the texture size as | |
# (xsize, ysize, 1.0/xsize, 1.0/ysize). The cubic interpolation weights | |
# are computed by the shader, so it is not necessary to supply an | |
# interpolation kernel texture. | |
# width, height, xspacing, yspacing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
// This is a program for converting a binary image (little-endian) | |
// into a set of integers that indicate the position where the bit | |
// value changes. It is much faster than going through bit-by-bit. | |
int main(int argc, char *argv[]) | |
{ | |
static const int debruijn[32] = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// A simple example of image streaming, using a reader that can stream | |
// from a file and a writer than can stream to a file. | |
// | |
// Currently, the only image writer in VTK that streams from its input | |
// is the vtkMINCImageWriter. | |
// | |
// Please send any comments to david.gobbi@gmail.com | |
// |
NewerOlder