Valid
	XHTML 1.1! Valid CSS!
Created 2010-04-10   Modified 2010-04-10
Chelton Evans

proj vistool home

Intro
Syntax
Spec
Development
gobj
Problems
Source
TODO

Intro

UNDER CONSTRUCTION

Work in 2D and 3D. This is intened to be a primitive geometric editor.

Spec

Developement

restructured. Moved point associated graphics to pointxml.
Implemented pointxml options.

img001.png

command line quotes eg points="2 3 4"
convex and line.
graphics bug: gobjQuadric automatically passed as a pointer caused the sphere to not be translated in the z-axis.


Added graphics, so non-graphics testing environment and graphics testing environment implemented.

No need for live input window - compile time development with tests in code favoured.


Developed command line concept of first string token command, rest the argument to that command.
Implemented least efficient dictionary.

supported composite builder pattern for a container of commands. First on matching is executed.

Test code with command strings. point2 read in, put into env data structure. Issues of where data should reside still not solved. Unit test that point entered was correct.


Worked on syntax developing the command line language. Fixed bug in commandline to enable strings to be passed as hat="a b c". So the commandline and xml syntax are interchangable.

Changed
pointxml <display>true</display> to
pointxml display=true


Problems

Syntax

command "string"
A list is a string of objects. Where an object is a command and an associated string. An object has a valid or invalid state. If it can be evaluated the object has a valid state.

point2 2.0 3.0 creates point in points vector (2,3,0).
point2 2.0 2.5 1.5 3.7 read vector of points

point3 1 1 1 creates point (1,1,1).
point3 1.0 0 0 2.3 1.1 .7 .8 .5 .3 -2. .1 .3

pointxml colorrandom=true
pointxml display=false turn of assumed behaviour of displaying added points.
pointxml colorrgb="120 12 10"

line 2 5 connects points labled 2 and 5.
line 2 5 1 3

linexml connected="1 3 7 1" line loop
linexml convex="1 11 19" points all connected by lines

triangle 1 6 7 draws a triangle

trianglexml colorrandom=false
trianglexml colorwinding=true turns on color winding three different colors at each vertex.

convex points="23 28 9" draws points in convex hull of points.
convex points="3 10 9 6 12" N=200 any number of points in convex hull

cmd clear clears the output window.
cmd edit=12 edits the input line 12
cmd run=12 recalls and runs the command at line 12
cmd run=12-15 runs commands 12-15
cmd runall
cmd save=s01.txt
cmd load=s01.txt

The following is a possible show/hide graphics toggle implementation. If each command stores the graphics stack state then it is possible to toggle the graphics at a later date. ie statebefore, stateafter in viscmd data structure.

If the gobj is not a toggle class (RTI) then move the pointers to a new toggle container. Set the previous references to 0.

Similarly group moves the gobj pointers to another container. The operation is not reversible.

cmd group="10 11 12 13" group commands, a composition objects
cmd toggle=18
cmd show=18
cmd hide=18

Restrictions

Application commands need to be simplified or remember their state. So the syntax simplifies, assumptions about the graphics are managed.

Source

Files

Makefile
main.cpp
viscmd.cpp
viscmd.h
visconvex.cpp
visconvex.h
visenv.cpp
visenv.h
visline.cpp
visline.h
visoperator.cpp
visoperator.h
vispoint2.cpp
vispoint2.h
vispoint3.cpp
vispoint3.h
vispointxml.cpp
vispointxml.h
vistest.cpp
vistest.h

projcompile.txt
testscript01.txt
unittestsreport.txt

Doxygen

main.cpp
Makefile
viscmd
visconvex
visdictionary
visenv
visline
visoperator
vispoint2
vispoint3
vispointxml
vistest

TODO

gobj

Command line open gl.

Interpret to likely mean push command to global graphics container.

Brackets () are tags capturing input string. ; separates commands. , in brackets is space.

Individual commands
gobj glPushAttrib GL_CURRENT_BIT
gobj glPushAttrib(GL_CURRNET_BIT);

Block of code, passed as a block by tags.

<gobj> glPushAttrib(GL_CURRENT_BIT); glPushAttrib(GL_LIGHTING_BIT); glDisable(GL_LIGHTING); glBegin(GL_LINES); glColor3f(1.0,0.0,0.0); glVertex3f(0.0,0.0,0.0); glVertex3f(1.0,0.0,0.0); glColor3f(0.0,1.0,0.0); glVertex3f(0.0,0.0,0.0); glVertex3f(0.0,1.0,0.0); glColor3f(0.0,0.0,1.0); glVertex3f(0.0,0.0,0.0); glVertex3f(0.0,0.0,1.0); glEnd(); glPopAttrib(); glPopAttrib(); </gobj>

This requires string to be interpreted. For example if glVertex3f serialized to
glVertex3f 0.0 0.0 0.0 or
<glVertex3f> 0.0 0.0 0.0 </glVertex3f>
then
serializeInverse("<glVertex3f> 0.0 0.0 0.0 </glVertex3f>") applies serializeInverse on argument string of gobjglVertex3f.

Issues