Added noarg item to example to show director default constructor.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5203 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
bd4f186ae1
commit
476fcbf76a
4 changed files with 69 additions and 2 deletions
|
|
@ -18,3 +18,33 @@ void draw_shape_coverage( shape *s, int div_x, int div_y ) {
|
|||
printf( "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
void draw_depth_map( volume *v, int div_x, int div_y ) {
|
||||
double i,j;
|
||||
char depth_map_chars[] = "#*+;:,. ";
|
||||
double lowbound, highbound;
|
||||
double current = 0.0;
|
||||
bool bounds_set = false;
|
||||
|
||||
for( i = 0; i < 1.0; i += 1.0 / ((float)div_y) ) {
|
||||
for( j = 0; j < 1.0; j += 1.0 / ((float)div_x) ) {
|
||||
current = v->depth( j,i );
|
||||
if( !bounds_set ) {
|
||||
lowbound = current; highbound = current; bounds_set = true;
|
||||
}
|
||||
if( current < lowbound ) lowbound = current;
|
||||
if( current > highbound ) highbound = current;
|
||||
}
|
||||
}
|
||||
|
||||
for( i = 0; i < 1.0; i += 1.0 / ((float)div_y) ) {
|
||||
for( j = 0; j < 1.0; j += 1.0 / ((float)div_x) ) {
|
||||
current = ((v->depth( j,i ) - lowbound) /
|
||||
(highbound - lowbound)) * 8;
|
||||
putchar(depth_map_chars[(int)current]);
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
|
||||
double volume::depth( double x, double y ) { return 0.0; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue