COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
covise::coDoBasisTree Class Reference

#include <coDoBasisTree.h>

Inheritance diagram for covise::coDoBasisTree:
Inheritance graph
[legend]
Collaboration diagram for covise::coDoBasisTree:
Collaboration graph
[legend]

Classes

class  functionObject
 

Public Types

enum  {
  SHM_OBJ = 8, MAX_NO_LEVELS = 10, MIN_SMALL_ENOUGH = 32, CRIT_LEVEL = 3,
  NORMAL_SIZE = 800
}
 

Public Member Functions

 coDoBasisTree (const coObjInfo &info, const char *label1, const char *label2, int nelem_l, int nconn_l, int ncoord_l, int *el, int *conn, float *x_c, float *y_c, float *z_c, int normal_size, int max_no_levels, int min_small_enough, int crit_level, int limit_fX, int limit_fY, int limit_fZ)
 
 coDoBasisTree (const coObjInfo &info)
 Another constructor. More...
 
 coDoBasisTree (const coObjInfo &info, const char *label)
 Still another constructor. More...
 
 coDoBasisTree (const coObjInfo &info, const char *label1, const char *label2, int cellListSize, int macroCellListSize, int cellBBoxesSize, int gridBBoxSize)
 
virtual ~coDoBasisTree ()
 Destructor. More...
 
void Visualise (std::vector< int > &ll, std::vector< int > &cl, std::vector< float > &xi, std::vector< float > &yi, std::vector< float > &zi)
 
const int * search (const float *point) const
 
const int * extended_search (const coVector &point1, const coVector &point2, std::vector< int > &OctreePolygonList) const
 Dump of information of the macrocells and cells defining the octtree. More...
 
bool cutLineCuboid (const coVector &point1, const coVector &point2, const float *cuboidBbox, std::vector< coVector > &CutVec) const
 extends normal search function, by searching for all cells between two points More...
 
bool cutThroughOct (int baum, const float bbox[6], std::vector< int > &ll, std::vector< int > &cl, std::vector< float > &xi, std::vector< float > &yi, std::vector< float > &zi, const coVector &point1, const coVector &point2, std::vector< int > &OctreePolygonList) const
 cuts a line with a cuboid and gives back a vector with the coordinates More...
 
const int * getBbox (std::vector< float > &boundingBox) const
 recursive cut through a octree macro cell More...
 
const int * area_search (std::vector< float > &Bbox, std::vector< int > &GridElemList) const
 get the BBox of a given Octtree More...
 
void getMacroCellElements (int baum, float bbox[6], std::vector< int > &ElementList, const float *reference_Bbox) const
 search for all cells within a 3D area More...
 
bool lineInBbox (const coVector &point1, const coVector &point2, const float bbox[6]) const
 get all Elements which are in a specific macro cell More...
 
void getChunks (vector< const int * > &chunks, const functionObject *test)
 /////////////////////////////////////////////// More...
 
int getNumCellLists ()
 
int getNumMacroCellLists ()
 
int getNumCellBBoxes ()
 
int getNumGridBBoxes ()
 
void getAddresses (int **cellList, int **macroCellList, float **cellBBox, float **gridBBox, int **fX, int **fY, int **fZ, int **max_no_levels)
 
- Public Member Functions inherited from covise::coDistributedObject
void getShmLocation (int &shmSegNo, shmSizeType &offset) const
 Get my location in shared memory. More...
 
void addAttribute (const char *, const char *)
 Attach an attribute to an object. More...
 
void addAttributes (int, const char *const *, const char *const *)
 Attach multiple attributes to an object. More...
 
const char * getAttribute (const char *) const
 get one attribute More...
 
int getNumAttributes () const
 get number of attributes More...
 
int getAllAttributes (const char ***name, const char ***content) const
 get all attributes More...
 
void copyAllAttributes (const coDistributedObject *src)
 copy all attributes from src to this object More...
 
char * getName () const
 get the object's name More...
 
const char * getType () const
 get the object's type More...
 
int isType (const char *reqType) const
 check whether this is a certain type More...
 
bool objectOk () const
 check whether object was created or received ok More...
 
 coDistributedObject ()
 
 coDistributedObject (const coObjInfo &info)
 
 coDistributedObject (const coObjInfo &info, const char *t)
 
 coDistributedObject (const coObjInfo &info, int shmSeg, shmSizeType offs, char *t)
 
virtual ~coDistributedObject ()
 
coDistributedObjectclone (const coObjInfo &newinfo) const
 
void copyObjInfo (coObjInfo *info) const
 
const coDistributedObjectcreateUnknown () const
 
