UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Public Attributes | Friends | List of all members
U3dModel Class Reference

#include <u3d_model.hpp>

Public Member Functions

 U3dModel (U3dModAreaPos modAreaPos, U3dBox modelBox, U3dBoundInfoAr bounds, U3dBodyInfoAr bodies, U3dProgress *prg=0x0)
 
 U3dModel (U3dModAreaPos modAreaPos, U3dBox modelBox, U3d1dModBodyInfoAr mod1dBodies, U3dProgress *prg=0x0)
 
 U3dModel (U3dModel *, U3dProgress *prg=0x0)
 
double getVel (U3dPoint p, U3D_WAVE_TYPE wt, int bId=-1)
 
bool getVelGrad (U3dPoint point, double &v, double &vf, double &vaz, U3D_WAVE_TYPE wt)
 
bool getVelGrad (U3dPoint point, int bodyId, double &v, double &vf, double &vaz, U3D_WAVE_TYPE wt)
 
int getBodyId (U3dPoint)
 
U3dBodygetBody (int bodyId)
 
const U3dBodygetBody (int bodyId) const
 
int getBodiesNum () const
 
U3dBox getModelBox () const
 
U3dGridgetGrid ()
 
const U3dGridgetGrid () const
 
U3dBoundgetBound (int boundId)
 
const U3dBoundgetBound (int boundId) const
 
int getBoundsNum () const
 
U3dModAreaPos getModelAreaPos () const
 
void setModelAreaPos (U3dModAreaPos MAP)
 
bool getFBNormal (U3dPoint p, double &iA, double &iAz)
 
bool getReady ()
 
void addDescription (const char *description)
 
std::vector< int > getCommonBoundsIds (int bodyId_0, int bodyId_1)
 
void constructGrid (bool plane_surf_model)
 
void gridCrusher (int boundId)
 
void getCommonCells (U3dGridCellsArray *common_cells, U3dBox *surfBox, U3dGridCell *root)
 
void recursiveDivideCell (int boundId, std::set< int > &trianglesId_ar, U3dGridCell *cell)
 
void fillGridInfoSimple ()
 
void recursiveFillCellInfo (U3dGridCell *cell)
 
void fillGridInfoComplex ()
 
void getNeighbours (U3dBox box, U3dGridCellsArray &cell_array, U3dGridCellsArray &neighbour_cells)
 
void fillBoundCellsInfo ()
 
void fillBoundCellsInfo (std::vector< int > bodies, int boundId, U3dGridCell *cell, U3D_COLOR b_color)
 
U3dGridCellgetBodyIdFromGrid (U3dPoint p, int &body_id)
 
int getBodyIdFromCell (U3dPoint p, U3dGridCell *cell)
 
int getBodyIdDummy (U3dPoint p)
 
bool getNormalLimPoints (U3dPoint p, U3dPoint *&p0, U3dPoint *&p1, double &iA0, double &iAz0, double &iA1, double &iAz1)
 
void defineNearestIntPoints (U3dPoint p, int bodyId, U3dPointsAr intersection_ps, std::vector< int > intersected_bounds_ind, int &p0_ind, int &p1_ind)
 
void interpolateNormals (U3dPoint p, U3dPoint *p0, U3dPoint *p1, double iA0, double iAz0, double iA1, double iAz1, double &iA, double &iAz)
 
void intersectCellTriangles (U3dPoint *p0, U3dPoint *p1, U3dGridCell *goal_cell, std::vector< int > &int_trIds, U3dPointsAr &int_points)
 
void clearOnStop ()
 
 U3dModel (U3dModAreaPos modAreaPos, U3dBox modelBox, U3dBoundInfoAr bounds, U3dBodyInfoAr bodies, U3dProgress *prg=0x0)
 
 U3dModel (U3dModAreaPos modAreaPos, U3dBox modelBox, U3d1dModBodyInfoAr mod1dBodies, U3dProgress *prg=0x0)
 
 U3dModel (U3dModel *, U3dProgress *prg=0x0)
 
double getVel (U3dPoint p, U3D_WAVE_TYPE wt, int bId=-1)
 
