MeshKit  1.0
AF2RuleNewTriangle.cpp
Go to the documentation of this file.
00001 #include "meshkit/AF2RuleNewTriangle.hpp"
00002 
00003 // MeshKit
00004 #include "meshkit/Error.hpp"
00005 
00006 AF2RuleNewTriangle::AF2RuleNewTriangle(
00007     unsigned int firstIndex, unsigned int secondIndex, unsigned int thirdIndex)
00008 {
00009   triVtxIndices[0] = firstIndex;
00010   triVtxIndices[1] = secondIndex;
00011   triVtxIndices[2] = thirdIndex;
00012 }
00013 
00014 unsigned int AF2RuleNewTriangle::getNumVertices() const
00015 {
00016   return 3u;
00017 }
00018 
00019 unsigned int AF2RuleNewTriangle::getVertexIndex(unsigned int vtxNum) const
00020 {
00021   if (vtxNum > 2)
00022   {
00023     MeshKit::Error badArg(MeshKit::MK_BAD_INPUT);
00024     badArg.set_string(
00025         "AF2RuleNewTriangle vertex number must not be greater than 2.");
00026     throw badArg;
00027   }
00028   return triVtxIndices[vtxNum];
00029 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines