• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetLayer函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetLayer函数的典型用法代码示例。如果您正苦于以下问题:C++ GetLayer函数的具体用法?C++ GetLayer怎么用?C++ GetLayer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetLayer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetScreenY

int Game_Character::GetScreenZ() const {
	int z = this == Main_Data::game_player.get() ? 1 : 0;

	// For events on the screen, this should be inside a 0-40 range
	z += GetScreenY() >> 3;

	z += GetLayer() * 50;

	return z;
}
开发者ID:KitoHo,项目名称:Player,代码行数:10,代码来源:game_character.cpp


示例2: GetWorld

CCommonCtrl::~CCommonCtrl()
{
#if !defined(__CLIENT)
	#ifdef __LAYER_1021
	GetWorld()->m_respawner.Increment( GetRespawn(), m_nRespawnType, FALSE, GetLayer() );
	#else	// __LAYER_1021
	GetWorld()->m_respawner.Increment( GetRespawn(), m_nRespawnType, FALSE );
	#endif	// __LAYER_1021
#endif
}
开发者ID:careysky,项目名称:FlyFF,代码行数:10,代码来源:CommonCtrl.cpp


示例3: RenderSprite

void CComponent_Items::RenderSprite(const CNetObj_TU_Sprite *pPrev, const CNetObj_TU_Sprite *pCurrent)
{
	if(pCurrent->m_ItemLayer != GetLayer()) return;

	float Angle = mix(2.0*pi*static_cast<float>(pPrev->m_Angle)/360.0f, 2.0*pi*static_cast<float>(pCurrent->m_Angle)/360.0f, Client()->IntraGameTick());
	float Size = mix(pPrev->m_Size, pCurrent->m_Size, Client()->IntraGameTick());
	vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());
	
	TUKernel()->AssetsRenderer()->DrawSprite(pCurrent->m_SpriteId, Pos, Size, Angle, 0x0, 1.0f);
}
开发者ID:teeworlds-modapi,项目名称:teeworlds,代码行数:10,代码来源:items.cpp


示例4: GetPlotOptions

bool PLOT_CONTROLLER::OpenPlotfile( const wxString &aSuffix,
                                    PlotFormat     aFormat,
                                    const wxString &aSheetDesc )
{
    LOCALE_IO toggle;

    /* Save the current format: sadly some plot routines depends on this
       but the main reason is that the StartPlot method uses it to
       dispatch the plotter creation */
    GetPlotOptions().SetFormat( aFormat );

    // Ensure that the previous plot is closed
    ClosePlot();

    // Now compute the full filename for the output and start the plot
    // (after ensuring the output directory is OK)
    wxString outputDirName = GetPlotOptions().GetOutputDirectory() ;
    wxFileName outputDir = wxFileName::DirName( outputDirName );
    wxString boardFilename = m_board->GetFileName();

    if( EnsureFileDirectoryExists( &outputDir, boardFilename ) )
    {
        // outputDir contains now the full path of plot files
        m_plotFile = boardFilename;
        m_plotFile.SetPath( outputDir.GetPath() );
        wxString fileExt = GetDefaultPlotExtension( aFormat );

        // Gerber format can use specific file ext, depending on layers
        // (now not a good practice, because the official file ext is .gbr)
        if( GetPlotOptions().GetFormat() == PLOT_FORMAT_GERBER &&
            GetPlotOptions().GetUseGerberProtelExtensions() )
            fileExt = GetGerberProtelExtension( GetLayer() );

        // Build plot filenames from the board name and layer names:
        BuildPlotFileName( &m_plotFile, outputDir.GetPath(), aSuffix, fileExt );

        m_plotter = StartPlotBoard( m_board, &GetPlotOptions(), ToLAYER_ID( GetLayer() ),
                                    m_plotFile.GetFullPath(), aSheetDesc );
    }

    return( m_plotter != NULL );
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:42,代码来源:pcbplot.cpp


示例5: RenderModAPISprite

void CModAPI_Component_Items::RenderModAPISprite(const CNetObj_ModAPI_Sprite *pPrev, const CNetObj_ModAPI_Sprite *pCurrent)
{
    if(pCurrent->m_ItemLayer != GetLayer()) return;
    if(!ModAPIGraphics()) return;

    float Angle = mix(2.0*pi*static_cast<float>(pPrev->m_Angle)/360.0f, 2.0*pi*static_cast<float>(pCurrent->m_Angle)/360.0f, Client()->IntraGameTick());
    float Size = mix(pPrev->m_Size, pCurrent->m_Size, Client()->IntraGameTick());
    vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());

    ModAPIGraphics()->DrawSprite(RenderTools(), pCurrent->m_SpriteId, Pos, Size, Angle, 0);
}
开发者ID:teeworlds-modapi,项目名称:mod-target,代码行数:11,代码来源:items.cpp