bool getVelGrad (U3dPoint point, double &v, double &vf, double &vaz, U3D_WAVE_TYPE wt)
 
bool getVelGrad (U3dPoint point, int bodyId, double &v, double &vf, double &vaz, U3D_WAVE_TYPE wt)
 
int getBodyId (U3dPoint)
 
U3dBodygetBody (int bodyId)
 
const U3dBodygetBody (int bodyId) const
 
int getBodiesNum () const
 
U3dBox getModelBox () const
 
U3dGridgetGrid ()
 
const U3dGridgetGrid () const
 
U3dBoundgetBound (int boundId) const
 
int getBoundsNum () const
 
U3dModAreaPos getModelAreaPos () const
 
void setModelAreaPos (U3dModAreaPos MAP)
 
bool getFBNormal (U3dPoint p, double &iA, double &iAz)
 
bool getReady ()
 
void addDescription (const char *description)
 
std::vector< int > getCommonBoundsIds (int bodyId_0, int bodyId_1)
 
void constructGrid (bool plane_surf_model)
 
void gridCrusher (int boundId)
 
void getCommonCells (U3dGridCellsArray *common_cells, U3dBox *surfBox, U3dGridCell *root)
 
void recursiveDivideCell (int boundId, int_set &trianglesId_ar, U3dGridCell *cell)
 
void fillGridInfoSimple ()
 
void recursiveFillCellInfo (U3dGridCell *cell)
 
void fillGridInfoComplex ()
 
void getNeighbours (U3dBox box, U3dGridCellsArray &cell_array, U3dGridCellsArray &neighbour_cells)
 
void fillBoundCellsInfo ()
 
void fillBoundCellsInfo (std::vector< int > bodies, int boundId, U3dGridCell *cell, U3D_COLOR b_color)
 
U3dGridCellgetBodyIdFromGrid (U3dPoint p, int &body_id)
 
int getBodyIdFromCell (U3dPoint p, U3dGridCell *cell)
 
int getBodyIdDummy (U3dPoint p)
 
bool getNormalLimPoints (U3dPoint p, U3dPoint *&p0, U3dPoint *&p1, double &iA0, double &iAz0, double &iA1, double &iAz1)
 
void defineNearestIntPoints (U3dPoint p, int bodyId, U3dPointsAr intersection_ps, std::vector< int > intersected_bounds_ind, int &p0_ind, int &p1_ind)
 
void interpolateNormals (U3dPoint p, U3dPoint *p0, U3dPoint *p1, double iA0, double iAz0, double iA1, double iAz1, double &iA, double &iAz)
 
void intersectCellTriangles (U3dPoint *p0, U3dPoint *p1, U3dGridCell *goal_cell, std::vector< int > &int_trIds, U3dPointsAr &int_points)
 
void clearOnStop ()
 
void checkInternalData (std::string &errstr)
 

Public Attributes

char * m_desc
 

Friends

bool U3dModelExport (char *, U3dModel *, char *, U3dProgress *)
 
void U3dModelSaveUnivers (const U3dModel *, const char *, const char *) throw ()
 
U3dModelU3dModelLoadUnivers (const char *, const char *) throw ()
 
bool U3dModelExport (char *, U3dModel *, char *, U3dProgress *)
 

Detailed Description

3d velocity model object

Constructor & Destructor Documentation

U3dModel::U3dModel ( U3dModAreaPos  modAreaPos,
U3dBox  modelBox,
U3dBoundInfoAr  bounds,
U3dBodyInfoAr  bodies,
U3dProgress prg = 0x0 
)

Constructor for model defined arbitrary

U3dModel::U3dModel ( U3dModAreaPos  modAreaPos,
U3dBox  modelBox,
U3d1dModBodyInfoAr  mod1dBodies,
U3dProgress prg = 0x0 
)

Constructor for 1d to 3d model importing

U3dModel::U3dModel ( U3dModel ,
U3dProgress prg = 0x0 
)

Copy constructor

U3dModel::U3dModel ( U3dModAreaPos  modAreaPos,
U3dBox  modelBox,
U3dBoundInfoAr  bounds,
U3dBodyInfoAr  bodies,
U3dProgress prg = 0x0 
)

Constructor for model defined arbitrary

U3dModel::U3dModel ( U3dModAreaPos  modAreaPos,
U3dBox  modelBox,
U3d1dModBodyInfoAr  mod1dBodies,
U3dProgress prg = 0x0 
)

Constructor for 1d to 3d model importing

U3dModel::U3dModel ( U3dModel ,
U3dProgress prg = 0x0 
)

Copy constructor

Member Function Documentation

void U3dModel::addDescription ( const char *  description)

Adds description.

void U3dModel::addDescription ( const char *  description)

Adds description.

void U3dModel::checkInternalData ( std::string &  errstr)

Check internal parameters for various incompatibilities. Errstr to be empty if all good, otherwise it will contain detected error description.

void U3dModel::constructGrid ( bool  plane_surf_model)

Create model grid

void U3dModel::constructGrid ( bool  plane_surf_model)

Create model grid

void U3dModel::defineNearestIntPoints ( U3dPoint  p,
int  bodyId,
U3dPointsAr  intersection_ps,
std::vector< int >  intersected_bounds_ind,
int &  p0_ind,
int &  p1_ind 
)

Returns indexes of two (if it is possible) points in intersection_ps, nearest to the point p; Attention: p lies on the different (black/white) sides from the bounds, on which these two points selected

void U3dModel::defineNearestIntPoints ( U3dPoint  p,
int  bodyId,
U3dPointsAr  intersection_ps,
std::vector< int >  intersected_bounds_ind,
int &  p0_ind,
int &  p1_ind 
)

Returns indexes of two (if it is possible) points in intersection_ps, nearest to the point p; Attention: p lies on the different (black/white) sides from the bounds, on which these two points selected

void U3dModel::fillBoundCellsInfo ( )

Fill cells, containing bounds, with information about contained bodies numbers

void U3dModel::fillBoundCellsInfo ( std::vector< int >  bodies,
int  boundId,
U3dGridCell cell,
U3D_COLOR  b_color 
)

Service procedure for fillBoundCellsInfo() : for the case of intersecting bounds

void U3dModel::fillBoundCellsInfo ( )

Fill cells, containing bounds, with information about contained bodies numbers

void U3dModel::fillBoundCellsInfo ( std::vector< int >  bodies,
int  boundId,
U3dGridCell cell,
U3D_COLOR  b_color 
)

Service procedure for fillBoundCellsInfo() : for the case of intersecting bounds

void U3dModel::fillGridInfoComplex ( )

Fills empty grid cells (do not contain bounds) with information about contained body. Complex method (work fast for curved bounds)

void U3dModel::fillGridInfoComplex ( )

Fills empty grid cells (do not contain bounds) with information about contained body. Complex method (work fast for curved bounds)

void U3dModel::fillGridInfoSimple ( )

Fills empty grid cells (do not contain bounds) with information about contained body. Simple method (work fast for plane bounds)

void U3dModel::fillGridInfoSimple ( )

Fills empty grid cells (do not contain bounds) with information about contained body. Simple method (work fast for plane bounds)

int U3dModel::getBodiesNum ( ) const
inline

Returns model bodies number

int U3dModel::getBodiesNum ( ) const
inline

Returns model bodies number

U3dBody* U3dModel::getBody ( int  bodyId)
Returns body, the given point belongs to 
[Was bogus!]

U3dBody* getBody(U3dPoint);Returns body by it's ID

U3dBody* U3dModel::getBody ( int  bodyId)
Returns body, the given point belongs to 
[Was bogus!]

U3dBody* getBody(U3dPoint);Returns body by it's ID

const U3dBody* U3dModel::getBody ( int  bodyId) const
inline

Returns body by it's ID (const variant)

const U3dBody* U3dModel::getBody ( int  bodyId) const

Returns body by it's ID (const variant)

int U3dModel::getBodyId ( U3dPoint  )

Returns density in given point Returns body number, the given point belongs to

