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() ));
  }
 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_);
 }
 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()));
 }
Esempio n. 4
0
void NumberAnimation::update()
{
	if (m_bRunning)
	{
		if (m_currentParam != "")
		{
			if (m_currentParam == "scale")
			{
				updateScale();
			}
			if (m_currentParam == "alpha")
			{
				updateAlpha();
			}
			if (m_currentParam == "angle")
			{
				updateAngle();
			}
			if (m_currentParam == "width")
			{
				updateWidth();
			}
		}
	}
}
Esempio n. 5
0
void OverlayTextDisplay::updateOvertakePositionProperties()
{

    if (!overtake_position_properties_ &&
            overtake_position_properties_property_->getBool()) {
        updateTop();
        updateLeft();
        updateWidth();
        updateHeight();
        updateTextSize();
        require_update_texture_ = true;
    }
    overtake_position_properties_
        = overtake_position_properties_property_->getBool();
    if (overtake_position_properties_) {
        top_property_->show();
        left_property_->show();
        width_property_->show();
        height_property_->show();
        text_size_property_->show();
    }
    else {
        top_property_->hide();
        left_property_->hide();
        width_property_->hide();
        height_property_->hide();
        text_size_property_->hide();
    }
}
int newtListboxAppendEntry(newtComponent co, const char * text,
	                const void * data) {
    struct listbox * li = co->data;
    struct items *item;

    if(li->boxItems) {
	for (item = li->boxItems; item->next != NULL; item = item->next);

	item = item->next = malloc(sizeof(struct items));
    } else {
	item = li->boxItems = malloc(sizeof(struct items));
    }

    if (!li->userHasSetWidth && text && (wstrlen(text,-1) > li->curWidth))
	updateWidth(co, li, wstrlen(text,-1));

    item->text = strdup(text); item->data = data; item->next = NULL;
    item->isSelected = 0;

    if (li->grow)
	co->height++, li->curHeight++;
    li->numItems++;

    return 0;
}
Esempio n. 7
0
int CHListBox::InsertString(int i, LPCTSTR s)
    {
     int result = CListBox::InsertString(i, s);
     if(result < 0)
	 return result;
     updateWidth(s);
     return result;
    }
Esempio n. 8
0
int CHListBox::AddString(LPCTSTR s)
    {
     int result = CListBox::AddString(s);
     if(result < 0)
	 return result;
     updateWidth(s);
     return result;
    }
Esempio n. 9
0
void walkReplaceBuiltin(ACCExpr *expr)
{
    while(1) {
    if (expr->value == "__bitconcat") {
        ACCExpr *list = expr->operands.front();
        if (list->value == PARAMETER_MARKER)
            list->value = "{";
        expr->value = list->value;
        expr->operands = list->operands;
    }
    else if (expr->value == "__bitsubstr") {
        ACCExpr *list = expr->operands.front();
        ACCExpr *bitem = list->operands.front();
        if (!isIdChar(bitem->value[0])) {  // can only do bit select on net or reg (not expressions)
            printf("[%s:%d] can only do __bitsubstr on elementary items\n", __FUNCTION__, __LINE__);
            dumpExpr("BITSUB", expr);
            exit(-1);
        }
        bitem->operands.push_back(allocExpr("[", allocExpr(":", getRHS(list), getRHS(list, 2))));
        expr->value = bitem->value;
        expr->operands = bitem->operands;
    }
    else if (expr->value == "__phi") {
        ACCExpr *list = expr->operands.front(); // get "(" list of [":", cond, value] items
        int size = list->operands.size();
        ACCExpr *firstInList = getRHS(list, 0), *secondInList = getRHS(list);
        ACCExpr *newe = nullptr;
        if (size == 2 && matchExpr(getRHS(firstInList, 0), invertExpr(getRHS(secondInList, 0))))
            newe = allocExpr("?", getRHS(firstInList, 0), getRHS(firstInList), getRHS(secondInList));
        else if (size == 2 && getRHS(firstInList, 0)->value == "__default" && exprWidth(getRHS(secondInList)) == 1)
            newe = allocExpr("&", getRHS(secondInList, 0), getRHS(secondInList));
        else if (size == 1)
            newe = getRHS(firstInList);
        else {
            //dumpExpr("PHI", list);
            newe = allocExpr("|");
            for (auto item: list->operands) {
                dumpExpr("PHIELEMENTBEF", item);
                if (checkInteger(getRHS(item), "0"))
                    continue;    // default value is already '0'
                item->value = "?"; // Change from ':' -> '?'
                item->operands.push_back(allocExpr("0"));
                updateWidth(item, exprWidth(getRHS(item)));
                newe->operands.push_back(item);
                if (trace_expr)
                    dumpExpr("PHIELEMENT", item);
            }
        }
        expr->value = newe->value;
        expr->operands = newe->operands;
    }
    else
        break;
    }
    for (auto item: expr->operands)
        walkReplaceBuiltin(item);
}
Esempio n. 10
0
GraphicTimeLine::GraphicTimeLine(GraphicResourceScene *parent)
	: itsHeight(27), itsScene(parent), itsScenePos(70)
{
	setPos(70,0);
    setZValue(4); // set stacking level
	updateWidth();
    itsTimeLineDayImage1 = new QImage(":/images/timeline_day.png");
    itsTimeLineDayImage2 = new QImage(":/images/timeline_day_long.png");

}
Esempio n. 11
0
void GUITable::setColumnWidth( unsigned int id, int width )
{
	if (id < columns.size())
	{
		columns[id].width = width;
	}

	// Actualizamos la anchura de la tabla
	updateWidth();
}
Esempio n. 12
0
void KNHeaderButton::setText(const QString &text)
{
    //Update the text.
    m_text->setText(text);
    //Resize the text.
    m_text->resize(m_text->fontMetrics().width(text),
                   m_text->fontMetrics().height());
    //Resize the button size.
    updateWidth();
}
 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();
 }
Esempio n. 14
0
/* PatchTableListView::updateList
 * Updates + refreshes the patch list
 *******************************************************************/
void PatchTableListView::updateList(bool clear) {
	if (clear)
		ClearAll();

	// Set list size
	if (patch_table)
		SetItemCount(patch_table->nPatches());
	else
		SetItemCount(0);

	updateWidth();
	Refresh();
}
 void OverlayImageDisplay::onInitialize()
 {
   ros::NodeHandle nh;
   it_ = boost::shared_ptr<image_transport::ImageTransport>(new image_transport::ImageTransport(nh));
   
   updateWidth();
   updateHeight();
   updateKeepAspectRatio();
   updateTop();
   updateLeft();
   updateAlpha();
   updateTopic();
 }
 void OverlayImageDisplay::processMessage(
   const sensor_msgs::Image::ConstPtr& msg)
 {
   boost::mutex::scoped_lock(mutex_);
   msg_ = msg;
   is_msg_available_ = true;
   require_update_ = true;
   if ((width_property_->getInt() < 0) || (height_property_->getInt() < 0) || keep_aspect_ratio_) {
     // automatically setup display size
     updateWidth();
     updateHeight();
   }
 }
Esempio n. 17
0
void GUITable::addColumn( const wchar_t* caption )
{
	Column column;
	column.caption = new GUIText();
	column.caption->setString( caption );
	column.index = columns.size();
	column.width = COLUMN_DEFAULT_WIDTH; // Por defecto

	columns.push_back(column);

	// Actualizamos la anchura de la tabla
	updateWidth();
}
Esempio n. 18
0
void updateWidth(ACCExpr *expr, int len)
{
    int ilen = exprWidth(expr);
    if (ilen < 0 || len < 0) {
        printf("[%s:%d] len %d ilen %d tree %s\n", __FUNCTION__, __LINE__, len, ilen, tree2str(expr).c_str());
        exit(-1);
    }
    if (isdigit(expr->value[0]) && len > 0 && expr->value.find("'") == std::string::npos)
        expr->value = autostr(len) + "'d" + expr->value;
    else if (isIdChar(expr->value[0])) {
        if (trace_expr)
            printf("[%s:%d] ID %s ilen %d len %d\n", __FUNCTION__, __LINE__, tree2str(expr).c_str(), ilen, len);
        if (ilen > len && len > 0 && !expr->operands.size()) {
            ACCExpr *subexpr = allocExpr(":", allocExpr(autostr(len-1)));
            if (len > 1)
                subexpr->operands.push_back(allocExpr("0"));
            expr->operands.push_back(allocExpr("[", subexpr));
        }
    }
    else if (expr->value == ":") // for __phi
        updateWidth(getRHS(expr), len);
    else if (expr->value == "?") {
        updateWidth(getRHS(expr), len);
        updateWidth(getRHS(expr, 2), len);
    }
    else if (arithOp(expr->value) || expr->value == "(") {
        if (expr->value == "-" && expr->operands.size() == 1
            && isdigit(expr->operands.front()->value[0]) && len == 1) {
            /* hack to update width on "~foo", which translates to "foo ^ -1" in the IR */
            expr->value = expr->operands.front()->value;
            expr->operands.clear();
            updateWidth(expr, len);
        }
        else
        for (auto item: expr->operands)
            updateWidth(item, len);
    }
}
 void OverlayTextDisplay::updateOvertakePositionProperties()
 {
   
   if (!overtake_position_properties_ &&
       overtake_position_properties_property_->getBool()) {
     updateTop();
     updateLeft();
     updateWidth();
     updateHeight();
     updateTextSize();
     require_update_texture_ = true;
   }
   overtake_position_properties_
     = overtake_position_properties_property_->getBool();
 }
Esempio n. 20
0
void newtListboxClear(newtComponent co)
{
    struct listbox * li;
    struct items *anitem, *nextitem;
    if(co == NULL || (li = co->data) == NULL)
	return;
    for(anitem = li->boxItems; anitem != NULL; anitem = nextitem) {
	nextitem = anitem->next;
	free(anitem->text);
	free(anitem);
    }
    li->numItems = li->numSelected = li->currItem = li->startShowItem = 0;
    li->boxItems = NULL;
    if (!li->userHasSetWidth)
	updateWidth(co, li, 5);
}
Esempio n. 21
0
void commandInterpreter(){
	char line[BUFFER],cmd[BUFFER];
	int session;
	char file[200];
	char arg3[200];
	int flag;
	while(1){
		printf("\nEnter Command:");
		gets(line);
		// printf("\nSTRING :{%s}\n",line);
		if(strcmp(line,"EXIT")==0){
			break;
		}
		if(strcmp(line,"LIST")==0){
			printf("\nACTIVE SESSIONS :\n");
			system("cat list.txt");
			continue;
		}
		flag = getCommand(line,cmd,&session,file,arg3);
		if(flag==0){
			printf("\nINVALID COMMAND:line = {%s}",line);
			continue;
		}
		if(strcmp(cmd,"ADD")==0){
			createSession(file);
			continue;
		}
		if(strcmp(cmd,"UPDATEPAGE")==0){
			updatePage(session,atoi(arg3));
			continue;	
		}
		if(strcmp(cmd,"UPDATEWIDTH")==0){
			updateWidth(session,atoi(arg3));
			continue;
		}
		if(strcmp(cmd,"UPDATEHEIGHT")==0){
			updateHeight(session,atoi(arg3));
			continue;
		}
		if(strcmp(cmd,"UPDATEZOOM")==0){
			updateZoom(session,atoi(arg3));
			continue;
		}
		printf("\nINVALID COMMAND : \nline = {%s}\ncmd = {%s}",line,cmd);
	}
	return;
}
Esempio n. 22
0
int newtListboxDeleteEntry(newtComponent co, void * key) {
    struct listbox * li = co->data;
    int widest = 0, t;
    struct items *item, *item2 = NULL;
    int num;

    if (li->boxItems == NULL || li->numItems <= 0)
	return 0;

    num = 0;

    item2 = NULL, item = li->boxItems;
    while (item && item->data != key) {
	item2 = item;
	item = item->next;
	num++;
    }

    if (!item)
	return -1;

    if (item2)
	item2->next = item->next;
    else
	li->boxItems = item->next;

    free(item->text);
    free(item);
    li->numItems--;

    if (!li->userHasSetWidth) {
	widest = 0;
	for (item = li->boxItems; item != NULL; item = item->next)
	    if ((t = wstrlen(item->text,-1)) > widest) widest = t;
    }

    if (li->currItem >= num)
	li->currItem--;

    if (!li->userHasSetWidth) {
	updateWidth(co, li, widest);
    }

    listboxDraw(co);

    return 0;
}
Esempio n. 23
0
void KisPDFImportWidget::updateMaxCanvasSize()
{
    m_maxWidthInch = 0., m_maxHeightInch = 0.;
    for (QList<int>::const_iterator it = m_pages.constBegin(); it != m_pages.constEnd(); ++it) {
        Poppler::Page *p = m_pdfDoc->page(*it);
        QSizeF size = p->pageSizeF();
        if (size.width() > m_maxWidthInch) {
            m_maxWidthInch = size.width();
        }
        if (size.height() > m_maxHeightInch) {
            m_maxHeightInch = size.height();
        }
    }
    m_maxWidthInch /= 72.;
    m_maxHeightInch /= 72.;
    dbgFile << m_maxWidthInch << "" << m_maxHeightInch;
    updateWidth();
    updateHeight();
}
Esempio n. 24
0
// only the first time
void OverlayTextDisplay::onInitialize()
{
    onEnable();
    updateTopic();
    updateOvertakePositionProperties();
    updateOvertakeColorProperties();
    updateTop();
    updateLeft();
    updateWidth();
    updateHeight();
    updateTextSize();
    updateFGColor();
    updateFGAlpha();
    updateBGColor();
    updateBGAlpha();
    updateFont();
    updateLineWidth();
    require_update_texture_ = true;
}
Esempio n. 25
0
void EWAUserActionsEditorDialog::initModel()
{
    if( m_pModel )
    {
        disconnectModel();
        delete m_pModel;
    }
    
    int iPagesCount = m_pStoredPages->size();
    int iRowsCount = 0;
    
    for( int i = 0; i<iPagesCount; i++ )
    {
        iRowsCount += m_pStoredPages->at( i )->getActionsCount();
    }

    m_pModel = new QStandardItemModel( iRowsCount, 2, this );
    m_tableViewPtr->setColumnWidth( 0, m_szIcons.width() );
    m_tableViewPtr->setColumnWidth( 1, m_szIcons.width() );
    
    m_tableViewPtr->setModel( m_pModel );

    int iCurrentRow = 0;
    for( int iPagesCounter = 0; iPagesCounter < iPagesCount; iPagesCounter++ )
    {
        EWAUserActionsCollection *pPage = m_pStoredPages->at( iPagesCounter );
        
        for( int iActionsCounter = 0; iActionsCounter < pPage->getActionsCount(); iActionsCounter++ )
        {
            EWAUserAction *pAction = pPage->getActionsPtr()->at( iActionsCounter );
            
            inserActionIntoModel( iCurrentRow, pAction, iPagesCounter, iActionsCounter );
            
            iCurrentRow++;
        }
    }
    
    updateWidth();
    connectModel();
    
    enbleItem( 0 );
}
Esempio n. 26
0
int newtListboxInsertEntry(newtComponent co, const char * text,
	                   const void * data, void * key) {
    struct listbox * li = co->data;
    struct items *item, *t;

    if (li->boxItems) {
	if (key) {
	    item = li->boxItems;
	    while (item && item->data != key) item = item->next;

	    if (!item) return 1;

	    t = item->next;
	    item = item->next = malloc(sizeof(struct items));
	    item->next = t;
	} else {
	    t = li->boxItems;
	    item = li->boxItems = malloc(sizeof(struct items));
	    item->next = t;
	}
    } else if (key) {
	return 1;
    } else {
	item = li->boxItems = malloc(sizeof(struct items));
	item->next = NULL;
    }

    if (!li->userHasSetWidth && text && (wstrlen(text,-1) > li->curWidth))
	updateWidth(co, li, wstrlen(text,-1));

    item->text = strdup(text?text:"(null)"); item->data = data;
    item->isSelected = 0;

    if (li->sb)
	li->sb->left = co->left + co->width - li->bdxAdjust - 1;
    li->numItems++;

    listboxDraw(co);

    return 0;
}
Esempio n. 27
0
/* TextureXListView::updateList
 * Clears the list if [clear] is true, and refreshes it
 *******************************************************************/
