logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Rubband - rubberbanding graphical objects

Description

Rubband  is  the  base  class  for  a  set of classes that provide graphical feedback to a user during an
       interactive operation such as sizing a rectangle.  A rubberband varies  in  appearance  as  its  trackingpoint changes.  A rubberband is not an interactor itself; interactors use rubberbands to provide animated
       effects.  Because rubberbands are not interactors, rubberband constructors must be passed the painter and
       canvas to use for drawing.

Name

       Rubband - rubberbanding graphical objects

Public Operations

RubberLine(Painter*,Canvas*,Coordfx,fy,mx,my,offx=0,offy=0)
              A rubber line stretches to follow the tracking point while its other endpoint stays tied down.

       RubberAxis(Painter*,Canvas*,Coordfx,fy,mx,my,offx=0,offy=0)
              A  rubber  axis stretches either horizontally or vertically to follow the tracking point while its
              other endpoint stays tied down.  One endpoint stays fixed while the other moves along  either  the
              horizontal or vertical axis, whichever is closer to the tracking point.

       SlidingLine(Painter*,Canvas*,Coordx0,y0,x1,y1,rfx,rfy,Coordoffx=0,offy=0)
              A  sliding  line  slides  around  without changing its length or angle as the tracking point moves
              around a reference point.

       RotatingLine(Painter*,Canvas*,Coordx0,y0,x1,y1,rfx,rfy,Coordoffx=0,offy=0)
              A rotating line rotates around (cx, cy) based on the angle between the  radius  from  (cx, cy)  to
              (rfx, rfy) and the radius from (cx, cy) to the tracking point.

       RubberRect(Painter*,Canvas*,Coordfx,fy,mx,my,offx=0,offy=0)
              A  rubber  rectangle  stretches  to  follow the tacking point while its opposite corner stays tied
              down.

       SlidingRect(Painter*,Canvas*,Coordx1,y1,x2,y2,rfx,rfy,Coordoffx=0,offy=0)
              A sliding rectangle slides around the screen without changing  its  side  or  orientation  as  the
              tracking point moves around a reference point.

       ScalingRect(Painter*,Canvas*,Coordx1,y1,x2,y2,cx,cy,Coordoffx=0,offy=0)
              A scaling rectangle scales equally in both dimensions about (cx, cy) to keep one edge intersecting
              the tracking point.

       RotatingRect(Painter*,Canvas*,Coordx1,y1,x2,y2,cx,cy,rfx,rfy,Coordoffx=0,offy=0)
              A  rotating  rectangle  rotates about (cx, cy) based on the radius from (cx, cy) to (rfx, rfy) and
              the radius from (cx, cy) to the tracking point.

       StretchingRect(Painter*,Canvas*,Coordx1,y1,x2,y2,Sidets,Coordoffx=0,offy=0)
              A stretching rectangle's tracking side follows the tracking point while the  opposite  side  stays
              fixed.  The side can be one of LeftSide, RightSide, BottomSide, or TopSide.

       RubberCircle(Painter*,Canvas*,Coordcx,cy,rx,ry,offx=0,offy=0)
              A rubber circle's radius varies with the magnitude of the tracking point's distance from (cx, cy).

       RubberEllipse(Painter*,Canvas*,Coordcx,cy,rx,ry,offx=0,offy=0)
              A  rubber  ellipse's horizontal and vertical radii vary with the magnitude of the tracking point's
              distance from (cx, cy).

       RubberSpline(Painter*,Canvas*,Coordx[],y[],intn,pt,Coordoffx=0,offy=0)RubberClosedSpline(Painter*,Canvas*,Coordx[],y[],intn,pt,Coordoffx=0,offy=0)
              A rubber spline is the section of a B-spline defined by n control points that changes shape as the
              control point indexed by pt is set to the tracking point.

       RubberHandles(Painter*,Canvas*,Coordx[],y[],intn,pt,size,Coordoffx=0,offy=0)
              A rubber handles object is a set of filled squares centered about each point  in  the  list.   The
              point index by pt follows the tracking point.

       SlidingPointList(Painter*,Canvas*,Coordx[],y[],intn,pt,Coordrfx,rfy,Coordoffx=0,offy=0)
              A  sliding  point  list  slides  around the screen without changing its appearance as the tracking
              point moves around a reference point.

       SlidingLineList(Painter*,Canvas*,Coordx[],y[],intn,pt,Coordrfx,rfy,Coordoffx=0,offy=0)
              A sliding line list slides around the screen without changing  the  appearance  of  its  connected
              lines as the tracking point moves around (rfx, rfy).

       ScalingLineList(Painer*,Canvas*,Coordx[],Coordy[],intn,Coordcx,cy,rfx,rfy,offx=0,offy=0)
              A  scaling  line  list  scales a list of lines about (cx,cy) to keep the line list's bounding box
              intersecting the tracking point.

       RotatingLineList(Painer*,Canvas*,Coordx[],Coordy[],intn,Coordcx,cy,rfx,rfy,offx=0,offy=0)
              A rotating line list rotates a list of lines about (cx,cy) based on the angle between the  radius
              from (cx, cy) to (rfx, rfy) and the radius from (cx, cy) to the tracking point.

       GrowingVertices(Painter*,Canvas*,Coordx[],y[],intn,intpt=-1,inthandleSize=-1)GrowingMultiLine(Painter*,Canvas*,Coordx[],y[],intn,intpt=-1,inthandleSize=-1)GrowingPolygon(Painter*,Canvas*,Coordx[],y[],intn,intpt=-1,inthandleSize=-1)GrowingBSpline(Painter*,Canvas*,Coordx[],y[],intn,intpt=-1,inthandleSize=-1)GrowingClosedBSpline(Painter*,Canvas*,Coordx[],y[],intn,intpt=-1,inthandleSize=-1)virtualvoidAddVertex(Coord,Coord)virtualvoidRemoveVertex()
              GrowingVertices  is  an  abstract  rubberband  containing a list of vertices that grows or shrinks
              dynamically.  The pt parameter specifies the index of the vertex that  will  follow  the  tracking
              point;  a value of -1 specifies a vertex after the last one in the list.  The handleSize parameter
              specifies the size of the handle drawn at each vertex (as in RubberHandles above); a value  of  -1
              specifies that no handles be drawn.

              The AddVertex operation adds a new vertex at the tracking point to the list and makes the next (or
              last)  vertex  in  the  list  follow  the  tracking point.  RemoveVertex removes the vertex at the
              tracking point and makes the previous (or first) vertex the new tracking point.  GrowingMultiLine,
              GrowingPolygon, GrowingBSpline, and GrowingClosedBSpline are GrowingVertices subclasses that  draw
              a multiline, polygon, B-spline, and closed B-spline, respectively.

       RubberGroup(Painter*,Canvas*)voidAppend(Rubberband*,Rubberband*=nil,Rubberband*=nil,Rubberband*=nil)voidRemove(Rubberband*)voidRemoveCur()voidSetCurrent(Rubberband*)Rubberband*GetCurrent()Rubberband*First()Rubberband*Last()Rubberband*Next()Rubberband*Prev()booleanIsEmpty()booleanAtEnd()
              A  RubberGroup  composes  other  rubberbands,  providing  operations for including, excluding, and
              traversing its children. RubberGroups are useful for combining the behavior of several rubberbands
              into one, eliminating the need to call Track on multiple rubberbands. The RubberGroup's  SetCanvas
              and  SetPainter operations set the children's canvas and painter as well as the RubberGroup's, but
              the children do not otherwise inherit the group's canvas and painter.  The Track  operation  calls
              Track on each child with the same parameters.

       virtualvoidDraw()voidRedraw()virtualvoidErase()
              Explicitly  draw, redraw, and erase the rubberband.  Multiple calls to Draw without an intervening
              Erase will only draw the rubberband once.  Redraw  forces  the  rubberband  to  be  drawn.   Since
              rubberbands are drawn in XOR mode, Redraw will erase the rubberband every other time it is called.
              These  functions are used only on occasion, for example, when part of the screen is erased while a
              rubberband is visible.  The Track function is normally used to draw the rubberband in response  to
              mouse input.

       virtualvoidTrack(Coordx,Coordy)
              Erase the rubberband and redraw it using the new tracking point.

       voidGetOriginal(Coord&x1,Coord&y2,Coord&x2,Coord&y2)voidGetCurrent(Coord&x1,Coord&y2,Coord&x2,Coord&y2)
              GetOriginal  obtains  the  original  points  specified for the rubberband.  GetCurrent obtains the
              current points based on the most recent call to Track.  The meaning of the points depends  on  the
              kind  of  rubberband.   For  lines,  the  points are the endpoints; for rectangles, the points are
              opposite corners; for curves, (x1, y1) is the center and x2 and y2 are the radii.

       virtualvoidSetPainter(Painter*)Painter*GetPainter()
              Explicitly set and get the painter used by the rubberband.  By default, rubberbands use a copy  of
              the  painter  passed  to  their  constructor.  The user can specify a particular painter to use by
              passing a nil painter to the constructor and later calling SetPainter.  N.B.: the  rubberband  may
              alter the painter specified via SetPainter.

       virtualvoidSetCanvas(Canvas*)Canvas*GetCanvas()
              Explicitly set and get the canvas used by the rubberband.

See Also

Canvas(3I), Painter(3I)

InterViews                                        15 June 1987                                       Rubband(3I)

Synopsis

#include<InterViews/rubband.h>#include<InterViews/rubcurve.h>#include<InterViews/rubgroup.h>#include<InterViews/rubline.h>#include<InterViews/rubrect.h>#include<InterViews/rubverts.h>

See Also