int U3dModel::getBodyId ( U3dPoint  )

Returns density in given point Returns body number, the given point belongs to

int U3dModel::getBodyIdDummy ( U3dPoint  p)

Get body number, the given point belongs to (model grid is not used)

int U3dModel::getBodyIdDummy ( U3dPoint  p)

Get body number, the given point belongs to (model grid is not used)

int U3dModel::getBodyIdFromCell ( U3dPoint  p,
U3dGridCell cell 
)

Service procedure for getBodyIdFromGrid()

int U3dModel::getBodyIdFromCell ( U3dPoint  p,
U3dGridCell cell 
)

Service procedure for getBodyIdFromGrid()

U3dGridCell* U3dModel::getBodyIdFromGrid ( U3dPoint  p,
int &  body_id 
)

Uses model grid to get body number, the given point belongs to

U3dGridCell* U3dModel::getBodyIdFromGrid ( U3dPoint  p,
int &  body_id 
)

Uses model grid to get body number, the given point belongs to

U3dBound* U3dModel::getBound ( int  boundId) const

Returns bound by it's ID

U3dBound* U3dModel::getBound ( int  boundId)

Returns bound by it's ID

const U3dBound* U3dModel::getBound ( int  boundId) const

Returns bound by it's ID (const version)

int U3dModel::getBoundsNum ( ) const
inline

Returns model bounds number

int U3dModel::getBoundsNum ( ) const
inline

Returns model bounds number

void U3dModel::getCommonCells ( U3dGridCellsArray *  common_cells,
U3dBox surfBox,
U3dGridCell root 
)

Returns array of model grid cells, which intersect with 3d box of given surface

void U3dModel::getCommonCells ( U3dGridCellsArray *  common_cells,
U3dBox surfBox,
U3dGridCell root 
)

Returns array of model grid cells, which intersect with 3d box of given surface

bool U3dModel::getFBNormal ( U3dPoint  p,
double &  iA,
double &  iAz 
)

Returns the angles of fictive bound direction in given point

bool U3dModel::getFBNormal ( U3dPoint  p,
double &  iA,
double &  iAz 
)

Returns the angles of fictive bound direction in given point

U3dGrid* U3dModel::getGrid ( )
inline

Returns pointer to model grid

U3dGrid* U3dModel::getGrid ( )
inline

Returns pointer to model grid

const U3dGrid* U3dModel::getGrid ( ) const
inline

Returns pointer to model grid (const variant)

const U3dGrid* U3dModel::getGrid ( ) const
inline

Returns pointer to model grid (const variant)

U3dModAreaPos U3dModel::getModelAreaPos ( ) const

Returns origin point of local model area coordinate system (in survey coordinate system)

U3dModAreaPos U3dModel::getModelAreaPos ( ) const

Returns origin point of local model area coordinate system (in survey coordinate system)

U3dBox U3dModel::getModelBox ( ) const
inline

Returns model area 3d box

U3dBox U3dModel::getModelBox ( ) const
inline

Returns model area 3d box

void U3dModel::getNeighbours ( U3dBox  box,
U3dGridCellsArray &  cell_array,
U3dGridCellsArray &  neighbour_cells 
)

For given box the neighbour cells are found and replaced from initial array to the array of neighbours (service procedure for FillGridInfoComplex())

void U3dModel::getNeighbours ( U3dBox  box,
U3dGridCellsArray &  cell_array,
U3dGridCellsArray &  neighbour_cells 
)

For given box the neighbour cells are found and replaced from initial array to the array of neighbours (service procedure for FillGridInfoComplex())

bool U3dModel::getNormalLimPoints ( U3dPoint  p,
U3dPoint *&  p0,
U3dPoint *&  p1,
double &  iA0,
double &  iAz0,
double &  iA1,
double &  iAz1 
)

Returns two points (and respective normal angles) for fictitious bound normal calculation

bool U3dModel::getNormalLimPoints ( U3dPoint  p,
U3dPoint *&  p0,
U3dPoint *&  p1,
double &  iA0,
double &  iAz0,
double &  iA1,
double &  iAz1 
)

