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

Class for coordination. More...

#include "KNGeometricCoordination.h"

Collaboration diagram for CKNGeometricCoordination:
Collaboration graph

Public Member Functions

 CKNGeometricCoordination ()
 
 ~CKNGeometricCoordination ()
 
double * GetCoordinationAll ()
 
void SetCoordination (CKNGeometricCoordination 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 (CKNGeometricCoordination 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 (CKNGeometricCoordination compare)
 Comparing coordination is same or not within tolerance. More...
 
bool operator== (const CKNGeometricCoordination &compare)
 Comparing coordination is same or not within tolerance. More...
 
bool operator!= (const CKNGeometricCoordination &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
Author
Kyu Nam Cho(mysto.nosp@m.us@k.nosp@m.orea..nosp@m.ac.k.nosp@m.r), Hoon Ryu(elec1.nosp@m.020@.nosp@m.gmail.nosp@m..com)

Definition at line 16 of file KNGeometricCoordination.h.

Constructor & Destructor Documentation

CKNGeometricCoordination::CKNGeometricCoordination ( )

Definition at line 11 of file KNGeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

12 {
13  m_fCoordination[_X] = 0;
14  m_fCoordination[_Y] = 0;
15  m_fCoordination[_Z] = 0;
16 }
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
double m_fCoordination[3]
Cooridnation for x, y, z direction.
Definition: CKNGlobal.h:105
CKNGeometricCoordination::~CKNGeometricCoordination ( )

Definition at line 18 of file KNGeometricCoordination.cpp.

19 {
20 }

Member Function Documentation

double CKNGeometricCoordination::GetCoordination ( AXIS_DEFINE  coord)

Get coordination specific axis.

Parameters
coordAxis that want to get coordination
Returns
Coordination value

Definition at line 48 of file KNGeometricCoordination.cpp.

References m_fCoordination.

Referenced by CKNGeometricShape::ArrangeUnitCell(), CKNGeometricShape::CalculateUnitcellCount(), CKNGeometricShape::ConstructMapInfo(), CKNGeometricUnitCell::NumberingSubElement(), CKNGeometricShape::RefillPeriodicBinding(), CKNGeometricShape::SetAtomAndNeighborInformation(), SetOffset(), and CKNGeometricUnitCell::SetSubDomainMaterial().

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

Here is the caller graph for this function:

double* CKNGeometricCoordination::GetCoordinationAll ( )
inline

Definition at line 22 of file KNGeometricCoordination.h.

References m_fCoordination.

Referenced by CKNGeometricShape::ArrangeUnitCell(), IsSame(), SetCoordination(), CKNGeometricUnitCell::SetCoordination(), and CKNGeometricAtom::SetCoordination().

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

Here is the caller graph for this function:

bool CKNGeometricCoordination::IsSame ( CKNGeometricCoordination  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 110 of file KNGeometricCoordination.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool CKNGeometricCoordination::operator!= ( const CKNGeometricCoordination 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 140 of file KNGeometricCoordination.cpp.

References IsSame().

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

Here is the call graph for this function:

bool CKNGeometricCoordination::operator== ( const CKNGeometricCoordination 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 131 of file KNGeometricCoordination.cpp.

References IsSame().

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

Here is the call graph for this function:

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

Rotate coordination with specific degree.

Parameters
axisRotate axis x, y, z
fDegreeRotate degree

Definition at line 57 of file KNGeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

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

Get coordination with double buffer.

Definition at line 23 of file KNGeometricCoordination.h.

References GetCoordinationAll(), and SetCoordination().

Referenced by CKNGeometricShape::ArrangeUnitCell(), CKNGeometricAtom::CKNGeometricAtom(), CKNGeometricShape::InitShape(), SetCoordination(), CKNGeometricUnitCell::SetCoordination(), CKNGeometricAtom::SetCoordination(), CKNGeometricAtomFactory::SetNeighborCoordination(), IKNGeometricUnitCellInfo::SetNeighborCoordination(), and CKNGeometricShape::SetOriginCoordination().

23 { SetCoordination(coordination.GetCoordinationAll()); };
void SetCoordination(CKNGeometricCoordination coordination)
Get coordination with double buffer.

Here is the call graph for this function:

Here is the caller graph for this function:

void CKNGeometricCoordination::SetCoordination ( double *  pfCoordination)

Set coordination to instance.

Set coordination to instance

Parameters
pfCoordinationArray of coordination of x, y, z direction

Definition at line 25 of file KNGeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

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

Set coordination to instance.

Parameters
fXCoordinationX axis coordination
fYCoordinationY axis coordination
fZCoordinationZ axis coordination

Definition at line 37 of file KNGeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

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

To offset coordination.

Parameters
coordOffset value

Definition at line 79 of file KNGeometricCoordination.cpp.

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

Referenced by CKNGeometricUnitCell::ArrangeAtom(), CKNGeometricShape::ArrangeUnitCell(), CKNGeometricShape::CalculateUnitcellCount(), and CKNGeometricUnitCell::IsMachedNeighborRule().

80 {
82 }
Definition: CKNGlobal.h:105
void SetOffset(CKNGeometricCoordination coord)
To offset coordination.
Definition: CKNGlobal.h:105
Definition: CKNGlobal.h:105
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 CKNGeometricCoordination::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 89 of file KNGeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

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

Set ratio.

Parameters
fRatioRatio value

Definition at line 99 of file KNGeometricCoordination.cpp.

References _X, _Y, _Z, and m_fCoordination.

Referenced by CKNGeometricAtom::SetRatio().

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

Here is the caller graph for this function:

Member Data Documentation

double CKNGeometricCoordination::m_fCoordination[3]
private

Cooridnation for x, y, z direction.

Definition at line 37 of file KNGeometricCoordination.h.

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


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