int * store_header (int, int, int, int *, data_type *, long *, int **)
 
int restore_header (int **, int, int *, int *, shmSizeType *)
 
void init_header (int *, int *, int, data_type **, long **)
 
int update_shared_dl (int count, covise_data_list *dl)
 
int store_shared_dl (int count, covise_data_list *dl)
 
int restore_shared_dl (int count, covise_data_list *dl)
 
void setType (const char *, const char *)
 
int getObjectInfo (coDoInfo **) const
 
int get_type_no () const
 
int access (access_type)
 
int destroy ()
 
char * object_on_hosts () const
 
int incRefCount () const
 
int decRefCount () const
 
int getRefCount () const
 
void print () const
 
void getObjectFromShm ()
 Common function for all read-Constructors: More...
 
bool checkObject () const
 Check object: return true if valid, false if not. More...
 

Protected Member Functions

int getObjInfo (int, coDoInfo **) const
 
int rebuildFromShm ()
 
void BBoxForElement (int i)
 
void ShareCellsBetweenLeaves ()
 
void IniBBox (float *, const int *) const
 
void fillBBoxSon (float *bbox_son, const float *bbox, int son) const
 
void SplitOctTree (const float *bbox, std::vector< int > &population_, int level, int offset)
 
int CellsAreTooBig (const float *bbox, std::vector< int > &population)
 
void RecreateShm (const char *label1, const char *label2)
 
void DivideUpToLevel ()
 
const int * lookUp (int position, int *okey, int mask) const
 
void MakeOctTree (int *el, int *conn, float *x_c, float *y_c, float *z_c)
 
int Position (int *key) const
 
- Protected Member Functions inherited from covise::coDistributedObject
int getShmArray () const
 
int createFromShm (coShmArray *arr)
 
bool checkObj (int shmSegNo, shmSizeType shmOffs, bool &printed) const
 Check object in shared memory. More...
 
virtual coDistributedObjectcloneObject (const coObjInfo &newinfo) const =0
 

Static Protected Member Functions

static int IsInMacroCell (const int *okey, const int *macro_keys)
 

Protected Attributes

coIntShmArray cellList
 
coIntShmArray macroCellList
 
coFloatShmArray cellBBoxes
 
coFloatShmArray gridBBox
 
coIntShm fXShm
 
coIntShm fYShm
 
coIntShm fZShm
 
coIntShm max_no_levels_Shm
 
std::vector< int > macCellList_
 
std::vector< int > cellList_
 
std::vector< int > * populations_
 
std::vector< float > cellBBoxes_
 
int nelem
 
int nconn
 
int ncoord
 
int * el_
 
int * conn_
 
float * x_c_
 
float * y_c_
 
float * z_c_
 
float * cell_bbox_
 
float grid_bbox_ [6]
 
int fX_
 
int fY_
 
int fZ_
 
const int normal_size_
 
int max_no_levels_
 
const int min_small_enough_
 
const int crit_level_
 
const int limit_fX_
 
const int limit_fY_
 
const int limit_fZ_
 
- Protected Attributes inherited from covise::coDistributedObject
coIntShm version
 
coIntShm refcount
 
coShmArrayshmarr
 
coStringShmArrayattributes
 
coDoHeaderheader
 
char type_name [7]
 
int type_no
 
char * name
 
int loc_version
 
bool new_ok
 
int size
 
char * attribs
 

Private Member Functions

void addChunk (vector< const int * > &chunks, int position, const float bbox[6], const functionObject *)
 
void treePrint (ostream &outfile, int level, int *key, int offset)
 
void VisualiseOneOctTree (int baum, const float bbox[6], std::vector< int > &ll, std::vector< int > &cl, std::vector< float > &xi, std::vector< float > &yi, std::vector< float > &zi)
 
void RecreateShmDL (covise_data_list *)
 

Private Attributes

float cellFactor_
 
int small_enough_
 

Friends

ostream & operator<< (ostream &outfile, coDoBasisTree &tree)
 check if line is in a bbox More...
 

Additional Inherited Members

- Static Public Member Functions inherited from covise::coDistributedObject
static const coDistributedObjectcreateFromShm (const coObjInfo &newinfo)
 
static const coDistributedObjectcreateUnknown (coShmArray *)
 
static const coDistributedObjectcreateUnknown (int seg, shmSizeType offs)
 
static int calcType (const char *)
 
static char * calcTypeString (int)
 
static int set_vconstr (const char *, coDistributedObject *(*)(coShmArray *))
 

Member Enumeration Documentation

anonymous enum
Enumerator
SHM_OBJ 
MAX_NO_LEVELS 
MIN_SMALL_ENOUGH 
CRIT_LEVEL 
NORMAL_SIZE 

