Board 0.9.6
Public Member Functions | Static Public Member Functions | List of all members
LibBoard::RoughVisitor Struct Reference

#include <RoughVisitor.h>

Inheritance diagram for LibBoard::RoughVisitor:
LibBoard::CompositeShapeTransform

Public Member Functions

 RoughVisitor ()
 
void setRepeat (int n)
 
void setFilling (SketchFilling filling)
 
void setHachureAngle (double angle)
 
void setHachureSpacing (double spacing)
 
void setAutomaticHachureSpacing (bool)
 
virtual Shape * map (const Shape &shape) override
 
virtual Shape * map (const Shape &shape) const override
 
virtual Shape * map (const Line &) override
 
virtual Shape * map (const Line &) const override
 
virtual Shape * map (const Arrow &) override
 
virtual Shape * map (const Arrow &) const override
 
virtual Shape * map (const Polyline &) override
 
virtual Shape * map (const Polyline &) const override
 
virtual Shape * map (const Ellipse &) override
 
virtual Shape * map (const Ellipse &) const override
 
virtual Shape * map (const Bezier &) override
 
virtual Shape * map (const Bezier &) const override
 
virtual ~RoughVisitor () override
 
- Public Member Functions inherited from LibBoard::CompositeShapeTransform
virtual Shape * map (const Shape &)=0
 
virtual Shape * map (const Shape &) const =0
 
virtual Shape * map (const Dot &)
 
virtual Shape * map (const Dot &) const
 
virtual Shape * map (const Line &)
 
virtual Shape * map (const Line &) const
 
virtual Shape * map (const Arrow &)
 
virtual Shape * map (const Arrow &) const
 
virtual Shape * map (const Polyline &)
 
virtual Shape * map (const Polyline &) const
 
virtual Shape * map (const Ellipse &)
 
virtual Shape * map (const Ellipse &) const
 
virtual Shape * map (const Text &)
 
virtual Shape * map (const Text &) const
 
virtual Shape * map (const Bezier &)
 
virtual Shape * map (const Bezier &) const
 
virtual ~CompositeShapeTransform ()
 

Static Public Member Functions

static void slideRandomly (Point &point, const double &radius)
 
static Point randomlySlided (const Point &point, const double &radius)
 
static void slideRandomlyAwayFromSegment (Point &p, const Point &a, const Point &b, const double magnitude)
 
static Point randomlySlidedAwayFromSegment (const Point &p, const Point &a, const Point &b, const double magnitude)
 
static void slideRandomlyAwayFromSegment (Point &p, const Point &a, const Point &b)
 
static Point randomlySlidedAwayFromSegment (const Point &p, const Point &a, const Point &b)
 
static void slideRandomlyAwayFromSegmentInBox (Point &p, const Point &u, double uMagnitude, const Point &v, double vMagnitude)
 
static Point randomlySlidedAwayFromSegmentInBox (const Point &p, const Point &u, double uMagnitude, const Point &v, double vMagnitude)
 

Detailed Description

Examples
examples/rough.cpp.

Constructor & Destructor Documentation

◆ RoughVisitor()

LibBoard::RoughVisitor::RoughVisitor ( )

References LibBoard::NoFilling.

◆ ~RoughVisitor()

LibBoard::RoughVisitor::~RoughVisitor ( )
overridevirtual

Member Function Documentation

◆ map() [1/12]

Shape * LibBoard::RoughVisitor::map ( const Arrow &  arrow) const
overridevirtual

◆ map() [2/12]

Shape * LibBoard::RoughVisitor::map ( const Arrow &  arrow)
overridevirtual

Reimplemented from LibBoard::CompositeShapeTransform.

References map().

◆ map() [3/12]

Shape * LibBoard::RoughVisitor::map ( const Bezier &  bezier) const
overridevirtual

◆ map() [4/12]

Shape * LibBoard::RoughVisitor::map ( const Bezier &  bezier)
overridevirtual

Reimplemented from LibBoard::CompositeShapeTransform.

References map().

◆ map() [5/12]

Shape * LibBoard::RoughVisitor::map ( const Ellipse &  ellipse) const
overridevirtual

◆ map() [6/12]

Shape * LibBoard::RoughVisitor::map ( const Ellipse &  ellipse)
overridevirtual

Reimplemented from LibBoard::CompositeShapeTransform.

References map().

◆ map() [7/12]

Shape * LibBoard::RoughVisitor::map ( const Line &  line) const
overridevirtual

◆ map() [8/12]

Shape * LibBoard::RoughVisitor::map ( const Line &  line)
overridevirtual

Reimplemented from LibBoard::CompositeShapeTransform.

References map().

◆ map() [9/12]

Shape * LibBoard::RoughVisitor::map ( const Polyline &  polyline) const
overridevirtual

◆ map() [10/12]

Shape * LibBoard::RoughVisitor::map ( const Polyline &  polyline)
overridevirtual

Reimplemented from LibBoard::CompositeShapeTransform.

References map().

◆ map() [11/12]

Shape * LibBoard::RoughVisitor::map ( const Shape &  shape) const
overridevirtual

