本文整理汇总了C++中vctDynamicVector::SetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ vctDynamicVector::SetSize方法的具体用法?C++ vctDynamicVector::SetSize怎么用?C++ vctDynamicVector::SetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vctDynamicVector
的用法示例。
在下文中一共展示了vctDynamicVector::SetSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BHMotion
BHMotion() : mtsTaskPeriodic( "BHMotion", 0.001, true ){
q.SetSize(4);
q.SetAll(0.0);
mtsInterfaceRequired* input = AddInterfaceRequired( "Input" );
mtsInterfaceRequired* output = AddInterfaceRequired( "Output" );
input->AddFunction( "GetPositionJoint", GetPositions );
output->AddFunction( "SetPositionJoint", SetPositions );
}
示例2: WAMMotion
WAMMotion( double period ) :
mtsTaskPeriodic( "WAMMotion", period, true ){
q.SetSize(7);
q.SetAll(0.0);
mtsInterfaceRequired* input = AddInterfaceRequired( "Input" );
mtsInterfaceRequired* output = AddInterfaceRequired( "Output" );
input->AddFunction( "GetPositionJoint", GetPositions );
output->AddFunction( "SetPositionJoint", SetPositions );
}
示例3: getFrame
void Camera::getFrame(vctDynamicVector<vct3> & points) {
sm = PXCSenseManager::CreateInstance();
PXCCaptureManager *cm = sm->QueryCaptureManager();
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 640, 480, 30);
pxcStatus sts = sm->Init();
if (sts < PXC_STATUS_NO_ERROR) {
std::cout << "DIDN\'T WORK" << std::endl;
}
PXCCapture::Device *device = sm->QueryCaptureManager()->QueryDevice();
device->ResetProperties(PXCCapture::STREAM_TYPE_ANY);
std::cout << device->SetDepthUnit(1000) << std::endl;
PXCProjection *projection = device->CreateProjection();
pxcStatus sts2 = sm->AcquireFrame(false);
if (sts2 >= PXC_STATUS_NO_ERROR) {
PXCCapture::Sample *sample = sm->QuerySample();
PXCImage* image = (*sample)[streamType];
PXCImage::ImageInfo info = {};
PXCImage::ImageData data;
image->AcquireAccess(PXCImage::ACCESS_READ, &data);
PXCImage::ImageInfo dinfo = sample->depth->QueryInfo();
int dpitch = data.pitches[0] / sizeof(short);
short *dpixels = (short*)data.planes[0];
int i = 0;
points.SetSize(dinfo.width * dinfo.height);
PXCPoint3DF32 * vertices = new PXCPoint3DF32[dinfo.width * dinfo.height];
projection->QueryVertices(image, vertices);
int c = 0;
for (int i = 0; i < points.size(); i++) {
PXCPoint3DF32 point = vertices[i];
if (point.z != 0) {
vct3 newPoint(point.x, point.y, point.z);
points[c++] = newPoint;
}
}
points.resize(c);
image->ReleaseAccess(&data);
}
projection->Release();
std::cout << sts2 << std::endl;
}