示例6: GetLayer

void
LayerComposite::AddBlendModeEffect(EffectChain& aEffectChain)
{
  gfx::CompositionOp blendMode = GetLayer()->GetEffectiveMixBlendMode();
  if (blendMode == gfx::CompositionOp::OP_OVER) {
    return;
  }

  aEffectChain.mSecondaryEffects[EffectTypes::BLEND_MODE] = new EffectBlendMode(blendMode);
  return;
}
开发者ID:rtrsparq,项目名称:gecko-dev,代码行数:11,代码来源:LayerManagerComposite.cpp


示例7: GetLayer

	void DeferredRenderQueue::AddMesh(int renderOrder, const Material* material, const MeshData& meshData, const Boxf& meshAABB, const Matrix4f& transformMatrix)
	{
		if (material->IsBlendingEnabled() || material->IsDepthSortingEnabled()) //< Fixme: Deferred Shading should be able to handle depth sorting
			// Deferred Shading cannot handle blended objects, put them in the forward list
			m_forwardQueue->AddMesh(renderOrder, material, meshData, meshAABB, transformMatrix);
		else
		{
			Layer& currentLayer = GetLayer(renderOrder);
			MeshPipelineBatches& opaqueModels = currentLayer.opaqueModels;

			const MaterialPipeline* materialPipeline = material->GetPipeline();

			auto pipelineIt = opaqueModels.find(materialPipeline);
			if (pipelineIt == opaqueModels.end())
			{
				BatchedMaterialEntry materialEntry;
				pipelineIt = opaqueModels.insert(MeshPipelineBatches::value_type(materialPipeline, std::move(materialEntry))).first;
			}

			BatchedMaterialEntry& materialEntry = pipelineIt->second;
			MeshMaterialBatches& materialMap = materialEntry.materialMap;

			auto materialIt = materialMap.find(material);
			if (materialIt == materialMap.end())
			{
				BatchedModelEntry entry;
				entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &DeferredRenderQueue::OnMaterialInvalidation);

				materialIt = materialMap.insert(MeshMaterialBatches::value_type(material, std::move(entry))).first;
			}

			BatchedModelEntry& entry = materialIt->second;
			entry.enabled = true;

			MeshInstanceContainer& meshMap = entry.meshMap;

			auto it2 = meshMap.find(meshData);
			if (it2 == meshMap.end())
			{
				MeshInstanceEntry instanceEntry;
				if (meshData.indexBuffer)
					instanceEntry.indexBufferReleaseSlot.Connect(meshData.indexBuffer->OnIndexBufferRelease, this, &DeferredRenderQueue::OnIndexBufferInvalidation);

				instanceEntry.vertexBufferReleaseSlot.Connect(meshData.vertexBuffer->OnVertexBufferRelease, this, &DeferredRenderQueue::OnVertexBufferInvalidation);

				it2 = meshMap.insert(std::make_pair(meshData, std::move(instanceEntry))).first;
			}

			std::vector<Matrix4f>& instances = it2->second.instances;
			instances.push_back(transformMatrix);

			materialEntry.maxInstanceCount = std::max(materialEntry.maxInstanceCount, instances.size());
		}
	}
开发者ID:Ardakaniz,项目名称:NazaraEngine,代码行数:54,代码来源:DeferredRenderQueue.cpp


示例8: main

int main()
{
	
	FILE* fp = nullptr;
	fopen_s(&fp, "import.psd", "rb");

	if (fp == nullptr) return 0;

	std::vector<uint8_t> data;
	fseek(fp, 0, SEEK_END);
	auto length = ftell(fp);
	fseek(fp, 0, SEEK_SET);

	data.resize(length);
	fread(data.data(), 1, length, fp);
	fclose(fp);

	auto doc = PSDParser::Document::Create(data.data(), data.size());

	for (auto i = 0; i < doc->GetLayerCount(); i++)
	{
		auto layer = doc->GetLayer(i);

		auto name = layer->GetName();
		auto rect = layer->GetRect();
		
		std::vector<uint8_t> bmp;
		auto height = rect.Bottom - rect.Top;
		auto width = rect.Right - rect.Left;
		bmp.resize(width * height * 4);

		for (int32_t y = 0; y < height; y++)
		{
			for (int32_t x = 0; x < width; x++)
			{
				auto p = (uint8_t*) layer->GetData();

				bmp[(x + y * width) * 4 + 0] = p[x * 4 + width * y + 0];
				bmp[(x + y * width) * 4 + 1] = p[x * 4 + width * y + 1];
				bmp[(x + y * width) * 4 + 2] = p[x * 4 + width * y + 2];
				bmp[(x + y * width) * 4 + 3] = p[x * 4 + width * y + 3];

			}
		}

		

		BitmapWriter::Write("test.bmp", (uint32_t*)(bmp.data()), width, height);

		//break;
	}

	return 0;
}
开发者ID:altseed,项目名称:Altseed,代码行数:54,代码来源:main.cpp


