当前位置: 首页>>代码示例>>C++>>正文


C++ NodeData类代码示例

本文整理汇总了C++中NodeData的典型用法代码示例。如果您正苦于以下问题:C++ NodeData类的具体用法?C++ NodeData怎么用?C++ NodeData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了NodeData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: resultPtr

std::shared_ptr<NodeData> EnvirePhysics::getInertialNode(const smurf::Inertial& inertial, const envire::core::FrameId& frame)
{
  NodeData * result = new NodeData;
  std::shared_ptr<NodeData> resultPtr(result);
  urdf::Inertial inertialUrdf = inertial.getUrdfInertial();
  result->init(inertial.getName());
  result->initPrimitive(mars::interfaces::NODE_TYPE_SPHERE, mars::utils::Vector(0.1, 0.1, 0.1), inertialUrdf.mass);
  result->groupID = inertial.getGroupId();
  result->movable = true;
  result->inertia[0][0] = inertialUrdf.ixx;
  result->inertia[0][1] = inertialUrdf.ixy;
  result->inertia[0][2] = inertialUrdf.ixz;
  result->inertia[1][0] = inertialUrdf.ixy;
  result->inertia[1][1] = inertialUrdf.iyy;
  result->inertia[1][2] = inertialUrdf.iyz;
  result->inertia[2][0] = inertialUrdf.ixz;
  result->inertia[2][1] = inertialUrdf.iyz;
  result->inertia[2][2] = inertialUrdf.izz;
  result->inertia_set = true;
  result->c_params.coll_bitmask = 0;
#ifdef DEBUG
  LOG_DEBUG("[EnvirePhysics::getInertialNode] Inertial object's mass: %f", result->mass);
#endif
  result->density = 0.0;
  setPos(frame, resultPtr);
  return resultPtr;
}
开发者ID:envire,项目名称:simulation-envire_mars,代码行数:27,代码来源:EnvirePhysics.cpp

示例2: NodeData

void MCTreeData::add(NodeSite *node) {
    node->initSum();
    if (_root->isFull()) {
        NodeData *newRoot = new NodeData(_width, _root->level() + 1);
        newRoot->add(_root);
        _root = newRoot;
    }
    _root->add(node);
}
开发者ID:newmen,项目名称:monte-carlo_techs,代码行数:9,代码来源:mctree_data.cpp

示例3: unknown

bool NodeToVnfmEvent::
unknown(NodeData & a_rNodeData, DashBoard & a_board)
{
    gLog->WARNING("unknown");
    gLog->WARNING("%-24s| unknown - [%d] [%s]",
        "NodeToVnfmEvent",
        a_rNodeData.GetCommand(),
        a_rNodeData.GetBody().c_str());
    return true;
}
开发者ID:Ntels-sup,项目名称:SRC_ATOM_BE,代码行数:10,代码来源:NodeToVnfmEvent.cpp

示例4: testConstructors

NodeData testConstructors() {
    NodeData A;
    assert(A.getToken() == "");
    assert(A.getCount() == 1);
    NodeData B("hello world");
    assert(B.getToken() == "hello world");
    NodeData C(B);
    assert(C.getToken() == "hello world");
    return B;
}
开发者ID:jamesus95,项目名称:Cpp,代码行数:10,代码来源:testData.cpp

示例5: handleData

//-----------------------------------------------------------------------------
void IoHandler::handleData(QByteArray *pPacket)
{
    NodeData *pData = new NodeData;
	pData->UpdateData(pPacket);
	pData->timeStamp= QTime::currentTime();

    pNodeDb->addData(pData);

    emit dataReceived();
}
开发者ID:RByambajav,项目名称:TI_Zigbee_Sensor_Monitor,代码行数:11,代码来源:iohandler.cpp

示例6: OutputNodeData

void OutputNodeData(NodeData & ndata)
{
	NodeData::iterator nit;
	int count(0);

	for(nit= ndata.begin(); nit!= ndata.end(); ++nit)
	{
		cout<<"         \""<<nit->first.c_str()<<"\" = \""<<nit->second.c_str()<<"\""<<endl;
	}

	cout<<"\n  NodeData size: "<<ndata.size()<<"\n\n\n\n"<<endl;
}
开发者ID:SiteView,项目名称:eccmeteor,代码行数:12,代码来源:util.cpp

