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

ADF Class Reference

#include <adf.h>

Inheritance diagram for ADF:

Inheritance graph
[legend]
Collaboration diagram for ADF:

Collaboration graph
[legend]
List of all members.

Detailed Description

An ADF based on an octree.

The accuracy_isosurface denotes the isosurface below which the tolerance is guaranteed. Allows only having accurate reconstruction near the surface. In this new verion, accuracy_isosurface is not used because the ADF is storing a field, it needs to be accurate every where, including places where the values are not close to zero.

Definition at line 137 of file adf.h.

Public Member Functions

 ADF ()
 ADF (Implicit *m_f, Box< double > *box, double error)
 default constructor needed by surface

 ~ADF ()
 constructor you normally use.

double get_sample (const ADFSampleAddress &addr, bool create=true)
 default destructor

double get_distance (const gmVector3 &p, gmVector3 *normal=NULL, double calc_normal_threshold=gmGOOGOL)
 return the distance and the normal of a point in the ADF

virtual bool setChildren (std::vector< Implicit * > children)
 this new std::map replaced the old hashmap used in STLPort

virtual double proc (gmVector3 x)
 Sets the operand of this operation.

virtual Intervald proc (Box< double > x)
 Evaluation of function.

virtual void procq (gmVector3, double *)
 Evaluation of dFdq.

virtual void getq (double *)
 Evaluation of dFdq.

virtual void _setq (double *)
 Retreives parameters.

virtual int qlen ()
 Assigns parameters.

virtual void getqname (char **qn)
 Returns the # of parameters.

 MAKE_NAME ()
 Retreives parameter names.

void createADF (Implicit *imp, Box< double > *b, double err=0.1)
 factory call


Public Attributes

hashmap< ADFSampleAddress,
ADFSample, ADFSampleHasher,
ADFSampleMap
sample_map
 old verion's proc

double length_table [16]
 calculate the ADF

double epsilon
 precomputered lengths for the data stucture

Box< double > * box
 the error tolerance


Protected Member Functions

virtual void copy_traversal_node (OctreeTraversalNode *dp, OctreeTraversalNode *sp)
virtual void init_traversal_node (OctreeTraversalNode *np, OctreeTraversalNode *pp, int child)


Constructor & Destructor Documentation

ADF::ADF  )  [inline]
 

Definition at line 144 of file adf.h.

References UnaryOp::m_f.

ADF::ADF Implicit imp,
Box< double > *  b,
double  error
 

default constructor needed by surface

Parameters:
imp a pointer to the implicit that is used to computer the values.
b a Box defining the region of space to evaluate proc() over.
error should be the tolerance that you want. ADF guarantees the approximated value is within this error tolerance.
Note:
This constructor just call createADF helper function, because serChildren also calls createADF.

Definition at line 66 of file adf.cpp.

References createADF().

ADF::~ADF  ) 
 

constructor you normally use.

Definition at line 71 of file adf.cpp.

References Octree::node_factoryp, and Octree::rootp.


Member Function Documentation

void ADF::_setq double *  q  )  [virtual]
 

Retreives parameters.

Parameters:
q Parameter array.

Reimplemented from UnaryOp.

Definition at line 170 of file adf.cpp.

References Implicit::_setq(), and UnaryOp::m_f.

void ADF::copy_traversal_node OctreeTraversalNode dp,
OctreeTraversalNode sp
[protected, virtual]
 

Reimplemented from Octree.

Definition at line 39 of file adf.cpp.

References ADFTraversalNode::address, Octree::copy_traversal_node(), and ADFTraversalNode::samples.

void ADF::createADF Implicit imp,
Box< double > *  b,
double  err = 0.1
 

factory call

Parameters:
imp a pointer to the implicit that is used to computer the values.
b a Box defining the region of space to evaluate proc() over.
err should be the tolerance that you want. ADF guarantees the approximated value is within this error tolerance.
Note:
This constructor accuately calls refine and prune to create the data stucture, so it may take a long time.

Definition at line 84 of file adf.cpp.

References ADFTraversalNode::address, ADF_NODE_LEAF, box, OctreeTraversalNode::center, Box< double >::center(), Octree::center, OctreeNode::childrenpp, OctreeTraversalNode::depth, epsilon, ADFTraversalNode::extract_samples_from(), OctreeTraversalNode::length, Octree::length, length_table, UnaryOp::m_f, Octree::node_factoryp, ADFNode::node_type, OctreeTraversalNode::nodep, OctreeNode::parentp, ADFPruner::prune(), ADFRefiner::refine(), Octree::rootp, ADFSampleAddress::set_to_root(), and Box< double >::width().

Referenced by ADF(), and setChildren().

