legendParamater.cpp 1.4 KB
#include "legendParamater.h"

namespace DmapCore_30
{
    legendParamater::legendParamater(/* args */)
    {
        index = 0;

        rowspacing = 15;

        size_x = 30;
        
        size_y = 15;

        pixYIndex = 10;

        pixXIndex = 20;

        fontSize = 10;

        current_Col_Index = 0;

        max_pixXIndex = 10;
        max_pixYIndex = 10;
    }
    
    legendParamater::~legendParamater()
    {
    }

    bool legendParamater::next(char * title)
    {
        if( row_maxsize >0  && index/row_maxsize > current_Col_Index)
        {
              current_Col_Index ++;
              pixXIndex = 10 + (current_Col_Index *100);
              pixYIndex = 10;

            if(pixXIndex> max_pixXIndex)
            {
               max_pixXIndex = pixXIndex;
            }
              
        }
        if(title == nullptr)
        {
          
           index ++;
           provTitle ="";

           pixYIndex += (rowspacing + size_y);

           if(pixYIndex> max_pixYIndex)
           {
               max_pixYIndex = pixYIndex;
           }
           return true;
        }
        string str_title = title;
        if(str_title != provTitle)
        {
           index ++;
            provTitle =str_title;
           pixYIndex += (rowspacing + size_y);
           if(pixYIndex> max_pixYIndex)
           {
               max_pixYIndex = pixYIndex;
           }
           return true;
        }
        
        return true;
       
    }

}