Classes | Typedefs | Enumerations | Functions | Variables

vgfx Namespace Reference
[Vector Graphics Engine]

Classes

class  Drawer
 Clients must implement this if they want to draw. More...
class  PushPopBrush
 helper class to throw on the stack More...
class  Request
 used to easily construct vgfx Requests More...
class  NodeChecker
 NodeChecker -- base class that can be used for walk validation see the bottom of this file for some useful validators. More...
struct  hit_result_t
 hit_result_t -- returned from hit detection More...
struct  meta_check_t
class  MetaKeyValueChecker
struct  visit_result_t
 hit detection results More...
class  Primitive
 the base class from which all vector graphics objects inherit. More...
class  ObjectMap
 an ObjectMap is a physical manifestation of a vector graphics 2D area. More...
struct  init_primitive_t
struct  init_point_t
struct  init_bezier_t
struct  init_rect_t
struct  init_line_t
struct  init_dxdy_t
struct  init_quad_t
struct  init_text_t

Typedefs

typedef std::map< std::string,
smart_ptr< Primitive > > 
primitive_map_t
typedef std::multimap< float,
object_t > 
map_obj_t
typedef point2d_t< float > point_t
typedef rect2d_t< float > rect_t
typedef bool(* callback_t )(void *context, visit_result_t &result)

Enumerations

enum  eGroupType {
  eGT_Normal = 1,
  eGT_Path = 2,
  eGT_Invalid = 0
}
enum  eHitDetect {
  eHit_Overlap = 1,
  eHit_Contained = 2,
  eHit_Always = 3,
  eHit_Invalid = 0
}
 

hit detection results

More...

enum  eBrushAttribute {
  eBrush_PenColor = 1,
  eBrush_FillColor = 2,
  eBrush_PenThickness = 3,
  eBrush_Font = 50,
  eBrush_TextFlags = 60,
  eBrush_Invalid = 0
}

Functions

static bool requiresQuotes (const char *p) throw ()
static void getFunctionValue (ObjectMap *map, const char *fn_name, std::string &value)
static bool isOperation (const char *s) throw ()
static float operate (float left, char op, float right) throw ()
static void computeValue (ObjectMap *map, const char *raw, const dictionary_t &variables, std::string &computed)
static void evaluate (ObjectMap *map, const dictionary_t &variables, const char *expr, std::string &result)
static float getFloat (ObjectMap *map, const dictionary_t &variables, const dictionary_t &data, const char *key, const char *default_value)
static void processTile (ObjectMap *map, const char *cursor, const dictionary_t &variables, std::ostream &stream)
static void processVariable (ObjectMap *map, const char *cursor, const dictionary_t &in_params, const objtree::property_set_t &pub, dictionary_t &variables)
static void getScriptOutputId (const char *param_id, std::string &output_id)
smart_ptr< PrimitiveparseFunction (std::istream &stream, ObjectMap *map)
void invokeFunction (Primitive *in_function, ObjectMap *map, const dictionary_t &in_params, std::ostream &out)
PrimitiveaddFunctionFromPath (ObjectMap *map, const char *path)
void setScript (ObjectMap *map, const char *parent_id, const char *script_id, const objtree::property_set_t &pset_def, std::ostream &stream, std::string &root)
void updateScriptParameters (ObjectMap *map, const char *parent_id, const objtree::property_set_t &pset, std::ostream &stream)
void resizeScript (ObjectMap *map, const char *parent_id, float width, float height, std::ostream &stream)
void init_bezier_from_data (const dictionary_t &data, init_bezier_t &init)
smart_ptr< Primitivecreate_bezier (const init_bezier_t &init)
static dword_t getDwordFromPointer (void *ptr) throw ()
static int getPathElement (const char *path, char *buffer, int bufsize)
static void updateBrush (const Dictionary &d, Drawer *drawer)
static void adjustRefCount (ObjectMap *map, const char *id, long delta)
static void updateObjectTransform (object_t &obj)
static void writeXY (std::ostream &stream, float x, float y)
static void constructObject (ObjectMap *map, const dictionary_t &data, object_t &obj)
smart_ptr< PrimitiveparseGroup (std::istream &stream, ObjectMap *map)
void init_line_from_data (const dictionary_t &data, init_line_t &init)
smart_ptr< Primitivecreate_line (const init_line_t &init)
void init_quad_from_data (const dictionary_t &data, init_quad_t &init)
smart_ptr< Primitivecreate_quad (const init_quad_t &init)
void init_rect_from_data (const dictionary_t &data, init_rect_t &init)
smart_ptr< Primitivecreate_rect (const init_rect_t &init)
void init_text_from_data (const dictionary_t &data, init_text_t &init)
smart_ptr< Primitivecreate_text (const init_text_t &init)
static bool isMultilineType (const char *type) throw ()
static void breakPath (const char *in_path, VecString &elements, VecString &relpath)
void processAdd (ObjectMap *map, const char *action)
static void processSet (ObjectMap *map, const char *action)
static void processRemove (ObjectMap *map, const char *action)
static void getActionString (const char *verb, std::istream &stream, std::string &action)
static void getUndoForAction (ObjectMap *map, const char *verb, const char *action, std::string &undo)
static void processAction (ObjectMap *map, const char *verb, const char *action)
static void processRequestInternal (ObjectMap *map, std::istream &stream, bool single_transaction, VecString &undo_actions)
bool processRequest (ObjectMap *map,std::istream &stream,bool single_transaction,std::string &undo_request,std::string &diagnostic)
 Request that an ObjectMap be updated with the given request.
