IPCC  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CGeometricCoordination Class Reference

Class for coordination. More...

#include "GeometricCoordination.h"

Collaboration diagram for CGeometricCoordination:
Collaboration graph

Public Member Functions

 CGeometricCoordination ()
 
 ~CGeometricCoordination ()
 
double * GetCoordinationAll ()
 
void SetCoordination (CGeometricCoordination coordination)
 Get coordination with double buffer. More...
 
void SetCoordination (double *pfCoordination)
 Set coordination to instance. More...
 
void SetCoordination (double fXCoordination, double fYCoordination, double fZCoordination)
 Set coordination to instance. More...
 
double GetCoordination (AXIS_DEFINE coord)
 Get coordination specific axis. More...
 
void Rotate (AXIS_DEFINE axis, double fDegree)
 Rotate coordination with specific degree. More...
 
void SetOffset (CGeometricCoordination coord)
 To offset coordination. More...
 
void SetOffset (double fXCoordination, double fYCoordination, double fZCoordination)
 To offset coordination. More...
 
void SetRatio (double fRatio[3])
 Set ratio. More...
 
bool IsSame (CGeometricCoordination compare)
 Comparing coordination is same or not within tolerance. More...
 
bool operator== (const CGeometricCoordination &compare)
 Comparing coordination is same or not within tolerance. More...
 
bool operator!= (const CGeometricCoordination &compare)
 Comparing coordination is same or not within tolerance. More...
 

Private Attributes

double m_fCoordination [3]
 Cooridnation for x, y, z direction. More...
 

Detailed Description

Class for coordination.

Date
03/Oct/2014

Definition at line 14 of file GeometricCoordination.h.

Constructor & Destructor Documentation

CGeometricCoordination::CGeometricCoordination ( )

Definition at line 10 of file GeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

11 {
12  m_fCoordination[_X] = 0;
13  m_fCoordination[_Y] = 0;
14  m_fCoordination[_Z] = 0;
15 }
Definition: Global.h:113
Definition: Global.h:113
Definition: Global.h:113
double m_fCoordination[3]
Cooridnation for x, y, z direction.
CGeometricCoordination::~CGeometricCoordination ( )

Definition at line 17 of file GeometricCoordination.cpp.

18 {
19 }

Member Function Documentation

double CGeometricCoordination::GetCoordination ( AXIS_DEFINE  coord)

Get coordination specific axis.

Parameters
coordAxis that want to get coordination
Returns
Coordination value

Definition at line 47 of file GeometricCoordination.cpp.

References m_fCoordination.

Referenced by CGeometricShape::ArrangeUnitCell(), CGeometricShape::CalculateUnitcellCount(), CGeometricShape::ConstructContactRegionOnPoissonGrid(), CGeometricShape::ConstructMapInfo(), CGeometricShape::MapElecAtomOnPoissonGrid(), CGeometricUnitCell::NumberingSubElement(), CGeometricShape::RefillPeriodicBinding(), CGeometricShape::SetAtomAndNeighborInformation(), SetOffset(), and CGeometricUnitCell::SetSubDomainMaterial().

48 {
49  return m_fCoordination[coord];
50 }
double m_fCoordination[3]
Cooridnation for x, y, z direction.

Here is the caller graph for this function:

double* CGeometricCoordination::GetCoordinationAll ( )
inline

Definition at line 20 of file GeometricCoordination.h.

References m_fCoordination.

Referenced by CGeometricShape::ArrangeUnitCell(), IsSame(), SetCoordination(), CGeometricUnitCell::SetCoordination(), and CGeometricAtom::SetCoordination().

20 { return m_fCoordination; };
double m_fCoordination[3]
Cooridnation for x, y, z direction.

Here is the caller graph for this function:

bool CGeometricCoordination::IsSame ( CGeometricCoordination  compare)

Comparing coordination is same or not within tolerance.

Parameters
compareCoordination that want to compare
Returns
Compare coordinatin is same or not

Definition at line 109 of file GeometricCoordination.cpp.

References _X, _Y, _Z, GetCoordinationAll(), and m_fCoordination.

Referenced by operator!=(), and operator==().

110 {
111  double *fCompare = compare.GetCoordinationAll();
112  double fTolerance = 1e-8;
113 
114  if (fabs(m_fCoordination[_X] - fCompare[_X]) > fTolerance)
115  return false;
116 
117  if (fabs(m_fCoordination[_Y] - fCompare[_Y]) > fTolerance)
118  return false;
119 
120  if( fabs(m_fCoordination[_Z] - fCompare[_Z]) > fTolerance)
121  return false;
122 
123  return true;
124 }
Definition: Global.h:113
Definition: Global.h:113
Definition: Global.h:113
double m_fCoordination[3]
Cooridnation for x, y, z direction.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CGeometricCoordination::operator!= ( const CGeometricCoordination compare)

Comparing coordination is same or not within tolerance.

Parameters
compareCoordination that want to compare
Returns
Compare coordinatin is same or not

Definition at line 139 of file GeometricCoordination.cpp.

References IsSame().

140 {
141  return !IsSame(compare);
142 }
bool IsSame(CGeometricCoordination compare)
Comparing coordination is same or not within tolerance.

Here is the call graph for this function:

bool CGeometricCoordination::operator== ( const CGeometricCoordination compare)

Comparing coordination is same or not within tolerance.

Parameters
compareCoordination that want to compare
Returns
Compare coordinatin is same or not

Definition at line 130 of file GeometricCoordination.cpp.

References IsSame().

131 {
132  return IsSame(compare);
133 }
bool IsSame(CGeometricCoordination compare)
Comparing coordination is same or not within tolerance.

Here is the call graph for this function:

void CGeometricCoordination::Rotate ( AXIS_DEFINE  axis,
double  fDegree 
)

Rotate coordination with specific degree.

Parameters
axisRotate axis x, y, z
fDegreeRotate degree

Definition at line 56 of file GeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

57 {
58  switch (axis)
59  {
60  case _X:
61  m_fCoordination[_Y] = m_fCoordination[_Y] * cos(fDegree) - m_fCoordination[_Z] * sin(fDegree);
62  m_fCoordination[_Z] = m_fCoordination[_Y] * sin(fDegree) + m_fCoordination[_Z] * cos(fDegree);
63  break;
64  case _Y:
65  m_fCoordination[_Z] = m_fCoordination[_Z] * cos(fDegree) - m_fCoordination[_X] * sin(fDegree);
66  m_fCoordination[_X] = m_fCoordination[_Z] * sin(fDegree) + m_fCoordination[_X] * cos(fDegree);
67  break;
68  case _Z:
69  m_fCoordination[_X] = m_fCoordination[_X] * cos(fDegree) - m_fCoordination[_Y] * sin(fDegree);
70  m_fCoordination[_Y] = m_fCoordination[_X] * sin(fDegree) + m_fCoordination[_Y] * cos(fDegree);
71  break;
72  }
73 }
Definition: Global.h:113
Definition: Global.h:113
Definition: Global.h:113
double m_fCoordination[3]
Cooridnation for x, y, z direction.
void CGeometricCoordination::SetCoordination ( CGeometricCoordination  coordination)
inline

Get coordination with double buffer.

Definition at line 21 of file GeometricCoordination.h.

References GetCoordinationAll(), and SetCoordination().

Referenced by CGeometricShape::ArrangeUnitCell(), CGeometricAtom::CGeometricAtom(), CGeometricShape::InitShape(), SetCoordination(), CGeometricUnitCell::SetCoordination(), CGeometricAtom::SetCoordination(), CGeometricAtomFactory::SetNeighborCoordination(), IGeometricUnitCellInfo::SetNeighborCoordination(), and CGeometricShape::SetOriginCoordination().