◆ map() [12/12]

Shape * LibBoard::RoughVisitor::map ( const Shape &  shape)
overridevirtual

Implements LibBoard::CompositeShapeTransform.

Referenced by map(), map(), map(), map(), and map().

◆ randomlySlided()

Point LibBoard::RoughVisitor::randomlySlided ( const Point &  point,
const double &  radius 
)
static

Return a point randomly slided withing a surrounding disk

Parameters
pointA point.
radiusMaximum radius of the motion.
Returns
The slided point, once translated.

References LibBoard::Tools::boardRandDouble(), M_PI, and point().

Referenced by map(), map(), and slideRandomly().

◆ randomlySlidedAwayFromSegment() [1/2]

Point LibBoard::RoughVisitor::randomlySlidedAwayFromSegment ( const Point &  p,
const Point &  a,
const Point &  b 
)
static

Move the point randomly away from an axis, at most 0.5% away from it.

Parameters
pPoint to be moved
aFirst extremity of the segment
bSecond extremity of the segment
Returns
The point once moved.

References slideRandomlyAwayFromSegment().

◆ randomlySlidedAwayFromSegment() [2/2]

Point LibBoard::RoughVisitor::randomlySlidedAwayFromSegment ( const Point &  p,
const Point &  a,
const Point &  b,
const double  magnitude 
)
static

Move the point randomly away from an axis

Parameters
pPoint to be moved
aFirst extremity of the segment
bSecond extremity of the segment
magnitudeMaximum distance from segment AB
Returns
The point once moved.

References slideRandomlyAwayFromSegment().

Referenced by map(), map(), and map().

◆ randomlySlidedAwayFromSegmentInBox()

Point LibBoard::RoughVisitor::randomlySlidedAwayFromSegmentInBox ( const Point &  p,
const Point &  u,
double  uMagnitude,
const Point &  v,
double  vMagnitude 
)
static

Move a point randomly away from an axis within a parallelogram.

Parameters
pPoint to be moved
uFirst unit vector
uMagnitudeMaximum distance along u
vFirst unit vector
vMagnitudeMaximum distance along v
Returns
The point once moved.

References slideRandomlyAwayFromSegmentInBox().

Referenced by map(), map(), and map().

◆ setAutomaticHachureSpacing()

void LibBoard::RoughVisitor::setAutomaticHachureSpacing ( bool  on)

◆ setFilling()

void LibBoard::RoughVisitor::setFilling ( SketchFilling  filling)

Referenced by LibBoard::makeRough().

◆ setHachureAngle()

void LibBoard::RoughVisitor::setHachureAngle ( double  angle)

Referenced by LibBoard::makeRough().

◆ setHachureSpacing()

void LibBoard::RoughVisitor::setHachureSpacing ( double  spacing)

Referenced by LibBoard::makeRough().

◆ setRepeat()

void LibBoard::RoughVisitor::setRepeat ( int  n)
Examples
examples/rough.cpp.

Referenced by LibBoard::makeRough(), map(), and slide().

◆ slideRandomly()

void LibBoard::RoughVisitor::slideRandomly ( Point &  point,
const double &  radius 
)
static

Randomly slide a point withing a surrounding disk

Parameters
pointA point.
radiusMaximum radius of the motion.

References point(), and randomlySlided().

Referenced by map(), map(), map(), and slide().

◆ slideRandomlyAwayFromSegment() [1/2]

void LibBoard::RoughVisitor::slideRandomlyAwayFromSegment ( Point &  p,
const Point &  a,
const Point &  b 
)
static

Move the point randomly away from an axis, at most 0.5% away from it.

Parameters
pPoint to be moved
aFirst extremity of the segment
bSecond extremity of the segment

References LibBoard::Tools::boardRandDouble(), LibBoard::Point::norm(), LibBoard::Point::normalised(), and LibBoard::Point::rotatedPI2().

◆ slideRandomlyAwayFromSegment() [2/2]

void LibBoard::RoughVisitor::slideRandomlyAwayFromSegment ( Point &  p,
const Point &  a,
const Point &  b,
const double  magnitude 
)
static

Move the point randomly away from an axis

Parameters
pPoint to be moved
aFirst extremity of the segment
bSecond extremity of the segment
magnitudeMaximum distance from segment AB

References LibBoard::Tools::boardRandDouble(), and LibBoard::Point::rotatedPI2().

Referenced by randomlySlidedAwayFromSegment(), and randomlySlidedAwayFromSegment().

◆ slideRandomlyAwayFromSegmentInBox()

void LibBoard::RoughVisitor::slideRandomlyAwayFromSegmentInBox ( Point &  p,
const Point &  u,
double  uMagnitude,
const Point &  v,
double  vMagnitude 
)
static

Move a point randomly away from an axis within a parallelogram.

Parameters
pPoint to be moved
uFirst unit vector
uMagnitudeMaximum distance along u
vFirst unit vector
vMagnitudeMaximum distance along v

References LibBoard::Tools::boardRandDouble().

Referenced by randomlySlidedAwayFromSegmentInBox().


The documentation for this struct was generated from the following files: