Example #1
0
	//!Returns current colour (either the current data's colour or the current layer's one)
	bool getCurrentColour( colorType ccColour[/*3*/] )
	{
		const DL_Attributes attributes = getAttributes();

		int colourIndex = attributes.getColor();

		if ( colourIndex == 0 )
		{
			// TODO Colours BYBLOCK not handled
			return false;
		}
		else if ( colourIndex == 256 )
		{
			// an attribute of 256 means the colours are BYLAYER, so grab it from our map instead
			const int defaultIndex = -1;
			colourIndex = m_layerColourMap.value( attributes.getLayer().c_str(), defaultIndex );

			//if we don't have any information on the current layer
			if (colourIndex == defaultIndex)
				return false;
		}

		ccColour[0] = static_cast<colorType>( dxfColors[colourIndex][0] * MAX_COLOR_COMP );
		ccColour[1] = static_cast<colorType>( dxfColors[colourIndex][1] * MAX_COLOR_COMP );
		ccColour[2] = static_cast<colorType>( dxfColors[colourIndex][2] * MAX_COLOR_COMP );

		return true;
	}
Example #2
0
//=============================================================================
void sstDxf02TypBaseCls::BaseReadFromDL(const DL_Attributes oDLAttrib)
{
  // this->dLinetypeID = oDLAttrib.getLineType();
  this->color = oDLAttrib.getColor();
  this->color24 = oDLAttrib.getColor24();
  this->width = oDLAttrib.getWidth();
  this->handle = oDLAttrib.getHandle();
}