Constructor & Destructor Documentation

coDoBasisTree::coDoBasisTree ( const coObjInfo info,
const char *  label1,
const char *  label2,
int  nelem_l,
int  nconn_l,
int  ncoord_l,
int *  el,
int *  conn,
float *  x_c,
float *  y_c,
float *  z_c,
int  normal_size,
int  max_no_levels,
int  min_small_enough,
int  crit_level,
int  limit_fX,
int  limit_fY,
int  limit_fZ 
)

Constructor

Parameters
nobjedct name
label1either OCTRE or OCTREP
label2another label
nelem_lnumber of cells
nconn_lnumber of vertices
ncoord_lnumber of points
elcell array
connvertices array
x_cX-coordinate array
y_cY-coordinate array
z_cZ-coordinate array
normal_sizedetermines how many octrees are created
max_no_levelsdetermines the maximum number of octree levels
min_small_enoughcriteria for stopping octree division
limit_fXlimits number of octrees
limit_fYlimits number of octrees
limit_fZlimits number of octrees
coDoBasisTree::coDoBasisTree ( const coObjInfo info)

Another constructor.

coDoBasisTree::coDoBasisTree ( const coObjInfo info,
const char *  label 
)

Still another constructor.

coDoBasisTree::coDoBasisTree ( const coObjInfo info,
const char *  label1,
const char *  label2,
int  cellListSize,
int  macroCellListSize,
int  cellBBoxesSize,
int  gridBBoxSize 
)

Constructor for deserialization

Parameters
infoobject name
label1either OCTREE or OCTREP
label2another label
cellListSizenumber of cellList items
macroCellListSizenumber of macroCellList items
cellBBoxesSizenumber of cellBBoxes items
gridBBoxSizenumber of gridBBox items
coDoBasisTree::~coDoBasisTree ( )
virtual

Destructor.

Member Function Documentation

void coDoBasisTree::addChunk ( vector< const int * > &  chunks,
int  position,
const float  bbox[6],
const functionObject test 
)
private
const int * coDoBasisTree::area_search ( std::vector< float > &  Bbox,
std::vector< int > &  GridElemList 
) const

get the BBox of a given Octtree

Bereich fuer Gitterelemente Octtree.

void coDoBasisTree::BBoxForElement ( int  i)
protected
int coDoBasisTree::CellsAreTooBig ( const float *  bbox,
std::vector< int > &  population 
)
protected
bool coDoBasisTree::cutLineCuboid ( const coVector point1,
const coVector point2,
const float *  cuboidBbox,
std::vector< coVector > &  CutVec 
) const

extends normal search function, by searching for all cells between two points

DEKLARATION GAUSS ELIMINATION


BERECHNUNG DURCH GAUSS ELIMINATIONSVERFAHREN

ENDE GAUSS ELIMINATION

bool coDoBasisTree::cutThroughOct ( int  baum,
const float  bbox[6],
std::vector< int > &  ll,
std::vector< int > &  cl,
std::vector< float > &  xi,
std::vector< float > &  yi,
std::vector< float > &  zi,
const coVector point1,
const coVector point2,
std::vector< int > &  OctreePolygonList 
) const

cuts a line with a cuboid and gives back a vector with the coordinates

void coDoBasisTree::DivideUpToLevel ( )
protected
const int * coDoBasisTree::extended_search ( const coVector point1,
const coVector point2,
std::vector< int > &  OctreePolygonList 
) const

Dump of information of the macrocells and cells defining the octtree.

void coDoBasisTree::fillBBoxSon ( float *  bbox_son,
const float *  bbox,
int  son 
) const
protected
void coDoBasisTree::getAddresses ( int **  cellList,
int **  macroCellList,
float **  cellBBox,
float **  gridBBox,
int **  fX,
int **  fY,
int **  fZ,
int **  max_no_levels 
)
const int * coDoBasisTree::getBbox ( std::vector< float > &  boundingBox) const

recursive cut through a octree macro cell

void coDoBasisTree::getChunks ( vector< const int * > &  chunks,
const functionObject test 
)

///////////////////////////////////////////////

void coDoBasisTree::getMacroCellElements ( int  baum,
float  bbox[6],
std::vector< int > &  ElementList,
const float *  reference_Bbox 
) const

search for all cells within a 3D area

int coDoBasisTree::getNumCellBBoxes ( )
int coDoBasisTree::getNumCellLists ( )
int coDoBasisTree::getNumGridBBoxes ( )
int coDoBasisTree::getNumMacroCellLists ( )
int coDoBasisTree::getObjInfo ( int  no,
coDoInfo **  il 
) const
protectedvirtual