Returns two points (and respective normal angles) for fictitious bound normal calculation

bool U3dModel::getReady ( )
inline

Returns model object status

bool U3dModel::getReady ( )
inline

Returns model object status

double U3dModel::getVel ( U3dPoint  p,
U3D_WAVE_TYPE  wt,
int  bId = -1 
)

Returns wave velocity of type wt in given point

double U3dModel::getVel ( U3dPoint  p,
U3D_WAVE_TYPE  wt,
int  bId = -1 
)

Returns wave velocity of type wt in given point

bool U3dModel::getVelGrad ( U3dPoint  point,
double &  v,
double &  vf,
double &  vaz,
U3D_WAVE_TYPE  wt 
)

Returns wave velocity gradient in given point

bool U3dModel::getVelGrad ( U3dPoint  point,
double &  v,
double &  vf,
double &  vaz,
U3D_WAVE_TYPE  wt 
)

Returns wave velocity gradient in given point

bool U3dModel::getVelGrad ( U3dPoint  point,
int  bodyId,
double &  v,
double &  vf,
double &  vaz,
U3D_WAVE_TYPE  wt 
)

Returns wave velocity gradient in given point of body #bodyId

bool U3dModel::getVelGrad ( U3dPoint  point,
int  bodyId,
double &  v,
double &  vf,
double &  vaz,
U3D_WAVE_TYPE  wt 
)

Returns wave velocity gradient in given point of body #bodyId

void U3dModel::gridCrusher ( int  boundId)

Update existing model grid in presence of bound #boundsId

void U3dModel::gridCrusher ( int  boundId)

Update existing model grid in presence of bound #boundsId

void U3dModel::interpolateNormals ( U3dPoint  p,
U3dPoint p0,
U3dPoint p1,
double  iA0,
double  iAz0,
double  iA1,
double  iAz1,
double &  iA,
double &  iAz 
)

Interpolates lineary the normal angles (information from two bounds points used)

void U3dModel::interpolateNormals ( U3dPoint  p,
U3dPoint p0,
U3dPoint p1,
double  iA0,
double  iAz0,
double  iA1,
double  iAz1,
double &  iA,
double &  iAz 
)

Interpolates lineary the normal angles (information from two bounds points used)

void U3dModel::intersectCellTriangles ( U3dPoint p0,
U3dPoint p1,
U3dGridCell goal_cell,
std::vector< int > &  int_trIds,
U3dPointsAr &  int_points 
)

Intersect triangles, contained in the cell, by the segment p0-p1. Returns arrays of triangles numbers and intersection points

void U3dModel::intersectCellTriangles ( U3dPoint p0,
U3dPoint p1,
U3dGridCell goal_cell,
std::vector< int > &  int_trIds,
U3dPointsAr &  int_points 
)

Intersect triangles, contained in the cell, by the segment p0-p1. Returns arrays of triangles numbers and intersection points

void U3dModel::recursiveDivideCell ( int  boundId,
int_set &  trianglesId_ar,
U3dGridCell cell 
)

Recursive procedure for dividing grid cell

void U3dModel::recursiveDivideCell ( int  boundId,
std::set< int > &  trianglesId_ar,
U3dGridCell cell 
)

Recursive procedure for dividing grid cell

void U3dModel::recursiveFillCellInfo ( U3dGridCell cell)

Service procedure for FillGridInfoSimple()

void U3dModel::recursiveFillCellInfo ( U3dGridCell cell)

Service procedure for FillGridInfoSimple()

Friends And Related Function Documentation

bool U3dModelExport ( char *  ,
U3dModel ,
char *  ,
U3dProgress  
)
friend

Exporting model to text file. Returns false, when export fails.

Parameters
filefile's name
modelmodel to save
model_namemodel's name in text file
prgpointer to progress object
bool U3dModelExport ( char *  ,
U3dModel ,
char *  ,
U3dProgress  
)
friend

Exporting model to text file. Returns false, when export fails.

Parameters
filefile's name
modelmodel to save
model_namemodel's name in text file
prgpointer to progress object

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