static bool containsSpace (const char *p) throw ()
static void getIdPrefix (const char *id, std::string &prefix)
void addDependenciesToGraphInternal (ObjectMap *map, const char *id, graph::DAG *dag)
static void replaceIDs (ObjectMap *map, std::istream &in, std::string &request)
const char * getDragDropRootNodeID (void) throw ()
 getDragDropRootNodeID() - returns the id of the root node used for all drag/drop/copy/paste operations
void getDragRequest (ObjectMap *map,Primitive *root,const SetString &selection,float x_cm,float y_cm,std::string &request)
 getDragRequest() - given root object in map, and selection of tag_paths, return a drag/drop request (all selected objects attached to the known drag/drop root node id)
void addDependenciesToGraph (ObjectMap *map,const char *id,graph::DAG *dag)
 addDependenciesToGraph(map, id, dag) - given a top-level object (id) in a map, run through and find all dependencies of the object.
bool getDropRequest (ObjectMap *map,Primitive *root,const SetString &selection,std::istream &drag_request,float x_cm,float y_cm,NodeChecker &okayToReceiveDrop,std::string &request,SetString &out_selection)
 getDropRequest() - given a drag_request that has been dropped at (x_cm, y_cm) on a given root in a given map, return a request that adds all of the dropped objects to the correct position in the root.
void getSelectionRect (ObjectMap *map,Primitive *root,const SetString &selection,rect_t &r_cm)
 getSelectionRect() - given a set of selected objects, return bounding rect
static bool getObjectAtCallback (void *context, visit_result_t &vr)
bool getObjectAt (Primitive *root, float x_cm, float y_cm, NodeChecker &checker, hit_result_t &wr)
meta_check_t getMeta (Primitive *p, const char *name)
std::string getOptionalMeta (Primitive *p, const char *name, const char *default_value)
template<class T >
std::string getStringValue (const T &t)
void init_point_from_data (const dictionary_t &data, init_point_t &)
smart_ptr< Primitivecreate_point (const init_point_t &)
void init_dxdy_from_data (const dictionary_t &data, init_dxdy_t &)
smart_ptr< Primitivecreate_dxdy (const init_dxdy_t &)
static void getOpenGLColorFromString (const char *text, glut_color_t &color)
smart_ptr< DrawercreateOpenGLDrawer (void)

Variables

static const eParseBehavior s_line_behavior
static const brush_entry_t s_brushTable []
static const eParseBehavior s_token_behavior = eParse_RespectQuotes
static const char * s_keyTop = "collectionRoot"

Typedef Documentation

