Ejemplo n.º 1
0
	bool Encode(uchar symbol, Output& result)
	{
		if(symbol == ' ')
		{
			LoadFromAddress(AddressOf(Space), result);
			return true;
		}

		if(!ConvertSymbol(symbol, symbol))
		{
			return false;
		}

		LoadFromAddress(AddressOf(MorseTable[symbol - '0']), result);
	
		return true;
	}
Ejemplo n.º 2
0
//////////////////////////////////////////////////////////////////////////////
// Checks if a style is already cached and returns it if it is.
// Otherwise evaluates a style and if it is constant, caches it
// in a hashtable.
void PointAdapter::ObtainStyle(MdfModel::PointSymbolization2D* psym, RS_MarkerDef& mdef)
{
    RS_MarkerDef* cachedStyle = m_hPointSymCache[psym];

    if (cachedStyle)
    {
        mdef = *cachedStyle;
    }
    else
    {
        bool cacheable = ConvertSymbol(psym->GetSymbol(), mdef);
        if (cacheable)
        {
            RS_MarkerDef* rsmdef = new RS_MarkerDef();
            *rsmdef = mdef;

            m_hPointSymCache[psym] = rsmdef;
        }
    }
}