SIM_RawIndexField Class Reference

#include <SIM_RawIndexField.h>

List of all members.

Public Types

typedef UT_RefArray< int64Indices
typedef SIM_VoxelBox Box
typedef UT_RefArray< BoxBoxes

Public Member Functions

 SIM_RawIndexField ()
virtual ~SIM_RawIndexField ()
 SIM_RawIndexField (const SIM_RawIndexField &src)
 Copy constructor:.
const SIM_RawIndexFieldoperator= (const SIM_RawIndexField &src)
 Assigment operator:.
void init (SIM_FieldSample sample, const UT_Vector3 &orig, const UT_Vector3 &size, int xres, int yres, int zres)
void match (const SIM_RawField &src)
void match (const SIM_RawIndexField &src)
bool indexToPos (int x, int y, int z, UT_Vector3 &pos) const
bool posToIndex (UT_Vector3 pos, int &x, int &y, int &z) const
 Converts a worldspace position into an integer index.
bool isMatching (const SIM_RawIndexField *field) const
bool isAligned (const SIM_RawIndexField *field) const
bool isAligned (const SIM_RawField *field) const
int64 getMemoryUsage () const
void getVoxelRes (int &xres, int &yres, int &zres) const
const UT_Vector3getVoxelSize () const
fpreal getVoxelDiameter () const
bool isValidIndex (int x, int y, int z) const
 Returns true if the given x, y, z values lie inside the valid index.
