示例#1
0
OsmPlugin::OsmPlugin( QObject *parent ) : RunnerPlugin( parent )
{
    setCapabilities( Parsing );
    setName( tr( "Osm File Parser" ) );
    setNameId( "Osm" );
    setDescription( tr( "Create GeoDataDocument from Osm Files" ) );
    setGuiString( tr( "Osm Parser" ) );
}
示例#2
0
LampTile::LampTile(int blockId, const std::string& texture, Material const* material) : Tile(blockId, texture, material) {
	init();
	if(isLit()) setLightEmission(1.0F);
	creativeTab = CreativeTab::ITEMS;
	setNameId("redstoneLight");
	destroyTime = 0.3F;
	soundType = &Tile::SOUND_GLASS;
}
CookieJarTile::CookieJarTile(int id, Material const* material) : FurnitureTile(id, material){
     init();
	setNameId("tileCookieJar");
	setSoundType(Tile::SOUND_GLASS);
	Tile::solid[id] = false;
	Tile::lightBlock[id] = 0;
	renderPass = Tile::glass->renderPass;
}
示例#4
0
ButtonTile::ButtonTile(int blockId, const std::string& texture, Material const* material) : Tile(blockId, texture, material) {
	init();
	setNameId("button");
	Tile::solid[id] = false;
	Tile::lightBlock[id] = 0;
	setTicking(true);
	destroyTime = 0.5;
	creativeTab = CreativeTab::ITEMS;
}
RedstoneWireTile::RedstoneWireTile(int blockId, const std::string& texture, const Material* material) : Tile(blockId, texture, material) {
	init();
	renderType = 5;
	renderPass = 3;
	setVisualShape(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
	Tile::solid[blockId] = false;
	Tile::lightBlock[blockId] = 0;
	setDestroyTime(0.0F);
	setNameId("redstoneDust");
}
示例#6
0
RoutinoPlugin::RoutinoPlugin( QObject *parent ) : RunnerPlugin( parent )
{
    setCapabilities( Routing );
    setSupportedCelestialBodies( QStringList() << "earth" );
    setCanWorkOffline( true );
    setName( tr( "Routino" ) );
    setNameId( "routino" );
    setDescription( tr( "Retrieves routes from routino" ) );
    setGuiString( tr( "Routino Routing" ) );
}
示例#7
0
LeverTile::LeverTile(int blockId, const std::string& texture, Material const* material) : Tile(blockId, texture, material) {
	init();
	setNameId("lever");
	Tile::solid[id] = false;
	Tile::lightBlock[id] = 0;
	creativeTab = CreativeTab::ITEMS;
	renderType = 12;
	destroyTime = 0.5;
	renderPass = 3;
}
CoffeeTableTile::CoffeeTableTile(int id, std::string name, FurnitureTileAttributes attributes, int item) : FurnitureTile(id, attributes.realMaterial) {
	Tile::solid[id] = false;
	Tile::lightBlock[id] = 0;

	setNameId(name);
	setSoundType(attributes.sounds);
	setDestroyTime(attributes.hardness);
	tex = attributes.primary_tex;
	secondary_tex = attributes.secondary_tex;
	droppedItem = item;
}
BarStoolTile::BarStoolTile(int id, Material const* material) : FurnitureTile(id, material) {
	tex = getTextureUVCoordinateSet("wool", 0);
	secondary_tex = getTextureUVCoordinateSet("stained_clay", 9);
	terciary_tex = getTextureUVCoordinateSet("quartz_block", 0);
	quartenary_tex = getTextureUVCoordinateSet("stone", 0);

	
	setNameId("tileBarStool");
	setSoundType(Tile::SOUND_WOOD);
	Tile::solid[id] = false;
	Tile::lightBlock[id] = 0;
}
示例#10
0
RepeaterTile::RepeaterTile(int blockId, const std::string& texture, bool powered) : Tile(blockId, texture, &Material::circuits) {
    init();
    side_texture = getTextureUVCoordinateSet("stone_slab", 0);
    renderType = 15;
    renderPass = 7;
	creativeTab = CreativeTab::ITEMS;
    solid[blockId] = false;
    lightBlock[blockId] = 0;
    setVisualShape(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
	setNameId("diode");
    this->powered = powered;
}
示例#11
0
PistonArmTile::PistonArmTile(int blockId) : Tile(blockId, &Material::stone) {
	init();
	
	setDestroyTime(0.5F);
	setNameId("piston_extension");
	renderType = 17;
	creativeTab = CreativeTab::ITEMS;
	Tile::solid[blockId] = false;
	Tile::lightBlock[blockId] = 0;

	tex = getTextureUVCoordinateSet("piston_top_normal", 0);
	texture_sticky = getTextureUVCoordinateSet("piston_top_sticky", 0);
	texture_side = getTextureUVCoordinateSet("piston_side", 0);
}
示例#12
0
OpenCachingPlugin::OpenCachingPlugin()
    : m_isInitialized( false ),
      m_configDialog( 0 )
{
    setNameId( "opencaching" );
    setVersion( "1.0" );
    setCopyrightYear( 2011 );
    addAuthor( "Daniel Marth", "*****@*****.**" );
    setDataText( tr( "Cache positions by opencaching.de." ) );

    setEnabled( true );  // Plugin is enabled by default
    setVisible( false ); // Plugin is invisible by default
    connect( this, SIGNAL(settingsChanged(QString)),
             this, SLOT(updateSettings()) );
}
示例#13
0
EarthquakePlugin::EarthquakePlugin()
    : m_isInitialized( false ),
      m_configDialog( 0 )
{
    setNameId( "earthquake" );
    setVersion( "1.0" );
    setCopyrightYears( QList<int>() << 2010 << 2011 );
    addAuthor( QString::fromUtf8( "Utku Aydın" ), "*****@*****.**" );
    addAuthor( "Daniel Marth", "*****@*****.**" );

    setEnabled( true ); // Plugin is enabled by default
    setVisible( false ); // Plugin is invisible by default
    connect( this, SIGNAL( settingsChanged( QString ) ),
             this, SLOT( updateSettings() ) );
}
示例#14
0
RedstoneWireTile::RedstoneWireTile(int id): Tile(id, &Material::decoration) {
	tex = getTextureUVCoordinateSet("redstone_dust_cross", 0);
	//secondary_tex = getTextureUVCoordinateSet("redstone_dust_line", 0);
	
	init();
	setNameId("redstone");
	setShape(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
	setCategory(3);
	setSoundType(Tile::SOUND_STONE);
	
	Tile::solid[id] = false;
	Tile::lightBlock[id] = 0;
	
	new TileItem(id - 256);
}
示例#15
0
/****************************************************************************
Desc:	Populate a vector's data components from the data part of a key.
****************************************************************************/
RCODE F_DataVector::inputData(
	IXD *					pIxd,
	const FLMBYTE *	pucData,
	FLMUINT				uiInputLen)
{
	RCODE			rc = NE_XFLM_OK;
	ICD *			pIcd = pIxd->pFirstData;
	FLMUINT		uiDataComponent = 0;
	FLMUINT		uiDataLength;
	FLMUINT		uiSENLen;

	while (pIcd)
	{
		if (!uiInputLen)
		{
			break;
		}

		// Get the data length - it is stored as a SEN

		uiSENLen = f_getSENLength( *pucData);
		if (uiSENLen > uiInputLen)
		{
			rc = RC_SET( NE_XFLM_DATA_ERROR);
			goto Exit;
		}

		if( RC_BAD( rc = f_decodeSEN( &pucData,
			&pucData[ uiSENLen], &uiDataLength)))
		{
			goto Exit;
		}

		uiInputLen -= uiSENLen;
		if (uiDataLength > uiInputLen)
		{
			rc = RC_SET( NE_XFLM_DATA_ERROR);
			goto Exit;
		}

		// Store the name ID

		if (RC_BAD( rc = setNameId( uiDataComponent + pIxd->uiNumKeyComponents,
									pIcd->uiDictNum,
									(FLMBOOL)((pIcd->uiFlags & ICD_IS_ATTRIBUTE)
												 ? TRUE
												 : FALSE), TRUE)))
		{
			goto Exit;
		}

		// Store the data into the vector.

		if (RC_BAD( rc = storeValue( uiDataComponent + pIxd->uiNumKeyComponents,
									icdGetDataType( pIcd),
									pucData, uiDataLength, NULL)))
		{
			goto Exit;
		}
		pucData += uiDataLength;
		uiInputLen -= uiDataLength;
		pIcd = pIcd->pNextDataComponent;
		uiDataComponent++;
	}

	// Output the remaining name IDs, even if the data is missing.

	while (pIcd)
	{

		// Store the name ID

		if (RC_BAD( rc = setNameId( uiDataComponent + pIxd->uiNumKeyComponents,
									pIcd->uiDictNum,
									(FLMBOOL)((pIcd->uiFlags & ICD_IS_ATTRIBUTE)
												 ? TRUE
												 : FALSE), TRUE)))
		{
			goto Exit;
		}

		pIcd = pIcd->pNextDataComponent;
		uiDataComponent++;
	}

Exit:

	return( rc);
}
示例#16
0
/****************************************************************************
Desc:	Populate a vector's components from the key part of an index key.
****************************************************************************/
RCODE F_DataVector::inputKey(
	IXD *					pIxd,
	const FLMBYTE *	pucKey,
	FLMUINT				uiKeyLen)
{
	RCODE					rc = NE_XFLM_OK;
	const FLMBYTE *	pucKeyEnd = pucKey + uiKeyLen;
	FLMBYTE				ucDataBuf [XFLM_MAX_KEY_SIZE];
	FLMUINT				uiDataLen;
	ICD *					pIcd;
	FLMUINT				uiLanguage = pIxd->uiLanguage;
	FLMUINT				uiComponentLen;
	FLMUINT				uiDataType;
	FLMBOOL				bDataRightTruncated;
	FLMBOOL				bFirstSubstring;
	FLMBOOL				bIsText;
	FLMUINT				uiComponent;
	FLMUINT64			ui64Id;
	FLMUINT				uiDictNumber;

	flmAssert( uiKeyLen);

	// Loop for each compound piece of key

	uiComponent = 0;
	pIcd = pIxd->pFirstKey;
	while (pIcd)
	{
		if (uiKeyLen < 2)
		{
			rc = RC_SET_AND_ASSERT( NE_XFLM_BTREE_ERROR);
			goto Exit;
		}
		
		uiComponentLen = getKeyComponentLength( pucKey);
		bDataRightTruncated = isKeyComponentTruncated( pucKey);
		uiKeyLen -= 2;
		pucKey += 2;
		
		if (uiComponentLen > uiKeyLen)
		{
			rc = RC_SET_AND_ASSERT( NE_XFLM_BTREE_ERROR);
			goto Exit;
		}
		
		bFirstSubstring = FALSE;
		bIsText = (icdGetDataType( pIcd) == XFLM_TEXT_TYPE &&
					  !(pIcd->uiFlags & (ICD_PRESENCE | ICD_METAPHONE)))
					 ? TRUE
					 : FALSE;

		uiDataType = icdGetDataType( pIcd);
		uiDictNumber = pIcd->uiDictNum;
		if (uiComponentLen)
		{
			if (pIcd->uiFlags & ICD_PRESENCE)
			{
				FLMUINT	uiNum;
				
				if (uiComponentLen != 4 || bDataRightTruncated)
				{
					rc = RC_SET_AND_ASSERT( NE_XFLM_BTREE_ERROR);
					goto Exit;
				}
				
				uiNum = (FLMUINT)f_bigEndianToUINT32( pucKey);
	
				// What is stored in the key better match the dictionary
				// number of the ICD.
	
				if (pIcd->uiDictNum != ELM_ROOT_TAG)
				{
					if (uiNum != uiDictNumber)
					{
						rc = RC_SET_AND_ASSERT( NE_XFLM_BTREE_ERROR);
						goto Exit;
					}
				}
				else
				{
					uiDictNumber = uiNum;
				}
				if (RC_BAD( rc = setUINT( uiComponent, uiNum)))
				{
					goto Exit;
				}
			}
			else if (pIcd->uiFlags & ICD_METAPHONE)
			{
				uiDataLen = sizeof( ucDataBuf);
	
				if ( uiComponentLen)
				{
					if( RC_BAD( rc = flmCollationNum2StorageNum( pucKey,
						uiComponentLen, ucDataBuf, &uiDataLen)))
					{
						goto Exit;
					}
				}
				else
				{
					uiDataLen = 0;
				}
	
				if (bDataRightTruncated)
				{
					rc = RC_SET_AND_ASSERT( NE_XFLM_BTREE_ERROR);
					goto Exit;
				}
	
				// Allocate and copy value into the component.  NOTE:
				// storeValue handles zero length data.
	
				if (RC_BAD( rc = storeValue( uiComponent, XFLM_NUMBER_TYPE, 
														ucDataBuf, uiDataLen)))
				{
					goto Exit;
				}
			}
			else
			{
	
				// Grab only the Nth section of key if compound key
	
				switch (uiDataType)
				{
					case XFLM_TEXT_TYPE:
					{
						FLMBOOL bTmpTruncated = FALSE;
	
						if (uiComponentLen)
						{
							uiDataLen = sizeof( ucDataBuf);
							if (RC_BAD( rc = flmColText2StorageText( pucKey,
								uiComponentLen,
								ucDataBuf, &uiDataLen, uiLanguage,
								&bTmpTruncated, &bFirstSubstring)))
							{
								goto Exit;
							}
							
							if (bTmpTruncated != bDataRightTruncated)
							{
								rc = RC_SET_AND_ASSERT( NE_XFLM_BTREE_ERROR);
								goto Exit;
							}
						}
						else
						{
							uiDataLen = 0;
						}
						break;
					}
	
					case XFLM_NUMBER_TYPE:
					{
						if (uiComponentLen)
						{
							uiDataLen = sizeof( ucDataBuf);
							if( RC_BAD( rc = flmCollationNum2StorageNum( pucKey,
								uiComponentLen, ucDataBuf, &uiDataLen)))
							{
								goto Exit;
							}
						}
						else
						{
							uiDataLen = 0;
						}
						
						if (bDataRightTruncated)
						{
							rc = RC_SET_AND_ASSERT( NE_XFLM_BTREE_ERROR);
							goto Exit;
						}
						break;
					}
	
					case XFLM_BINARY_TYPE:
					{
						uiDataLen = uiComponentLen;
						if (uiComponentLen > sizeof( ucDataBuf))
						{
							rc = RC_SET( NE_XFLM_CONV_DEST_OVERFLOW);
							goto Exit;
						}
						if (uiComponentLen)
						{
							f_memcpy( ucDataBuf, pucKey, uiComponentLen);
						}
						break;
					}
	
					default:
						rc = RC_SET( NE_XFLM_DATA_ERROR);
						goto Exit;
				}
	
				// Allocate and copy value into the component.  NOTE:
				// storeValue handles zero length data.
	
				if (RC_BAD( rc = storeValue( uiComponent, uiDataType, ucDataBuf,
											uiDataLen)))
				{
					goto Exit;
				}
	
				// Set first sub-string and truncated flags.
	
				if ((pIcd->uiFlags & ICD_SUBSTRING) && !bFirstSubstring)
				{
					setLeftTruncated( uiComponent);
				}
				if (bDataRightTruncated)
				{
					setRightTruncated( uiComponent);
				}
			}
		}
		else
		{
			if ((pIcd->uiFlags & ICD_PRESENCE) && uiDictNumber == ELM_ROOT_TAG)
			{
				uiDictNumber = 0;
			}
		}

		// Store the name ID

		if (RC_BAD( rc = setNameId( uiComponent, uiDictNumber,
								(FLMBOOL)((pIcd->uiFlags & ICD_IS_ATTRIBUTE)
											 ? TRUE
											 : FALSE), FALSE)))
		{
			goto Exit;
		}

		// Position to the end of this component

		flmAssert( uiKeyLen >= uiComponentLen);
		pucKey += uiComponentLen;
		uiKeyLen -= uiComponentLen;
		uiComponent++;

		pIcd = pIcd->pNextKeyComponent;
	}
	
	// See if we have a document ID.
	
	if (RC_BAD( rc = f_decodeSEN64( &pucKey, pucKeyEnd, &m_ui64DocumentID)))
	{
		goto Exit;
	}
	
	// Get the node IDs for the key components, if any

	pIcd = pIxd->pFirstKey;
	uiComponent = 0;
	while (pIcd)
	{
		
		// Extract the component node ID

		if (RC_BAD( rc = f_decodeSEN64( &pucKey, pucKeyEnd, &ui64Id)))
		{
			goto Exit;
		}
		
		// No need to store if it is zero
		
		if (ui64Id)
		{
			if (RC_BAD( rc = setID( uiComponent, ui64Id)))
			{
				goto Exit;
			}
		}
		uiComponent++;
		pIcd = pIcd->pNextKeyComponent;
	}

	// Get the node IDs for the data components, if any

	pIcd = pIxd->pFirstData;
	while (pIcd)
	{

		// Extract the component node ID

		if (RC_BAD( rc = f_decodeSEN64( &pucKey, pucKeyEnd, &ui64Id)))
		{
			goto Exit;
		}
		
		// No need to store if it is zero
		
		if (ui64Id)
		{
			if (RC_BAD( rc = setID( uiComponent, ui64Id)))
			{
				goto Exit;
			}
		}
		
		// Store the name ID

		if (RC_BAD( rc = setNameId( uiComponent, pIcd->uiDictNum,
											(FLMBOOL)((pIcd->uiFlags & ICD_IS_ATTRIBUTE)
												 ? TRUE
												 : FALSE), TRUE)))
		{
			goto Exit;
		}
		uiComponent++;
		pIcd = pIcd->pNextDataComponent;
	}

	// Get the node IDs for the context components, if any

	pIcd = pIxd->pFirstContext;
	while (pIcd)
	{

		// Extract the component node ID

		if (RC_BAD( rc = f_decodeSEN64( &pucKey, pucKeyEnd, &ui64Id)))
		{
			goto Exit;
		}
		
		// No need to store if it is zero
		
		if (ui64Id)
		{
			if (RC_BAD( rc = setID( uiComponent, ui64Id)))
			{
				goto Exit;
			}
		}
		
		// Store the name ID

		if (RC_BAD( rc = setNameId( uiComponent, pIcd->uiDictNum,
											(FLMBOOL)((pIcd->uiFlags & ICD_IS_ATTRIBUTE)
												 ? TRUE
												 : FALSE), TRUE)))
		{
			goto Exit;
		}
		uiComponent++;
		pIcd = pIcd->pNextKeyComponent;
	}

Exit:

	return( rc);
}