当前位置: 首页>>代码示例>>C++>>正文


C++ SetShape函数代码示例

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


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

示例1: SetShape

void CRvizMarker::SetShape(std::string shape){
    std::transform(shape.begin(), shape.end(), shape.begin(), ::tolower);
    if(shape=="cube")
        SetShape(visualization_msgs::Marker::CUBE);
    if(shape=="sphere")
        SetShape(visualization_msgs::Marker::SPHERE);
    if(shape=="arrow")
        SetShape(visualization_msgs::Marker::ARROW);
    if(shape=="cylinder")
        SetShape(visualization_msgs::Marker::CYLINDER);
}
开发者ID:johnmichaloski,项目名称:ROS,代码行数:11,代码来源:RvizMarker.cpp

示例2: SetShape

void Cursor::SetShape(CursorShape shape)
{
    if (shape < CS_NORMAL || shape >= CS_MAX_SHAPES || shape_ == shapeNames[shape])
        return;

    SetShape(shapeNames[shape]);
}
开发者ID:EternalXY,项目名称:AtomicGameEngine,代码行数:7,代码来源:Cursor.cpp

示例3: Building

ResearchItem::ResearchItem()
:   Building(),
    m_researchType(-1),
    m_inLibrary(false),
    m_reprogrammed(100.0),
    m_end1(NULL),
    m_end2(NULL),
    m_level(1),
	m_percentResearchedSmooth(0.0f)
{
    m_type = TypeResearchItem;
    m_researchType = GlobalResearch::TypeEngineer;
    
    SetShape( g_app->m_resource->GetShape( "researchitem.shp" ) );    

    m_front.RotateAroundY( frand(2.0 * M_PI) );

    const char end1Name[] = "MarkerGrab1";
    m_end1 = m_shape->m_rootFragment->LookupMarker( end1Name );
    AppReleaseAssert( m_end1, "ResearchItem: Can't get Marker(%s) from shape(%s), probably a corrupted file\n", end1Name, m_shape->m_name );

    const char end2Name[] = "MarkerGrab2";
    m_end2 = m_shape->m_rootFragment->LookupMarker( end2Name );
    AppReleaseAssert( m_end2, "ResearchItem: Can't get Marker(%s) from shape(%s), probably a corrupted file\n", end2Name, m_shape->m_name );
}
开发者ID:gene9,项目名称:Darwinia-and-Multiwinia-Source-Code,代码行数:25,代码来源:researchitem.cpp

示例4: Initialize

func Initialize()
{
	// Bin ich der erste?
	if(!FindObject(GetID()))
	{
		SetAction("Master");
		SetPosition(16,16);
		aTools = [0,0,0,0,0,0];
		for(var i = 0; i < 9; i++)
		{
			aTools[i] = CreateObject(GetID(), 26+35*i, 26, -1);
			aTools[i]->SetAction("Tool");
			aTools[i]->SetDir(0);
			aTools[i]->SetPhase(i);
			aTools[i]->LocalN("pMaster") = this;
			aTools[i]->LocalN("iToolID") = i;
		}
		aTools[0]->SetDir(1);
		iMode = -1;
		SetShape();
		if(GetPlayerCount(C4PT_User))
		{
			var iPlr = GetPlayerByIndex(0, C4PT_User);
			SetOwner(iPlr);
			MakeCrewMember(this, iPlr);
			SetFoW(0, iPlr);
			SetCursor(iPlr, this);
		}
	}
开发者ID:Froggit,项目名称:Data_Project1_Repos2,代码行数:29,代码来源:Script.c

示例5: SetShape

void gcImageControl::setImage(const char* image)
{
	wxRegion r;
	SetShape(r, this);
	m_imgHandle = GetGCThemeManager()->getImageHandle(image);
	invalidatePaint();
}
开发者ID:callumlinden,项目名称:desura-app,代码行数:7,代码来源:gcImageControl.cpp

示例6: GeometryObject2D_CircleShape

/**
@brief	円を描画するサンプル。
*/
void GeometryObject2D_CircleShape()
{
	// Altseedを初期化する。
	asd::Engine::Initialize(asd::ToAString("GeometryObject2D_CircleShape").c_str(), 640, 480, asd::EngineOption());

	// 図形描画オブジェクトのインスタンスを生成する。
	auto geometryObj = std::make_shared<asd::GeometryObject2D>();

	// 図形描画オブジェクトのインスタンスをエンジンに追加する。
	asd::Engine::AddObject2D(geometryObj);

	// 円の図形クラスのインスタンスを生成する。
	auto arc = std::make_shared<asd::CircleShape>();

	// 円の外径、中心位置を指定する。
	arc->SetOuterDiameter(400);
	arc->SetPosition(asd::Vector2DF(320, 240));

	// 円を描画する図形として設定する。
	geometryObj->SetShape(arc);

	// Altseedのウインドウが閉じられていないか確認する。
	while (asd::Engine::DoEvents())
	{
		// Altseedを更新する。
		asd::Engine::Update();
	}

	// Altseedを終了する。
	asd::Engine::Terminate();
}
开发者ID:Pctg-x8,项目名称:Altseed,代码行数:34,代码来源:GeometryObject2D_CircleShape.cpp

示例7: wxCHECK_MSG

bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
{
    wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,
                 _T("Shaped windows must be created with the wxFRAME_SHAPED style."));

#if TARGET_CARBON
    // The empty region signifies that the shape should be removed from the
    // window.
    if ( region.IsEmpty() )
    {
        wxSize sz = GetClientSize();
        wxRegion rgn(0, 0, sz.x, sz.y);
        return SetShape(rgn);
    }

    // Make a copy of the region
    RgnHandle  shapeRegion = NewRgn();
    CopyRgn( (RgnHandle)region.GetWXHRGN(), shapeRegion );

    // Dispose of any shape region we may already have
    RgnHandle oldRgn = (RgnHandle)GetWRefCon( (WindowRef)MacGetWindowRef() );
    if ( oldRgn )
        DisposeRgn(oldRgn);

    // Save the region so we can use it later
    SetWRefCon((WindowRef)MacGetWindowRef(), (SInt32)shapeRegion);

    // Tell the window manager that the window has changed shape
    ReshapeCustomWindow((WindowRef)MacGetWindowRef());
    return TRUE;
#else
    return FALSE;
#endif
}
开发者ID:Duion,项目名称:Torsion,代码行数:34,代码来源:toplevel.cpp

