本文整理汇总了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 );
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
}
}
}
示例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() );
}
示例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");
}
}
示例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 );
}
示例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);
}
示例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);
}
}
示例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;
}
示例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()));
}
示例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);
}
示例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;
}
示例15: getRenderer
void Kinectic::onRender()
{
getRenderer()->setClearColor(Color::Blue);
getRenderer()->setProjectionMatrix(View(0,0,1024,768).getMatrix());
world.drawDebugShapes(getRenderer());
}