typedef std::map<std::string, smart_ptr<Primitive> > vgfx::primitive_map_t

Definition at line 48 of file object_map.cpp.

typedef std::multimap<float, object_t> vgfx::map_obj_t

Definition at line 282 of file p_group.cpp.


Enumeration Type Documentation

Enumerator:
eGT_Normal 
eGT_Path 
eGT_Invalid 

Definition at line 61 of file p_group.cpp.


Function Documentation

static bool vgfx::requiresQuotes ( const char *  p  )  throw () [static]

Definition at line 63 of file function.cpp.

static void vgfx::getFunctionValue ( ObjectMap *  map,
const char *  fn_name,
std::string &  value 
) [static]

Definition at line 86 of file function.cpp.

static bool vgfx::isOperation ( const char *  s  )  throw () [static]

Definition at line 110 of file function.cpp.

static float vgfx::operate ( float  left,
char  op,
float  right 
) throw () [static]

Definition at line 129 of file function.cpp.

static void vgfx::computeValue ( ObjectMap *  map,
const char *  raw,
const dictionary_t variables,
std::string &  computed 
) [static]

Definition at line 238 of file function.cpp.

static void vgfx::evaluate ( ObjectMap *  map,
const dictionary_t variables,
const char *  expr,
std::string &  result 
) [static]

Definition at line 163 of file function.cpp.

static float vgfx::getFloat ( ObjectMap *  map,
const dictionary_t variables,
const dictionary_t data,
const char *  key,
const char *  default_value 
) [static]

Definition at line 268 of file function.cpp.

static void vgfx::processTile ( ObjectMap *  map,
const char *  cursor,
const dictionary_t variables,
std::ostream &  stream 
) [static]

Definition at line 296 of file function.cpp.

static void vgfx::processVariable ( ObjectMap *  map,
const char *  cursor,
const dictionary_t in_params,
const objtree::property_set_t pub,
dictionary_t variables 
) [static]

Definition at line 368 of file function.cpp.

static void vgfx::getScriptOutputId ( const char *  param_id,
std::string &  output_id 
) [static]

Definition at line 694 of file function.cpp.

static dword_t vgfx::getDwordFromPointer ( void *  ptr  )  throw () [static]

Definition at line 93 of file p_group.cpp.

static int vgfx::getPathElement ( const char *  path,
char *  buffer,
int  bufsize 
) [static]

Definition at line 107 of file p_group.cpp.

static void vgfx::updateBrush ( const Dictionary d,
Drawer *  drawer 
) [static]

Definition at line 151 of file p_group.cpp.

static void vgfx::adjustRefCount ( ObjectMap *  map,
const char *  id,
long  delta 
) [static]

Definition at line 172 of file p_group.cpp.

static void vgfx::updateObjectTransform ( object_t &  obj  )  [static]

Definition at line 293 of file p_group.cpp.

static void vgfx::writeXY ( std::ostream &  stream,
float  x,
float  y 
) [static]

Definition at line 469 of file p_group.cpp.

static void vgfx::constructObject ( ObjectMap *  map,
const dictionary_t data,
object_t &  obj 
) [static]

Definition at line 1378 of file p_group.cpp.

static bool vgfx::isMultilineType ( const char *  type  )  throw () [static]

Definition at line 70 of file parser.cpp.

static void vgfx::breakPath ( const char *  in_path,
VecString elements,
VecString relpath 
) [static]

Definition at line 87 of file parser.cpp.

void vgfx::processAdd ( ObjectMap *  map,
const char *  action 
)

Definition at line 119 of file parser.cpp.

static void vgfx::processSet ( ObjectMap *  map,
const char *  action 
) [static]

Definition at line 209 of file parser.cpp.

static void vgfx::processRemove ( ObjectMap *  map,
const char *  action 
) [static]

Definition at line 248 of file parser.cpp.

static void vgfx::getActionString ( const char *  verb,
std::istream &  stream,
std::string &  action 
) [static]

Definition at line 287 of file parser.cpp.

static void vgfx::getUndoForAction ( ObjectMap *  map,
const char *  verb,
const char *  action,
std::string &  undo 
) [static]

