DLA-Fire-Prediction-Thesis 1.0
|
This class is the constructor class of each point on the fire area. More...
#include <FuelPoint.h>
Public Member Functions | |
FuelPoint () | |
default ctor of points | |
FuelPoint (ngl::Vector _pointPosition, int _pointStatus) | |
ctor of point | |
ngl::Vector & | getPosition () |
This method will return the position of point. | |
ngl::Vector & | getColour () |
This method will return the current colour of point. | |
void | makeToBeflammable (float _fuel) |
This method will make the point to be flammable. | |
void | makeToBeNonflammable () |
This method will make the point to be non-flammable. | |
void | setFire () |
This method will change the status of point to be burning. | |
bool | isFlammable () |
This method will return the current status of each point that is flammable or not. | |
bool | isBurning () |
This method will return the current status of each point that is burning or not. | |
float | getCurrentFuelValue () |
This method will return the current fuel value of point. | |
void | subtractFuel (float _decreaseAmount) |
This method will decrease the fuel amount of point. | |
void | changeColour (ngl::Vector _assignedColour) |
This method will change the colour of point to the assigned colour value. | |
void | setFuelAmount (float _newFuel) |
This method will set the fuel amount of each point to the assigned value. | |
float | getMoisture () |
This method will return the moisture value of point. | |
void | decreaseMoisture (float _decreasedAmount) |
This method will decrease moisture value. | |
void | setPosition (ngl::Vector _newPosition) |
This method will set the new position for the point. | |
float | getCircleSize () |
This method will return the circle size of mountain point. | |
float | getCircleHeight () |
This method will return the height of mountain point. | |
void | setCircleHeight (float m_circleHeight) |
This method will set the new height of mountain point. | |
bool | isMointain () |
This method will return type of point that is a mountain or not. | |
void | setToBeMountain (float _circleSize, float _circleHeight) |
This method will set the point to be mountain point with assigned circle size and height. | |
void | setToBeBigFuel (float _fuelAmount) |
This method will set the point to be the point of fuel object. | |
bool | isFuel () |
This method will return type of point that is located in fuel object area or not. | |
void | setToBeNonBigFuel () |
This method will set the point to be regular point that is not located in the area of fuel object. | |
void | setBurningTime (float _burningTime) |
This method will set the burning time of the point. It would explain how long the point would be burnt down. | |
float | getBurningTime () |
This method will return the current burning time of point. | |
float | getEmittedHeat () |
This method will return the heat of the point that is received from burning fire path. | |
void | setEmittedHeat (float _heat) |
This method will set the heat that received from fire path. | |
void | setNewMoisture (float _moistureAmount) |
This method will set the moisture of point. | |
void | setGeneration (int _generationNumber) |
This method will assign the genearation number of point, referred to the created fire path. | |
int | getGeneration () |
This method will return the number of generation of point. | |
void | setToOrigin () |
This method will set the point to be origin point. | |
void | setToRegular () |
This method will set the point to be regular point, no origin. | |
bool | isOrigin () |
This method will return type of point that is an origin point or not. | |
int | getGridIndex () |
This method will return index of grid point from the specific point list. | |
void | setGridIndex (int _gridIndex) |
This method will set the index number of grid point. | |
int | getBurningFormNumber () |
This method will return form number of fire path. | |
void | setBurningFormNumber (int _formNumber) |
This method will set the form number of fire path that the point is belong to. | |
void | setToBeBurningDown () |
This method will set the status of point that is burning down. | |
bool | isBurningDown () |
This method will return the burnt status of point. | |
void | setDrawingFlag (bool _drawFlag) |
bool | canDraw () |
Private Attributes | |
bool | m_isFlammable |
status of point that is flammable or not | |
bool | m_isBurning |
status of point that is burning or not | |
ngl::Vector | m_position |
point position | |
float | m_fuel |
fuel loading of point | |
float | m_moisture |
fuel moisture | |
ngl::Vector | m_currentColour |
colour vector of point | |
float | m_pointCircleSize |
size of mountain point | |
float | m_pointCircleHeight |
height of mountain point | |
bool | m_isMountainPoint |
flag to identify the mountain point | |
bool | m_isOrigin |
flag to identify the origin point | |
bool | m_isFuel |
status of point that is located in fuel object area or not | |
float | m_burningTimeAtThePoint |
the current burning time | |
float | m_emittedHeat |
the current heat | |
int | m_generation |
the number of generation | |
int | m_gridIndex |
the index number of grid point | |
int | m_burningFormNumber |
the form number of fire path | |
bool | m_isBurningDown |
the burnt status | |
bool | m_draw |
This class is the constructor class of each point on the fire area.
Definition at line 25 of file FuelPoint.h.
FuelPoint::FuelPoint | ( | ) |
default ctor of points
FuelPoint::FuelPoint | ( | ngl::Vector | _pointPosition, |
int | _pointStatus | ||
) |
ctor of point
_pointPosition | is the position of each point on the fire area grid, |
_pointStatus | is the status of point that is flammable or not |
Definition at line 14 of file FuelPoint.cpp.
References m_burningFormNumber, m_burningTimeAtThePoint, m_currentColour, m_draw, m_emittedHeat, m_fuel, m_generation, m_gridIndex, m_isBurning, m_isBurningDown, m_isFlammable, m_isFuel, m_isMountainPoint, m_isOrigin, m_moisture, m_pointCircleHeight, m_pointCircleSize, and m_position.
{ m_position = _pointPosition; if(_pointStatus==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(0.0f,m_fuelColour,0.0f); m_moisture = 0.1; m_isMountainPoint = false; m_isOrigin = false; } else // non-flammable starts with no fuel { // ----- non-flammable point m_isFlammable = false; m_isBurning = false; m_fuel = 0.0; // set initial colour m_currentColour = ngl::Vector(0.0f,0.0f,1.0f); m_moisture = 0.8; m_isMountainPoint = false; m_isOrigin = false; } m_pointCircleSize = 1.0f; m_pointCircleHeight = 1.0f; m_isFuel = false; m_burningTimeAtThePoint = 10.0; m_emittedHeat = 0.0; m_generation = 0; m_gridIndex = 0; m_burningFormNumber = -10; // negative 10 means it has not been burnt yet m_isBurningDown = false; m_draw = true; }
bool FuelPoint::canDraw | ( | ) |
void FuelPoint::changeColour | ( | ngl::Vector | _assignedColour | ) |
This method will change the colour of point to the assigned colour value.
_assignedColour | is the new colour that would assign to the point |
Definition at line 223 of file FuelPoint.cpp.
References m_currentColour.
{ m_currentColour = _assignedColour; }
void FuelPoint::decreaseMoisture | ( | float | _decreasedAmount | ) |
This method will decrease moisture value.
_decreasedAmount | is the amount that will be decreased |
Definition at line 327 of file FuelPoint.cpp.
References m_moisture.
{ m_moisture -= _decreasedAmount; }
int FuelPoint::getBurningFormNumber | ( | ) |
This method will return form number of fire path.
Definition at line 90 of file FuelPoint.cpp.
References m_burningFormNumber.
{ return m_burningFormNumber; }
float FuelPoint::getBurningTime | ( | ) |
This method will return the current burning time of point.
Definition at line 168 of file FuelPoint.cpp.
References m_burningTimeAtThePoint.
{ return m_burningTimeAtThePoint; }
float FuelPoint::getCircleHeight | ( | ) |
This method will return the height of mountain point.
Definition at line 335 of file FuelPoint.cpp.
References m_pointCircleHeight.
{ return m_pointCircleHeight; }
float FuelPoint::getCircleSize | ( | ) |
This method will return the circle size of mountain point.
Definition at line 341 of file FuelPoint.cpp.
References m_pointCircleSize.
{ return m_pointCircleSize; }
ngl::Vector & FuelPoint::getColour | ( | ) |
This method will return the current colour of point.
Definition at line 217 of file FuelPoint.cpp.
References m_currentColour.
{ return m_currentColour; }
float FuelPoint::getCurrentFuelValue | ( | ) |
This method will return the current fuel value of point.
Definition at line 307 of file FuelPoint.cpp.
References m_fuel.
{ return m_fuel; }
float FuelPoint::getEmittedHeat | ( | ) |
This method will return the heat of the point that is received from burning fire path.
Definition at line 174 of file FuelPoint.cpp.
References m_emittedHeat.
{ return m_emittedHeat; }
int FuelPoint::getGeneration | ( | ) |
This method will return the number of generation of point.
Definition at line 128 of file FuelPoint.cpp.
References m_generation.
{ return m_generation; }
int FuelPoint::getGridIndex | ( | ) |
This method will return index of grid point from the specific point list.
Definition at line 102 of file FuelPoint.cpp.
References m_gridIndex.
{ return m_gridIndex; }
float FuelPoint::getMoisture | ( | ) |
This method will return the moisture value of point.
Definition at line 313 of file FuelPoint.cpp.
References m_moisture.
{ return m_moisture; }
ngl::Vector & FuelPoint::getPosition | ( | ) |
This method will return the position of point.
Definition at line 211 of file FuelPoint.cpp.
References m_position.
{ return m_position; }
bool FuelPoint::isBurning | ( | ) |
This method will return the current status of each point that is burning or not.
Definition at line 301 of file FuelPoint.cpp.
References m_isBurning.
{ return m_isBurning; }
bool FuelPoint::isBurningDown | ( | ) |
This method will return the burnt status of point.
m_isBurningDown | the burnt status |
Definition at line 78 of file FuelPoint.cpp.
References m_isBurningDown.
{ return m_isBurningDown; }
bool FuelPoint::isFlammable | ( | ) |
This method will return the current status of each point that is flammable or not.
Definition at line 295 of file FuelPoint.cpp.
References m_isFlammable.
{ return m_isFlammable; }
bool FuelPoint::isFuel | ( | ) |
This method will return type of point that is located in fuel object area or not.
Definition at line 143 of file FuelPoint.cpp.
References m_isFuel.
{ return m_isFuel; }
bool FuelPoint::isMointain | ( | ) |
This method will return type of point that is a mountain or not.
Definition at line 114 of file FuelPoint.cpp.
References m_isMountainPoint.
{ return m_isMountainPoint; }
bool FuelPoint::isOrigin | ( | ) |
This method will return type of point that is an origin point or not.
Definition at line 367 of file FuelPoint.cpp.
References m_isOrigin.
{ return m_isOrigin; }
void FuelPoint::makeToBeflammable | ( | float | _fuel | ) |
This method will make the point to be flammable.
_fuel | is the fuel power that would assign to each point |
Definition at line 242 of file FuelPoint.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 FuelPoint::makeToBeNonflammable | ( | ) |
This method will make the point to be non-flammable.
Definition at line 231 of file FuelPoint.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 FuelPoint::setBurningFormNumber | ( | int | _formNumber | ) |
This method will set the form number of fire path that the point is belong to.
_formNumber | the dla form number |
Definition at line 96 of file FuelPoint.cpp.
References m_burningFormNumber.
{ m_burningFormNumber = _formNumber; }
void FuelPoint::setBurningTime | ( | float | _burningTime | ) |
This method will set the burning time of the point. It would explain how long the point would be burnt down.
_burningTime | the assigned burning time |
Definition at line 155 of file FuelPoint.cpp.
References m_burningTimeAtThePoint.
{ if(_burningTime<0) _burningTime = 1; else if(_burningTime>15) _burningTime = 15; m_burningTimeAtThePoint = _burningTime; }
void FuelPoint::setCircleHeight | ( | float | m_circleHeight | ) |
This method will set the new height of mountain point.
m_circleHeight | is the new assigned height of the mountain point |
Definition at line 347 of file FuelPoint.cpp.
References m_pointCircleHeight.
{ m_pointCircleHeight = m_circleHeight; }
void FuelPoint::setDrawingFlag | ( | bool | _drawFlag | ) |
void FuelPoint::setEmittedHeat | ( | float | _heat | ) |
This method will set the heat that received from fire path.
_heat | the assigned heat amount |
Definition at line 180 of file FuelPoint.cpp.
References m_currentColour, and m_emittedHeat.
{ m_emittedHeat = _heat; // set the colour along the heat m_currentColour = ngl::Vector(_heat/1000, (1000-_heat)/1000 , 0.0); }
void FuelPoint::setFire | ( | ) |
This method will change the status of point to be burning.
Definition at line 254 of file FuelPoint.cpp.
References m_currentColour, m_fuel, and m_isBurning.
{ 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); }
void FuelPoint::setFuelAmount | ( | float | _newFuel | ) |
This method will set the fuel amount of each point to the assigned value.
_newFuel | is the new amount of fuel |
Definition at line 263 of file FuelPoint.cpp.
References m_currentColour, and m_fuel.
{ 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(0.0f,m_fuelColour,0.0f); }
void FuelPoint::setGeneration | ( | int | _generationNumber | ) |
This method will assign the genearation number of point, referred to the created fire path.
_generationNumber | is the generation number |
Definition at line 120 of file FuelPoint.cpp.
References m_generation.
{ m_generation = _generationNumber; }
void FuelPoint::setGridIndex | ( | int | _gridIndex | ) |
This method will set the index number of grid point.
_gridIndex | the new index of grid point |
Definition at line 108 of file FuelPoint.cpp.
References m_gridIndex.
{ m_gridIndex = _gridIndex; }
void FuelPoint::setNewMoisture | ( | float | _moistureAmount | ) |
This method will set the moisture of point.
_moistureAmount | is the new moisture amount |
Definition at line 319 of file FuelPoint.cpp.
References m_moisture.
{ m_moisture = _moistureAmount; }
void FuelPoint::setPosition | ( | ngl::Vector | _newPosition | ) |
This method will set the new position for the point.
_newPosition | is the new assigned position of the point |
Definition at line 203 of file FuelPoint.cpp.
References m_position.
{ m_position = _newPosition; }
void FuelPoint::setToBeBigFuel | ( | float | _fuelAmount | ) |
This method will set the point to be the point of fuel object.
_fuelAmount | the fuel amount of object that the point is located at |
Definition at line 134 of file FuelPoint.cpp.
References m_fuel, and m_isFuel.
void FuelPoint::setToBeBurningDown | ( | ) |
This method will set the status of point that is burning down.
Definition at line 84 of file FuelPoint.cpp.
References m_isBurningDown.
{ m_isBurningDown = true; }
void FuelPoint::setToBeMountain | ( | float | _circleSize, |
float | _circleHeight | ||
) |
This method will set the point to be mountain point with assigned circle size and height.
_circleSize | is the circle size of mountain |
_circleHeight | is the height of mountain |
Definition at line 192 of file FuelPoint.cpp.
References m_isMountainPoint, m_pointCircleHeight, and m_pointCircleSize.
{ m_isMountainPoint = true; m_pointCircleSize = _circleSize; m_pointCircleHeight = _circleHeight; }
void FuelPoint::setToBeNonBigFuel | ( | ) |
This method will set the point to be regular point that is not located in the area of fuel object.
Definition at line 149 of file FuelPoint.cpp.
References m_isFuel.
{ m_isFuel = false; }
void FuelPoint::setToOrigin | ( | ) |
This method will set the point to be origin point.
Definition at line 355 of file FuelPoint.cpp.
References m_isOrigin.
{ m_isOrigin = true; }
void FuelPoint::setToRegular | ( | ) |
This method will set the point to be regular point, no origin.
Definition at line 361 of file FuelPoint.cpp.
References m_isOrigin.
{ m_isOrigin = false; }
void FuelPoint::subtractFuel | ( | float | _decreaseAmount | ) |
This method will decrease the fuel amount of point.
_decreaseAmount | is the amount of fuel that would be decrease each time this method is called |
Definition at line 275 of file FuelPoint.cpp.
References m_fuel.
{ if(m_fuel>0.0) { m_fuel = m_fuel-_decreaseAmount; //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; } }
int FuelPoint::m_burningFormNumber [private] |
the form number of fire path
Definition at line 366 of file FuelPoint.h.
float FuelPoint::m_burningTimeAtThePoint [private] |
the current burning time
Definition at line 350 of file FuelPoint.h.
ngl::Vector FuelPoint::m_currentColour [private] |
colour vector of point
Definition at line 324 of file FuelPoint.h.
bool FuelPoint::m_draw [private] |
Definition at line 372 of file FuelPoint.h.
float FuelPoint::m_emittedHeat [private] |
the current heat
Definition at line 354 of file FuelPoint.h.
float FuelPoint::m_fuel [private] |
fuel loading of point
Definition at line 314 of file FuelPoint.h.
int FuelPoint::m_generation [private] |
the number of generation
Definition at line 358 of file FuelPoint.h.
int FuelPoint::m_gridIndex [private] |
the index number of grid point
Definition at line 362 of file FuelPoint.h.
bool FuelPoint::m_isBurning [private] |
status of point that is burning or not
Definition at line 304 of file FuelPoint.h.
bool FuelPoint::m_isBurningDown [private] |
the burnt status
Definition at line 370 of file FuelPoint.h.
bool FuelPoint::m_isFlammable [private] |
status of point that is flammable or not
Definition at line 299 of file FuelPoint.h.
bool FuelPoint::m_isFuel [private] |
status of point that is located in fuel object area or not
Definition at line 346 of file FuelPoint.h.
bool FuelPoint::m_isMountainPoint [private] |
flag to identify the mountain point
Definition at line 337 of file FuelPoint.h.
bool FuelPoint::m_isOrigin [private] |
flag to identify the origin point
Definition at line 342 of file FuelPoint.h.
float FuelPoint::m_moisture [private] |
fuel moisture
Definition at line 319 of file FuelPoint.h.
float FuelPoint::m_pointCircleHeight [private] |
height of mountain point
Definition at line 333 of file FuelPoint.h.
float FuelPoint::m_pointCircleSize [private] |
size of mountain point
Definition at line 329 of file FuelPoint.h.
ngl::Vector FuelPoint::m_position [private] |
point position
Definition at line 309 of file FuelPoint.h.