示例8: PowerBuilding

PylonStart::PylonStart()
:   PowerBuilding(),
    m_reqBuildingId(-1)
{
    m_type = TypePylonStart;
    SetShape( g_app->m_resource->GetShape( "pylon.shp" ) );
};
开发者ID:gene9,项目名称:Darwinia-and-Multiwinia-Source-Code,代码行数:7,代码来源:generator.cpp

示例9: jmax

void JParam::InitFloat(const String& name, float defaultVal, float minVal, float maxVal, float step, const String& label, const String& group, bool readonly, float shape, std::function<String (float)> displayTextFunction)
{
  if (mType == kTypeNone) mType = kTypeFloat;
  
  mName = name;
  mLabel = label;
  mParamGroup = group;
  mValue = defaultVal;
  mMin = minVal;
  mMax = jmax(maxVal, minVal + step);
  mStep = step;
  mDefault = defaultVal;
  mIsReadOnly = readonly;
  mDisplayTextFunction = displayTextFunction;
  
  if (mIsReadOnly)
    mCanAutomate = false;
  
  for (mDisplayPrecision = 0;
       mDisplayPrecision < MAX_PARAM_DISPLAY_PRECISION && step != floor(step);
       ++mDisplayPrecision, step *= 10.0)
  {
    ;
  }
  
  SetShape(shape);
}
开发者ID:olilarkin,项目名称:juce_jparam,代码行数:27,代码来源:juce_jparam.cpp

示例10: wxRegion

bool wxSkinWindow::SetShape(const wxBitmap& img)
{
	wxRegion region;
	region = wxRegion(img);
	
	return SetShape(region);
}
开发者ID:EEmmanuel7,项目名称:wxskintoy,代码行数:7,代码来源:wxSkinWindow.cpp

示例11: BOARD_CONNECTED_ITEM

D_PAD::D_PAD( MODULE* parent ) :
    BOARD_CONNECTED_ITEM( parent, PCB_PAD_T )
{
    m_NumPadName          = 0;
    m_Size.x = m_Size.y   = DMils2iu( 600 ); // Default pad size 60 mils.
    m_Drill.x = m_Drill.y = DMils2iu( 300 ); // Default drill size 30 mils.
    m_Orient              = 0;               // Pad rotation in 1/10 degrees.
    m_LengthPadToDie      = 0;

    if( m_Parent  &&  m_Parent->Type() == PCB_MODULE_T )
    {
        m_Pos = GetParent()->GetPosition();
    }

    SetShape( PAD_SHAPE_CIRCLE );                   // Default pad shape is PAD_CIRCLE.
    SetDrillShape( PAD_DRILL_SHAPE_CIRCLE );        // Default pad drill shape is a circle.
    m_Attribute           = PAD_ATTRIB_STANDARD;    // Default pad type is NORMAL (thru hole)
    m_LocalClearance      = 0;
    m_LocalSolderMaskMargin  = 0;
    m_LocalSolderPasteMargin = 0;
    m_LocalSolderPasteMarginRatio = 0.0;
    m_ZoneConnection      = PAD_ZONE_CONN_INHERITED; // Use parent setting by default
    m_ThermalWidth        = 0;                  // Use parent setting by default
    m_ThermalGap          = 0;                  // Use parent setting by default

    // Set layers mask to default for a standard thru hole pad.
    m_layerMask           = StandardMask();

    SetSubRatsnest( 0 );                       // used in ratsnest calculations

    m_boundingRadius      = -1;
}
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:32,代码来源:class_pad.cpp

示例12: SetShape

void D_PAD::ImportSettingsFromMaster( const D_PAD& aMasterPad )
{
    SetShape( aMasterPad.GetShape() );
    SetLayerSet( aMasterPad.GetLayerSet() );
    SetAttribute( aMasterPad.GetAttribute() );

    // The pad orientation, for historical reasons is the
    // pad rotation + parent rotation.
    // So we have to manage this parent rotation
    double pad_rot = aMasterPad.GetOrientation();

    if( aMasterPad.GetParent() )
        pad_rot -= aMasterPad.GetParent()->GetOrientation();

    if( GetParent() )
        pad_rot += GetParent()->GetOrientation();

    SetOrientation( pad_rot );

    SetSize( aMasterPad.GetSize() );
    SetDelta( wxSize( 0, 0 ) );
    SetOffset( aMasterPad.GetOffset() );
    SetDrillSize( aMasterPad.GetDrillSize() );
    SetDrillShape( aMasterPad.GetDrillShape() );
    SetRoundRectRadiusRatio( aMasterPad.GetRoundRectRadiusRatio() );

    switch( aMasterPad.GetShape() )
    {
    case PAD_SHAPE_TRAPEZOID:
        SetDelta( aMasterPad.GetDelta() );
        break;

    case PAD_SHAPE_CIRCLE:
        // ensure size.y == size.x
        SetSize( wxSize( GetSize().x, GetSize().x ) );
        break;

    default:
        ;
    }

    switch( aMasterPad.GetAttribute() )
    {
    case PAD_ATTRIB_SMD:
    case PAD_ATTRIB_CONN:
        // These pads do not have hole (they are expected to be only on one
        // external copper layer)
        SetDrillSize( wxSize( 0, 0 ) );
        break;

    default:
        ;
    }

    // Add or remove custom pad shapes:
    SetPrimitives( aMasterPad.GetPrimitives() );
    SetAnchorPadShape( aMasterPad.GetAnchorPadShape() );
    MergePrimitivesAsPolygon();
}
开发者ID:cpavlina,项目名称:kicad,代码行数:59,代码来源:class_pad.cpp

示例13: GetSize

void DispLoading::onEraseBG( wxEraseEvent& event )
{
	wxDC *dc = event.GetDC();

	if (!m_imgHandle.getImg() || !m_imgHandle->IsOk())
	{
		dc->SetTextForeground(wxColor(0,0,0));
		dc->Clear();
		return;
	}

	int h = GetSize().GetHeight();
	int w = GetSize().GetWidth();
	int iw = m_imgHandle->GetSize().GetWidth();


	//size 7
	const int l_start = 0;
	const int l_width = 2;

	//size 6
	const int m_start = 2;
	const int m_width = 15;

	//size 7 with 1 pix gap
	const int r_start = 17;
	const int r_width = 2;


	wxBitmap   tmpBmp(w, h);
	wxMemoryDC tmpDC(tmpBmp);

	tmpDC.SetBrush(wxBrush(wxColor(255,0,255)));
	tmpDC.SetPen( wxPen(wxColor(255,0,255),1) );
	tmpDC.DrawRectangle(0,0,w,h);

	wxImage scaled = m_imgHandle->Scale(iw, h);

	if (scaled.IsOk())
	{
		wxBitmap left = wxBitmap(scaled.GetSubImage( wxRect(l_start,0,l_width,h)) );
		wxBitmap right = wxBitmap(scaled.GetSubImage( wxRect(r_start,0,r_width,h)) );
		wxBitmap center(w-(l_width+r_width),h);

		wxColor c(255,0,255);
		gcImage::tileImg(center, wxBitmap(scaled.GetSubImage( wxRect(m_start,0,m_width,h)) ), &c);

		tmpDC.DrawBitmap(left, l_start,0,true);
		tmpDC.DrawBitmap(center, m_start,0,true);
		tmpDC.DrawBitmap(right, w-r_width,0,true);
	}

	tmpDC.SelectObject(wxNullBitmap);
	dc->DrawBitmap(tmpBmp, 0,0, true);

	wxRegion region = wxRegion(tmpBmp, wxColor(255,0,255), 1);
	SetShape(region, this);
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:58,代码来源:DispLoading.cpp

示例14: Initialize

func Initialize()
{
	// smaller SolidMask and larger shape so doors can take damage more easily
	SetSolidMask(2,0,4,40,2,0);
	SetShape(-10,-20,20,40);
	// effect to reroute life loss to damage
	AddEffect("IntLife2Damage", this, 1, 0, this);
	return _inherited(...);
}
开发者ID:772,项目名称:openclonk,代码行数:9,代码来源:StoneDoors.c

示例15: SetColor

void Shape::Init()
{
    SetColor( ofColor(ofRandom(100,255),ofRandom(70,225),ofRandom(100,255)));
    SetDistance(ofRandom(50,400));
    SetShape((ShapeType)ofRandom(ST_MAXLENGTH));
    SetSpeed(ofRandom(1,5));
    SetAngle(ofRandom(360));
    SetSize(ofRandom(10,30));
}
开发者ID:cca-company,项目名称:NHNNEXT-HCI,代码行数:9,代码来源:Shape.cpp


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