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


C++ View函数代码示例

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


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

示例1: Hanowa

inline void
Hanowa( DistMatrix<T,U,V>& A, int n, T mu )
{
#ifndef RELEASE
    CallStackEntry entry("Hanowa");
#endif
    if( n % 2 != 0 )
        throw std::logic_error("n must be an even integer");
    A.ResizeTo( n, n );
    const int m = n/2;
    std::vector<T> d(m);
    DistMatrix<T,U,V> ABlock( A.Grid() );

    for( int j=0; j<m; ++j )
        d[j] = mu;
    View( ABlock, A, 0, 0, m, m );
    Diagonal( ABlock, d );
    View( ABlock, A, m, m, m, m );
    Diagonal( ABlock, d );

    for( int j=0; j<m; ++j )
        d[j] = -(j+1);
    View( ABlock, A, 0, m, m, m );
    Diagonal( ABlock, d );

    for( int j=0; j<m; ++j )
        d[j] = j+1;
    View( ABlock, A, m, 0, m, m );
    Diagonal( ABlock, d );
}
开发者ID:ahmadia,项目名称:Elemental-1,代码行数:30,代码来源:Hanowa.hpp

示例2: main

int main(int argc, char *argv[])
{
    Stack *top = new Stack;
    //зазаносим данные в стек
    int a = 123;
    Push(top, a);
    a = 456;
    Push(top, a);
    a = 789;
    Push(top, a);

    //смотрим текущее состояние
    cout << "stack: " << endl;
    View(top);

    //Достаем данные
    cout << endl << Pop(*top);
    cout << endl << Pop(*top) << endl;

    //смотрим текущее состояние
    cout << endl << "stack: " << endl;
    View(top);

    system("pause");
    return 0;
}
开发者ID:selenzo,项目名称:bsuir,代码行数:26,代码来源:main.cpp

示例3: StopDraggingSplitter

// StartDraggingSplitter
bool
BSplitLayout::StartDraggingSplitter(BPoint point)
{
	StopDraggingSplitter();

	// Layout must be valid. Bail out, if it isn't.
	if (!fLayoutValid)
		return false;

	// Things shouldn't be draggable, if we have a >= max layout.
	BSize size = _SubtractInsets(View()->Frame().Size());
	if ((fOrientation == B_HORIZONTAL && size.width >= fMax.width)
		|| (fOrientation == B_VERTICAL && size.height >= fMax.height)) {
		return false;
	}

	int32 index = -1;
	if (_SplitterItemAt(point, &index) != NULL) {
		fDraggingStartPoint = View()->ConvertToScreen(point);
		fDraggingStartValue = _SplitterValue(index);
		fDraggingCurrentValue = fDraggingStartValue;
		fDraggingSplitterIndex = index;

		return true;
	}

	return false;
}
开发者ID:mariuz,项目名称:haiku,代码行数:29,代码来源:SplitLayout.cpp

示例4: Exit

void cxFollow::OnStep(cxFloat dt)
{
    if(cxFloatIsEqual(speed, 0)){
        Exit(true);
        return;
    }
    cxView *target = GetTarget();
    //target miss
    if(target == nullptr){
        onMiss.Fire(this);
        Exit(true);
        return;
    }
    cxPoint2F cpos = View()->Position();
    cxPoint2F tpos = target->Position() + offset;
    cxFloat angle = cpos.Angle(tpos);
    if(!cxFloatIsOK(angle)){
        return;
    }
    cxFloat dv = dt * speed;
    cpos.x += cosf(angle) * dv;
    cpos.y += sinf(angle) * dv;
    View()->SetPosition(cpos);
    //if position changed
    if(View()->IsDirtyMode(cxView::DirtyModePosition)){
        onMoving.Fire(this);
    }
    cxAction::OnStep(dt);
}
开发者ID:cxuhua,项目名称:cxengine,代码行数:29,代码来源:cxFollow.cpp

示例5: if

void
ALMGroup::_Build(BALMLayout* layout, BReference<XTab> left,
                 BReference<YTab> top, BReference<XTab> right, BReference<YTab> bottom) const
{
    if (LayoutItem())
        layout->AddItem(LayoutItem(), left, top, right, bottom);
    else if (View()) {
        layout->AddView(View(), left, top, right, bottom);
    } else {
        for (unsigned int i = 0; i < Groups().size(); i++) {
            const ALMGroup& current = Groups()[i];
            if (Orientation() == B_HORIZONTAL) {
                BReference<XTab> currentRight;
                if (i == Groups().size() - 1)
                    currentRight = right;
                else
                    currentRight = layout->AddXTab();
                current._Build(layout, left, top, currentRight, bottom);
                left = currentRight;
            } else {
                BReference<YTab> currentBottom;
                if (i == Groups().size() - 1)
                    currentBottom = bottom;
                else
                    currentBottom = layout->AddYTab();
                current._Build(layout, left, top, right, currentBottom);
                top = currentBottom;
            }
        }
    }
}
开发者ID:yunxiaoxiao110,项目名称:haiku,代码行数:31,代码来源:ALMGroup.cpp

示例6: DEBUG_ONLY

void PartitionDown
( Matrix<T>& A, Matrix<T>& AT, Matrix<T>& AB, Int heightAT ) 
{
    DEBUG_ONLY(CSE cse("PartitionDown"))
    heightAT = Max(Min(heightAT,A.Height()),0);
    const Int heightAB = A.Height()-heightAT;
    View( AT, A, 0,        0, heightAT, A.Width() );
    View( AB, A, heightAT, 0, heightAB, A.Width() );
}
开发者ID:restrin,项目名称:Elemental,代码行数:9,代码来源:Partition.cpp

示例7: if

void World::mouseReleased(int x, int y, int button){
	if(View() == CAPTURE_POSTURE_VIEW){
		_player->savePosture("postures-captured.xml");	//space saves posture
		_player->getUserMapRef()->getKinectControllerRef()->saveImageForCaptures();
	} else if(View() == INSTRUCTIONS_VIEW){
		_instructions.nextSlide();
	} else if(View() == FIRST_PERSON_VIEW || View() == END_GAME_VIEW){
		ofSaveScreen("captures/captures_"+ofGetTimestampString()+".png");
	}
}
开发者ID:joanjane,项目名称:El_Mur_Infernal_Game,代码行数:10,代码来源:World.cpp

示例8: Lauchli

inline void
Lauchli( BlockDistMatrix<T,U,V>& A, Int n, T mu )
{
    DEBUG_ONLY(CallStackEntry cse("Lauchli"))
    A.Resize( n+1, n );

    auto ABlock = View( A, 0, 0, 1, n );
    MakeOnes( ABlock );

    std::vector<T> d(n,mu);
    ABlock = View( A, 1, 0, n, n );
    Diagonal( ABlock, d );
}
开发者ID:SamKChang,项目名称:madness,代码行数:13,代码来源:Lauchli.hpp

示例9: Divergence

void Fluid::Project(
    int maxIterations,
    const View2f& velocities,
    View2f* velocitiesProjected) const {
  // Part1: Compute divergence of velocity field.
  auto divergence = Image<float, 1>::Create(_velocities->Rect(), _velocities->Width(), 1, 1);
  auto pressure = Image<float, 1>::Create(divergence->View(), kLeaveUninitialized);
  Divergence(_velocities->View(), &divergence->View());
  ComputePressureField(maxIterations, divergence->View(), &pressure->View());
  divergence.reset();
  // Part2: Make the velocity field divergence-free by substracting pressure gradients.
  SubstractGradient(_velocities->View(), pressure->View(), velocitiesProjected);
}
开发者ID:ingo2,项目名称:gargleblaster,代码行数:13,代码来源:Fluid.cpp

示例10: _ValidateMinMax

void
BTwoDimensionalLayout::LayoutView()
{
	_ValidateMinMax();

	// layout the horizontal/vertical elements
	BSize size = SubtractInsets(View()->Frame().Size());

#ifdef DEBUG_LAYOUT
printf("BTwoDimensionalLayout::LayoutView(%p): size: (%.1f, %.1f)\n",
View(), size.width, size.height);
#endif

	fLocalLayouter->Layout(size);

	// layout the items
	int itemCount = CountItems();
	for (int i = 0; i < itemCount; i++) {
		BLayoutItem* item = ItemAt(i);
		if (item->IsVisible()) {
			Dimensions itemDimensions;
			GetItemDimensions(item, &itemDimensions);
			BRect frame = fLocalLayouter->ItemFrame(itemDimensions);
			frame.left += fLeftInset;
			frame.top += fTopInset;
			frame.right += fLeftInset;
			frame.bottom += fTopInset;
{
#ifdef DEBUG_LAYOUT
printf("  frame for item %2d (view: %p): ", i, item->View());
frame.PrintToStream();
#endif
//BSize min(item->MinSize());
//BSize max(item->MaxSize());
//printf("    min: (%.1f, %.1f), max: (%.1f, %.1f)\n", min.width, min.height,
//	max.width, max.height);
//if (item->HasHeightForWidth()) {
//float minHeight, maxHeight, preferredHeight;
//item->GetHeightForWidth(frame.Width(), &minHeight, &maxHeight,
//	&preferredHeight);
//printf("    hfw: min: %.1f, max: %.1f, pref: %.1f\n", minHeight, maxHeight,
//	preferredHeight);
//}
}

			item->AlignInFrame(frame);
		}
//else
//printf("  item %2d not visible", i);
	}
}
开发者ID:mariuz,项目名称:haiku,代码行数:51,代码来源:TwoDimensionalLayout.cpp

