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 )(IN void *context, IN 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 (IN const char *p) throw ()
static void getFunctionValue (IN ObjectMap *map, const char *fn_name, OUT std::string &value)
static bool isOperation (IN const char *s) throw ()
static float operate (IN float left, IN char op, IN float right) throw ()
static void computeValue (IN ObjectMap *map, IN const char *raw, IN const dictionary_t &variables, OUT std::string &computed)
static void evaluate (IN ObjectMap *map, IN const dictionary_t &variables, IN const char *expr, OUT std::string &result)
static float getFloat (IN ObjectMap *map, IN const dictionary_t &variables, IN const dictionary_t &data, IN const char *key, IN const char *default_value)
static void processTile (IN ObjectMap *map, IN const char *cursor, IN const dictionary_t &variables, IO std::ostream &stream)
static void processVariable (IN ObjectMap *map, IN const char *cursor, IN const dictionary_t &in_params, IN const objtree::property_set_t &pub, IO dictionary_t &variables)
static void getScriptOutputId (IN const char *param_id, OUT std::string &output_id)
smart_ptr< PrimitiveparseFunction (IN std::istream &stream, IN ObjectMap *map)
void invokeFunction (IN Primitive *in_function, IN ObjectMap *map, IN const dictionary_t &in_params, OUT std::ostream &out)
PrimitiveaddFunctionFromPath (IN ObjectMap *map, IN const char *path)
void setScript (IN ObjectMap *map, IN const char *parent_id, IN const char *script_id, IN const objtree::property_set_t &pset_def, IO std::ostream &stream, OUT std::string &root)
void updateScriptParameters (IN ObjectMap *map, IN const char *parent_id, IN const objtree::property_set_t &pset, IO std::ostream &stream)
void resizeScript (IN ObjectMap *map, IN const char *parent_id, IN float width, IN float height, IO std::ostream &stream)
void init_bezier_from_data (IN const dictionary_t &data, OUT init_bezier_t &init)
smart_ptr< Primitivecreate_bezier (IN const init_bezier_t &init)
static dword_t getDwordFromPointer (IN void *ptr) throw ()
static int getPathElement (IN const char *path, IO char *buffer, IN int bufsize)
static void updateBrush (IN const Dictionary &d, IN Drawer *drawer)
static void adjustRefCount (IN ObjectMap *map, IN const char *id, IN long delta)
static void updateObjectTransform (IO object_t &obj)
static void writeXY (IO std::ostream &stream, IN float x, IN float y)
static void constructObject (IN ObjectMap *map, IN const dictionary_t &data, OUT object_t &obj)
smart_ptr< PrimitiveparseGroup (IN std::istream &stream, IO ObjectMap *map)
void init_line_from_data (IN const dictionary_t &data, OUT init_line_t &init)
smart_ptr< Primitivecreate_line (IN const init_line_t &init)
void init_quad_from_data (IN const dictionary_t &data, OUT init_quad_t &init)
smart_ptr< Primitivecreate_quad (IN const init_quad_t &init)
void init_rect_from_data (IN const dictionary_t &data, OUT init_rect_t &init)
smart_ptr< Primitivecreate_rect (IN const init_rect_t &init)
void init_text_from_data (IN const dictionary_t &data, OUT init_text_t &init)
smart_ptr< Primitivecreate_text (IN const init_text_t &init)
static bool isMultilineType (IN const char *type) throw ()
static void breakPath (IN const char *in_path, OUT VecString &elements, OUT VecString &relpath)
void processAdd (IN ObjectMap *map, IN const char *action)
static void processSet (IN ObjectMap *map, IN const char *action)
static void processRemove (IN ObjectMap *map, IN const char *action)
static void getActionString (IN const char *verb, IO std::istream &stream, OUT std::string &action)
static void getUndoForAction (IN ObjectMap *map, IN const char *verb, IO const char *action, OUT std::string &undo)
static void processAction (IN ObjectMap *map, IN const char *verb, IN const char *action)
static void processRequestInternal (IN ObjectMap *map, IN std::istream &stream, IN bool single_transaction, OUT VecString &undo_actions)
bool processRequest (IN ObjectMap *map, IN std::istream &stream, IN bool single_transaction, OUT std::string &undo_request, OUT std::string &diagnostic)
 Request that an ObjectMap be updated with the given request.
static bool containsSpace (IN const char *p) throw ()
static void getIdPrefix (IN const char *id, OUT std::string &prefix)
void addDependenciesToGraphInternal (IN ObjectMap *map, IN const char *id, IO graph::DAG *dag)
static void replaceIDs (IN ObjectMap *map, IN std::istream &in, OUT 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 (IN ObjectMap *map, IN Primitive *root, IN const SetString &selection, IN float x_cm, IN float y_cm, OUT 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 (IN ObjectMap *map, IN const char *id, IO 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 (IN ObjectMap *map, IN Primitive *root, IN const SetString &selection, IN std::istream &drag_request, IN float x_cm, IN float y_cm, IN NodeChecker &okayToReceiveDrop, OUT std::string &request, OUT 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 (IN ObjectMap *map, IN Primitive *root, IN const SetString &selection,OUT rect_t &r_cm)
 getSelectionRect() - given a set of selected objects, return bounding rect
static bool getObjectAtCallback (IN void *context, IN visit_result_t &vr)
bool getObjectAt (IN Primitive *root, IN float x_cm, IN float y_cm, IN NodeChecker &checker, OUT hit_result_t &wr)
meta_check_t getMeta (IN Primitive *p, IN const char *name)
std::string getOptionalMeta (IN Primitive *p, IN const char *name, IN const char *default_value)
template<class T >
std::string getStringValue (const T &t)
void init_point_from_data (IN const dictionary_t &data, OUT init_point_t &)
smart_ptr< Primitivecreate_point (IN const init_point_t &)
void init_dxdy_from_data (IN const dictionary_t &data, OUT init_dxdy_t &)
smart_ptr< Primitivecreate_dxdy (IN const init_dxdy_t &)
smart_ptr< PrimitiveparseGroup (IN std::istream &stream, IN ObjectMap *map)

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 ( IN const char *  p  )  throw () [static]

Definition at line 63 of file function.cpp.

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

Definition at line 86 of file function.cpp.

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

Definition at line 110 of file function.cpp.

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

Definition at line 129 of file function.cpp.

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

Definition at line 238 of file function.cpp.

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

Definition at line 163 of file function.cpp.

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

Definition at line 268 of file function.cpp.

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

Definition at line 296 of file function.cpp.

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

Definition at line 368 of file function.cpp.

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

Definition at line 694 of file function.cpp.

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

Definition at line 93 of file p_group.cpp.

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

Definition at line 107 of file p_group.cpp.

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

Definition at line 151 of file p_group.cpp.

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

Definition at line 172 of file p_group.cpp.

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

Definition at line 293 of file p_group.cpp.

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

Definition at line 469 of file p_group.cpp.

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

Definition at line 1378 of file p_group.cpp.

smart_ptr<Primitive> vgfx::parseGroup ( IN std::istream &  stream,
IO ObjectMap *  map 
)

Definition at line 1403 of file p_group.cpp.

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

Definition at line 70 of file parser.cpp.

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

Definition at line 87 of file parser.cpp.

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

Definition at line 119 of file parser.cpp.

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

Definition at line 209 of file parser.cpp.

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

Definition at line 248 of file parser.cpp.

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

Definition at line 287 of file parser.cpp.

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

Definition at line 329 of file parser.cpp.

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

Definition at line 490 of file parser.cpp.

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

Definition at line 522 of file parser.cpp.

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

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

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

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

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

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

static void vgfx::replaceIDs ( IN ObjectMap *  map,
IN std::istream &  in,
OUT 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 ( IN ObjectMap *  map,
IN Primitive *  root,
IN const SetString &  selection,
IN float  x_cm,
IN float  y_cm,
OUT 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 ( IN ObjectMap *  map,
IN const char *  id,
IO 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 ( IN ObjectMap *  map,
IN Primitive *  root,
IN const SetString &  selection,
IN std::istream &  drag_request,
IN float  x_cm,
IN float  y_cm,
IN NodeChecker &  okayToReceiveDrop,
OUT std::string &  request,
OUT 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 ( IN ObjectMap *  map,
IN Primitive *  root,
IN const SetString &  selection,
OUT rect_t &  r_cm 
)

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

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

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

bool vgfx::getObjectAt ( IN Primitive *  root,
IN float  x_cm,
IN float  y_cm,
IN NodeChecker &  checker,
OUT hit_result_t &  wr 
)
meta_check_t vgfx::getMeta ( IN Primitive *  p,
IN const char *  name 
)
std::string vgfx::getOptionalMeta ( IN Primitive *  p,
IN const char *  name,
IN const char *  default_value 
)

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.