Definition at line 329 of file parser.cpp.

static void vgfx::processAction ( ObjectMap *  map,
const char *  verb,
const char *  action 
) [static]

Definition at line 490 of file parser.cpp.

static void vgfx::processRequestInternal ( ObjectMap *  map,
std::istream &  stream,
bool  single_transaction,
VecString undo_actions 
) [static]

Definition at line 522 of file parser.cpp.

static bool vgfx::containsSpace ( const char *  p  )  throw () [static]

Definition at line 68 of file vgfx-util.cpp.

static void vgfx::getIdPrefix ( const char *  id,
std::string &  prefix 
) [static]

Definition at line 87 of file vgfx-util.cpp.

void vgfx::addDependenciesToGraphInternal ( ObjectMap *  map,
const char *  id,
graph::DAG dag 
)

Definition at line 106 of file vgfx-util.cpp.

static void vgfx::replaceIDs ( ObjectMap *  map,
std::istream &  in,
std::string &  request 
) [static]

Definition at line 163 of file vgfx-util.cpp.

const char * vgfx::getDragDropRootNodeID ( void   )  throw ()

getDragDropRootNodeID() - returns the id of the root node used for all drag/drop/copy/paste operations

void vgfx::getDragRequest ( ObjectMap *  map,
Primitive *  root,
const SetString selection,
float  x_cm,
float  y_cm,
std::string &  request 
)

getDragRequest() - given root object in map, and selection of tag_paths, return a drag/drop request (all selected objects attached to the known drag/drop root node id)

void vgfx::addDependenciesToGraph ( ObjectMap *  map,
const char *  id,
graph::DAG dag 
)

addDependenciesToGraph(map, id, dag) - given a top-level object (id) in a map, run through and find all dependencies of the object.

bool vgfx::getDropRequest ( ObjectMap *  map,
Primitive *  root,
const SetString selection,
std::istream &  drag_request,
float  x_cm,
float  y_cm,
NodeChecker &  okayToReceiveDrop,
std::string &  request,
SetString out_selection 
)

getDropRequest() - given a drag_request that has been dropped at (x_cm, y_cm) on a given root in a given map, return a request that adds all of the dropped objects to the correct position in the root.

void vgfx::getSelectionRect ( ObjectMap *  map,
Primitive *  root,
const SetString selection,
rect_t r_cm 
)

getSelectionRect() - given a set of selected objects, return bounding rect

static bool vgfx::getObjectAtCallback ( void *  context,
visit_result_t &  vr 
) [static]

Definition at line 604 of file vgfx-util.cpp.

bool vgfx::getObjectAt ( Primitive *  root,
float  x_cm,
float  y_cm,
NodeChecker &  checker,
hit_result_t &  wr 
)
meta_check_t vgfx::getMeta ( Primitive *  p,
const char *  name 
)
std::string vgfx::getOptionalMeta ( Primitive *  p,
const char *  name,
const char *  default_value 
)
static void vgfx::getOpenGLColorFromString ( const char *  text,
glut_color_t color 
) [static]

Definition at line 47 of file vgfx-opengl-draw.cpp.


Variable Documentation

static const eParseBehavior vgfx::s_line_behavior [static]
Initial value:

Definition at line 48 of file function.cpp.

const brush_entry_t vgfx::s_brushTable[] [static]
Initial value:
 {
        { "vgfx" "Color" , eBrush_PenColor  },
        { "vgfx" "FillColor" , eBrush_FillColor  },
        { "vgfx" "Thickness" , eBrush_PenThickness  },
        { "vgfx" "Font" , eBrush_Font  },
        { "vgfx" "TextFlags" , eBrush_TextFlags  },

        
        { NULL, eBrush_Invalid }
}

Definition at line 78 of file p_group.cpp.

const eParseBehavior vgfx::s_token_behavior = eParse_RespectQuotes [static]

Definition at line 58 of file parser.cpp.

const char* vgfx::s_keyTop = "collectionRoot" [static]

Definition at line 55 of file vgfx-util.cpp.