double ADF::get_distance const gmVector3 &  p,
gmVector3 *  normal = NULL,
double  threshold = gmGOOGOL
 

return the distance and the normal of a point in the ADF

Parameters:
p a point in ADF
normal a pointer to return for the normal
threshold default to 0
Returns:
distance from the point to the surface

Definition at line 262 of file adf.cpp.

References ADF_NODE_LEAF, ADFTraversalNode::estimate_normal(), ADFTraversalNode::extract_samples_from(), ADFTraversalNode::get_distance(), Octree::get_leaf_for_point(), ADFNode::node_type, and OctreeTraversalNode::nodep.

Referenced by main(), and proc().

double ADF::get_sample const ADFSampleAddress addr,
bool  c = true
 

default destructor

First, convert the sample address to a point in space, and then extract the new sample from the distance function, and store it.

Note:
changed after using new hashset and hashtable.

Definition at line 229 of file adf.cpp.

References hashmap< ADFSampleAddress, ADFSample, ADFSampleHasher, ADFSampleMap >::end(), hashmap< ADFSampleAddress, ADFSample, ADFSampleHasher, ADFSampleMap >::find(), hashmap< ADFSampleAddress, ADFSample, ADFSampleHasher, ADFSampleMap >::insert(), UnaryOp::m_f, nan(), Implicit::proc(), sample_map, and ADFSampleAddress::to_point().

Referenced by ADFTraversalNode::extract_samples_from(), and ADFTraversalNode::is_reconstruction_valid().

void ADF::getq double *  q  )  [virtual]
 

Evaluation of dFdq.

Parameters:
q Parameter array.

Reimplemented from UnaryOp.

Definition at line 157 of file adf.cpp.

References Implicit::getq(), and UnaryOp::m_f.

void ADF::getqname char **  qn  )  [virtual]
 

Returns the # of parameters.

Parameters:
qn Paramater name array.

Reimplemented from UnaryOp.

Definition at line 213 of file adf.cpp.

References UnaryOp::getqname().

void ADF::init_traversal_node OctreeTraversalNode np,
OctreeTraversalNode pp,
int  child
[protected, virtual]
 

Reimplemented from Octree.

Definition at line 16 of file adf.cpp.

References ADFTraversalNode::address, ADFSampleAddress::adjust_for_child(), OctreeTraversalNode::depth, and ADFSampleAddress::set_to_root().

ADF::MAKE_NAME  ) 
 

Retreives parameter names.

Intervald ADF::proc Box< double >  x  )  [virtual]
 

Evaluation of function.

Reimplemented from UnaryOp.

Definition at line 302 of file adf.cpp.

References Box< Float >::center(), convert(), get_distance(), Intervald, and UnaryOp::m_f.

double ADF::proc gmVector3  x  )  [virtual]
 

Sets the operand of this operation.

Parameters:
x a point in ADF
Returns:
evaluation of function

Reimplemented from UnaryOp.

Definition at line 293 of file adf.cpp.

References get_distance(), and UnaryOp::m_f.

void ADF::procq gmVector3  x,
double *  dfdq
[virtual]
 

Evaluation of dFdq.

Parameters:
x Point to evaluate at.
dfdq Array representing dfdq.

Reimplemented from UnaryOp.

Definition at line 186 of file adf.cpp.

References UnaryOp::m_f, and Implicit::procq().

int ADF::qlen void   )  [virtual]
 

Assigns parameters.

Reimplemented from UnaryOp.

Definition at line 200 of file adf.cpp.

References UnaryOp::m_f, and Implicit::qlen().

bool ADF::setChildren std::vector< Implicit * >  children  )  [virtual]
 

this new std::map replaced the old hashmap used in STLPort

It then call createADF.

Parameters:
children A vector of children (there should only be 1)
Returns:
False if there is not exactly 1 child in the vector.

Reimplemented from Implicit.

Definition at line 136 of file adf.cpp.

References createADF().


Member Data Documentation

Box<double>* ADF::box
 

the error tolerance

Definition at line 186 of file adf.h.

Referenced by createADF().

double ADF::epsilon
 

precomputered lengths for the data stucture

Definition at line 185 of file adf.h.

Referenced by createADF(), ADFTraversalNode::is_reconstruction_valid(), and ADFRefiner::refine().

double ADF::length_table[16]
 

calculate the ADF

Definition at line 184 of file adf.h.

Referenced by ADFSampleAddress::coord_to_point(), and createADF().

hashmap<ADFSampleAddress, ADFSample, ADFSampleHasher, ADFSampleMap> ADF::sample_map
 

old verion's proc

Definition at line 156 of file adf.h.

Referenced by get_sample(), ADFPruner::prune(), and ADFAnalyzer::report_statistics().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:01:56 2004 for Advanced Surface Library by doxygen 1.3.4