int64 buildIndex (const SIM_RawField *surface, const SIM_RawField *collision)
int64 buildPartitionedIndex (const SIM_RawField *surface, const SIM_RawField *collision, const bool allowSubdivide, Indices &setEnds)
 THREADED_METHOD1 (SIM_RawIndexField, shouldMultiThread(), buildCollisionLookup, const SIM_RawField *, collision) void buildCollisionLookupPartial(const SIM_RawField *collision
int64 computeConnectedComponents (const SIM_RawField &surface)
int64 computeConnectedComponents (const SIM_RawIndexField &idx)
bool shouldMultiThread () const
 Returns true if this should be multithreaded.
int64 operator() (int x, int y, int z) const
int64 getIndex (const UT_VoxelArrayIteratorF &vit) const
int64 getValue (const UT_Vector3 &pos) const
UT_VoxelArray< int64 > * field () const
int64 maxIndex () const
const UT_Vector3getOrig () const
const UT_Vector3getSize () const
const UT_Vector3getBBoxOrig () const
const UT_Vector3getBBoxSize () const
SIM_FieldSample getSample () const

Public Attributes

const UT_JobInfoinfo

Protected Member Functions

int64 collapseClassIndices ()
bool shouldConnectIndices (int64 idx1, int64 idx2) const
void findRange (const SIM_RawField *surface, const SIM_RawField *collision, int begin[3], int end[3]) const
int64 countVoxelsInBox (const SIM_RawField *surface, const SIM_RawField *collision, const Box &box) const

Protected Attributes

UT_VoxelArray< int64 > * myField
SIM_FieldSample mySample
int64 myMaxIndex
UT_Vector3 myOrig
UT_Vector3 mySize
UT_Vector3 myBBoxOrig
UT_Vector3 myBBoxSize
UT_Vector3 myVoxelSize
fpreal myVoxelDiameter


Detailed Description

Definition at line 47 of file SIM_RawIndexField.h.


Member Typedef Documentation

Definition at line 51 of file SIM_RawIndexField.h.

Definition at line 52 of file SIM_RawIndexField.h.

Definition at line 50 of file SIM_RawIndexField.h.


Constructor & Destructor Documentation

SIM_RawIndexField::SIM_RawIndexField (  ) 

virtual SIM_RawIndexField::~SIM_RawIndexField (  )  [virtual]

SIM_RawIndexField::SIM_RawIndexField ( const SIM_RawIndexField src  ) 

Copy constructor:.


Member Function Documentation

int64 SIM_RawIndexField::buildIndex ( const SIM_RawField surface,
const SIM_RawField collision 
)

Builds from a surface & collision field. -1 if inside collision, -2 if not in collision and not in surface, otherwise a unique number. Returns maximum index (which you can also get from getMaxIndex)

int64 SIM_RawIndexField::buildPartitionedIndex ( const SIM_RawField surface,
const SIM_RawField collision,
const bool  allowSubdivide,
Indices setEnds 
)

int64 SIM_RawIndexField::collapseClassIndices (  )  [protected]

Given a set of connectivity classes, collapse into the minimal set and renumber from 0. myMaxIndex will be updated with the resulting maximum & the number of components returned.

int64 SIM_RawIndexField::computeConnectedComponents ( const SIM_RawIndexField idx  ) 

Computes the connected components according to the given index values. Areas of -1, -2, and >=0 will be consdiered three different material types and connectivity computed respectively.

int64 SIM_RawIndexField::computeConnectedComponents ( const SIM_RawField surface  ) 

Computes the connected components of the given field. Anything with a value < 0 will be considered "inside" and connected to each other. Voxels with a value >= 0 will be flagged as being in component -1. The maxIndex will store the number of connected components.

int64 SIM_RawIndexField::countVoxelsInBox ( const SIM_RawField surface,
const SIM_RawField collision,
const Box box 
) const [protected]

UT_VoxelArray<int64>* SIM_RawIndexField::field (  )  const [inline]

Definition at line 174 of file SIM_RawIndexField.h.

void SIM_RawIndexField::findRange ( const SIM_RawField surface,
const SIM_RawField collision,
int  begin[3],
int  end[3] 
) const [protected]

const UT_Vector3& SIM_RawIndexField::getBBoxOrig (  )  const [inline]

Definition at line 180 of file SIM_RawIndexField.h.

const UT_Vector3& SIM_RawIndexField::getBBoxSize (  )  const [inline]

Definition at line 181 of file SIM_RawIndexField.h.

int64 SIM_RawIndexField::getIndex ( const UT_VoxelArrayIteratorF vit  )  const [inline]

Definition at line 167 of file SIM_RawIndexField.h.

int64 SIM_RawIndexField::getMemoryUsage (  )  const

const UT_Vector3& SIM_RawIndexField::getOrig (  )  const [inline]

Definition at line 178 of file SIM_RawIndexField.h.

SIM_FieldSample SIM_RawIndexField::getSample (  )  const [inline]

Definition at line 183 of file SIM_RawIndexField.h.

const UT_Vector3& SIM_RawIndexField::getSize ( void   )  const [inline]

Definition at line 179 of file SIM_RawIndexField.h.

int64 SIM_RawIndexField::getValue ( const UT_Vector3 pos  )  const

fpreal SIM_RawIndexField::getVoxelDiameter (  )  const [inline]

Definition at line 103 of file SIM_RawIndexField.h.

void SIM_RawIndexField::getVoxelRes ( int &  xres,
int &  yres,
int &  zres 
) const

Returns the resolution of the voxel grid that we are sampling. This is a count of voxels, so may differ for our different sampling methods.

const UT_Vector3& SIM_RawIndexField::getVoxelSize (  )  const [inline]

Definition at line 102 of file SIM_RawIndexField.h.

bool SIM_RawIndexField::indexToPos ( int  x,
int  y,
int  z,
UT_Vector3 pos 
) const

Convert indices to world coordinates and vice-versa. Note this uses this field's indices which change depending on sampling.

void SIM_RawIndexField::init ( SIM_FieldSample  sample,
const UT_Vector3 orig,
const UT_Vector3 size,
int  xres,
int  yres,
int  zres 
)

Initializes the field. The resolution given is in terms of voxels, the actual dimensions of this field may be slightly different due to the sampling choice.

bool SIM_RawIndexField::isAligned ( const SIM_RawField field  )  const

bool SIM_RawIndexField::isAligned ( const SIM_RawIndexField field  )  const

Returns true if the two fields are precisely aligned. This means that samples are matched so a given integer index into either field would give the same result.

bool SIM_RawIndexField::isMatching ( const SIM_RawIndexField field  )  const

Returns true if the given field and this one match in terms of number of voxels and bounding box size. This means the voxel cells match - not necessarily the sample points!

bool SIM_RawIndexField::isValidIndex ( int  x,
int  y,
int  z 
) const [inline]

Returns true if the given x, y, z values lie inside the valid index.

Definition at line 106 of file SIM_RawIndexField.h.

void SIM_RawIndexField::match ( const SIM_RawIndexField src  ) 

void SIM_RawIndexField::match ( const SIM_RawField src  ) 

Initialize this to be the same dimension and sampling patern as the given field.

int64 SIM_RawIndexField::maxIndex (  )  const [inline]

Definition at line 176 of file SIM_RawIndexField.h.

int64 SIM_RawIndexField::operator() ( int  x,
int  y,
int  z 
) const [inline]

Definition at line 163 of file SIM_RawIndexField.h.

const SIM_RawIndexField& SIM_RawIndexField::operator= ( const SIM_RawIndexField src  ) 

Assigment operator:.

bool SIM_RawIndexField::posToIndex ( UT_Vector3  pos,
int &  x,
int &  y,
int &  z 
) const

Converts a worldspace position into an integer index.

bool SIM_RawIndexField::shouldConnectIndices ( int64  idx1,
int64  idx2 
) const [protected]

Determines if two indices should be connected using our empty cell merge rule.

bool SIM_RawIndexField::shouldMultiThread (  )  const [inline]

Returns true if this should be multithreaded.

Definition at line 158 of file SIM_RawIndexField.h.

SIM_RawIndexField::THREADED_METHOD1 ( SIM_RawIndexField  ,
shouldMultiThread()  ,
buildCollisionLookup  ,
const SIM_RawField ,
collision   
) const


Member Data Documentation

Definition at line 143 of file SIM_RawIndexField.h.

Definition at line 204 of file SIM_RawIndexField.h.

Definition at line 204 of file SIM_RawIndexField.h.

Definition at line 195 of file SIM_RawIndexField.h.

Definition at line 197 of file SIM_RawIndexField.h.

Definition at line 201 of file SIM_RawIndexField.h.

Definition at line 196 of file SIM_RawIndexField.h.

Definition at line 201 of file SIM_RawIndexField.h.

Definition at line 208 of file SIM_RawIndexField.h.

Definition at line 207 of file SIM_RawIndexField.h.


The documentation for this class was generated from the following file:

Generated on Fri May 25 00:10:40 2012 for HDK by  doxygen 1.5.9