您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ updateHeight函数代码示例

51自学网 2021-06-03 09:13:40
  C++
这篇教程C++ updateHeight函数代码示例写得很实用,希望能帮到您。

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

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

示例1: doubleRotate

 static void doubleRotate(TLDNode *k1, TLDNode *k2, TLDNode *k3, TLDNode *p, int isLeftChild, TLDList *tld){    if (p == NULL)    {        tld->root = k2;        k2->parent = NULL;    }    else if (isLeftChild)    {        p->left = k2;        k2->parent = p;    }    else    {        p->right = k2;        k2->parent = p;    }    k3->left = k2->right;    updateParent(k3, k2->right);    k1->right = k2->left;    updateParent(k1, k2->left);    k2->left = k1;    k2->right = k3;    k1->parent = k2;    k3->parent = k2;    updateHeight(k1);    updateHeight(k3);}
开发者ID:antonbelev,项目名称:Glasgow_assignments,代码行数:28,


示例2: AVLNode

static AVLNode *insertNode(AVLNode *node,    const void* key, const void *value,Comparator comp){  if (node == nullptr){  // tree is empty    node =  new AVLNode(key,value);    assert(node != nullptr);    node->setHeight(0);    return node;  }  if(comp(key,node->key()) < 0){ // key is to the left    node->setLeft(insertNode(node->left(),key,value,comp)); // insert left    node->left()->setParent(node);  // connecting to parent    updateHeight(node); // re-calculating node height after change    return rebalanceNode(node);  }  if(comp(node->key(),key) < 0){  // key is to the right    node->setRight(insertNode(node->right(),key,value,comp));// right    node->right()->setParent(node); // connecting to parent    updateHeight(node); // re-calculating node height after change    return rebalanceNode(node);  // returning initial node following update  }  node->set(value); // < and > have failed: duplicate keys  return node;  // returning initial node with new value}
开发者ID:possientis,项目名称:Prog,代码行数:30,


示例3: balanceNode

static TreeNode * balanceNode(TreeNode * node){	int loadBalance = calcLoadBalance(node->left, node->right);	if(isUnbalanced(loadBalance) == RIGHTHEAVY)	{		int rightChildBalance = calcLoadBalance(node->right->left, node->right->right);		if(rightChildBalance > 0)		{			node->right = rightRotateTree(node->right);			updateHeight(node->right);		}		node = leftRotateTree(node);	}	if(isUnbalanced(loadBalance) == LEFTHEAVY)	{		int leftChildBalance = calcLoadBalance(node->left->left, node->left->right);		if(leftChildBalance < 0)		{			node->left = leftRotateTree(node->left);			updateHeight(node->left);		}		node = rightRotateTree(node);	}	return node;}
开发者ID:rchreptyk,项目名称:libRussell,代码行数:32,


示例4: tldlist_insert

static int tldlist_insert(char *tldStr, TLDNode *node, TLDList *tld){    int comparison = strcmp(tldStr, node->tld);    if (comparison == 0)    {        node->count++;        free(tldStr);        return 2; //tld already is in the tree    }    else if (comparison < 0 && node->left == NULL)    {        node->left = tldnode_create(node, tldStr, 1);        if (node->left == NULL)            return 0;        updateHeight(node->left);		restoreBalance(node->left, tld);        return 1;//TODO height    }    else if (comparison < 0 && node->left != NULL)        return tldlist_insert(tldStr, node->left, tld);    else if (comparison > 0 && node->right == NULL)    {        node->right = tldnode_create(node, tldStr, 1);        if (node->right == NULL)            return 0;        updateHeight(node->right);		restoreBalance(node->right, tld);        return 1;    }    else if (comparison > 0 && node->right != NULL)        return tldlist_insert(tldStr, node->right, tld);    return 0;}
开发者ID:antonbelev,项目名称:Glasgow_assignments,代码行数:33,


示例5: updateHeight

void AVLTree::leftLeft(AVLNode *& node) {    cout << "leftLeft" << endl;    AVLNode * temp;    temp = node;    node = node->left;    temp->left = node->right;    node->right = temp;    updateHeight(node->right);    updateHeight(node);}
开发者ID:TaylorEllington,项目名称:SearchEngine,代码行数:13,


示例6: deleteNode

static AVLNode *deleteNode(AVLNode *node, const void* key, Comparator comp){  if(node == nullptr) return nullptr;   // nothing to do on empty tree  if(comp(key,node->key()) < 0){  // key is to the left    AVLNode *temp = deleteNode(node->left(),key, comp);// left delete    node->setLeft(temp);  // linking new left child    if(temp != nullptr) temp->setParent(node); // parent link if applicable    updateHeight(node);     // re-calc height after change of child    return rebalanceNode(node);  // return original node after modification  }  if(comp(node->key(),key) < 0){  // key is to the right    AVLNode *temp = deleteNode(node->right(),key,comp);//right delete    node->setRight(temp);  // linking new right child    if(temp != nullptr) temp->setParent(node); // parent link if applicable    updateHeight(node);     // re-calc height after change of child    return rebalanceNode(node);  // return original node after modification  }  // key to be deleted is equal to node key  if(node->left() == nullptr){  // left child does not exist    AVLNode *temp = node->right(); //  candidate for tree after deletion    if(temp != nullptr) temp->setParent(nullptr); // new root    delete node; // just free memory for root node which is deleted    node = nullptr; // for safety reasons    return temp;  }  if(node->right() == nullptr){ // left child does exist, but not right child    AVLNode *temp = node->left();    temp->setParent(nullptr); // no need to check for null pointer now    delete node;  // just free memory for root node which is deleted    node = nullptr; // for safety reasons    return temp;  }  // both left and right child exist, while root needs to be deleted  // we arbitrarily choose to promote successor as new root  AVLNode *temp = rootMinNode(node->right());  temp->setLeft(node->left());  // gluing initial left child  temp->left()->setParent(temp);  // not forgetting parent link  updateHeight(temp); // re-calc height after change of child  delete node;  // just free memory for root node which is deleted  node = nullptr; // for safety reasons  return rebalanceNode(temp);}
开发者ID:possientis,项目名称:Prog,代码行数:49,


示例7: insertIntoTree

static TreeNode * insertIntoTree(AVLTree * tree, TreeNode * node, void * data, Boolean * success){	if(node == NULL)		return newTreeNode(data);	int comparision = tree->compare(data, node->data);	if(comparision == 0)	{		*success = false;		return node;	}	int direction = comparision > 0 ? RIGHT : LEFT;	if(direction == RIGHT)	{		node->right = insertIntoTree(tree, node->right, data, success);	}	else	{		node->left = insertIntoTree(tree, node->left, data, success);	}	updateHeight(node);	node = balanceNode(node);	return node;}
开发者ID:rchreptyk,项目名称:libRussell,代码行数:30,


示例8: Display

 OverlayImageDisplay::OverlayImageDisplay()   : Display(), width_(128), height_(128), left_(128), top_(128), alpha_(0.8),     is_msg_available_(false), require_update_(false) {   // setup properties   update_topic_property_ = new rviz::RosTopicProperty(     "Topic", "",     ros::message_traits::datatype<sensor_msgs::Image>(),     "sensor_msgs::Image topic to subscribe to.",     this, SLOT( updateTopic() ));   keep_aspect_ratio_property_ = new rviz::BoolProperty("keep aspect ratio", false,                                                        "keep aspect ratio of original image",                                                        this, SLOT(updateKeepAspectRatio()));   width_property_ = new rviz::IntProperty("width", 128,                                           "width of the image window",                                           this, SLOT(updateWidth()));   height_property_ = new rviz::IntProperty("height", 128,                                            "height of the image window",                                            this, SLOT(updateHeight()));   left_property_ = new rviz::IntProperty("left", 128,                                          "left of the image window",                                          this, SLOT(updateLeft()));   top_property_ = new rviz::IntProperty("top", 128,                                         "top of the image window",                                         this, SLOT(updateTop()));   alpha_property_ = new rviz::FloatProperty("alpha", 0.8,                                             "alpha belnding value",                                             this, SLOT(updateAlpha())); }
开发者ID:YoheiKakiuchi,项目名称:jsk_visualization,代码行数:29,


示例9: OverlayObject

 void Plotter2DDisplay::onInitialize() {   static int count = 0;   rviz::UniformStringStream ss;   ss << "Plotter2DDisplayObject" << count++;   overlay_.reset(new OverlayObject(ss.str()));   updateBufferSize();   onEnable();   updateShowValue();   updateWidth();   updateHeight();   updateLeft();   updateTop();   updateFGColor();   updateBGColor();   updateFGAlpha();   updateBGAlpha();   updateLineWidth();   updateUpdateInterval();   updateShowBorder();   updateAutoColorChange();   updateMaxColor();   updateShowCaption();   updateTextSize();   updateAutoScale();   updateMinValue();   updateMaxValue();   overlay_->updateTextureSize(width_property_->getInt(),                               height_property_->getInt() + caption_offset_); }
开发者ID:CPFL,项目名称:jsk_visualization_packages,代码行数:30,


示例10: while

void BSTree::insert(int x){    Node *parent = nullptr, *current = root;    while (current != nullptr)    {        parent = current;        if (x < current->value)            current = current->left;        else            current = current->right;    }    Node *newNode = new Node(x, parent);    if (parent)    {        if (x < parent->value)            parent->left = newNode;        else            parent->right = newNode;    }    else{        root = newNode;        newNode->height = 1;    }    for (Node *it = newNode; it != nullptr; it = it->parent){        it = updateHeight(it);    }    countOfElements++;}
开发者ID:Mikhail-M,项目名称:Programming_in_university,代码行数:33,


示例11: color

sbGroup::sbGroup(ofXML & xml,bGroup * destin):ofInterObj(){	dest=destin;	string font=xml.getCurrentTag().getAttribute("font");	xml.setCurrentTag(";blocks");	ofTag & tag=xml.getCurrentTag();	for (unsigned int i=0; i<tag.size(); i++) {		if (tag[i].getLabel()=="bar") {			string col=tag[i].getAttribute("color");			unsigned long colTrip=strtol(col.c_str(),NULL,0);			ofColor color(colTrip);			cout << tag[i].getAttribute("name") + " " + tag[i].getLabel() <<endl;			unsigned int curBar=bars.size();			bars.push_back( sideBar(-20,50+40*i,260,40,tag[i].getAttribute("name"),color));						for (unsigned int j=0; j<tag[i].size(); j++) {				if (tag[i][j].getLabel()=="block") {					bars[curBar].blocks.push_back(block(tag[i][j],color,j*45));				}			}		}	}	bars.push_back( sideBar(-20,50+40*bars.size(),260,40,"Filler",ofColor(0,0,0)));	if (bars.size()) {		y=bars[0].y;		x=0;		w=bars[0].w;	}	updateHeight();	if(bars.size()>=2) bars[bars.size()-2].Open=true;	for (unsigned int i=0; i<bars.size(); i++) {		//updateBlocks(i);	}}
开发者ID:heidgera,项目名称:RobotBlocks,代码行数:33,


示例12: SLOT

  FootstepDisplay::FootstepDisplay()  {    alpha_property_ =  new rviz::FloatProperty( "Alpha", 0.5,                                                "0 is fully transparent, 1.0 is fully opaque.",                                                this, SLOT( updateAlpha() ));    show_name_property_ = new rviz::BoolProperty(      "Show Name", true,      "Show name of each footstep",      this, SLOT(updateShowName()));    use_group_coloring_property_ = new rviz::BoolProperty(      "Use Group Coloring", false,      "Use footstep_group field to colorize footsteps",      this, SLOT(updateUseGroupColoring()));    width_property_ =  new rviz::FloatProperty(      "Width", 0.15,      "width of the footstep, it's not used if the dimensions is specified in Footstep message.",      this, SLOT( updateWidth() ));    height_property_ =  new rviz::FloatProperty(      "height", 0.01,      "height of the footstep, it's not used if the dimensions is specified in Footstep message.",      this, SLOT( updateHeight() ));    depth_property_ =  new rviz::FloatProperty(      "depth", 0.3,      "depth of the footstep, it's not used if the dimensions is specified in Footstep message.",      this, SLOT( updateDepth() ));  }
开发者ID:CPFL,项目名称:jsk_visualization_packages,代码行数:27,


示例13: connect

TemporalConstraintPresenter::TemporalConstraintPresenter(        const TemporalConstraintViewModel& cstr_model,        QGraphicsObject *parentobject,        QObject* parent) :    AbstractConstraintPresenter {"TemporalConstraintPresenter",                                 cstr_model,                                 new TemporalConstraintView{*this, parentobject},                                 parent}{    connect(::view(this), &TemporalConstraintView::constraintHoverEnter,            this,       &TemporalConstraintPresenter::constraintHoverEnter);    connect(::view(this), &TemporalConstraintView::constraintHoverLeave,            this,       &TemporalConstraintPresenter::constraintHoverLeave);    if(viewModel(this)->isRackShown())    {        on_rackShown(viewModel(this)->shownRack());    }    ::view(this)->setLabel(cstr_model.model().metadata.label());    connect(&cstr_model.model().metadata, &ModelMetadata::labelChanged,            ::view(this), &TemporalConstraintView::setLabel);    connect(&cstr_model.model().metadata,   &ModelMetadata::colorChanged,            ::view(this),   &TemporalConstraintView::setLabelColor);    updateHeight();}
开发者ID:gitter-badger,项目名称:i-score,代码行数:28,


示例14: updateHeight

void pluginDescWidget::leaveEvent( QEvent * _e ){	m_mouseOver = false;	m_targetHeight = 24;	updateHeight();	QWidget::leaveEvent( _e );}
开发者ID:bhattigurjot,项目名称:lmms,代码行数:7,


示例15: height

void pluginDescWidget::enterEvent( QEvent * _e ){	m_mouseOver = true;	m_targetHeight = height() + 1;	updateHeight();	QWidget::enterEvent( _e );}
开发者ID:bhattigurjot,项目名称:lmms,代码行数:7,


示例16: updateHeight

void GuiGameListMenuCtrl::enforceConstraints(){   if (hasValidProfile())   {      ((GuiGameListMenuProfile *)mProfile)->enforceConstraints();   }   updateHeight();}
开发者ID:adhistac,项目名称:ee-client-2-0,代码行数:8,


示例17: clearRackPresenter

void ConstraintPresenter::on_rackShown(const Id<RackModel>& rackId){    clearRackPresenter();    createRackPresenter(m_viewModel.model().racks.at(rackId));    m_header->setState(ConstraintHeader::State::RackShown);    updateHeight();}
开发者ID:OpenDAWN,项目名称:i-score,代码行数:8,


示例18: ITNode

 ITNode(Key *k, const ITNode* lptr, const ITNode* hptr) : key(k), lesser(lptr), greater(hptr) {   assert(false);   lesser = new(Key) (*lptr);   *lesser = *lptr;   greater = new(Key) (*hptr);   *greater = *hptr;   updateHeight(); }
开发者ID:scoiatael,项目名称:ThingsIdidAtII,代码行数:10,


示例19: updateHeight

void sbGroup::update(){	for (unsigned int i=0; i<bars.size(); i++) {		for (unsigned int j=0; j<bars[i].size(); j++) {			if(bars[i][j].updateSize())				updateHeight();			bars[i][j].updatePositions();		}	}}
开发者ID:heidgera,项目名称:RobotBlocks,代码行数:10,


示例20: Display

GridDisplay::GridDisplay(): Display(){  frame_property_ = new TfFrameProperty( "Reference Frame", TfFrameProperty::FIXED_FRAME_STRING,                                         "The TF frame this grid will use for its origin.",                                         this, 0, true );  cell_count_property_ = new IntProperty( "Plane Cell Count", 10,                                          "The number of cells to draw in the plane of the grid.",                                          this, SLOT( updateCellCount() ));  cell_count_property_->setMin( 1 );  height_property_ = new IntProperty( "Normal Cell Count", 0,                                      "The number of cells to draw along the normal vector of the grid. "                                      " Setting to anything but 0 makes the grid 3D.",                                      this, SLOT( updateHeight() ));  height_property_->setMin( 0 );  cell_size_property_ = new FloatProperty( "Cell Size", 1.0f,                                           "The length, in meters, of the side of each cell.",                                           this, SLOT( updateCellSize() ));  cell_size_property_->setMin( 0.0001 );  style_property_ = new EnumProperty( "Line Style", "Lines",                                      "The rendering operation to use to draw the grid lines.",                                      this, SLOT( updateStyle() ));  style_property_->addOption( "Lines", Grid::Lines );  style_property_->addOption( "Billboards", Grid::Billboards );  line_width_property_ = new FloatProperty( "Line Width", 0.03,                                            "The width, in meters, of each grid line.",                                            style_property_, SLOT( updateLineWidth() ), this );  line_width_property_->setMin( 0.001 );  line_width_property_->hide();  color_property_ = new ColorProperty( "Color", Qt::gray,                                       "The color of the grid lines.",                                       this, SLOT( updateColor() ));  alpha_property_ = new FloatProperty( "Alpha", 0.5f,                                       "The amount of transparency to apply to the grid lines.",                                       this, SLOT( updateColor() ));  alpha_property_->setMin( 0.0f );  alpha_property_->setMax( 1.0f );  plane_property_ = new EnumProperty( "Plane", "XY",                                      "The plane to draw the grid along.",                                      this, SLOT( updatePlane() ));  plane_property_->addOption( "XY", XY );  plane_property_->addOption( "XZ", XZ );  plane_property_->addOption( "YZ", YZ );  offset_property_ = new VectorProperty( "Offset", Ogre::Vector3::ZERO,                                         "Allows you to offset the grid from the origin of the reference frame.  In meters.",                                         this, SLOT( updateOffset() ));}
开发者ID:jkammerl,项目名称:rviz,代码行数:55,


示例21: removeNode

static TreeNode * removeNode(AVLTree * tree, TreeNode * node, void * data, void ** removedData){	if(node == NULL)		return NULL;	int comparision = tree->compare(data, node->data);	if(comparision > 0)	{		node->right = removeNode(tree, node->right, data, removedData);	}		if(comparision < 0)	{		node->left = removeNode(tree, node->left, data, removedData);	}	if(comparision == 0)	{		*removedData = node->data;		if(node->left == NULL && node->right == NULL) /*leaf node*/		{			destroyNode(node);			node = NULL;			return node;		}		else if(node->left != NULL && node->right != NULL)		{			node->data = replaceWithData(node->left, data);			node->left = removeNode(tree, node->left, data, removedData);		}		else if(node->left != NULL) /*only left node*/		{			TreeNode * leftNode = node->left;			*removedData = node->data;			destroyNode(node);			node = leftNode;		}		else /*only right node*/		{			TreeNode * rightNode = node->right;			*removedData = node->data;			destroyNode(node);			node = rightNode;		}	}	updateHeight(node);	node = balanceNode(node);	return node;}
开发者ID:rchreptyk,项目名称:libRussell,代码行数:55,


示例22: rootMaxNode

static AVLNode *rootMaxNode(AVLNode *node){  if(node == nullptr) return nullptr; // no impact on empty tree  if(node->right() == nullptr){ // no right child, max node already root    node->setParent(nullptr); // returning a root node    return node;  }  else {  // right child does exist    AVLNode *temp = rootMaxNode(node->right());  // recursive call    node->setRight(temp->left()); // new right child without the max    if(node->right() != nullptr) node->right()->setParent(node);    updateHeight(node);     // re-calc height after change of child    temp->setLeft(node);  // node getting to the left of max    node->setParent(temp);  // not forgetting parent link    updateHeight(temp);     // re-calc height after change of child    return temp;  // returning max node  }}
开发者ID:possientis,项目名称:Prog,代码行数:20,


示例23: assert

 ITNode& operator=(const ITNode& n) {   assert(false);   key = n.key;   if(lesser != NULL) delete(lesser);   lesser = new(ITNode) (*n.lesser);   *lesser = *n.lesser;   if(greater != NULL) delete(greater);   greater = new(ITNode) (*n.greater);   *lesser = *n.greater;   updateHeight(); }
开发者ID:scoiatael,项目名称:ThingsIdidAtII,代码行数:12,


示例24: setWindowTitle

void LaconicaConversationTimelineWidget::slotConversationFetched(Choqok::Account* theAccount,                                                                 const ChoqokId& convId,                                                                 QList< Choqok::Post* > posts){    if( currentAccount() == theAccount && convId == this->conversationId){        setWindowTitle(i18n("Conversation"));        addNewPosts(posts);        foreach(Choqok::UI::PostWidget* post, postWidgets()){            post->setReadWithSignal();        }        QTimer::singleShot(0, this, SLOT(updateHeight()));    }
开发者ID:pankajb64,项目名称:Choqok-Facebook-Plugin-Trial,代码行数:12,


示例25: updateShowName

 void FootstepDisplay::onInitialize() {   MFDClass::onInitialize();   scene_node_ = scene_manager_->getRootSceneNode()->createChildSceneNode();   line_ = new rviz::BillboardLine(context_->getSceneManager(), scene_node_);   updateShowName();   updateWidth();   updateHeight();   updateDepth();   updateAlpha();   updateUseGroupColoring(); }
开发者ID:CPFL,项目名称:jsk_visualization_packages,代码行数:12,


示例26: minimum

void BSTree::remove(Tree::Node *node){    if (!node)        return;    Node *current = nullptr;    Node *child = nullptr;    if (node->right != nullptr)        current = minimum(node->right);    else current = node;    if (current->left != nullptr)        child = current->left;    else        child = current->right;    if (current == root) {        delete current;        root = nullptr;        return;    }    if (child != nullptr)    {        if (current->parent == nullptr)            root = child;        child->parent = current->parent;    }    if (current->parent != nullptr)    {        if (current->parent->left == current)            current->parent->left = child;        else            current->parent->right = child;    }    node->value = current->value;    current->left = nullptr;    current->right = nullptr;    for (Node *it = current; it != nullptr; it = it->parent){        it = updateHeight(it);    }    delete current;    countOfElements--;}
开发者ID:Mikhail-M,项目名称:Programming_in_university,代码行数:53,



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


C++ updateIcon函数代码示例
C++ updateGeometry函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。