void TextureXListView::updateList(bool clear)
{
	if (clear)
		ClearAll();

	// Set list size
	items.clear();
	if (texturex)
	{
		unsigned count = texturex->nTextures();
		SetItemCount(count);
		for (unsigned a = 0; a < count; a++)
			items.push_back(a);
	}
	else
		SetItemCount(0);

	sortItems();
	updateWidth();
	Refresh();
}
Esempio n. 28
0
/* PatchTableListView::updateList
 * Updates + refreshes the patch list
 *******************************************************************/
void PatchTableListView::updateList(bool clear)
{
	if (clear)
		ClearAll();

	// Set list size
	items.clear();
	if (patch_table)
	{
		size_t count = patch_table->nPatches();
		SetItemCount(count);
		for (unsigned a = 0; a < count; a++)
			items.push_back(a);
	}
	else
		SetItemCount(0);

	sortItems();
	updateWidth();
	Refresh();
}
Esempio n. 29
0
void newtListboxSetEntry(newtComponent co, int num, const char * text) {
    struct listbox * li = co->data;
    int i;
    struct items *item;

    for(i = 0, item = li->boxItems; item != NULL && i < num;
	i++, item = item->next);

    if(!item)
	return;
    else {
	free(item->text);
	item->text = strdup(text);
    }
    if (li->userHasSetWidth == 0 && wstrlen(text,-1) > li->curWidth) {
	updateWidth(co, li, wstrlen(text,-1));
    }

    if (num >= li->startShowItem && num <= li->startShowItem + co->height)
	listboxDraw(co);
}
Esempio n. 30
0
    // Implements DelegateRule::ISource.
    void delegateUpdate(int id)
    {
        switch(id)
        {
        case OutLeft:
        case OutRight:
            updateHorizontal();
            break;

        case OutWidth:
            updateWidth();
            break;

        case OutTop:
        case OutBottom:
            updateVertical();
            break;

        case OutHeight:
            updateHeight();
            break;
        }
    }