Action:
|
Restores a saved surface.
|
|
Prototype:
|
bs3_surface bs3_surface_restore ();
|
|
Includes:
|
#include "kernel/acis.hxx"
|
|
#include "kernel/spline/bs3_srf/bs3surf.hxx"
|
|
#include "kernel/spline/bs3_srf/sp3srtn.hxx"
|
|
Description:
|
Reads back a representation of a parametric surface as written by
bs3_surface_save, and creates a duplicate of the original surface.
|
|
|
The overloaded >> operator behaves like
bs3_surface_restore, except that it reads from a
C++ style stream using stream operators, and sets the result into the second argument.
|
|
|
For example:
bs3_surface surf;
|
|
|
Reading uses routines
read_int,
read_long,
read_real, and
read_string that are defined in
kernutil/fileio/fileio.hxx.
|
|
|
if (restore_version_number < SPLINE_VERSION)
|
|
if (read_int() == -1)
|
|
|
// First check that there is a surface to read.
|
|
read_int
|
stype
|
|
read_int
|
save_dim
|
|
read_int
|
u degree
|
|
read_int
|
v degree
|
|
read_int
|
save nu span
|
|
read_int
|
save nv span
|
|
read_int
|
rat u
|
|
read_int
|
rat v
|
|
read_int
|
form u
|
|
read_int
|
form v
|
|
read_int
|
pole u
|
|
read_int
|
pole v
|
|
else
|
|
// New style header. There are keywords instead of numbers
|
|
// where appropriate, and redundant values are missing.
|
|
read_id
|
id string
|
|
if (strcmp( id_string, type_nullbs ) == 0)
|
|
|
// return NULL;
|
|
else if (strcmp( id_string, type_nubs ) == 0 )
|
|
|
// rational = FALSE;
|
|
else if (strcmp( id_string, type_nurbs ) == 0 )
|
|
|
// rational = TRUE;
|
|
else
|
|
|
// sys_error( UNKNOWN_BS_SURFACE );
|
|
read_int
|
u degree
|
|
read_int
|
v degree
|
|
if (rational)
|
|
|
read_id
|
id string for rational_u or rational_v
|
|
if (restore_version_number < CONSISTENT_VERSION)
|
|
|
read_id
|
id string for formu
|
|
|
read_id
|
id string for formv
|
|
|
read_id
|
id string for poleu
|
|
|
read_id
|
id string for polev
|
|
else
|
|
|
read_enum
|
Read enumeration bs3_surf_form for form_map for form u
|
|
|
read_enum
|
Read enumeration bs3_surf_form for form_map for form v
|
|
|
read_enum
|
Read enumeration sing_map for pole u
|
|
|
read_enum
|
Read enumeration sing_map for pole v
|
|
// Read the knots and multiplicities, allocating space for
|
|
// the knot values as we go, and accumulating the total of
|
|
// knots and multiplicities.
|
|
read_int
|
Number of knots in u
|
|
if (restore_version_number >= SPLINE_VERSION)
|
|
read_int
|
Number of knots in v
|
|
for (int i = 0; i < n_uknots; i++)
|
|
read_real
|
u knot
|
|
read_int
|
u multiplicity
|
|
if (restore_version_number < SPLINE_VERSION)
|
|
read_int
|
Number of knots in v
|
|
for (i = 0; i < n_vknots; i++)
|
|
read_real
|
v knot
|
|
read_int
|
v multiplicity
|
|
// Finally read the control point values.
|
|
for (row_start = bs->node0;
|
|
row_start != NULL;
|
|
row_start = row_start->vnext)
|
|
for (ag_snode *this_node = row_start;
|
|
|
this_node != NULL;
|
|
|
this_node = this_node->unext)
|
|
|
for (i = 0; i < dimh; i++)
|
|
|
|
|
|
|
read_real
|
node Pw weight
|
|
Library:
|
kernel
|
|
Filename:
|
kern/kernel/spline/bs3_srf/sp3srtn.hxx
|
|
Effect:
|
System routine
|