MeshKit
1.0
|
00001 #include "meshkit/AF2RuleNewVertex.hpp" 00002 00003 AF2RuleNewVertex::AF2RuleNewVertex(AF2Point2D const & rfrncPoint, 00004 const AF2PointTransform* const & pntTrnsfrm) 00005 { 00006 referencePoint = rfrncPoint; 00007 pointTransform = pntTrnsfrm->clone(); 00008 } 00009 00010 AF2RuleNewVertex::~AF2RuleNewVertex() 00011 { 00012 delete pointTransform; 00013 } 00014 00015 AF2RuleNewVertex::AF2RuleNewVertex(const AF2RuleNewVertex & toCopy) 00016 { 00017 referencePoint = toCopy.referencePoint; 00018 pointTransform = toCopy.pointTransform->clone(); 00019 } 00020 00021 AF2RuleNewVertex& AF2RuleNewVertex::operator=( 00022 const AF2RuleNewVertex & rhs) 00023 { 00024 // directly copy members that are not using a pointer 00025 referencePoint = rhs.referencePoint; 00026 00027 // copy constructor functionality, 00028 // but to other parts of memory, not yet to this 00029 AF2PointTransform* otherPointTransform; 00030 otherPointTransform = rhs.pointTransform->clone(); 00031 00032 // destructor functionality 00033 delete pointTransform; 00034 00035 // transfer ownership from other parts of memory to this object 00036 pointTransform = otherPointTransform; 00037 otherPointTransform = NULL; // not necessary, but to be explicit 00038 00039 // return this 00040 return *this; 00041 } 00042 00043 AF2Point2D AF2RuleNewVertex::getLocation( 00044 AF2Binding const & vertexBinding) const 00045 { 00046 return pointTransform->transformPoint(referencePoint, vertexBinding); 00047 }