Graphics properties implementation

Ben Abbott bpabbott at mac.com
Sat Jan 12 11:16:17 CST 2008


On Jan 12, 2008, at 11:53 AM, Shai Ayal wrote:

> On Jan 12, 2008 6:44 PM, Michael Goffioul  
> <michael.goffioul at gmail.com> wrote:
>> On 1/12/08, Shai Ayal <shaiay at gmail.com> wrote:
>>> OK, it seems like it's time to start adding properties.
>>> Michael, Just so we don't duplicate our work, Do you plan on adding
>>> other properties soon or will you focus on the backend?
>>> If you are planning to add, lets divide the work -- tell me what you
>>> want to add, and I'll do the rest
>>
>> Please go ahead with adding properties (I need them in order
>> to continue on the rendering code). I won't have that much time
>> this weekend, so I'll let you start on it. I think that the first
>> thing to do is to identify the properties that every object should
>> have and put them in the base_properties class (note that this
>> class is not auto-generated). I remember I've seen a page
>> in Matlab doc about common properties (I don't have Matlab
>> under hand for the moment and the Mathworks server is down).
>
> yeah -- I noticed their server is down also. I don't have a copy of
> matlab either, so I'll wait until their server is up.
>
>> There are other things I can do while you're working on the
>> properties: for instance add the C++ code to implement listeners,
>> add flags for the genprops.awk script to support hidden or
>> read-only properties.
>>
>> Related to hidden properties, I think that properties like
>> __plot_stream__ and so on should be hidden. Normally, hidden
>> properties should not be listed by the "get(void)" method; they
>> should only be accessible on explicit requests by the
>> "get(caseless_str)" method. However, doing this will make
>> some m-code not functional: for instance, "drawnow" uses
>> "get(fig_handle)" to get a structure containing all properties;
>> if hidden properties are not part of the structure, drawnow
>> will fail. What do you think?
>
> Maybe it's not so important that this particular property is hidden -
> our users are hardned folks and they won't be intimidated by it
>
> Shai

Shai/Michael,

If I understand what you're looking for, I'm happy to provide a list  
of properties. Let me know if this is the sort of thing you need, and  
what other objects you'd like interrogated.

set(0)
	CurrentFigure
	Diary: [ on | off ]
	DiaryFile
	Echo: [ on | off ]
	FixedWidthFontName
	Format: [ short | long | shortE | longE | shortG | longG | hex | bank  
| + | rational | debug | shortEng | longEng ]
	FormatSpacing: [ loose | compact ]
	Language
	More: [ on | off ]
	PointerLocation
	RecursionLimit
	ScreenDepth
	ScreenPixelsPerInch
	ShowHiddenHandles: [ on | {off} ]
	Units: [ inches | centimeters | normalized | points | pixels |  
characters ]

	ButtonDownFcn: string -or- function handle -or- cell array
	Children
	Clipping: [ {on} | off ]
	CreateFcn: string -or- function handle -or- cell array
	DeleteFcn: string -or- function handle -or- cell array
	BusyAction: [ {queue} | cancel ]
	HandleVisibility: [ {on} | callback | off ]
	HitTest: [ {on} | off ]
	Interruptible: [ {on} | off ]
	Parent
	Selected: [ on | off ]
	SelectionHighlight: [ {on} | off ]
	Tag
	UIContextMenu
	UserData
	Visible: [ {on} | off ]


set(gcf)
	Alphamap
	CloseRequestFcn: string -or- function handle -or- cell array
	Color
	Colormap
	CurrentAxes
	CurrentCharacter
	CurrentObject
	CurrentPoint
	DockControls: [ {on} | off ]
	DoubleBuffer: [ {on} | off ]
	FileName
	IntegerHandle: [ {on} | off ]
	InvertHardcopy: [ {on} | off ]
	KeyPressFcn: string -or- function handle -or- cell array
	KeyReleaseFcn: string -or- function handle -or- cell array
	MenuBar: [ none | {figure} ]
	MinColormap
	Name
	NextPlot: [ new | {add} | replace | replacechildren ]
	NumberTitle: [ {on} | off ]
	PaperUnits: [ {inches} | centimeters | normalized | points ]
	PaperOrientation: [ {portrait} | landscape | rotated ]
	PaperPosition
	PaperPositionMode: [ auto | {manual} ]
	PaperSize
	PaperType: [ {usletter} | uslegal | A0 | A1 | A2 | A3 | A4 | A5 | B0  
| B1 | B2 | B3 | B4 | B5 | arch-A | arch-B | arch-C | arch-D | arch-E  
| A | B | C | D | E | tabloid | <custom> ]
	Pointer: [ crosshair | fullcrosshair | {arrow} | ibeam | watch | topl  
| topr | botl | botr | left | top | right | bottom | circle | cross |  
fleur | custom | hand ]
	PointerShapeCData
	PointerShapeHotSpot
	Position
	Renderer: [ {painters} | zbuffer | OpenGL | None ]
	RendererMode: [ {auto} | manual ]
	Resize: [ {on} | off ]
	ResizeFcn: string -or- function handle -or- cell array
	SelectionType: [ normal | open | alt | extend ]
	ToolBar: [ none | {auto} | figure ]
	Units: [ inches | centimeters | normalized | points | {pixels} |  
characters ]
	WindowButtonDownFcn: string -or- function handle -or- cell array
	WindowButtonMotionFcn: string -or- function handle -or- cell array
	WindowButtonUpFcn: string -or- function handle -or- cell array
	WindowScrollWheelFcn: string -or- function handle -or- cell array
	WindowStyle: [ {normal} | modal | docked ]
	XDisplay
	XVisual: { 0x23 (TrueColor, depth 24, RGB mask 0xff0000 0xff00  
0x00ff) }
   0x24 (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)
   0x25 (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)
   0x26 (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)

	XVisualMode: [ {auto} | manual ]

	ButtonDownFcn: string -or- function handle -or- cell array
	Children
	Clipping: [ {on} | off ]
	CreateFcn: string -or- function handle -or- cell array
	DeleteFcn: string -or- function handle -or- cell array
	BusyAction: [ {queue} | cancel ]
	HandleVisibility: [ {on} | callback | off ]
	HitTest: [ {on} | off ]
	Interruptible: [ {on} | off ]
	Parent
	Selected: [ on | off ]
	SelectionHighlight: [ {on} | off ]
	Tag
	UIContextMenu
	UserData
	Visible: [ {on} | off ]

set(gca)
	ActivePositionProperty: [ position | {outerposition} ]
	ALim
	ALimMode: [ {auto} | manual ]
	AmbientLightColor
	Box: [ on | {off} ]
	CameraPosition
	CameraPositionMode: [ {auto} | manual ]
	CameraTarget
	CameraTargetMode: [ {auto} | manual ]
	CameraUpVector
	CameraUpVectorMode: [ {auto} | manual ]
	CameraViewAngle
	CameraViewAngleMode: [ {auto} | manual ]
	CLim
	CLimMode: [ {auto} | manual ]
	Color
	ColorOrder
	DataAspectRatio
	DataAspectRatioMode: [ {auto} | manual ]
	DrawMode: [ {normal} | fast ]
	FontAngle: [ {normal} | italic | oblique ]
	FontName
	FontSize
	FontUnits: [ inches | centimeters | normalized | {points} | pixels ]
	FontWeight: [ light | {normal} | demi | bold ]
	GridLineStyle: [ - | -- | {:} | -. | none ]
	Layer: [ top | {bottom} ]
	LineStyleOrder
	LineWidth
	MinorGridLineStyle: [ - | -- | {:} | -. | none ]
	NextPlot: [ new | add | {replace} | replacechildren ]
	OuterPosition
	PlotBoxAspectRatio
	PlotBoxAspectRatioMode: [ {auto} | manual ]
	Projection: [ {orthographic} | perspective ]
	Position
	TickLength
	TickDir: [ {in} | out ]
	TickDirMode: [ {auto} | manual ]
	Title
	Units: [ inches | centimeters | {normalized} | points | pixels |  
characters ]
	View
	XColor
	XDir: [ {normal} | reverse ]
	XGrid: [ on | {off} ]
	XLabel
	XAxisLocation: [ top | {bottom} ]
	XLim
	XLimMode: [ {auto} | manual ]
	XMinorGrid: [ on | {off} ]
	XMinorTick: [ on | {off} ]
	XScale: [ {linear} | log ]
	XTick
	XTickLabel
	XTickLabelMode: [ {auto} | manual ]
	XTickMode: [ {auto} | manual ]
	YColor
	YDir: [ {normal} | reverse ]
	YGrid: [ on | {off} ]
	YLabel
	YAxisLocation: [ {left} | right ]
	YLim
	YLimMode: [ {auto} | manual ]
	YMinorGrid: [ on | {off} ]
	YMinorTick: [ on | {off} ]
	YScale: [ {linear} | log ]
	YTick
	YTickLabel
	YTickLabelMode: [ {auto} | manual ]
	YTickMode: [ {auto} | manual ]
	ZColor
	ZDir: [ {normal} | reverse ]
	ZGrid: [ on | {off} ]
	ZLabel
	ZLim
	ZLimMode: [ {auto} | manual ]
	ZMinorGrid: [ on | {off} ]
	ZMinorTick: [ on | {off} ]
	ZScale: [ {linear} | log ]
	ZTick
	ZTickLabel
	ZTickLabelMode: [ {auto} | manual ]
	ZTickMode: [ {auto} | manual ]

	ButtonDownFcn: string -or- function handle -or- cell array
	Children
	Clipping: [ {on} | off ]
	CreateFcn: string -or- function handle -or- cell array
	DeleteFcn: string -or- function handle -or- cell array
	BusyAction: [ {queue} | cancel ]
	HandleVisibility: [ {on} | callback | off ]
	HitTest: [ {on} | off ]
	Interruptible: [ {on} | off ]
	Parent
	Selected: [ on | off ]
	SelectionHighlight: [ {on} | off ]
	Tag
	UIContextMenu
	UserData
	Visible: [ {on} | off ]