示例9: RenderModAPIText

void CModAPI_Component_Items::RenderModAPIText(const CNetObj_ModAPI_Text *pPrev, const CNetObj_ModAPI_Text *pCurrent)
{
    if(pCurrent->m_ItemLayer != GetLayer()) return;
    if(!TextRender()) return;

    vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());

    char aText[64];
    IntsToStr(pCurrent->m_aText, 16, &aText[0]);

    ModAPIGraphics()->DrawText(TextRender(), aText, Pos, ModAPI_IntToColor(pCurrent->m_Color), pCurrent->m_Size, pCurrent->m_Alignment);
}
开发者ID:teeworlds-modapi,项目名称:mod-target,代码行数:12,代码来源:items.cpp


示例10: GetLayer

Matrix4x4
HostLayer::GetShadowTransform() {
  Matrix4x4 transform = mShadowTransform;
  Layer* layer = GetLayer();

  transform.PostScale(layer->GetPostXScale(), layer->GetPostYScale(), 1.0f);
  if (const ContainerLayer* c = layer->AsContainerLayer()) {
    transform.PreScale(c->GetPreXScale(), c->GetPreYScale(), 1.0f);
  }

  return transform;
}
开发者ID:ollie314,项目名称:gecko-dev,代码行数:12,代码来源:LayerManagerComposite.cpp


示例11: CheckEventTriggerTouch

bool Game_Event::CheckEventTriggerTouch(int x, int y) {
	if (Game_Map::GetInterpreter().IsRunning())
		return false;

	if (trigger == RPG::EventPage::Trigger_collision && !IsJumping()) {
		if (Main_Data::game_player->IsInPosition(GetX(), GetY()) && GetLayer() == RPG::EventPage::Layers_same) {
			return false;
		}

		if (Main_Data::game_player->IsInPosition(x, y) && !Main_Data::game_player->IsBlockedByMoveRoute()) {
			if (Main_Data::game_player->InAirship() && GetLayer() == RPG::EventPage::Layers_same) {
				return false;
			}

			Start();
			return true;
		}
	}

	return false;
}
开发者ID:Zegeri,项目名称:Player,代码行数:21,代码来源:game_event.cpp


示例12: NEGATE

void DRAWSEGMENT::Flip( const wxPoint& aCentre )
{
    m_Start.y  = aCentre.y - (m_Start.y - aCentre.y);
    m_End.y  = aCentre.y - (m_End.y - aCentre.y);

    if( m_Shape == S_ARC )
    {
        NEGATE( m_Angle );
    }

    SetLayer( FlipLayer( GetLayer() ) );
}
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:12,代码来源:class_drawsegment.cpp


示例13: RenderText

void CComponent_Items::RenderText(const CNetObj_TU_Text *pPrev, const CNetObj_TU_Text *pCurrent)
{
	if(pCurrent->m_ItemLayer != GetLayer()) return;
	if(!TextRender()) return;

	vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());
	
	char aText[64];
	IntsToStr(pCurrent->m_aText, 16, &aText[0]);
	
	TUKernel()->AssetsRenderer()->DrawText(aText, Pos, tu::IntToColor(pCurrent->m_Color), pCurrent->m_Size, pCurrent->m_Alignment);
}
开发者ID:teeworlds-modapi,项目名称:teeworlds,代码行数:12,代码来源:items.cpp


