PeriDyno 1.2.1
Loading...
Searching...
No Matches
dyno::Canvas Class Reference

#include <Canvas.h>

Inheritance diagram for dyno::Canvas:

Classes

struct  Coord2D
 
struct  EndPoint
 
struct  OriginalCoord
 

Public Types

enum  Interpolation { Linear = 0 , Bezier = 1 , InterpolationCount = 2 }
 
enum  CurveMode { Open = 0 , Close = 1 }
 

Public Member Functions

 Canvas ()
 
 ~Canvas ()
 
void addPoint (float x, float y)
 
void addPointAndHandlePoint (Coord2D point, Coord2D handle_1, Coord2D handle_2)
 
void addFloatItemToCoord (float x, float y, std::vector< Coord2D > &coordArray)
 
void clearMyCoord ()
 
void setCurveClose (bool s)
 
void setInterpMode (bool useBezier)
 
void setResample (bool s)
 
virtual bool isSquard ()
 
void useBezier ()
 
void useLinear ()
 
void setSpacing (double s)
 
virtual void updateBezierCurve ()
 
void updateBezierPointToBezierSet (Coord2D p0, Coord2D p1, Coord2D p2, Coord2D p3, std::vector< Coord2D > &bezierSet)
 
void updateResampleLinearLine ()
 
void resamplePointFromLine (std::vector< Coord2D > pointSet)
 
std::vector< Coord2DgetPoints ()
 
unsigned getPointSize ()
 
Canvas::InterpolationgetInterpMode ()
 
virtual void UpdateFieldFinalCoord ()
 
void convertCoordToStr (std::string VarName, std::vector< Canvas::Coord2D > Array, std::string &Str)
 
template<typename T>
void convertVarToStr (std::string VarName, T value, std::string &Str)
 
void setVarByStr (std::string Str, double &value)
 
void setVarByStr (std::string Str, float &value)
 
void setVarByStr (std::string Str, int &value)
 
void setVarByStr (std::string Str, bool &value)
 
void setVarByStr (std::string Str, Canvas::Interpolation &value)
 
std::vector< Coord2D > & getUserPoints ()
 
std::vector< Coord2D > & getUserHandles ()
 
bool & getResample ()
 
bool & getClose ()
 
float & getSpacing ()
 

Protected Member Functions

void rebuildHandlePoint (std::vector< Coord2D > coordSet)
 
void buildSegMent_Length_Map (std::vector< Coord2D > BezierPtSet)
 

Protected Attributes

Canvas::Interpolation mInterpMode = Linear
 
float mSpacing = 5
 
bool mResample = true
 
bool mClose = false
 
std::vector< Coord2DmUserCoord
 
std::vector< Coord2DmUserHandle
 
std::vector< Coord2DmBezierPoint
 
std::vector< Coord2DmFinalCoord
 
std::vector< Coord2DmResamplePoint
 
std::map< float, EndPointmLength_EndPoint_Map
 
std::vector< double > mLengthArray
 

Detailed Description

Definition at line 11 of file Canvas.h.

Member Enumeration Documentation

◆ CurveMode

Enumerator
Open 
Close 

Definition at line 22 of file Canvas.h.

◆ Interpolation

Enumerator
Linear 
Bezier 
InterpolationCount 

Definition at line 15 of file Canvas.h.

Constructor & Destructor Documentation

◆ Canvas()

dyno::Canvas::Canvas ( )
inline

Definition at line 90 of file Canvas.h.

◆ ~Canvas()

dyno::Canvas::~Canvas ( )
inline

Definition at line 91 of file Canvas.h.

Member Function Documentation

◆ addFloatItemToCoord()

void dyno::Canvas::addFloatItemToCoord ( float x,
float y,
std::vector< Coord2D > & coordArray )

Definition at line 20 of file Canvas.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addPoint()

void dyno::Canvas::addPoint ( float x,
float y )

Definition at line 3 of file Canvas.cpp.

Here is the call graph for this function:

◆ addPointAndHandlePoint()

void dyno::Canvas::addPointAndHandlePoint ( Coord2D point,
Coord2D handle_1,
Coord2D handle_2 )

Definition at line 11 of file Canvas.cpp.

Here is the call graph for this function:

◆ buildSegMent_Length_Map()

void dyno::Canvas::buildSegMent_Length_Map ( std::vector< Coord2D > BezierPtSet)
protected

Definition at line 242 of file Canvas.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearMyCoord()

void dyno::Canvas::clearMyCoord ( )

Definition at line 271 of file Canvas.cpp.

Here is the caller graph for this function:

◆ convertCoordToStr()

void dyno::Canvas::convertCoordToStr ( std::string VarName,
std::vector< Canvas::Coord2D > Array,
std::string & Str )
inline

Definition at line 128 of file Canvas.h.

◆ convertVarToStr()

template<typename T>
void dyno::Canvas::convertVarToStr ( std::string VarName,
T value,
std::string & Str )
inline

Definition at line 145 of file Canvas.h.

◆ getClose()

bool & dyno::Canvas::getClose ( )
inline

Definition at line 207 of file Canvas.h.

Here is the caller graph for this function:

◆ getInterpMode()

Canvas::Interpolation & dyno::Canvas::getInterpMode ( )
inline

Definition at line 121 of file Canvas.h.

Here is the caller graph for this function:

◆ getPoints()

std::vector< Coord2D > dyno::Canvas::getPoints ( )
inline

Definition at line 118 of file Canvas.h.

Here is the caller graph for this function:

◆ getPointSize()

unsigned dyno::Canvas::getPointSize ( )
inline

Definition at line 119 of file Canvas.h.

◆ getResample()

bool & dyno::Canvas::getResample ( )
inline

Definition at line 206 of file Canvas.h.

Here is the caller graph for this function:

◆ getSpacing()

float & dyno::Canvas::getSpacing ( )
inline

Definition at line 208 of file Canvas.h.

Here is the caller graph for this function:

◆ getUserHandles()

std::vector< Coord2D > & dyno::Canvas::getUserHandles ( )
inline

Definition at line 204 of file Canvas.h.

Here is the caller graph for this function:

◆ getUserPoints()

std::vector< Coord2D > & dyno::Canvas::getUserPoints ( )
inline

Definition at line 203 of file Canvas.h.

Here is the caller graph for this function:

◆ isSquard()

virtual bool dyno::Canvas::isSquard ( )
inlinevirtual

Reimplemented in dyno::Curve, and dyno::Ramp.

Definition at line 104 of file Canvas.h.

◆ rebuildHandlePoint()

void dyno::Canvas::rebuildHandlePoint ( std::vector< Coord2D > coordSet)
protected

Definition at line 192 of file Canvas.cpp.

Here is the caller graph for this function:

◆ resamplePointFromLine()

void dyno::Canvas::resamplePointFromLine ( std::vector< Coord2D > pointSet)

Definition at line 130 of file Canvas.cpp.

Here is the caller graph for this function:

◆ setCurveClose()

void dyno::Canvas::setCurveClose ( bool s)
inline

Definition at line 101 of file Canvas.h.

Here is the call graph for this function:

◆ setInterpMode()

void dyno::Canvas::setInterpMode ( bool useBezier)

Definition at line 266 of file Canvas.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setResample()

void dyno::Canvas::setResample ( bool s)
inline

Definition at line 103 of file Canvas.h.

Here is the call graph for this function:

◆ setSpacing()

void dyno::Canvas::setSpacing ( double s)
inline

Definition at line 107 of file Canvas.h.

Here is the call graph for this function:

◆ setVarByStr() [1/5]

void dyno::Canvas::setVarByStr ( std::string Str,
bool & value )
inline

Definition at line 185 of file Canvas.h.

◆ setVarByStr() [2/5]

void dyno::Canvas::setVarByStr ( std::string Str,
Canvas::Interpolation & value )
inline

Definition at line 194 of file Canvas.h.

◆ setVarByStr() [3/5]

void dyno::Canvas::setVarByStr ( std::string Str,
double & value )
inline

Definition at line 160 of file Canvas.h.

◆ setVarByStr() [4/5]

void dyno::Canvas::setVarByStr ( std::string Str,
float & value )
inline

Definition at line 168 of file Canvas.h.

◆ setVarByStr() [5/5]

void dyno::Canvas::setVarByStr ( std::string Str,
int & value )
inline

Definition at line 176 of file Canvas.h.

◆ updateBezierCurve()

void dyno::Canvas::updateBezierCurve ( )
virtual

Reimplemented in dyno::Ramp.

Definition at line 38 of file Canvas.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateBezierPointToBezierSet()

void dyno::Canvas::updateBezierPointToBezierSet ( Coord2D p0,
Coord2D p1,
Coord2D p2,
Coord2D p3,
std::vector< Coord2D > & bezierSet )

Definition at line 82 of file Canvas.cpp.

Here is the caller graph for this function:

◆ UpdateFieldFinalCoord()

virtual void dyno::Canvas::UpdateFieldFinalCoord ( )
inlinevirtual

Reimplemented in dyno::Curve, and dyno::Ramp.

Definition at line 123 of file Canvas.h.

Here is the caller graph for this function:

◆ updateResampleLinearLine()

void dyno::Canvas::updateResampleLinearLine ( )

Definition at line 117 of file Canvas.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ useBezier()

void dyno::Canvas::useBezier ( )

Definition at line 27 of file Canvas.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ useLinear()

void dyno::Canvas::useLinear ( )

Definition at line 32 of file Canvas.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ mBezierPoint

std::vector<Coord2D> dyno::Canvas::mBezierPoint
protected

Definition at line 227 of file Canvas.h.

◆ mClose

bool dyno::Canvas::mClose = false
protected

Definition at line 222 of file Canvas.h.

◆ mFinalCoord

std::vector<Coord2D> dyno::Canvas::mFinalCoord
protected

Definition at line 228 of file Canvas.h.

◆ mInterpMode

Canvas::Interpolation dyno::Canvas::mInterpMode = Linear
protected

Definition at line 219 of file Canvas.h.

◆ mLength_EndPoint_Map

std::map<float, EndPoint> dyno::Canvas::mLength_EndPoint_Map
protected

Definition at line 230 of file Canvas.h.

◆ mLengthArray

std::vector<double> dyno::Canvas::mLengthArray
protected

Definition at line 231 of file Canvas.h.

◆ mResample

bool dyno::Canvas::mResample = true
protected

Definition at line 221 of file Canvas.h.

◆ mResamplePoint

std::vector<Coord2D> dyno::Canvas::mResamplePoint
protected

Definition at line 229 of file Canvas.h.

◆ mSpacing

float dyno::Canvas::mSpacing = 5
protected

Definition at line 220 of file Canvas.h.

◆ mUserCoord

std::vector<Coord2D> dyno::Canvas::mUserCoord
protected

Definition at line 223 of file Canvas.h.

◆ mUserHandle

std::vector<Coord2D> dyno::Canvas::mUserHandle
protected

Definition at line 224 of file Canvas.h.


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