Reimplemented from covise::coDistributedObject.

void coDoBasisTree::IniBBox ( float *  bbox,
const int *  key 
) const
protected
int coDoBasisTree::IsInMacroCell ( const int *  okey,
const int *  macro_keys 
)
staticprotected
bool coDoBasisTree::lineInBbox ( const coVector point1,
const coVector point2,
const float  bbox[6] 
) const

get all Elements which are in a specific macro cell

const int * coDoBasisTree::lookUp ( int  position,
int *  okey,
int  mask 
) const
protected
void coDoBasisTree::MakeOctTree ( int *  el,
int *  conn,
float *  x_c,
float *  y_c,
float *  z_c 
)
protected
int coDoBasisTree::Position ( int *  key) const
protected
int coDoBasisTree::rebuildFromShm ( )
protectedvirtual
void coDoBasisTree::RecreateShm ( const char *  label1,
const char *  label2 
)
protected
void coDoBasisTree::RecreateShmDL ( covise_data_list dl)
private
const int * coDoBasisTree::search ( const float *  point) const

search: Finding the cell (cells) in which a point lies

Parameters
pointarray with the 3 coordinates of the point
Returns
an array is returned whose first element gives the number of candidate cells, the cell labels follow
void coDoBasisTree::ShareCellsBetweenLeaves ( )
protected
void coDoBasisTree::SplitOctTree ( const float *  bbox,
std::vector< int > &  population_,
int  level,
int  offset 
)
protected
void coDoBasisTree::treePrint ( ostream &  outfile,
int  level,
int *  key,
int  offset 
)
private
void coDoBasisTree::Visualise ( std::vector< int > &  ll,
std::vector< int > &  cl,
std::vector< float > &  xi,
std::vector< float > &  yi,
std::vector< float > &  zi 
)

Visualise fills std::vectors with the information required to produce a coDoLines object (line and connectivity list, and coordinate arrays) with which you may create for instance a coDoLines object for visualising the octtree

void coDoBasisTree::VisualiseOneOctTree ( int  baum,
const float  bbox[6],
std::vector< int > &  ll,
std::vector< int > &  cl,
std::vector< float > &  xi,
std::vector< float > &  yi,
std::vector< float > &  zi 
)
private

Friends And Related Function Documentation

ostream& operator<< ( ostream &  outfile,
coDoBasisTree tree 
)
friend

check if line is in a bbox

Member Data Documentation

float* covise::coDoBasisTree::cell_bbox_
protected
coFloatShmArray covise::coDoBasisTree::cellBBoxes
protected
std::vector<float> covise::coDoBasisTree::cellBBoxes_
protected
float covise::coDoBasisTree::cellFactor_
private
coIntShmArray covise::coDoBasisTree::cellList
protected
std::vector<int> covise::coDoBasisTree::cellList_
protected
int* covise::coDoBasisTree::conn_
protected
const int covise::coDoBasisTree::crit_level_
protected
int* covise::coDoBasisTree::el_
protected
int covise::coDoBasisTree::fX_
mutableprotected
coIntShm covise::coDoBasisTree::fXShm
protected
int covise::coDoBasisTree::fY_
mutableprotected
coIntShm covise::coDoBasisTree::fYShm
protected
int covise::coDoBasisTree::fZ_
mutableprotected
coIntShm covise::coDoBasisTree::fZShm
protected
float covise::coDoBasisTree::grid_bbox_[6]
mutableprotected
coFloatShmArray covise::coDoBasisTree::gridBBox
protected
const int covise::coDoBasisTree::limit_fX_
protected
const int covise::coDoBasisTree::limit_fY_
protected
const int covise::coDoBasisTree::limit_fZ_
protected
std::vector<int> covise::coDoBasisTree::macCellList_
protected
coIntShmArray covise::coDoBasisTree::macroCellList
protected
int covise::coDoBasisTree::max_no_levels_
mutableprotected
coIntShm covise::coDoBasisTree::max_no_levels_Shm
protected
const int covise::coDoBasisTree::min_small_enough_
protected
int covise::coDoBasisTree::nconn
protected
int covise::coDoBasisTree::ncoord
protected
int covise::coDoBasisTree::nelem
protected
const int covise::coDoBasisTree::normal_size_
protected
std::vector<int>* covise::coDoBasisTree::populations_
protected
int covise::coDoBasisTree::small_enough_
private
float* covise::coDoBasisTree::x_c_
protected
float* covise::coDoBasisTree::y_c_
protected
float* covise::coDoBasisTree::z_c_
protected

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