示例7: GetNodeDataRawDataSize

S_UINT GetNodeDataRawDataSize(NodeData & ndata)
{
	S_UINT len=0,tlen=sizeof(S_UINT);
	len+=tlen + tlen;	
	NodeData::iterator it;
	for(it=ndata.begin();it!=ndata.end();it++)
	{
		len+=(S_UINT)strlen(it->first.c_str())+1;
		len+=(S_UINT)strlen(it->second.c_str())+1;
	}

	return len;
}
开发者ID:SiteView,项目名称:eccmeteor,代码行数:13,代码来源:util.cpp

示例8: nodePtr

std::shared_ptr<NodeData> EnvirePhysics::getCollidableNode(const smurf::Collidable& collidable, const envire::core::FrameId& frame) {
  NodeData * node = new NodeData;
  std::shared_ptr<NodeData> nodePtr(node);
  urdf::Collision collision = collidable.getCollision();
  node->init(collision.name);
  node->fromGeometry(collision.geometry);
  node->density = 0.0;
  node->mass = 0.00001;
  setPos(frame, nodePtr);
  node->movable = true;
  node->c_params.fromSmurfCP(collidable.getContactParams());
  node->groupID = collidable.getGroupId();
  return nodePtr;
}
开发者ID:envire,项目名称:simulation-envire_mars,代码行数:14,代码来源:EnvirePhysics.cpp

示例9: addFloor

 void EnvireSmurfLoader::addFloor(const vertex_descriptor &center)
 {
     NodeData data;
     data.init("floorData", Vector(0,0,0));
     data.initPrimitive(interfaces::NODE_TYPE_BOX, Vector(25, 25, 0.1), 0.0001);
     data.movable = false;
     mars::sim::PhysicsConfigMapItem::Ptr item(new mars::sim::PhysicsConfigMapItem);
     data.material.transparency = 0.5;
     //data.material.ambientFront = mars::utils::Color(0.0, 1.0, 0.0, 1.0);
     // TODO Fix the material data is lost in the conversion from/to configmap
     data.material.emissionFront = mars::utils::Color(1.0, 1.0, 1.0, 1.0);
     LOG_DEBUG("Color of the Item in the addFloor: %f , %f, %f, %f", data.material.emissionFront.a , data.material.emissionFront.b, data.material.emissionFront.g, data.material.emissionFront.r );
     data.toConfigMap(&(item.get()->getData()));
     control->graph->addItemToFrame(control->graph->getFrameId(center), item);
 }                                      
开发者ID:envire,项目名称:simulation-envire_mars,代码行数:15,代码来源:EnvireSmurfLoader.cpp

示例10: locker

int LimitedNodeList::updateNodeWithDataFromPacket(QSharedPointer<NLPacket> packet, SharedNodePointer sendingNode) {
    QMutexLocker locker(&sendingNode->getMutex());

    NodeData* linkedData = sendingNode->getLinkedData();
    if (!linkedData && linkedDataCreateCallback) {
        linkedDataCreateCallback(sendingNode.data());
    }

    if (linkedData) {
        QMutexLocker linkedDataLocker(&linkedData->getMutex());
        return linkedData->parseData(*packet);
    }
    
    return 0;
}
开发者ID:Giugiogia,项目名称:hifi,代码行数:15,代码来源:LimitedNodeList.cpp

示例11: testSetters

NodeData testSetters(NodeData& B) {
    NodeData A("a");
    A.decreaseCount();
    assert(A.getCount() == 0);
    
    int bCount = 7;
    while(B.getCount() < bCount) {
        B.increaseCount();
    }
    assert(B.getCount() == bCount);

    assert(A.getToken() < B.getToken());

    A = B;
    assert(A.getToken() == B.getToken());    
    return B;
}
开发者ID:jamesus95,项目名称:Cpp,代码行数:17,代码来源:testData.cpp

示例12: assert

/** 
 * @brief copy constructor
 * @details creates a copy of the passed in TBST
 * 
 * @param other TBST tree to copy
 */
