本文整理汇总了C++中Stage类的典型用法代码示例。如果您正苦于以下问题:C++ Stage类的具体用法?C++ Stage怎么用?C++ Stage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Stage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
/**
* One-time setup in response to Application InitSignal.
*/
void Create( Application& application )
{
Stage stage = Stage::GetCurrent();
stage.KeyEventSignal().Connect(this, &TextLabelMultiLanguageExample::OnKeyEvent);
stage.SetBackgroundColor( Color::WHITE );
mTableView = Toolkit::TableView::New( NUMBER_OF_LANGUAGES, 1 );
mTableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
mTableView.TouchSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouch );
stage.Add( mTableView );
for( unsigned int index = 0u; index < NUMBER_OF_LANGUAGES; ++index )
{
const Language& language = LANGUAGES[index];
TextLabel label = TextLabel::New();
label.SetProperty( TextLabel::Property::MULTI_LINE, true );
const std::string text = language.languageName + " " + language.languageRomanName + " " + language.text;
label.SetProperty( TextLabel::Property::TEXT, text );
mTableView.SetFitHeight( index );
mTableView.AddChild( label, Toolkit::TableView::CellPosition( index, 0 ) );
}
}
示例2: writeStart
//------------------------------------------------------------------------------
/// ステージの記録を開始することを通知します。
///
/// @param[in] aStage 現在実行しているステージを表す Stage クラスへの参照。
void RecordStage::writeStart(const Stage& aStage)
{
#ifdef DEBUG
mField.set(aStage.field());
mItems.set(aStage.items());
#endif
}
示例3: Initialize
void DynamicsWorld::Initialize(Stage& stage, Integration::DynamicsFactory& dynamicsFactory, DynamicsWorldConfigPtr config)
{
// Create shader for debug drawing
const std::string debugDrawVertexShader(
"attribute lowp vec4 aColor;\n"
"varying mediump vec4 vColor;\n"
"void main()\n"
"{\n"
" vColor = aColor;\n"
" gl_Position = uMvpMatrix * vec4(aPosition, 1.0);\n"
"}\n" );
const std::string debugDrawFragmentShader(
"varying mediump vec4 vColor;\n"
"void main()\n"
"{\n"
" gl_FragColor = vColor;\n"
"}\n" );
mDebugShader = ShaderEffect::New(debugDrawVertexShader, debugDrawFragmentShader, GEOMETRY_TYPE_IMAGE, Dali::ShaderEffect::HINT_NONE);
mDynamicsWorld = new SceneGraph::DynamicsWorld( stage.GetDynamicsNotifier(),
stage.GetNotificationManager(),
dynamicsFactory );
Integration::DynamicsWorldSettings* worldSettings( new Integration::DynamicsWorldSettings(*config->GetSettings()) );
const SceneGraph::Shader* shader( static_cast< const SceneGraph::Shader* >(mDebugShader->GetSceneObject()) );
InitializeDynamicsWorldMessage( stage.GetUpdateManager(), mDynamicsWorld, worldSettings, shader );
mGravity = config->GetGravity();
}
示例4: update_debug_mesh
void Boid::update_debug_mesh() const {
Stage* stage = actor_->stage();
assert(stage);
auto mesh = stage->mesh(debug_mesh_).lock();
auto& vd = mesh->submesh(normal_points_mesh_).vertex_data();
auto& id = mesh->submesh(normal_points_mesh_).index_data();
vd.clear();
id.clear();
vd.move_to_start();
int i = 0;
for(kglt::Vec3 p: normal_points_) {
vd.position(p);
vd.diffuse(kglt::Colour::red);
vd.tex_coord0(kglt::Vec2());
vd.tex_coord1(kglt::Vec2());
vd.normal(kglt::Vec3());
vd.move_next();
id.index(i++);
}
id.done();
vd.done();
}
示例5: OnInit
void OnInit( Application& application )
{
// Create a ScrollView instance
ScrollView scrollView = ScrollView::New();
scrollView.SetParentOrigin( ParentOrigin::CENTER );
Stage stage = Stage::GetCurrent();
stage.Add(scrollView);
// Set the size of scrollView; it covers the entire stage
Size size = stage.GetSize();
scrollView.SetSize(size);
// Add actors to the ScrollView
for( int i = 0; i < NUM_IMAGES; ++i )
{
AddImage( scrollView, size, i );
}
// The ScrollView contents are now draggable
// To enforce horizontal-only scrolling, the Y axis ruler can be disabled
RulerPtr rulerY = new DefaultRuler();
rulerY->Disable();
scrollView.SetRulerY( rulerY );
// A domain can be applied to rulers to prevent scrolling beyond this boundary
// In this case, to 4 times the width of the stage, allowing for 4 pages to be scrolled
RulerPtr rulerX2 = new FixedRuler( size.width );
rulerX2->SetDomain( RulerDomain( 0.0f, size.width*NUM_IMAGES ) );
scrollView.SetRulerX( rulerX2 );
// Connect key event signal
stage.KeyEventSignal().Connect( this, &ScrollViewSample::OnKeyEvent );
}
示例6: QString
void CascadeWriter::writeStages()
{
xml.writeStartElement("stages");
for (int i = 0; i < m_cascadeObj.stageNum(); i++)
{
QString stageStr = QString(" stage %1 ").arg(i);
xml.writeComment(stageStr);
Stage stage = m_cascadeObj.getStage(i);
xml.writeStartElement("_");
xml.writeTextElement("maxWeakCount", QString::number(stage.maxWeakCount()));
xml.writeTextElement("stageThreshold", QString::number(stage.stageThreshold()));
// write weak classifiers
xml.writeStartElement("weakClassifiers");
for (int j = 0; j < stage.maxWeakCount(); j++)
{
WeakClassifier wc = stage.getWeakClassifier(j);
xml.writeStartElement("_");
xml.writeTextElement("internalNodes", wc.internalNodes());
xml.writeTextElement("leafValues", wc.leafValues());
xml.writeEndElement();
}
xml.writeEndElement();
xml.writeEndElement();
}
xml.writeEndElement();
}
示例7: UtcDaliHoverMultipleRenderableActors
int UtcDaliHoverMultipleRenderableActors(void)
{
TestApplication application;
Stage stage ( Stage::GetCurrent() );
Vector2 stageSize ( stage.GetSize() );
Actor parent = CreateRenderableActor();
parent.SetSize( 100.0f, 100.0f );
parent.SetAnchorPoint(AnchorPoint::TOP_LEFT);
stage.Add(parent);
Actor actor = CreateRenderableActor();
actor.SetSize( 100.0f, 100.0f );
actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
parent.Add(actor);
// Render and notify
application.SendNotification();
application.Render();
// Connect to layer's hovered signal
SignalData data;
HoverEventFunctor functor( data );
parent.HoveredSignal().Connect( &application, functor );
actor.HoveredSignal().Connect( &application, functor );
// Emit a started signal
application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( actor == data.hoveredActor );
END_TEST;
}
示例8: UtcDaliMagnifierFrameVisibility
int UtcDaliMagnifierFrameVisibility(void)
{
ToolkitTestApplication application;
Stage stage = Stage::GetCurrent();
Magnifier view = Magnifier::New();
stage.Add( view );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
view.SetProperty( Magnifier::Property::FRAME_VISIBILITY, false );
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), false, TEST_LOCATION );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), false, TEST_LOCATION );
view.SetProperty( Magnifier::Property::FRAME_VISIBILITY, true );
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
END_TEST;
}
示例9: UtcDaliStageKeepRenderingN
int UtcDaliStageKeepRenderingN(void)
{
TestApplication application;
Stage stage = Stage::GetCurrent();
// Run core until it wants to sleep
bool keepUpdating( true );
while ( keepUpdating )
{
application.SendNotification();
keepUpdating = application.Render( 1000.0f /*1 second*/ );
}
// Force rendering for the next 5 seconds
stage.KeepRendering( -1.0f );
application.SendNotification();
// Test that core wants to sleep after 10 seconds
keepUpdating = application.Render( 1000.0f /*1 second*/ );
DALI_TEST_CHECK( !keepUpdating );
END_TEST;
}
示例10: UtcDaliMagnifierSourcePosition
int UtcDaliMagnifierSourcePosition(void)
{
ToolkitTestApplication application;
Stage stage = Stage::GetCurrent();
Magnifier view = Magnifier::New();
stage.Add( view );
application.SendNotification();
application.Render();
Vector3 position( 100.0f, 200.0f, 300.0f );
DALI_TEST_CHECK( view.GetProperty( Magnifier::Property::SOURCE_POSITION ).Get< Vector3 >() != position );
view.SetProperty( Magnifier::Property::SOURCE_POSITION, position );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::SOURCE_POSITION ).Get< Vector3 >(), position, TEST_LOCATION );
view.SetProperty( Magnifier::Property::SOURCE_POSITION, Vector3::ONE );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::SOURCE_POSITION ).Get< Vector3 >(), Vector3::ONE, TEST_LOCATION );
END_TEST;
}
示例11:
int InitNMCModule3AxisStatic (int & iModules, Stage & stage, Path & path)
{
iModules=stage.Initialize("COM4:");
if (iModules < 3)
{
MessageBox(NULL,"3 servos not found","",MB_TASKMODAL | MB_SETFOREGROUND);
return -1;
}
stage.Rotate(180.0);
//Set the group address for both controllers to 128
stage.SetGroupAddress(128, eXAxis);
SetScaling_3AxisStatic(stage);
SetPIDGain_3AxisStatic(stage);
ServoOnNMCModule3AxisStatic(stage);
//Set the required status items for the path control module
stage.SetPathStatus();
// ServoSetIoCtrl(1, IO1_IN | IO2_IN);
// ServoSetIoCtrl(2, IO1_IN | IO2_IN);
// ServoSetIoCtrl(3, IO1_IN | IO2_IN);
return 0;
};
示例12: UtcDaliStageSignalWheelEventP
int UtcDaliStageSignalWheelEventP(void)
{
TestApplication application;
Stage stage = Stage::GetCurrent();
WheelEventSignalData data;
WheelEventReceivedFunctor functor( data );
stage.WheelEventSignal().Connect( &application, functor );
Integration::WheelEvent event( Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2( 0.0f, 0.0f ), 1, 1000u );
application.ProcessEvent( event );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event.type) == data.receivedWheelEvent.type );
DALI_TEST_CHECK( event.direction == data.receivedWheelEvent.direction );
DALI_TEST_CHECK( event.modifiers == data.receivedWheelEvent.modifiers );
DALI_TEST_CHECK( event.point == data.receivedWheelEvent.point );
DALI_TEST_CHECK( event.z == data.receivedWheelEvent.z );
DALI_TEST_CHECK( event.timeStamp == data.receivedWheelEvent.timeStamp );
data.Reset();
Integration::WheelEvent event2( Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2( 0.0f, 0.0f ), -1, 1000u );
application.ProcessEvent( event2 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event2.type) == data.receivedWheelEvent.type );
DALI_TEST_CHECK( event2.direction == data.receivedWheelEvent.direction );
DALI_TEST_CHECK( event2.modifiers == data.receivedWheelEvent.modifiers );
DALI_TEST_CHECK( event2.point == data.receivedWheelEvent.point );
DALI_TEST_CHECK( event2.z == data.receivedWheelEvent.z );
DALI_TEST_CHECK( event2.timeStamp == data.receivedWheelEvent.timeStamp );
END_TEST;
}
示例13: HitTest
bool HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results, HitTestInterface& hitTestInterface )
{
bool wasHit( false );
// Hit-test the system-overlay actors first
SystemOverlay* systemOverlay = stage.GetSystemOverlayInternal();
if ( systemOverlay )
{
RenderTaskList& overlayTaskList = systemOverlay->GetOverlayRenderTasks();
LayerList& overlayLayerList = systemOverlay->GetLayerList();
wasHit = HitTestForEachRenderTask( stage, overlayLayerList, overlayTaskList, screenCoordinates, results, hitTestInterface );
}
// Hit-test the regular on-stage actors
if ( !wasHit )
{
RenderTaskList& taskList = stage.GetRenderTaskList();
LayerList& layerList = stage.GetLayerList();
wasHit = HitTestForEachRenderTask( stage, layerList, taskList, screenCoordinates, results, hitTestInterface );
}
return wasHit;
}
示例14: data
void PcInfo::dumpOnePoint(const Stage& stage) const
{
const Schema& schema = stage.getSchema();
PointBuffer data(schema, 1);
boost::scoped_ptr<StageSequentialIterator> iter(stage.createSequentialIterator(data));
iter->skip(m_pointNumber);
const boost::uint32_t numRead = iter->read(data);
if (numRead != 1)
{
std::ostringstream oss;
oss << "problem reading point number " << m_pointNumber;
throw app_runtime_error(oss.str());
}
boost::property_tree::ptree tree = data.toPTree();
std::ostream& ostr = m_outputStream ? *m_outputStream : std::cout;
boost::property_tree::ptree output;
output.add_child("point", tree.get_child("0"));
if (m_useXML)
write_xml(ostr, output);
else
write_json(ostr, tree.get_child("0"));
return;
}
示例15: execute
int MyKernel::execute()
{
PointTable table;
StageFactory f;
Stage * reader = f.createStage("readers.las");
Options readerOptions;
readerOptions.add("filename", m_input_file);
reader->setOptions(readerOptions);
Stage * filter = f.createStage("filters.decimation");
Options filterOptions;
filterOptions.add("step", 10);
filter->setOptions(filterOptions);
filter->setInput(*reader);
Stage * writer = f.createStage("writers.text");
Options writerOptions;
writerOptions.add("filename", m_output_file);
writer->setOptions(writerOptions);
writer->setInput(*filter);
writer->prepare(table);
writer->execute(table);
return 0;
}