line = plot([1,2],[1,2])

line =

   159.0022

 >> set(line)

ans =

            DisplayName: {}
                  Color: {}
              EraseMode: {4x1 cell}
              LineStyle: {5x1 cell}
              LineWidth: {}
                 Marker: {14x1 cell}
             MarkerSize: {}
        MarkerEdgeColor: {2x1 cell}
        MarkerFaceColor: {2x1 cell}
                  XData: {}
                  YData: {}
                  ZData: {}
          ButtonDownFcn: {}
               Children: {}
               Clipping: {2x1 cell}
              CreateFcn: {}
              DeleteFcn: {}
             BusyAction: {2x1 cell}
       HandleVisibility: {3x1 cell}
                HitTest: {2x1 cell}
          Interruptible: {2x1 cell}
               Selected: {2x1 cell}
     SelectionHighlight: {2x1 cell}
                    Tag: {}
          UIContextMenu: {}
               UserData: {}
                Visible: {2x1 cell}
                 Parent: {}
              XDataMode: {2x1 cell}
            XDataSource: {}
            YDataSource: {}
            ZDataSource: {}

ht = text(0,0,'test')

ht =

   160.0011

 >> set(ht)
	BackgroundColor
	Color
	DisplayName
	EdgeColor
	EraseMode: [ {normal} | background | xor | none ]
	Editing: [ on | off ]
	FontAngle: [ {normal} | italic | oblique ]
	FontName
	FontSize
	FontUnits: [ inches | centimeters | normalized | {points} | pixels ]
	FontWeight: [ light | {normal} | demi | bold ]
	HorizontalAlignment: [ {left} | center | right ]
	LineStyle: [ {-} | -- | : | -. | none ]
	LineWidth
	Margin
	Position
	Rotation
	String
	Units: [ inches | centimeters | normalized | points | pixels |  
characters | {data} ]
	Interpreter: [ latex | {tex} | none ]
	VerticalAlignment: [ top | cap | {middle} | baseline | bottom ]

	ButtonDownFcn: string -or- function handle -or- cell array
	Children
	Clipping: [ {on} | off ]
	CreateFcn: string -or- function handle -or- cell array
	DeleteFcn: string -or- function handle -or- cell array
	BusyAction: [ {queue} | cancel ]
	HandleVisibility: [ {on} | callback | off ]
	HitTest: [ {on} | off ]
	Interruptible: [ {on} | off ]
	Parent
	Selected: [ on | off ]
	SelectionHighlight: [ {on} | off ]
	Tag
	UIContextMenu
	UserData
	Visible: [ {on} | off ]

  x = [0 0 1 1];
 >> y = [0 1 1 0];
 >> c = [0 0 1];
 >> hp = patch(x,y,c)

hp =

   161.0011

 >> set(hp)
	AlphaDataMapping: [ none | direct | {scaled} ]
	CData
	CDataMapping: [ direct | {scaled} ]
	DisplayName
	FaceVertexAlphaData
	FaceVertexCData
	EdgeAlpha: [ flat | interp ] -or- {an Alpha}.
	EdgeColor: [ none | flat | interp ] -or- {a ColorSpec}.
	EraseMode: [ {normal} | background | xor | none ]
	FaceAlpha: [ flat | interp ] -or- {an Alpha}.
	FaceColor: [ none | flat | interp ] -or- {a ColorSpec}.
	Faces
	LineStyle: [ {-} | -- | : | -. | none ]
	LineWidth
	Marker: [ + | o | * | . | x | square | diamond | v | ^ | > | < |  
pentagram | hexagram | {none} ]
	MarkerEdgeColor: [ none | {auto} | flat ] -or- a ColorSpec.
	MarkerFaceColor: [ {none} | auto | flat ] -or- a ColorSpec.
	MarkerSize
	Vertices
	XData
	YData
	ZData
	FaceLighting: [ none | {flat} | gouraud | phong ]
	EdgeLighting: [ {none} | flat | gouraud | phong ]
	BackFaceLighting: [ unlit | lit | {reverselit} ]
	AmbientStrength
	DiffuseStrength
	SpecularStrength
	SpecularExponent
	SpecularColorReflectance
	VertexNormals
	NormalMode: [ {auto} | manual ]

	ButtonDownFcn: string -or- function handle -or- cell array
	Children
	Clipping: [ {on} | off ]
	CreateFcn: string -or- function handle -or- cell array
	DeleteFcn: string -or- function handle -or- cell array
	BusyAction: [ {queue} | cancel ]
	HandleVisibility: [ {on} | callback | off ]
	HitTest: [ {on} | off ]
	Interruptible: [ {on} | off ]
	Parent
	Selected: [ on | off ]
	SelectionHighlight: [ {on} | off ]
	Tag
	UIContextMenu
	UserData
	Visible: [ {on} | off ]

Ben





More information about the Octave-maintainers mailing list