21 { SetCoordination(coordination.GetCoordinationAll()); };
void SetCoordination(CGeometricCoordination coordination)
Get coordination with double buffer.

Here is the call graph for this function:

Here is the caller graph for this function:

void CGeometricCoordination::SetCoordination ( double *  pfCoordination)

Set coordination to instance.

Set coordination to instance

Parameters
pfCoordinationArray of coordination of x, y, z direction

Definition at line 24 of file GeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

25 {
26  m_fCoordination[_X] = pfCoordination[0];
27  m_fCoordination[_Y] = pfCoordination[1];
28  m_fCoordination[_Z] = pfCoordination[2];
29 }
Definition: Global.h:113
Definition: Global.h:113
Definition: Global.h:113
double m_fCoordination[3]
Cooridnation for x, y, z direction.
void CGeometricCoordination::SetCoordination ( double  fXCoordination,
double  fYCoordination,
double  fZCoordination 
)

Set coordination to instance.

Parameters
fXCoordinationX axis coordination
fYCoordinationY axis coordination
fZCoordinationZ axis coordination

Definition at line 36 of file GeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

37 {
38  m_fCoordination[_X] = fXCoordination;
39  m_fCoordination[_Y] = fYCoordination;
40  m_fCoordination[_Z] = fZCoordination;
41 }
Definition: Global.h:113
Definition: Global.h:113
Definition: Global.h:113
double m_fCoordination[3]
Cooridnation for x, y, z direction.
void CGeometricCoordination::SetOffset ( CGeometricCoordination  coord)

To offset coordination.

Parameters
coordOffset value

Definition at line 78 of file GeometricCoordination.cpp.

References _X, _Y, _Z, and GetCoordination().

Referenced by CGeometricUnitCell::ArrangeAtom(), CGeometricShape::ArrangeUnitCell(), CGeometricShape::CalculateUnitcellCount(), and CGeometricUnitCell::IsMachedNeighborRule().

79 {
81 }
Definition: Global.h:113
Definition: Global.h:113
void SetOffset(CGeometricCoordination coord)
To offset coordination.
Definition: Global.h:113
double GetCoordination(AXIS_DEFINE coord)
Get coordination specific axis.

Here is the call graph for this function:

Here is the caller graph for this function:

void CGeometricCoordination::SetOffset ( double  fXCoordination,
double  fYCoordination,
double  fZCoordination 
)

To offset coordination.

Parameters
fXCoordinationOffset value of x axis
fYCoordinationOffset value of y axis
fZCoordinationOffset value of z axis

Definition at line 88 of file GeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

89 {
90  m_fCoordination[_X] += fXCoordination;
91  m_fCoordination[_Y] += fYCoordination;
92  m_fCoordination[_Z] += fZCoordination;
93 }
Definition: Global.h:113
Definition: Global.h:113
Definition: Global.h:113
double m_fCoordination[3]
Cooridnation for x, y, z direction.
void CGeometricCoordination::SetRatio ( double  fRatio[3])

Set ratio.

Parameters
fRatioRatio value

Definition at line 98 of file GeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

Referenced by CGeometricAtom::SetRatio().

99 {
100  m_fCoordination[_X] *= fRatio[_X];
101  m_fCoordination[_Y] *= fRatio[_Y];
102  m_fCoordination[_Z] *= fRatio[_Z];
103 }
Definition: Global.h:113
Definition: Global.h:113
Definition: Global.h:113
double m_fCoordination[3]
Cooridnation for x, y, z direction.

Here is the caller graph for this function:

Member Data Documentation

double CGeometricCoordination::m_fCoordination[3]
private

Cooridnation for x, y, z direction.

Definition at line 35 of file GeometricCoordination.h.

Referenced by CGeometricCoordination(), GetCoordination(), GetCoordinationAll(), IsSame(), Rotate(), SetCoordination(), SetOffset(), and SetRatio().


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