MeshKit  1.0
AF2Point3D.cpp
Go to the documentation of this file.
00001 #include "meshkit/AF2Point3D.hpp"
00002 
00003 // C++
00004 #include <climits>
00005 
00006 // MeshKit
00007 #include "meshkit/Error.hpp"
00008 
00009 AF2Point3D::AF2Point3D(unsigned long pntId,
00010     double xVal, double yVal, double zVal)
00011 {
00012   localId = pntId;
00013   x = xVal;
00014   y = yVal;
00015   z = zVal;
00016   distToBndry = UINT_MAX;
00017   committed = false;
00018 }
00019 
00020 unsigned int AF2Point3D::getDistanceToBoundary() const
00021 {
00022   return distToBndry;
00023 }
00024 
00025 unsigned long AF2Point3D::getLocalId() const
00026 {
00027   return localId;
00028 }
00029 
00030 moab::EntityHandle AF2Point3D::getVertexHandle() const
00031 {
00032   if (!committed)
00033   {
00034     MeshKit::Error badState(MeshKit::MK_FAILURE);
00035     badState.set_string("The point has not been committed to the mesh yet.");
00036     throw badState;
00037   }
00038   return vertexHandle;
00039 }
00040 
00041 double AF2Point3D::getX() const
00042 {
00043   return x;
00044 }
00045 
00046 double AF2Point3D::getY() const
00047 {
00048   return y;
00049 }
00050 
00051 double AF2Point3D::getZ() const
00052 {
00053   return z;
00054 }
00055 
00056 bool AF2Point3D::isCommitted() const
00057 {
00058   return committed;
00059 }
00060 
00061 void AF2Point3D::limitDistanceToBoundary(unsigned int upperBound)
00062 {
00063   if (upperBound < distToBndry)
00064   {
00065     distToBndry = upperBound;
00066   }
00067 }
00068 
00069 void AF2Point3D::setCommittedHandle(const moab::EntityHandle & vertexHandleArg)
00070 {
00071   vertexHandle = vertexHandleArg;
00072   committed = true;
00073 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines