Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

adf.cpp File Reference

#include "adf.h"
#include "gmTNTconvert.h"

Include dependency graph for adf.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define NBITS4   8
#define RBITS4   8
#define MASK4   0x0360
#define NBITS   8
#define RBITS   8
#define MASK   0x000F3C00
#define HASH(a, b, c)   ((((a&MASK)<<NBITS|b&MASK)<<NBITS|c&MASK)>>RBITS)

Functions

 REGISTER_IMPLICIT (ADF,"UnaryOp:ADF")
double nan ()
 nan function for windows this was changed after move the code from cygwin to VC++ since the STL is different

void collect_bilinear_weights (double x, double y, double *weights)
 Collect the weights for bilinear interpolation within the unit square.

void collect_trilinear_weights (const gmVector3 &p, double *weights)
 Collect the weights for trilinear interpolation within a unit cube.


Variables

const int ADF_sample_address_offset [][3]
 Offsets of the samples, in terms of addresses.

const gmVector3 ADF_sample_offset []
 Sample offsets, used for trilinear reconstructions.


Define Documentation

#define HASH a,
b,
 )     ((((a&MASK)<<NBITS|b&MASK)<<NBITS|c&MASK)>>RBITS)
 

Definition at line 521 of file adf.cpp.

Referenced by jbProcess::getedge(), ADFSampleHasher::operator()(), jbProcess::setcenter(), jbProcess::setcorner(), and jbProcess::setedge().

#define MASK   0x000F3C00
 

Definition at line 520 of file adf.cpp.

#define MASK4   0x0360
 

Definition at line 516 of file adf.cpp.

#define NBITS   8
 

Definition at line 518 of file adf.cpp.

#define NBITS4   8
 

Definition at line 514 of file adf.cpp.

#define RBITS   8
 

Definition at line 519 of file adf.cpp.

#define RBITS4   8
 

Definition at line 515 of file adf.cpp.


Function Documentation

void collect_bilinear_weights double  x,
double  y,
double *  weights
[static]
 

Collect the weights for bilinear interpolation within the unit square.

The order of weights is quadrant order, of course. x and y should be transformed to between 0 and 1, as well.

Parameters:
x The x coordinate of the point to be weighted.
y The y coordinate of the point to be weighted.
weights On return, the weights. Must have room for 4 items.

Definition at line 679 of file adf.cpp.

Referenced by ADFTraversalNode::estimate_normal().

void collect_trilinear_weights const gmVector3 &  p,
double *  weights
[static]
 

Collect the weights for trilinear interpolation within a unit cube.

The order of weights corresponds to the sample order, of course.

Parameters:
p The point to be weighted. Should be in the unit cube.
weights On return, the weights. Must have room for 8 items.

Definition at line 701 of file adf.cpp.

Referenced by ADFTraversalNode::get_local_coord_distance().

double nan  ) 
 

nan function for windows this was changed after move the code from cygwin to VC++ since the STL is different

Definition at line 11 of file adf.cpp.

Referenced by ADFSample::ADFSample(), ADF::get_sample(), and ADFSample::is_valid().

REGISTER_IMPLICIT ADF  ,
"UnaryOp:ADF" 
 


Variable Documentation

const int ADF_sample_address_offset[][3]
 

Initial value:

{
    

    { 0,  0,  0},

    

    { 0,  0, -1},
    { 0, -1,  0},
    {-1,  0,  0},
    { 0,  0,  1},
    { 0,  1,  0},
    { 1,  0,  0},

    

    { 0, -1, -1},
    {-1,  0, -1},
    {-1, -1,  0},
    { 0, -1,  1},
    {-1,  0,  1},
    {-1,  1,  0},
    { 0,  1, -1},
    { 1,  0, -1},
    { 1, -1,  0},
    { 0,  1,  1},
    { 1,  0,  1},
    { 1,  1,  0},
}
Offsets of the samples, in terms of addresses.

Here, we're offsetting from the center of the cube. The order is such that it is most likely to find a violating sample first (assumes more interior == more likely to fail).

Definition at line 318 of file adf.cpp.

Referenced by ADFSampleAddress::adjust_for_sample().

const gmVector3 ADF_sample_offset[]
 

Initial value:

{
    

    gmVector3(0.5, 0.5, 0.5),

    

    gmVector3(0.5, 0.5,   0),
    gmVector3(0.5,   0, 0.5),
    gmVector3(  0, 0.5, 0.5),
    gmVector3(0.5, 0.5,   1),
    gmVector3(0.5,   1, 0.5),
    gmVector3(  1, 0.5, 0.5),

    

    gmVector3(0.5,   0,   0),
    gmVector3(  0, 0.5,   0),
    gmVector3(  0,   0, 0.5),
    gmVector3(0.5,   0,   1),
    gmVector3(  0, 0.5,   1),
    gmVector3(  0,   1, 0.5),
    gmVector3(0.5,   1,   0),
    gmVector3(  1, 0.5,   0),
    gmVector3(  1,   0, 0.5),
    gmVector3(0.5,   1,   1),
    gmVector3(  1, 0.5,   1),
    gmVector3(  1,   1, 0.5)
}
Sample offsets, used for trilinear reconstructions.

Here, in contrast to the above, we use the -,-,- corner as 0,0,0, as is used for the trilinear reconstruction. The order must match ADF_sample_address_offset.

Definition at line 355 of file adf.cpp.

Referenced by ADFTraversalNode::is_reconstruction_valid().


Generated on Mon Jun 28 14:58:25 2004 for Advanced Surface Library by doxygen 1.3.4