本文整理汇总了C++中SharedArray::get方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedArray::get方法的具体用法?C++ SharedArray::get怎么用?C++ SharedArray::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharedArray
的用法示例。
在下文中一共展示了SharedArray::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateCamPosition
void RendererService::updateCamPosition(SharedArray positionValue,
SharedArray focalValue,
SharedArray viewUpValue)
{
vtkCamera* camera = m_render->GetActiveCamera();
camera->SetPosition(positionValue.get());
camera->SetFocalPoint(focalValue.get());
camera->SetViewUp(viewUpValue.get());
camera->SetClippingRange(0.1, 1000000);
m_interactorManager->getInteractor()->Render();
}
示例2: notifyCamPositionUpdated
void RendererService::notifyCamPositionUpdated()
{
vtkCamera* camera = m_render->GetActiveCamera();
SharedArray position = SharedArray(new double[3]);
SharedArray focal = SharedArray(new double[3]);
SharedArray viewUp = SharedArray(new double[3]);
std::copy(camera->GetPosition(), camera->GetPosition()+3, position.get());
std::copy(camera->GetFocalPoint(), camera->GetFocalPoint()+3, focal.get());
std::copy(camera->GetViewUp(), camera->GetViewUp()+3, viewUp.get());
fwServicesBlockAndNotifyMacro( this->getLightID(), m_sigCamUpdated,
(position, focal, viewUp),
m_slotUpdateCamPosition );
}
示例3: loadBspDirEntry
bool BspSceneFile::loadBspDirEntry(std::istream& bspStream, const Q3Bsp::DirEntry& entry, SharedArray<uint8_t>::Type& outData) {
if (!bspStream.seekg(entry.offset, std::ios::beg)) {
return false;
}
outData.reset(new uint8_t[entry.length]);
if (!bspStream.read(reinterpret_cast<char*>(outData.get()), entry.length)) {
return false;
}
return true;
}
示例4: basicSample
void basicSample()
{
poco_assert( UDT_use_count == 0 ); // reality check
// test shared_array with a built-in type
char * cap = new char [ 100 ];
SharedArray<char> ca ( cap );
poco_assert( ca.get() == cap );
poco_assert( cap == ca.get() );
poco_assert( &ca[0] == cap );
strcpy( ca.get(), "Hot Dog with mustard and relish" );
poco_assert( strcmp( ca.get(), "Hot Dog with mustard and relish" ) == 0 );
poco_assert( strcmp( cap, "Hot Dog with mustard and relish" ) == 0 );
poco_assert( ca[0] == 'H' );
poco_assert( ca[30] == 'h' );
SharedArray<char> ca2 ( ca );
SharedArray<char> ca3 ( ca2 );
ca[0] = 'N';
ca[4] = 'd';
poco_assert( strcmp( ca.get(), "Not dog with mustard and relish" ) == 0 );
poco_assert( strcmp( ca2.get(), "Not dog with mustard and relish" ) == 0 );
poco_assert( strcmp( ca3.get(), "Not dog with mustard and relish" ) == 0 );
ca2.reset();
ca.reset();
poco_assert( ca.get() == 0 );
SharedArray<char> ca4;
swap( ca3, ca4 );
poco_assert( strcmp( ca4.get(), "Not dog with mustard and relish" ) == 0 );
poco_assert( ca3.get() == 0 );
std::set< SharedArray<char> > sca;
sca.insert(ca4);
poco_assert( sca.find(ca4) != sca.end() );
poco_assert( sca.find(ca4) == sca.find( SharedArray<char>(ca4) ) );
// test shared_array with user defined type
SharedArray<UDT> udta ( new UDT[3] );
udta[0].value( 111 );
udta[1].value( 222 );
udta[2].value( 333 );
SharedArray<UDT> udta2 ( udta );
poco_assert( udta[0].value() == 111 );
poco_assert( udta[1].value() == 222 );
poco_assert( udta[2].value() == 333 );
poco_assert( udta2[0].value() == 111 );
poco_assert( udta2[1].value() == 222 );
poco_assert( udta2[2].value() == 333 );
udta2.reset();
poco_assert( udta2.get() == 0 );
poco_assert( UDT_use_count == 3 ); // reality check
std::cout << "OK\n";
}