TBST::TBST(const TBST& other) {
    root = NULL;
    nodeCount = 0;
    if(other.root != NULL) {
        // handle root separately
        assert(root == NULL); // make sure that tree is empty
        // then add the root
        NodeData* rootData = other.root->getData();
        insert(rootData->getToken(), rootData->getCount());

        // recursively copy the left and right subtrees
        recursiveCopy(other.root->getLeft());
        recursiveCopy(other.root->getRight());
    }
    else {
        root = NULL;
    }
}
开发者ID:jamesus95,项目名称:Cpp,代码行数:24,代码来源:tbst.cpp

示例13: CreateNodeDataByRawData

bool	CreateNodeDataByRawData(NodeData & ndata,const char *lpbuf,S_UINT bufsize)
{
	if(lpbuf==NULL)
		return false;

	if(bufsize<sizeof(S_UINT))
		return false;
		
	S_UINT len=0,tlen=sizeof(S_UINT);

	try{

		const char *pend=lpbuf+bufsize;
		const char *pt=lpbuf;
		memmove(&len,pt,tlen);
		pt+=tlen;
		if(pt>pend)
			return false;

		if(len!=bufsize)
		{
			puts("Raw data of NodeData error");
			return false;
		}

		S_UINT count;
		memmove(&count,pt,tlen);
		pt+=tlen;


		std::string str1,str2;
		S_UINT datalen;
		char * data;

		for(S_UINT i=0;i<count;i++)
		{
			str1=pt;
			pt+=strlen(str1.c_str())+1;
			if(pt>pend)
				return true;

			str2=pt;
			pt+=strlen(str2.c_str())+1;
			if(pt>pend)
				return true;

			ndata.insert(std::make_pair(str1,str2));
		}
	}catch(...)
	{
		cout<<"Exception to CreateNodeDataByRawData."<<endl;
		return false;
	}
    
	return true;
}
开发者ID:SiteView,项目名称:eccmeteor,代码行数:56,代码来源:util.cpp

示例14: LOG_DEBUG

void EnvirePhysics::itemAdded(const TypedItemAddedEvent<Item<urdf::Collision>>& e)
{
#ifdef DEBUG
  LOG_DEBUG(("[EnvirePhysics::ItemAdded] urdf::Collision item received in frame *** " + e.frame + "***").c_str());
#endif
  urdf::Collision collision = e.item->getData();
  NodeData * node = new NodeData;
  node->init(collision.name);
  node->fromGeometry(collision.geometry);
  node->mass = 0.00001;
  node->density = 0.0;
  std::shared_ptr<NodeData> nodePtr(node);
  setPos(e.frame, nodePtr);
  node->movable = true;
  if (instantiateNode(nodePtr, e.frame))
  {
#ifdef DEBUG    
    LOG_DEBUG(("[EnvirePhysics::ItemAdded] Smurf::Collision - Instantiated and stored the nodeInterface in frame ***" + e.frame +"***").c_str());
#endif
  }
}
开发者ID:envire,项目名称:simulation-envire_mars,代码行数:21,代码来源:EnvirePhysics.cpp

示例15: locker

int LimitedNodeList::updateNodeWithDataFromPacket(const SharedNodePointer& matchingNode, const QByteArray &packet) {
    QMutexLocker locker(&matchingNode->getMutex());

    matchingNode->setLastHeardMicrostamp(usecTimestampNow());

    // if this was a sequence numbered packet we should store the last seq number for
    // a packet of this type for this node
    PacketType packetType = packetTypeForPacket(packet);
    if (SEQUENCE_NUMBERED_PACKETS.contains(packetType)) {
        matchingNode->setLastSequenceNumberForPacketType(sequenceNumberFromHeader(packet, packetType), packetType);
    }

    NodeData* linkedData = matchingNode->getLinkedData();
    if (!linkedData && linkedDataCreateCallback) {
        linkedDataCreateCallback(matchingNode.data());
    }

    if (linkedData) {
        QMutexLocker linkedDataLocker(&linkedData->getMutex());
        return linkedData->parseData(packet);
    }
    return 0;
}
开发者ID:Dreckinfeuer,项目名称:hifi,代码行数:23,代码来源:LimitedNodeList.cpp


注:本文中的NodeData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。