DLA-Fire-Prediction-Thesis 1.0
|
This class is the constructor class of fuel object. It idenetifies each object with its variables, such as fuel type, fuel amount , fuel moisture, and etc. More...
#include <FuelObject.h>
Public Member Functions | |
FuelObject () | |
default ctor of fuels | |
FuelObject (ngl::Vector _objectPosition, int _objectStatus, int _objectShape) | |
ctor of fuel | |
ngl::Vector & | getPosition () |
This method will return the position of fuel. | |
ngl::Vector & | getColour () |
This method will return the current colour of fuel. | |
void | makeToBeflammable (float _fuel) |
This method will make the fuel to be flammable. | |
void | makeToBeNonflammable () |
This method will make the fuel to be non-flammable. | |
void | setFire () |
This method will change the status of fuel to be burning. | |
bool | isFlammable () |
This method will return the current status of each fuel that is flammable or not. | |
bool | isBurning () |
This method will return the current status of each fuel that is burning or not. | |
float | getCurrentFuelValue () |
This method will return the current fuel value of fuel. | |
void | subtractFuel (float _decreaseAmount) |
This method will decrease the fuel amount of fuel. | |
void | changeColour (ngl::Vector _assignedColour) |
This method will change the colour of fuel to the assigned colour value. | |
void | setFuelAmount (float _newFuel) |
This method will set the fuel amount of each fuel to the assigned value. | |
float | getMoisture () |
This method will return the moisture value of fuel. | |
void | decreaseMoisture (float _decreasedAmount) |
This method will decrease moisture value. | |
int | getShape () |
This method will return shape of fuel. | |
float | getHeight () |
This method will return the height value of fuel. | |
float | getRadius () |
This method will return the radius of fuel. | |
void | setRadius (float _newRadious) |
This method will set radius of fuel. | |
void | setHeight (float _newHeight) |
This method will set height of fuel. | |
void | setPosition (ngl::Vector _newPos) |
This method will set the new position to the object. | |
Private Attributes | |
bool | m_isFlammable |
status of fuel that is flammable or not | |
bool | m_isBurning |
status of fuel that is burning or not | |
ngl::Vector | m_position |
fuel position | |
float | m_fuel |
fuel loading of fuel | |
float | m_moisture |
fuel moisture | |
ngl::Vector | m_currentColour |
colour vector of fuel | |
int | m_objectShape |
shape of object | |
float | m_objectRadius |
radius of object | |
float | m_objectHeight |
height of object |
This class is the constructor class of fuel object. It idenetifies each object with its variables, such as fuel type, fuel amount , fuel moisture, and etc.
Definition at line 20 of file FuelObject.h.
FuelObject::FuelObject | ( | ) |
default ctor of fuels
FuelObject::FuelObject | ( | ngl::Vector | _objectPosition, |
int | _objectStatus, | ||
int | _objectShape | ||
) |
ctor of fuel
_objectPosition | is the position of each fuel on the fire area grid, |
_objectStatus | is the status of object that is flammable or not |
_objectShape | is the shape of object that is sphere, cylinder, or cube |
Definition at line 14 of file FuelObject.cpp.
References m_currentColour, m_fuel, m_isBurning, m_isFlammable, m_moisture, m_objectHeight, m_objectRadius, m_objectShape, and m_position.
{ m_position = _objectPosition; m_objectShape = _objectShape; // initial size m_objectRadius = 0.0; m_objectHeight = 0.0; if(_objectStatus==1) // flammable point starts with 100 fuel power { // ----- flammable point m_isFlammable = true; m_isBurning = false; m_fuel = 100.0; // set initial colour to green, depends on the fuel amount float m_fuelColour = m_fuel/100; m_currentColour = ngl::Vector(m_fuelColour,0.0,0.0); m_moisture = 0.1; } else // non-flammable starts with no fuel { // ----- non-flammable point m_isFlammable = false; m_isBurning = false; m_fuel = 0.0; // set initial colour if(m_objectShape==1) m_currentColour = ngl::Vector(0.7,0.8,1.0); else if(m_objectShape==2) m_currentColour = ngl::Vector(0.6,0.7,1.0); else m_currentColour = ngl::Vector(0.4,0.5,1.0); m_moisture = 0.8; } }
void FuelObject::changeColour | ( | ngl::Vector | _assignedColour | ) |
This method will change the colour of fuel to the assigned colour value.
_assignedColour | is the new colour that would assign to the fuel |
Definition at line 106 of file FuelObject.cpp.
References m_currentColour.
{ m_currentColour = _assignedColour; }
void FuelObject::decreaseMoisture | ( | float | _decreasedAmount | ) |
This method will decrease moisture value.
_decreasedAmount | is the amount that will be decreased |
Definition at line 217 of file FuelObject.cpp.
References m_moisture.
{ m_moisture -= _decreasedAmount; }
ngl::Vector & FuelObject::getColour | ( | ) |
This method will return the current colour of fuel.
Definition at line 100 of file FuelObject.cpp.
References m_currentColour.
{ return m_currentColour; }
float FuelObject::getCurrentFuelValue | ( | ) |
This method will return the current fuel value of fuel.
Definition at line 205 of file FuelObject.cpp.
References m_fuel.
{ return m_fuel; }
float FuelObject::getHeight | ( | ) |
This method will return the height value of fuel.
Definition at line 66 of file FuelObject.cpp.
References m_objectHeight.
{ return m_objectHeight; }
float FuelObject::getMoisture | ( | ) |
This method will return the moisture value of fuel.
Definition at line 211 of file FuelObject.cpp.
References m_moisture.
{ return m_moisture; }
ngl::Vector & FuelObject::getPosition | ( | ) |
This method will return the position of fuel.
Definition at line 94 of file FuelObject.cpp.
References m_position.
{ return m_position; }
float FuelObject::getRadius | ( | ) |
This method will return the radius of fuel.
Definition at line 60 of file FuelObject.cpp.
References m_objectRadius.
{ return m_objectRadius; }
int FuelObject::getShape | ( | ) |
This method will return shape of fuel.
Definition at line 88 of file FuelObject.cpp.
References m_objectShape.
{ return m_objectShape; }
bool FuelObject::isBurning | ( | ) |
This method will return the current status of each fuel that is burning or not.
Definition at line 199 of file FuelObject.cpp.
References m_isBurning.
{ return m_isBurning; }
bool FuelObject::isFlammable | ( | ) |
This method will return the current status of each fuel that is flammable or not.
Definition at line 193 of file FuelObject.cpp.
References m_isFlammable.
{ return m_isFlammable; }
void FuelObject::makeToBeflammable | ( | float | _fuel | ) |
This method will make the fuel to be flammable.
_fuel | is the fuel power that would assign to each fuel |
Definition at line 125 of file FuelObject.cpp.
References m_currentColour, m_fuel, and m_isFlammable.
{ m_isFlammable = true; m_fuel = _fuel; float m_fuelColour = m_fuel/100; // set initial colour to green, depends on the adding fuel m_currentColour = ngl::Vector(0.0f,m_fuelColour,0.0f); }
void FuelObject::makeToBeNonflammable | ( | ) |
This method will make the fuel to be non-flammable.
Definition at line 114 of file FuelObject.cpp.
References m_currentColour, m_fuel, m_isFlammable, and m_moisture.
{ m_isFlammable = false; m_fuel = 0.0; // set initial colour to blue m_currentColour = ngl::Vector(0.0f,0.0f,1.0f); m_moisture = 1.0; }
void FuelObject::setFire | ( | ) |
This method will change the status of fuel to be burning.
Definition at line 137 of file FuelObject.cpp.
References m_currentColour, m_fuel, m_isBurning, and m_isFlammable.
{ if(m_isFlammable==true) { m_isBurning = true; float m_fuelColour = m_fuel/100; // set colour of the burning point to red, depends on fuel amount m_currentColour = ngl::Vector(m_fuelColour,0.0f,0.0f); } else { m_isBurning = false; } }
void FuelObject::setFuelAmount | ( | float | _newFuel | ) |
This method will set the fuel amount of each fuel to the assigned value.
_newFuel | is the new amount of fuel |
Definition at line 153 of file FuelObject.cpp.
References m_currentColour, m_fuel, and m_isFlammable.
{ if(m_isFlammable==true) { m_fuel = _newFuel; float m_fuelColour = m_fuel/100; // set colour of the burning point to red, depends on fuel amount m_currentColour = ngl::Vector(m_fuelColour, 0.0f,0.0f); } else m_fuel = 0.0; }
void FuelObject::setHeight | ( | float | _newHeight | ) |
This method will set height of fuel.
_newHeight | is the new height of fuel |
Definition at line 72 of file FuelObject.cpp.
References m_objectHeight.
{ m_objectHeight = _newHeight; }
void FuelObject::setPosition | ( | ngl::Vector | _newPos | ) |
This method will set the new position to the object.
_newPos | is the new position |
Definition at line 225 of file FuelObject.cpp.
References m_position.
{ m_position = _newPos; }
void FuelObject::setRadius | ( | float | _newRadious | ) |
This method will set radius of fuel.
_newRadious | is the new radius |
Definition at line 80 of file FuelObject.cpp.
References m_objectRadius.
{ m_objectRadius = _newRadious; }
void FuelObject::subtractFuel | ( | float | _decreaseAmount | ) |
This method will decrease the fuel amount of fuel.
_decreaseAmount | is the amount of fuel that would be decrease each time this method is called |
Definition at line 170 of file FuelObject.cpp.
References m_currentColour, m_fuel, and m_isBurning.
{ if(m_fuel>0.0) { m_fuel = m_fuel-_decreaseAmount; } else { m_fuel = 0.0; } if(m_isBurning==true) { float m_fuelColour = m_fuel/100; // set colour of the burning point to red, depends on fuel amount m_currentColour = ngl::Vector(m_fuelColour,0.0f,0.0f); } }
ngl::Vector FuelObject::m_currentColour [private] |
colour vector of fuel
Definition at line 196 of file FuelObject.h.
float FuelObject::m_fuel [private] |
fuel loading of fuel
Definition at line 186 of file FuelObject.h.
bool FuelObject::m_isBurning [private] |
status of fuel that is burning or not
Definition at line 176 of file FuelObject.h.
bool FuelObject::m_isFlammable [private] |
status of fuel that is flammable or not
Definition at line 171 of file FuelObject.h.
float FuelObject::m_moisture [private] |
fuel moisture
Definition at line 191 of file FuelObject.h.
float FuelObject::m_objectHeight [private] |
height of object
Definition at line 209 of file FuelObject.h.
float FuelObject::m_objectRadius [private] |
radius of object
Definition at line 205 of file FuelObject.h.
int FuelObject::m_objectShape [private] |
shape of object
Definition at line 201 of file FuelObject.h.
ngl::Vector FuelObject::m_position [private] |
fuel position
Definition at line 181 of file FuelObject.h.