Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ShapeFuns.h File Reference

#include <vector>
#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.

Namespaces

namespace  DualCoding

Classes

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

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< T > find_if (const std::vector< Shape< T > > &vec, PredType pred)
 Find a Shape<T> satisfying pred.
template<class T>
Shape< T > find_if (const std::vector< ShapeRoot > &vec)
 Find a Shape<T> in a vector of ShapeRoot.
template<class T>
Shape< T > 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 ComparisonType>
Shape< T > max_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< T > min_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, PredType pred)
template<typename PredType>
std::vector< ShapeRoot > stable_sort (const std::vector< ShapeRoot > &vec, 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 345 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 74 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 81 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 67 of file ShapeFuns.h.

Referenced by BrickData::findBricks().

#define END_ITERATE   }

Definition at line 64 of file ShapeFuns.h.

#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 35 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 31 of file ShapeFuns.h.

Referenced by Pilot::BuildTarget::generateMapBuilderRequest(), Pilot::BuildTarget::getNextPoint(), and Pilot::BuildTarget::processEvent().

#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 26 of file ShapeFuns.h.

Referenced by visops::bottomHalfPlane(), BrickData::findBricks(), BrickData::findOrthogonalBoundingBox(), visops::leftHalfPlane(), visops::rightHalfPlane(), and visops::topHalfPlane().

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

Create a new vector of shapes of mixed type.

Definition at line 43 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 39 of file ShapeFuns.h.

Referenced by TargetData::extractLineTarget().

#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 53 of file ShapeFuns.h.

#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 59 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 47 of file ShapeFuns.h.


DualCoding 4.0
Generated Thu Nov 22 00:53:19 2007 by Doxygen 1.5.4