DLA-Fire-Prediction-Thesis 1.0

FuelObject Class Reference

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>

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

FuelObject::FuelObject ( )

default ctor of fuels

FuelObject::FuelObject ( ngl::Vector  _objectPosition,
int  _objectStatus,
int  _objectShape 
)

ctor of fuel

Parameters:
_objectPositionis the position of each fuel on the fire area grid,
_objectStatusis the status of object that is flammable or not
_objectShapeis 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;
    }
}

Member Function Documentation

void FuelObject::changeColour ( ngl::Vector  _assignedColour)

This method will change the colour of fuel to the assigned colour value.

Parameters:
_assignedColouris 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.

Parameters:
_decreasedAmountis 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.

Returns:
m_currentColour which is the colour vector of fuel

Definition at line 100 of file FuelObject.cpp.

References m_currentColour.

{
    return m_currentColour;
}

Here is the caller graph for this function:

float FuelObject::getCurrentFuelValue ( )

This method will return the current fuel value of fuel.

Returns:
m_fuel variable to tell how much fuel does the fuel has left

Definition at line 205 of file FuelObject.cpp.

References m_fuel.

{
    return m_fuel;
}

Here is the caller graph for this function:

float FuelObject::getHeight ( )

This method will return the height value of fuel.

Returns:
m_objectHeight the fuel's height

Definition at line 66 of file FuelObject.cpp.

References m_objectHeight.

{
    return m_objectHeight;
}

Here is the caller graph for this function:

float FuelObject::getMoisture ( )

This method will return the moisture value of fuel.

Returns:
m_moisture the current 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.

Returns:
m_position that is the fuel position of fuel

Definition at line 94 of file FuelObject.cpp.

References m_position.

{
    return m_position;
}

Here is the caller graph for this function:

float FuelObject::getRadius ( )

This method will return the radius of fuel.

Returns:
m_objectRadius the radius value of fuel

Definition at line 60 of file FuelObject.cpp.

References m_objectRadius.

{
    return m_objectRadius;
}

Here is the caller graph for this function:

int FuelObject::getShape ( )

This method will return shape of fuel.

Returns:
m_objectShape the shape of fuel

Definition at line 88 of file FuelObject.cpp.

References m_objectShape.

{
    return m_objectShape;
}

Here is the caller graph for this function:

bool FuelObject::isBurning ( )

This method will return the current status of each fuel that is burning or not.

Returns:
m_isBurning variable to identify that the fuel 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.

Returns:
m_isFlammable variable to identify that the fuel is flamable 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.

Parameters:
_fuelis 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.

Parameters:
_newFuelis 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;
}

Here is the caller graph for this function:

void FuelObject::setHeight ( float  _newHeight)

This method will set height of fuel.

Parameters:
_newHeightis the new height of fuel

Definition at line 72 of file FuelObject.cpp.

References m_objectHeight.

{
    m_objectHeight = _newHeight;
}

Here is the caller graph for this function:

void FuelObject::setPosition ( ngl::Vector  _newPos)

This method will set the new position to the object.

Parameters:
_newPosis 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.

Parameters:
_newRadiousis the new radius

Definition at line 80 of file FuelObject.cpp.

References m_objectRadius.

{
    m_objectRadius = _newRadious;
}

Here is the caller graph for this function:

void FuelObject::subtractFuel ( float  _decreaseAmount)

This method will decrease the fuel amount of fuel.

Parameters:
_decreaseAmountis 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);
    }

}

Member Data Documentation

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.

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator