ICT290 / src / ShaysWorld / PlaneNode.h
PlaneNode.h
Raw
//  PlaneNode.h
//  Header file for the PlaneNode class
//  Stores details for each plane.  Each node is stored in each link of the
//  Plane Linked List

//  Shay Leary, April 2005
//--------------------------------------------------------------------------------------

#pragma once

//--------------------------------------------------------------------------------------

#include "../glIncludes.h"

#include <cmath>
#include <iostream>

class PlaneNode {
   public:
    PlaneNode() { Clear(); }
    virtual ~PlaneNode() { Clear(); }

    //----------------------------------------------------------------------------------

    void Clear();

    //----------------------------------------------------------------------------------
    //  Get Methods
    //----------------------------------------------------------------------------------
    GLdouble GetType() { return m_type; }
    GLdouble GetXstart() { return m_xPlaneStart; }
    GLdouble GetXend() { return m_xPlaneEnd; }
    GLdouble GetYstart() { return m_yPlaneStart; }
    GLdouble GetYend() { return m_yPlaneEnd; }
    GLdouble GetZstart() { return m_zPlaneStart; }
    GLdouble GetZend() { return m_zPlaneEnd; }

    // Return the address of the link to the next node in the list
    PlaneNode* GetNext() const { return m_next; }

    //----------------------------------------------------------------------------------
    //  Set Methods
    //----------------------------------------------------------------------------------
    void SetData(const int tempType,
                 const GLdouble tempXs,
                 const GLdouble tempXe,
                 const GLdouble tempYs,
                 const GLdouble tempYe,
                 const GLdouble tempZs,
                 const GLdouble tempZe);

    // Set the address of the link to the next node in the list
    void SetNext(PlaneNode* next) { m_next = next; }

   private:
    // The address of the next node in the list
    PlaneNode* m_next;

    // Stores type of plain:
    // (0: flat plane)
    // (1: incline from z to y)
    // (2: incline from x to y)
    GLdouble m_type;

    // stores start and end co-ordinates of plane on x, y and z axis
    GLdouble m_xPlaneStart, m_xPlaneEnd;
    GLdouble m_yPlaneStart, m_yPlaneEnd;
    GLdouble m_zPlaneStart, m_zPlaneEnd;

    //----------------------------------------------------------------------------------

    // Privatised copy constructor and assignment operator
    PlaneNode(const PlaneNode&) = default;
    PlaneNode& operator=(const PlaneNode&) = default;
};

//--------------------------------------------------------------------------------------