示例11: switch

// __________________________________________________________________________________________________
// RegistersDlgProc 
//
BOOL CALLBACK 
CDynaViewDlg::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{

	switch(message)
	{
	case WM_COMMAND:
		{
			switch (LOWORD(wParam))
			{
			case IDC_PREVBLOCK: 
				{
					if (m_iBlock>0)
						View(m_iBlock-1);
				}
				break;
			case IDC_NEXTBLOCK:
				{
					if (m_iBlock>=-1)
						View(m_iBlock+1);
				}
				break;
			case IDC_CODEADDRESS:
				{
					
				}
				break;
			}
		}
		break;
	case WM_INITDIALOG:
		{
			SendMessage(GetDlgItem(hDlg,IDC_X86ASM),WM_SETFONT,(WPARAM)dfont,0);
			SendMessage(GetDlgItem(hDlg,IDC_POWERPCASM),WM_SETFONT,(WPARAM)dfont,0);
			View(-1);
			return TRUE;
		}
		break;
	case WM_SIZE:
		Size();
		break;

	case WM_CLOSE:
		Show(false);
		break;
	}

	return FALSE;
}
开发者ID:173210,项目名称:ppsspp,代码行数:52,代码来源:DlgDynaView.cpp

示例12: View

int MkView::HashCmd() {
  c4_View nview = View(interp, objv[2]);
  int nkeys = objc > 3 ? tcl_GetIntFromObj(objv[3]): 1;
  MkView *ncmd = new MkView(interp, view.Hash(nview, nkeys));

  return tcl_SetObjResult(tcl_NewStringObj(ncmd->CmdName()));
}
开发者ID:electric-cloud,项目名称:metakit,代码行数:7,代码来源:mk4too.cpp

示例13: _ItemLayoutInfo

// _LayoutItem
void
BSplitLayout::_LayoutItem(BLayoutItem* item, BRect frame, bool visible)
{
	// update the layout frame
	ItemLayoutInfo* info = _ItemLayoutInfo(item);
	info->isVisible = visible;
	if (visible)
		info->layoutFrame = frame;
	else
		info->layoutFrame = BRect(0, 0, -1, -1);

	// update min/max
	info->min = item->MinSize();
	info->max = item->MaxSize();

	if (item->HasHeightForWidth()) {
		BSize size = _SubtractInsets(View()->Frame().Size());
		float minHeight, maxHeight;
		item->GetHeightForWidth(size.width, &minHeight, &maxHeight, NULL);
		info->min.height = max_c(info->min.height, minHeight);
		info->max.height = min_c(info->max.height, maxHeight);
	}

	// layout the item
	if (visible)
		item->AlignInFrame(frame);
}
开发者ID:mariuz,项目名称:haiku,代码行数:28,代码来源:SplitLayout.cpp

示例14: View

 ///
 /// Assign to this view_or_value from a moved-in view_or_value.
 ///
 /// TODO CXX-800: Create a noexcept expression to check the conditions that must be met.
 BSONCXX_INLINE view_or_value& operator=(view_or_value&& other) noexcept {
     _value = std::move(other._value);
     _view = _value ? *_value : std::move(other._view);
     other._view = View();
     other._value = stdx::nullopt;
     return *this;
 }
开发者ID:0x20004,项目名称:mongo-cxx-driver,代码行数:11,代码来源:view_or_value.hpp

示例15: getRenderer

void Kinectic::onRender()
{
	getRenderer()->setClearColor(Color::Blue);
	getRenderer()->setProjectionMatrix(View(0,0,1024,768).getMatrix());

	world.drawDebugShapes(getRenderer());
}
开发者ID:GrimshawA,项目名称:Nephilim,代码行数:7,代码来源:SampleKinesis.cpp


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