void CBCGPTransferFunction::AddPoint(double point, double value)
{
	ASSERT(m_InputValueMin <= point && point <= m_InputValueMax);

	int index = (int)m_Points.GetSize();

	BOOL add = TRUE;
	if (index > 0)
	{
		for (int i = 0; i < index; i++)
		{
			if (point == m_Points[i].m_Point)
			{
				m_Points[i].m_Value = value;
				add = FALSE;
				break;
			}
			else if (point < m_Points[i].m_Point)
			{
				m_Points.InsertAt(i, XPoint(point, value));
				add = FALSE;
				break;
			}
		}
	}

	if (add)
	{
		m_Points.Add(XPoint(point, value));
	}
}
示例#2
0
objinst::objinst(object* thisobj, int x, int y) :
        positionable(OBJINST, XPoint(x,y)),
        thisobject(thisobj),
        params(NULL),
        bbox(thisobj->bbox),
        schembbox(NULL)
{
    color = areawin->color;
}
示例#3
0
polygon::polygon(int number, int x, int y) :
        generic(POLYGON),
        cycle(NULL)
{
    style = areawin->style & ~UNCLOSED;
    color = areawin->color;
    width = areawin->linewidth;
    points.fill(XPoint(x, y), number);
}
示例#4
0
labelptr new_temporary_label(objectptr destobject, char *cstr,
        int x, int y)
{
   labelptr *newlab;

   destobject->append(new label(LOCAL, XPoint(x,y)));

   (*newlab)->string->type = TEXT_STRING; /* overwrites FONT record */
   (*newlab)->string->data.string = cstr;
   return *newlab;
}
示例#5
0
labelptr new_label(objinstptr destinst, stringpart *strptr, int pintype,
        int x, int y)
{
   labelptr *newlab;
   objectptr destobject;
   objinstptr locdestinst;

   locdestinst = (destinst == NULL) ? areawin->topinstance : destinst;
   destobject = locdestinst->thisobject;

   newlab = destobject->append(new label(pintype, XPoint(x,y)));

   if (strptr->type == FONT_NAME) {
      free ((*newlab)->string);
      (*newlab)->string = strptr;
   }
   else
      (*newlab)->string->nextpart = strptr;

   calcbboxvalues(locdestinst, (genericptr *)newlab);
   updatepagebounds(destobject);
   incr_changes(destobject);
   return *newlab;
}