示例14: GetLayer

  //
  // Export
  //
  // Export this footprint to the given file name
  //
  Bool Type::Export(const char *fileName)
  {
    PTree tree;
    FScope *root, *cellInfo;
  
    // Add the top level scope
    root = tree.GetGlobalScope()->AddFunction("ConfigureFootPrint");

    // Get the layer used for zipping
    Layer &layer = GetLayer(LAYER_LOWER);

    // Save out the grid
    for (S32 z = 0; z <= size.z; z++)
    {
      for (S32 x = 0; x <= size.x; x++)
      {
        // Write out cell info
        cellInfo = root->AddFunction("SetupCell");
        cellInfo->AddArgInteger(x);
        cellInfo->AddArgInteger(z);

        // Is this cell on the footprint
        if (x < size.x && z < size.z)
        {
          Cell &cell = GetCell(x, z);
          StdSave::TypeU32(cellInfo, "Hide", cell.GetFlag(HIDE));
          StdSave::TypeU32(cellInfo, "SetBase", cell.GetFlag(SETBASE));
          StdSave::TypeU32(cellInfo, "Second", cell.GetFlag(SECOND));
          StdSave::TypeU32(cellInfo, "Dirs", cell.dirs);
          StdSave::TypeU32(cellInfo, "ClaimLo", cell.GetFlag(CLAIMLO));
          StdSave::TypeU32(cellInfo, "ClaimHi", cell.GetFlag(CLAIMHI));
          StdSave::TypeU32(cellInfo, "BlockLOS", cell.GetFlag(BLOCKLOS));

          if (cell.GetFlag(SURFACE))
          {
            MoveTable::KeyInfo *info = MoveTable::FindSurfaceInfo(cell.surface);

            if (info)
            {
              StdSave::TypeString(cellInfo, "Surface", info->ident.str);
            }
          }
        }

        Layer::Cell &cell = layer.GetCell(x, z);
        StdSave::TypeU32(cellInfo, "Zip", cell.GetFlag(Layer::ZIP));
      }
    }
  
    // Save out to disk
    return (tree.WriteTreeText(fileName));
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:57,代码来源:footprint_type.cpp


示例15: PlotOneBoardLayer

bool PLOT_CONTROLLER::PlotLayer()
{
    LOCALE_IO toggle;

    // No plot open, nothing to do...
    if( !m_plotter )
        return false;

    // Fully delegated to the parent
    PlotOneBoardLayer( m_board, m_plotter, ToLAYER_ID( GetLayer() ), GetPlotOptions() );

    return true;
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:13,代码来源:pcbplot.cpp


示例16: ITEM_GAL_LAYER

void TEXTE_MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
{
    if( m_NoShow )      // Hidden text
        aLayers[0] = ITEM_GAL_LAYER( MOD_TEXT_INVISIBLE );
    //else if( IsFrontLayer( m_Layer ) )
        //aLayers[0] = ITEM_GAL_LAYER( MOD_TEXT_FR_VISIBLE );
    //else if( IsBackLayer( m_Layer ) )
        //aLayers[0] = ITEM_GAL_LAYER( MOD_TEXT_BK_VISIBLE );
    else
        aLayers[0] = GetLayer();

    aCount = 1;
}
开发者ID:RocFan,项目名称:kicad-source-mirror,代码行数:13,代码来源:class_text_mod.cpp


示例17: GetLayerColor

void SCH_TEXT::Plot( PLOTTER* aPlotter )
{
    static std::vector <wxPoint> Poly;
    COLOR4D  color = GetLayerColor( GetLayer() );
    int      tmp = GetThickness();
    int      thickness = GetPenSize();

    // Two thicknesses are set here:
    // The first is for EDA_TEXT, which controls the interline spacing based on text thickness
    // The second is for the output that sets the actual stroke size
    SetThickness( thickness );
    aPlotter->SetCurrentLineWidth( thickness );

    if( IsMultilineAllowed() )
    {
        std::vector<wxPoint> positions;
        wxArrayString strings_list;
        wxStringSplit( GetShownText(), strings_list, '\n' );
        positions.reserve( strings_list.Count() );

        GetPositionsOfLinesOfMultilineText(positions, (int) strings_list.Count() );

        for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
        {
            wxPoint textpos = positions[ii] + GetSchematicTextOffset();
            wxString& txt = strings_list.Item( ii );
            aPlotter->Text( textpos, color, txt, GetTextAngle(), GetTextSize(),
                            GetHorizJustify(), GetVertJustify(),
                            thickness, IsItalic(), IsBold() );
        }
    }
    else
    {
        wxPoint textpos = GetTextPos() + GetSchematicTextOffset();

        aPlotter->Text( textpos, color, GetShownText(), GetTextAngle(), GetTextSize(),
                        GetHorizJustify(), GetVertJustify(),
                        thickness, IsItalic(), IsBold() );
    }

    // Draw graphic symbol for global or hierarchical labels
    CreateGraphicShape( Poly, GetTextPos() );

    aPlotter->SetCurrentLineWidth( GetPenSize() );

    if( Poly.size() )
        aPlotter->PlotPoly( Poly, NO_FILL );

    SetThickness( tmp );
}
开发者ID:johnbeard,项目名称:kicad,代码行数:50,代码来源:sch_text.cpp


示例18: UpdateData

void ContourColorDlg::OnBnClickedOk()
{
    UpdateData( TRUE );

    // 获取图层名称
    CString layer;
    if( !GetLayer( layer ) )
    {
        MessageBox( _T( "没有选择包含等值线的图层" ) );
        return;
    }

    AcGeDoubleArray zValues;
    AcArray<COLORREF> colors;
    int n = m_colorList.GetItemCount();
    for( int i = 0; i < n; i++ )
    {
        ColorListItemData* pData = ( ColorListItemData* )m_colorList.GetItemData( i );
        zValues.append( pData->z );
        colors.append( pData->rgb );
    }
    // 删除最后一个z值
    zValues.removeLast();

    // 删除color list上的附加数据
    DeleteColorListItemDatas();

    // 获取图层上的等值线信息图元
    AcDbObjectId objId = GetContourInfoOnLayer( layer );
    SetContourInfo( objId, zValues, colors, m_bFillColor );

    // 获取边界坐标数据
    AcGePoint3dArray bounds;
    GetBoundaryPoints( bounds );
    if( bounds.isEmpty() )
    {
        MessageBox( _T( "请添加一个闭合的井田边界" ) );
        return;
    }

    // 获取点集数据
    AcGePoint3dArray datas;
    GetContourDatas( objId, datas );

    //assert((colors.length()-zValues.length()) == 1);
    // 绘制填充
    DrawFill( layer, bounds,  datas, zValues, colors, m_bFillColor );

    OnOK();
}
开发者ID:kanbang,项目名称:myexercise,代码行数:50,代码来源:ContourColorDlg.cpp


示例19: GetActiveLayerForConfig

LayerType GetActiveLayerForConfig(const ConfigLocation& config)
{
  for (auto layer : SEARCH_ORDER)
  {
    if (!LayerExists(layer))
      continue;

    if (GetLayer(layer)->Exists(config))
      return layer;
  }

  // If config is not present in any layer, base layer is considered active.
  return LayerType::Base;
}
开发者ID:TurboK234,项目名称:dolphin,代码行数:14,代码来源:Config.cpp


示例20: assert

// --[  Method  ]---------------------------------------------------------------
//
//  - Class     : CEffect
//  - prototype : bool WriteASCII(CWriterASCII* pWriter)
//
//  - Purpose   : Writes the script data of the effect.
//
// -----------------------------------------------------------------------------
bool CEffect::WriteASCII(CWriterASCII* pWriter)
{
	assert(pWriter);
	assert(pWriter->Ready());

	// Description

	pWriter->Write("\n#Effect #Name=\"%s\" #Class=\"%s\"", GetFXName().data(), GetClassName().data());
	pWriter->Write("\n{");
	pWriter->Write("\n  #Begin=%f #End=%f #Layer=%u", GetBegin(), GetEnd(), GetLayer());

	// Resources

	MAPRESOURCES::iterator itRes;

	for(itRes = m_mapResources.begin(); itRes != m_mapResources.end(); ++itRes)
	{
		pWriter->Write("\n  #Resource #Name=\"%s\" #Class=\"%s\" #Value=\"%s\"",
						itRes->first.data(), itRes->second.strClass.data(), itRes->second.strValue.data());
	}
	
	// Variables

	MAPVARS::iterator itVar;

	pWriter->IncIndentation(2);
	pWriter->Write("\n");

	for(itVar = m_mapVars.begin(); itVar != m_mapVars.end(); ++itVar)
	{
		itVar->second->WriteASCII(pWriter);
	}

	pWriter->DecIndentation(2);

	// Commands

	pWriter->Write("\n");

	VECCOMMANDS::iterator itCmds;

	for(itCmds = m_vecCommands.begin(); itCmds != m_vecCommands.end(); ++itCmds)
	{
		pWriter->Write("\n  #Command #Time=%f #Send=<%s>", itCmds->fTime, itCmds->strCommand.data());
	}

	pWriter->Write("\n}");

	return true;
}
开发者ID:fernandojsg,项目名称:sgzsourcepack,代码行数:58,代码来源:Effect.cpp



注:本文中的GetLayer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetLayerDefn函数代码示例发布时间:2022-05-30
下一篇:
C++ GetLastPosition函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap