From 53b73dec4d6e71899d183335509591b7c89a419b Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Thu, 14 Jun 2012 18:34:23 -0400 Subject: pushing the fly-tools into this repository --- fly-tools/FlyObject.cpp | 118 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 fly-tools/FlyObject.cpp (limited to 'fly-tools/FlyObject.cpp') diff --git a/fly-tools/FlyObject.cpp b/fly-tools/FlyObject.cpp new file mode 100644 index 0000000..d6cbee3 --- /dev/null +++ b/fly-tools/FlyObject.cpp @@ -0,0 +1,118 @@ +/* + * FlyObject.cpp + * + * + * Created by Md. Alimoor Reza on 6/26/10. + * Copyright 2010 Drexel University. All rights reserved. + * + */ + +#include "FlyObject.h" + +FlyObject::FlyObject(int area, pair centroid, pair majorAxisEV, pair velocityV,bool headIsInDirectionMAEV, pair head, double speed) { +//FlyObject::FlyObject(int area, pair centroid, pair majorAxisEV, pair velocityV, vector > areaCoord) { + this->area = area; + this->centroid = centroid; + this->majorAxisEV = majorAxisEV; + this->velocityV = velocityV; + this->headIsInDirectionMAEV = headIsInDirectionMAEV; + this->head = head; + this->speed = speed; +// this->areaCoord = areaCoord; +} + +FlyObject::FlyObject(const FlyObject &f){ + this->area = f.getArea(); + this->centroid=f.getCentroid(); + this->majorAxisEV =f.getMajorAxisEV(); + this->velocityV = f.getVelocityV(); +// this->areaCoord = f.getAreaCoord(); + this->headIsInDirectionMAEV = f.getHeadIsInDirectionMAEV(); + this->head = f.getHead(); + this->speed = f.getSpeed(); +} + +int FlyObject::getArea() const { + return area; +} + +pair FlyObject::getCentroid() const { + return this->centroid; +} + +pair FlyObject::getMajorAxisEV() const { + return this->majorAxisEV; +} + +pair FlyObject::getVelocityV() const { + return this->velocityV; +} +bool FlyObject::getHeadIsInDirectionMAEV() const { + return this->headIsInDirectionMAEV; +} +pair FlyObject::getHead() const { + return this->head; +} +//vector > FlyObject::getAreaCoord() const { +// return this->areaCoord; +//} +double FlyObject::getSpeed() const { + return this->speed; +} +void FlyObject::setArea(int area) { + this->area = area; +} + +void FlyObject::setCentroid(pair centroid) { + this->centroid = centroid; +} + +void FlyObject::setMajorAxisEV(pair majorAxisEV) { + this->majorAxisEV = majorAxisEV; +} + +void FlyObject::setVelocityV(pair velocityV) { + this->velocityV = velocityV; +// cout << "velocityV is set to "<velocityV.first<<","<velocityV.second< head) { + this->head = head; + cout << "new head is set"< > areaCoord){ +// this->areaCoord = areaCoord; +//} +void FlyObject::setSpeed(double speed) { + this->speed = speed; +} + +void FlyObject::normalizeVelocity() { + double temp = velocityV.first*velocityV.first + velocityV.second*velocityV.second; + temp = sqrt(temp); + cout << "sum = "<headIsInDirectionMAEV = headIsInDirectionMAEV; + cout << "head flag set to "<headIsInDirectionMAEV<headIsInDirectionMAEV<head.first<<","<