Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ShapeFuns.h File Reference

#include <vector>
#include <algorithm>
#include "Shared/ProjectInterface.h"
#include "ShapeTypes.h"
#include "ShapeRoot.h"
Include dependency graph for ShapeFuns.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UnaryShapeRootPred
 Unary predicates over ShapeRoot objects.
class  BinaryShapeRootPred
 Binary predicates over ShapeRoot objects. More...
class  UnaryShapePred< T >
 Unary predicates over Shape<T> objects. More...
class  BinaryShapePred< T >
 Binary predicates over Shape<T> objects. More...
class  shortcircuit_and< PredType1, PredType2 >
 Classes for implementing shortcircuit And and Or predicates. Don't call directly; use AndPred and OrPred; use not1 for negation. More...
class  shortcircuit_or< PredType1, PredType2 >
class  IsType
class  IsColor
class  IsName
class  IsNamePrefix
class  IsLastMatch
class  IsLeftOf
class  IsLeftOfThis
class  IsRightOf
class  IsRightOfThis
class  IsAbove
class  IsAboveThis
class  IsBelow
class  IsBelowThis

Namespaces

namespace  DualCoding
 

Dual coding vision representations (Sketches and Shapes).


Defines

#define NEW_SHAPE(_name, _type, _value)
 Create a new shape and make it visible in the SketchGUI.
#define NEW_SHAPE_N(_name, _type, _value)
 Create a new shape but hide it from the SketchGUI.
#define GET_SHAPE(_name, _type, _shapevec)   DualCoding::Shape<_type> _name(find_shape<_type>(_shapevec,#_name));
 Retrieve a shape based on its name.
#define GET_RENAMED(_new_name, _old_name, _type, _shapevec)   DualCoding::Shape<_type> _new_name(find_shape<_type>(_shapevec,#_old_name));
 Retrieve a shape based on its name, but bind to a new name.
#define NEW_SHAPEVEC(_name, _type, _value)   std::vector<DualCoding::Shape<_type> > _name((_value));
 Create a new vector of shapes of the specified type.
#define NEW_SHAPEROOTVEC(_name, _value)   std::vector<DualCoding::ShapeRoot> _name((_value));
 Create a new vector of shapes of mixed type.
#define SHAPEVEC_ITERATE(_shapesvec, _type, _var)
 Iterate over the shapes in a vector; _var is the iterator.
#define SHAPENEXT_ITERATE(_shapesvec, _type, _var1, _var2)
 Nested iteration over the shapes in a vector; _var2 begins one past _var1.
#define SHAPEROOTVEC_ITERATE(_shapesvec, _var)
 Iterate over a vector for shapes of mixed type.
#define END_ITERATE   }
#define DO_SHAPEVEC(_shapesvec, _type, _var, _body)
 Obsolete: Iterate over the shapes in a vector; _var is the iterator.
#define DO_SHAPENEXT(_shapesvec, _type, _var1, _var2, _body)
 Obsolete: nested iteration over the shapes in a vector; _var2 begins one past _var1.
#define DO_SHAPEROOTVEC(_shapesvec, _var, _body)
 Obsolete: Iterate over a vector for shapes of mixed type.
#define DIRECTION_PAIR(dir, oppdir)

Functions

template<typename PredType >
ShapeRoot find_if (const std::vector< ShapeRoot > &vec, PredType pred)
 Find a ShapeRoot satisfying pred.
template<class T , typename PredType >
Shape< Tfind_if (const std::vector< ShapeRoot > &vec, PredType pred)
 Find a Shape<T> in a vector of ShapeRoot satisfying pred.
template<class T , typename PredType >
Shape< Tfind_if (const std::vector< Shape< T > > &vec, PredType pred)
 Find a Shape<T> satisfying pred.
template<class T >
Shape< Tfind_if (const std::vector< ShapeRoot > &vec)
 Find a Shape<T> in a vector of ShapeRoot.
ShapeRoot find_shape (const std::vector< ShapeRoot > &vec, const std::string &name)
 Return the first ShapeRoot with the specified name, else return an invalid ShapeRoot.
template<class T >
std::vector< Shape< T > > select_type (std::vector< ShapeRoot > &vec)
 Select the Shape<T> elements from a vector of ShapeRoots.
template<class T , typename PredType >
std::vector< Shape< T > > subset (const std::vector< Shape< T > > &vec, PredType pred)
 Find all elements in a vector of Shape<T> satisfying pred.
template<typename PredType >
std::vector< ShapeRoot > subset (const std::vector< ShapeRoot > &vec, PredType pred)
 Find all elements in a vector of ShapeRoot satisfying pred.
template<class T , typename PredType >
std::vector< Tsubset (const std::vector< ShapeRoot > &vec, PredType pred)
 Find all elements of type T in a vector of ShapeRoot satisfying pred.
template<class T , typename ComparisonType >
Shape< Tmax_element (const std::vector< Shape< T > > &vec, ComparisonType comp)
template<typename ComparisonType >
ShapeRoot max_element (const std::vector< ShapeRoot > &vec, ComparisonType comp)
template<class T , typename ComparisonType >
Shape< Tmin_element (const std::vector< Shape< T > > &vec, ComparisonType comp)
template<typename ComparisonType >
ShapeRoot min_element (const std::vector< ShapeRoot > &vec, ComparisonType comp)
template<class T , typename PredType >
std::vector< Shape< T > > stable_sort (const std::vector< Shape< T > > &vec, const PredType &pred)
template<typename PredType >
std::vector< ShapeRoot > stable_sort (const std::vector< ShapeRoot > &vec, const PredType &pred)

template<typename PredType1 , typename PredType2 >
shortcircuit_and< PredType1,
PredType2 > 
AndPred (PredType1 p1, PredType2 p2)
 Conjunction of two predicates; p2 is called only if p1 returns true.
template<typename PredType1 , typename PredType2 >
shortcircuit_or< PredType1,
PredType2 > 
OrPred (PredType1 p1, PredType2 p2)
 Disjunction of two predicates; p2 is called only if p1 returns false.

Define Documentation

#define DIRECTION_PAIR ( dir,
oppdir   ) 

Definition at line 366 of file ShapeFuns.h.

#define DO_SHAPENEXT ( _shapesvec,
_type,
_var1,
_var2,
_body   ) 
Value:
for ( std::vector<DualCoding::Shape<_type> >::iterator _var2##_it = ++std::vector<DualCoding::Shape<_type> >::iterator(_var1##_it); \
        _var2##_it != _shapesvec.end(); _var2##_it++ ) { \
    DualCoding::Shape<_type> &_var2 = *_var2##_it; \
    _body }

Obsolete: nested iteration over the shapes in a vector; _var2 begins one past _var1.

Definition at line 75 of file ShapeFuns.h.

Referenced by BrickData::findBricks().

#define DO_SHAPEROOTVEC ( _shapesvec,
_var,
_body   ) 
Value:
for ( std::vector<DualCoding::ShapeRoot>::iterator _var##_it = _shapesvec.begin(); \
        _var##_it != _shapesvec.end(); _var##_it++ ) { \
    DualCoding::ShapeRoot &_var = *_var##_it; \
    _body }

Obsolete: Iterate over a vector for shapes of mixed type.

Definition at line 82 of file ShapeFuns.h.

Referenced by DualCoding::select_type().

#define DO_SHAPEVEC ( _shapesvec,
_type,
_var,
_body   ) 
Value:
for ( std::vector<DualCoding::Shape<_type> >::iterator _var##_it = _shapesvec.begin(); \
        _var##_it != _shapesvec.end(); _var##_it++ ) { \
    DualCoding::Shape<_type> &_var = *_var##_it; \
    _body } \

Obsolete: Iterate over the shapes in a vector; _var is the iterator.

Definition at line 68 of file ShapeFuns.h.

Referenced by BrickData::findBricks().

#define END_ITERATE   }

Definition at line 65 of file ShapeFuns.h.

Referenced by BiColorMarkerData::extractMarkers(), and AgentData::findCirclesManual().

#define GET_RENAMED ( _new_name,
_old_name,
_type,
_shapevec   )     DualCoding::Shape<_type> _new_name(find_shape<_type>(_shapevec,#_old_name));

Retrieve a shape based on its name, but bind to a new name.

Definition at line 36 of file ShapeFuns.h.

#define GET_SHAPE ( _name,
_type,
_shapevec   )     DualCoding::Shape<_type> _name(find_shape<_type>(_shapevec,#_name));

Retrieve a shape based on its name.

Definition at line 32 of file ShapeFuns.h.

#define NEW_SHAPE_N ( _name,
_type,
_value   ) 
Value:
NEW_SHAPE(_name, _type, _value); \
  if ( _name.isValid() ) _name->N(#_name);

Create a new shape but hide it from the SketchGUI.

Definition at line 27 of file ShapeFuns.h.

Referenced by BrickData::findBricks(), AgentData::findCirclesManual(), and BrickData::findOrthogonalBoundingBox().

#define NEW_SHAPEROOTVEC ( _name,
_value   )     std::vector<DualCoding::ShapeRoot> _name((_value));

Create a new vector of shapes of mixed type.

Definition at line 44 of file ShapeFuns.h.

#define NEW_SHAPEVEC ( _name,
_type,
_value   )     std::vector<DualCoding::Shape<_type> > _name((_value));

Create a new vector of shapes of the specified type.

Definition at line 40 of file ShapeFuns.h.

Referenced by TargetData::extractLineTarget(), BiColorMarkerData::extractMarkers(), and AgentData::findCirclesManual().

#define SHAPENEXT_ITERATE ( _shapesvec,
_type,
_var1,
_var2   ) 
Value:
for ( std::vector<DualCoding::Shape<_type> >::iterator _var2##_it = ++std::vector<DualCoding::Shape<_type> >::iterator(_var1##_it); \
        _var2##_it != _shapesvec.end(); _var2##_it++ ) { \
    DualCoding::Shape<_type> &_var2 = *_var2##_it;

Nested iteration over the shapes in a vector; _var2 begins one past _var1.

Definition at line 54 of file ShapeFuns.h.

Referenced by BiColorMarkerData::extractMarkers().

#define SHAPEROOTVEC_ITERATE ( _shapesvec,
_var   ) 
Value:
for ( std::vector<DualCoding::ShapeRoot>::iterator _var##_it = _shapesvec.begin(); \
        _var##_it != _shapesvec.end(); _var##_it++ ) { \
    DualCoding::ShapeRoot &_var = *_var##_it;

Iterate over a vector for shapes of mixed type.

Definition at line 60 of file ShapeFuns.h.

#define SHAPEVEC_ITERATE ( _shapesvec,
_type,
_var   ) 
Value:
for ( std::vector<DualCoding::Shape<_type> >::iterator _var##_it = _shapesvec.begin(); \
        _var##_it != _shapesvec.end(); _var##_it++ ) { \
    DualCoding::Shape<_type> &_var = *_var##_it;

Iterate over the shapes in a vector; _var is the iterator.

Definition at line 48 of file ShapeFuns.h.

Referenced by BiColorMarkerData::extractMarkers(), and AgentData::findCirclesManual().


DualCoding 5.1CVS
Generated Mon May 9 04:56:29 2016 by Doxygen 1.6.3