本文整理汇总了C++中View类的典型用法代码示例。如果您正苦于以下问题:C++ View类的具体用法?C++ View怎么用?C++ View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了View类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: onBeginDrawFrame
void TextStyle::onBeginDrawFrame(const View& _view, Scene& _scene, int _textureUnit) {
bool contextLost = Style::glContextLost();
m_fontContext->bindAtlas(0);
m_shaderProgram->setUniformf("u_uv_scale_factor",
1.0f / m_fontContext->getAtlasResolution());
if (contextLost) {
m_shaderProgram->setUniformi("u_tex", 0);
}
if (m_dirtyViewport || contextLost) {
m_shaderProgram->setUniformMatrix4f("u_ortho", glm::value_ptr(_view.getOrthoViewportMatrix()));
m_dirtyViewport = false;
}
Style::onBeginDrawFrame(_view, _scene, 1);
}
开发者ID:deepinit-arek,项目名称:tangram-es,代码行数:20,代码来源:textStyle.cpp
示例2: transform_pixels_locator
GIL_FORCEINLINE
F transform_pixels_locator( const View& src, const rect_t<std::ptrdiff_t>& srcRod,
const ViewDst& dst, const rect_t<std::ptrdiff_t>& dstRod,
const rect_t<std::ptrdiff_t>& renderWin, F& fun )
{
const std::ptrdiff_t renderWidth = renderWin.x2 - renderWin.x1;
typename View::xy_locator sloc = src.xy_at( renderWin.x1-srcRod.x1, renderWin.y1-srcRod.y1 );
for( std::ptrdiff_t y = renderWin.y1; y < renderWin.y2; ++y )
{
typename ViewDst::x_iterator dstIt = dst.x_at( renderWin.x1-dstRod.x1, y-dstRod.y1 );
for( std::ptrdiff_t x = renderWin.x1;
x < renderWin.x2;
++x, ++sloc.x(), ++dstIt )
{
*dstIt = fun( sloc );
}
sloc.x() -= renderWidth; ++sloc.y();
}
return fun;
}
开发者ID:morphimac,项目名称:TuttleOFX,代码行数:20,代码来源:algorithm.hpp
示例3: drawCharactersFromView
void Play::drawCharactersFromView(const View& view)
{
if(!_isPlaying)
return ;
// Draw from view only if it was installed
for(const auto& v : _views)
{
if(v->id() == view.id())
{
StageTime time(_drawClock.totalSeconds(),
_drawClock.elapsedSeconds(),
_drawClock.ticksPerSecond());
DrawCaller drawCaller(v, time);
(*_currentAct)->welcome( drawCaller );
break;
}
}
}
开发者ID:wibus,项目名称:ExperimentalTheatre,代码行数:20,代码来源:Play.cpp
示例4: insert_feature
double State::insert_feature(int feature_idx, vector<double> feature_data,
View& which_view) {
string col_datatype = global_col_datatypes[feature_idx];
CM_Hypers& hypers = hypers_m[feature_idx];
double crp_logp_delta, data_logp_delta;
double score_delta = calc_feature_view_predictive_logp(feature_data,
col_datatype,
which_view,
crp_logp_delta,
data_logp_delta,
hypers);
vector<int> data_global_row_indices = create_sequence(feature_data.size());
which_view.insert_col(feature_data,
data_global_row_indices, feature_idx,
hypers);
view_lookup[feature_idx] = &which_view;
column_crp_score += crp_logp_delta;
data_score += data_logp_delta;
return score_delta;
}
开发者ID:campustimes,项目名称:crosscat,代码行数:20,代码来源:State.cpp
示例5: lock
bool LarsonSekaninaInstance::ExecuteOn( View& view )
{
AutoViewLock lock( view );
ImageVariant image = view.Image();
if ( image.IsComplexSample() )
return false;
StandardStatus status;
image.SetStatusCallback( &status );
Console().EnableAbort();
ImageVariant sharpImg;
sharpImg.CreateFloatImage( (image.BitsPerSample() > 32) ? image.BitsPerSample() : 32 );
sharpImg.AllocateImage( image->Width(), image->Height(), 1, ColorSpace::Gray );
if ( useLuminance && image->IsColor() )
{
ImageVariant L;
image.GetLightness( L );
Convolve( L, sharpImg, interpolation, radiusDiff, angleDiff, center, 0 );
ApplyFilter( L, sharpImg, amount, threshold, deringing, rangeLow, rangeHigh, false, 0, highPass );
image.SetLightness( L );
}
else
{
for ( int c = 0, n = image->NumberOfNominalChannels(); c < n; ++c )
{
image->SelectChannel( c );
if ( n > 1 )
Console().WriteLn( "<end><cbr>Processing channel #" + String( c ) );
Convolve( image, sharpImg, interpolation, radiusDiff, angleDiff, center, c );
ApplyFilter( image, sharpImg, amount, threshold, deringing, rangeLow, rangeHigh, disableExtension, c, highPass );
}
}
return true;
}
开发者ID:Astroshed,项目名称:PCL,代码行数:41,代码来源:LarsonSekaninaInstance.cpp
示例6: drawScene
void drawScene() {
glEnable(GL_DEPTH_TEST);
glEnable(GL_NORMALIZE);
glEnable(GL_COLOR_MATERIAL);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_TEXTURE_2D);
glViewport(0,0, width, height);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
v.setView(width, height);
if (c.isThirdPerson()) c.updateLook(m);
else c.updateLook(m.getX()+hx, m.getY()+hy, m.getZ());
if (phase == 0) introGame();
if (phase == 1) playGame();
if (phase == 2) concGame();
glutSwapBuffers();
}
开发者ID:kentaurus44,项目名称:HeliAvoid,代码行数:21,代码来源:Source_modded.cpp
示例7: pivot
void PivotPlugin::pivot()
{
View *view = dynamic_cast<View *>(parent());
if (!view) {
return;
}
if ((view->selection()->lastRange().width() < 2) || (view->selection()->lastRange().height() < 2)) {
KMessageBox::error(view->canvasWidget(), i18n("You must select multiple cells."));
return;
}
QPointer<Pivot> dialog = new Pivot(view->canvasWidget(), view->selection());
dialog->exec();
delete dialog;
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:16,代码来源:pivotplugin.cpp
示例8: if
View lb::operator|(View const& _a, View const& _b)
{
if (!!_a->children().size() == !!_b->children().size())
{
View ret = FrameBody::create();
_a->setParent(ret);
_b->setParent(ret);
return ret;
}
else if (_a->children().size())
{
_b->setParent(_a);
return _a;
}
else
{
_a->setParent(_b);
return _b;
}
}
开发者ID:LancasterLogRes,项目名称:Lightbox,代码行数:20,代码来源:Frame.cpp
示例9: transform_pixels_locator_progress
GIL_FORCEINLINE
F transform_pixels_locator_progress( const View& src, const OfxRectI& srcRod,
const ViewDst& dst, const OfxRectI& dstRod,
const OfxRectI& renderWin, const F& fun, IProgress& p )
{
const std::ptrdiff_t renderWidth = renderWin.x2 - renderWin.x1;
typename View::xy_locator sloc = src.xy_at( renderWin.x1-srcRod.x1, renderWin.y1-srcRod.y1 );
for( std::ptrdiff_t y = renderWin.y1; y < renderWin.y2; ++y )
{
typename ViewDst::x_iterator dstIt = dst.x_at( renderWin.x1-dstRod.x1, y-dstRod.y1 );
for( std::ptrdiff_t x = renderWin.x1;
x < renderWin.x2;
++x, ++sloc.x(), ++dstIt )
{
*dstIt = fun( sloc );
}
sloc.x() -= renderWidth; ++sloc.y();
if( p.progressForward( renderWidth ) )
return fun;
}
return fun;
}
开发者ID:morphimac,项目名称:TuttleOFX,代码行数:22,代码来源:algorithm.hpp
示例10: region
/*!
Estimates shift of current image relative to background image.
\param [in] current - current image.
\param [in] region - a region at the background where the algorithm start to search current image. Estimated shift is taken relative of the region.
\param [in] maxShift - a 2D-point which characterizes maximal possible shift of the region (along X and Y axes).
\param [in] hiddenAreaPenalty - a parameter used to restrict searching of the shift at the border of background image.
\param [in] regionAreaMin - a parameter used to set minimal area of region use for shift estimation. By default is equal to 25.
\return a result of shift estimation.
*/
bool Estimate(const View & current, const Rect & region, const Point & maxShift, double hiddenAreaPenalty = 0, ptrdiff_t regionAreaMin = REGION_CORRELATION_AREA_MIN)
{
assert(current.Size() == region.Size() && region.Area() > 0);
assert(_current.Size() && _current[0].width >= current.width && _current[0].height >= current.height);
if (region.Area() < regionAreaMin)
return false;
InitLevels(region, maxShift, regionAreaMin);
SetCurrent(current, region);
Point shift;
for (ptrdiff_t i = _levels.size() - 1; i >= 0; i--)
{
shift.x *= 2;
shift.y *= 2;
if (!SearchLocalMin(_levels[i], shift, hiddenAreaPenalty))
return false;
shift = _levels[i].shift;
}
return true;
}
开发者ID:flying19880517,项目名称:AntiDupl,代码行数:32,代码来源:SimdShift.hpp
示例11: init
void init(View& view, std::vector<Sprite*>& sprites, bool val[2][WIDTH][HEIGHT]) {
int i,j;
for (i = 0; i < HEIGHT; i++) {
for (j=0; j < WIDTH;j++) {
Vector2d<float> pos(j*S_WIDTH,i*S_WIDTH);
Vector2d<float> size(S_WIDTH,S_WIDTH);
Rect<float> texCoord(0,0,S_WIDTH,S_WIDTH);
Sprite *s = view.addSprite(pos,size,"bitmap",texCoord);
Color tColor(System::rnd(10)/10.0f,System::rnd(10)/10.0f,System::rnd(10)/10.0f,1.0f);
Vector2d<float> c(2,2);
s->setRotationCenter(c);
s->setRotationAngle(45.0f);
s->setTintColor(tColor);
sprites.push_back(s);
s->hide();
val[0][j][i] = false;
if (System::rnd(7) == 0) {
val[0][j][i] = true;
}
}
}
}
开发者ID:remeh,项目名称:meh2d,代码行数:22,代码来源:life.cpp
示例12: renderAxes
void PoslvControl::renderAxes(View& view, const QColor& color, double length) {
Line<double, 3> l_1, l_2, l_3;
l_1[1][0] = length;
view.render(l_1, color, _T_w_i);
l_2[1][1] = length;
view.render(l_2, color, _T_w_i);
l_3[1][2] = length;
view.render(l_3, color, _T_w_i);
Eigen::Vector3d xLabelPosition = _T_w_i * l_1[1];
Eigen::Vector3d yLabelPosition = _T_w_i * l_2[1];
Eigen::Vector3d zLabelPosition = _T_w_i * l_3[1];
view.render("X", xLabelPosition, color, 0.2*length);
view.render("Y", yLabelPosition, color, 0.2*length);
view.render("Z", zLabelPosition, color, 0.2*length);
Eigen::Vector3d labelPosition = _T_w_i * Eigen::Vector3d(0, 0, length + 0.1);
view.render("poslv", labelPosition, color, 0.2 * length);
}
开发者ID:jmaye,项目名称:janeth-ros-viewer,代码行数:17,代码来源:PoslvControl.cpp
示例13: UpdateReadout
void BinarizeInterface::UpdateReadout( const View& v, const DPoint&, double R, double G, double B, double /*A*/ )
{
if ( GUI != 0 && IsVisible() )
{
if ( instance.isGlobal )
{
RGBColorSystem rgbws;
v.Window().GetRGBWS( rgbws );
instance.level[0] = instance.level[1] = instance.level[2] = rgbws.Lightness( R, G, B );
}
else
{
instance.level[0] = R;
instance.level[1] = G;
instance.level[2] = B;
}
UpdateControls();
if ( !RealTimePreview::IsUpdating() )
RealTimePreview::Update();
}
}
开发者ID:GeorgViehoever,项目名称:PCL,代码行数:23,代码来源:BinarizeInterface.cpp
示例14: paintEvent
void SummaryDrawWidget::paintEvent( QPaintEvent * )
{
Channel *ch;
//if((right - left) <= 0) return;
View *view = gdata->view;
/* if (view->totalTime() == 0) {
buffer = new QPixmap(size());
buffer->fill(myBackgroundColor);
bitBlt(this, 0, 0, buffer); */
if(gdata->totalTime() < 0) return;
double timeRatio = double(width()) / gdata->totalTime();
double pitchRatio = double(height()) / (gdata->topPitch() / scaler);
beginDrawing();
//draw all the channels
for(int j = 0; j < (int)gdata->channels.size(); j++) {
ch = gdata->channels.at(j);
if(!ch->isVisible()) continue;
//drawChannel(ch, p, view->leftTime(), (view->totalTime() / (double) width()), 0.0f, (double) view->topNote() / (double) height(), DRAW_VIEW_SUMMARY);
drawChannel(*this, ch, p, gdata->leftTime(), view->currentTime(), (gdata->totalTime() / (double) width()), 0.0f, (double) gdata->topPitch() / (double) height(), DRAW_VIEW_SUMMARY);
}
//draw the view rectangle
p.setPen(QPen(colorGroup().highlight(), 1));
p.drawRect(int((gdata->leftTime()+view->viewLeft())*timeRatio), height()-1-int((view->viewTop())*pitchRatio),
int(view->viewWidth()*timeRatio), int(view->viewHeight()*pitchRatio));
//draw the current time line
p.setPen(QPen(colorGroup().foreground(), 1));
//p.moveTo(int((gdata->leftTime()+view->currentTime())*timeRatio), 0);
//p.lineTo(int((gdata->leftTime()+view->currentTime())*timeRatio), height()-1);
p.drawLine(int((gdata->leftTime()+view->currentTime())*timeRatio), 0,
int((gdata->leftTime()+view->currentTime())*timeRatio), height()-1);
endDrawing();
}
开发者ID:Guildenstern,项目名称:Tartini,代码行数:40,代码来源:summarydrawwidget.cpp
示例15: for_each
inline
void
for_each(
View const &_view,
Function const &_function,
MakeIterator const _make_iterator,
mizuiro::image::algorithm::uninitialized const _uninitialized
)
{
switch(
_uninitialized
)
{
case mizuiro::image::algorithm::uninitialized::yes:
mizuiro::image::algorithm::unary_iteration(
mizuiro::image::algorithm::detail::wrap_prepare<
typename
View::access,
typename
View::format
>(
_view.format_store(),
_function
),
_view,
_make_iterator
);
return;
case mizuiro::image::algorithm::uninitialized::no:
mizuiro::image::algorithm::unary_iteration(
_function,
_view,
_make_iterator
);
return;
}
}
开发者ID:freundlich,项目名称:mizuiro,代码行数:37,代码来源:for_each.hpp
示例16: remove_all_data
void remove_all_data(View &v, map<int, vector<double> > data_map) {
vector<int> rows_in_view;
for(mapICp_it it=v.cluster_lookup.begin(); it!=v.cluster_lookup.end(); it++) {
rows_in_view.push_back(it->first);
}
for(vectorI_it it=rows_in_view.begin(); it!=rows_in_view.end(); it++) {
int idx_to_remove = *it;
vector<double> row = data_map[idx_to_remove];
vector<int> global_indices = create_sequence(row.size());
vector<double> aligned_row = v.align_data(row, global_indices);
v.remove_row(aligned_row, idx_to_remove);
}
cout << "removed all data" << endl;
v.print();
//
for(setCp_it it=v.clusters.begin(); it!=v.clusters.end(); it++) {
v.remove_if_empty(**it);
}
assert(v.get_num_vectors()==0);
assert(v.get_num_clusters()==0);
cout << "removed empty clusters" << endl;
v.print();
}
开发者ID:evelynmitchell,项目名称:crosscat,代码行数:23,代码来源:test_view_speed.cpp
示例17: pos
void EventSystem::updateCurrentViewStack(Event* event)
{
Vec2 pos(event->mouseEvent.x, event->mouseEvent.y);
bool containsPoint = rootView->containsPoint(pos);
View* view = rootView;
currentViewStack.clear();
while(view && view->visible() && view->userInteractionEnabled() && containsPoint)
{
currentViewStack.push_back(view);
containsPoint = false;
for(auto i=view->subviews.rbegin(); i!=view->subviews.rend(); ++i)
{
View* v = (*i).get();
if(v->visible() && v->userInteractionEnabled() && v->containsPoint(pos))
{
view = v;
containsPoint = true;
break;
}
}
}
}
开发者ID:jomanto,项目名称:le2,代码行数:24,代码来源:EventSystem.cpp
示例18: test_image_views
void test_image_views(const View& img_view, const string& prefix) {
check_image(img_view,prefix+"original.jpg");
check_image(subimage_view(img_view, iround(img_view.dimensions()/4), iround(img_view.dimensions()/2)),prefix+"cropped.jpg");
check_image(color_converted_view<gray8_pixel_t>(img_view),prefix+"gray8.jpg");
check_image(color_converted_view<gray8_pixel_t>(img_view,my_color_converter()),prefix+"my_gray8.jpg");
check_image(transposed_view(img_view),prefix+"transpose.jpg");
check_image(rotated180_view(img_view),prefix+"rot180.jpg");
check_image(rotated90cw_view(img_view),prefix+"90cw.jpg");
check_image(rotated90ccw_view(img_view),prefix+"90ccw.jpg");
check_image(flipped_up_down_view(img_view),prefix+"flipped_ud.jpg");
check_image(flipped_left_right_view(img_view),prefix+"flipped_lr.jpg");
check_image(subsampled_view(img_view,typename View::point_t(2,1)),prefix+"subsampled.jpg");
check_image(nth_channel_view(img_view,0),prefix+"0th_channel.jpg");
// some iterator math
ptrdiff_t dst=(img_view.end()-(img_view.begin()+4500))+4500; ignore_unused_variable_warning(dst);
ptrdiff_t dst2=img_view.end()-img_view.begin(); ignore_unused_variable_warning(dst2);
ptrdiff_t sz=img_view.size(); ignore_unused_variable_warning(sz);
io_error_if(sz!=dst2);
}
开发者ID:apextw,项目名称:Ramen,代码行数:21,代码来源:image.cpp
示例19: GEMM
static void
GEMM (const Teuchos::ETransp transA,
const Teuchos::ETransp transB,
const double& alpha,
const View<const double**, LayoutLeft, DeviceType>& A,
const View<const double**, LayoutLeft, DeviceType>& B,
const double& beta,
const View<double**, LayoutLeft, DeviceType>& C)
{
const int n = static_cast<int> (C.dimension_1 ());
// For some BLAS implementations (e.g., MKL), GEMM when B has
// one column may be signficantly less efficient than GEMV.
if (n == 1 && transB == Teuchos::NO_TRANS) {
char trans = 'N';
if (transA == Teuchos::TRANS) {
trans = 'T';
}
else if (transA == Teuchos::CONJ_TRANS) {
trans = 'C';
}
auto B_0 = Kokkos::subview (B, Kokkos::ALL (), 0);
auto C_0 = Kokkos::subview (C, Kokkos::ALL (), 0);
KokkosBlas::gemv (&trans, alpha, A, B_0, beta, C_0);
}
else {
const int m = static_cast<int> (C.dimension_0 ());
const int k = static_cast<int> (transA == Teuchos::NO_TRANS ? A.dimension_1 () : A.dimension_0 ());
const int lda = static_cast<int> (Impl::getStride2DView (A));
const int ldb = static_cast<int> (Impl::getStride2DView (B));
const int ldc = static_cast<int> (Impl::getStride2DView (C));
Teuchos::BLAS<int,double> blas;
blas.GEMM (transA, transB, m, n, k, alpha,
A.ptr_on_device(), lda,
B.ptr_on_device(), ldb,
beta, C.ptr_on_device(), ldc);
}
}
开发者ID:cihanuq,项目名称:Trilinos,代码行数:39,代码来源:Kokkos_MV_GEMM.hpp
示例20: handleMouseEvents
void ViewManager::handleMouseEvents(M4EventType event) {
Common::Point mousePos = _vm->_mouse->currentPos();
ListIterator i;
View *view;
bool blockedFlag;
bool foundFlag;
// If a window sets the _captureEvents flag to true, it will receive all events until
// it sets it to false, even if it's not the top window
if (_captureEvents) {
if (_captureScreen->screenFlags().get & SCREVENT_MOUSE)
(_captureScreen->onEvent)(event, 0, mousePos.x, mousePos.y, _captureEvents);
} else {
blockedFlag = false;
foundFlag = false;
view = NULL;
// Loop from the front to back view
for (i = _views.reverse_begin(); (i != _views.end()) && !foundFlag && !blockedFlag; --i) {
view = *i;
if (!view->isVisible()) continue;
if (view->screenFlags().blocks & SCREVENT_MOUSE)
blockedFlag = true;
if ((view->screenFlags().get & SCREVENT_MOUSE) && view->isInside(mousePos.x, mousePos.y))
foundFlag = true;
}
if (foundFlag)
view->onEvent(event, 0, mousePos.x, mousePos.y, _captureEvents);
else
_captureEvents = false;
if (_captureEvents)
_captureScreen = view;
}
}
开发者ID:havlenapetr,项目名称:Scummvm,代码行数:37,代码来源:viewmgr.cpp
注:本文中的View类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论