PeriDyno 1.0.0
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  Direction { x = 0 , y = 1 , count = 2 }
 
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)
 
void setUseSquard (bool s)
 
void useBezier ()
 
void useLinear ()
 
void setSpacing (double s)
 
void remapX (double minX, double maxX)
 
void remapY (double minY, double maxY)
 
void remapXY (double minX, double maxX, double minY, double maxY)
 
void setRange_MinX (float min, float max)
 
void setRange_MaxX (float min, float max)
 
void setRange_MinY (float min, float max)
 
void setRange_MaxY (float min, float max)
 
void setRange (float min, float max)
 
void addItemOriginalCoord (int x, int y)
 
void addItemHandlePoint (int x, int y)
 
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 ()
 
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)
 
void setVarByStr (std::string Str, Direction &value)
 

Public Attributes

Canvas::Interpolation mInterpMode = Linear
 
std::vector< Coord2DmCoord
 
std::vector< Coord2DmBezierPoint
 
std::vector< Coord2DmFinalCoord
 
std::vector< Coord2DmResamplePoint
 
std::vector< double > mLengthArray
 
std::vector< Coord2DmyHandlePoint
 
std::string InterpStrings [2] = { "Linear","Bezier" }
 
std::vector< OriginalCoordOriginalcoord
 
std::vector< OriginalCoordOriginalHandlePoint
 
float remapRange [8] = { -3,3,-3,3,-3,3,-3,3 }
 
double NminX = 0
 
double NmaxX = 1
 
double mNewMinY = 0
 
double NmaxY = 1
 
bool lockSize = false
 
bool useBezierInterpolation = false
 
bool resample = true
 
bool curveClose = false
 
bool useColseButton = true
 
bool useSquard = true
 
bool useSquardButton = true
 
float Spacing = 5
 
float segment = 10
 
float resampleResolution = 20
 
std::map< float, EndPointlength_EndPoint_Map
 

Protected Member Functions

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

Detailed Description

Definition at line 11 of file Canvas.h.

Member Enumeration Documentation

◆ CurveMode

Enumerator
Open 
Close 

Definition at line 29 of file Canvas.h.

◆ Direction

Enumerator
count 

Definition at line 15 of file Canvas.h.

◆ Interpolation

Enumerator
Linear 
Bezier 
InterpolationCount 

Definition at line 22 of file Canvas.h.

Constructor & Destructor Documentation

◆ Canvas()

dyno::Canvas::Canvas ( )
inline

Definition at line 97 of file Canvas.h.

◆ ~Canvas()

dyno::Canvas::~Canvas ( )
inline

Definition at line 98 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:

◆ addItemHandlePoint()

void dyno::Canvas::addItemHandlePoint ( int x,
int y )

Definition at line 44 of file Canvas.cpp.

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

◆ addItemOriginalCoord()

void dyno::Canvas::addItemOriginalCoord ( int x,
int y )

Definition at line 37 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 255 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 292 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 148 of file Canvas.h.

◆ convertVarToStr()

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

Definition at line 165 of file Canvas.h.

◆ getPoints()

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

Definition at line 139 of file Canvas.h.

Here is the caller graph for this function:

◆ getPointSize()

unsigned dyno::Canvas::getPointSize ( )
inline

Definition at line 140 of file Canvas.h.

◆ rebuildHandlePoint()

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

Definition at line 205 of file Canvas.cpp.

Here is the caller graph for this function:

◆ remapX()

void dyno::Canvas::remapX ( double minX,
double maxX )
inline

Definition at line 117 of file Canvas.h.

Here is the call graph for this function:

◆ remapXY()

void dyno::Canvas::remapXY ( double minX,
double maxX,
double minY,
double maxY )
inline

Definition at line 119 of file Canvas.h.

Here is the call graph for this function:

◆ remapY()

void dyno::Canvas::remapY ( double minY,
double maxY )
inline

Definition at line 118 of file Canvas.h.

Here is the call graph for this function:

◆ resamplePointFromLine()

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

Definition at line 143 of file Canvas.cpp.

Here is the caller graph for this function:

◆ setCurveClose()

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

Definition at line 108 of file Canvas.h.

Here is the call graph for this function:

◆ setInterpMode()

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

Definition at line 279 of file Canvas.cpp.

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

◆ setRange()

void dyno::Canvas::setRange ( float min,
float max )
inline

Definition at line 125 of file Canvas.h.

Here is the call graph for this function:

◆ setRange_MaxX()

void dyno::Canvas::setRange_MaxX ( float min,
float max )
inline

Definition at line 122 of file Canvas.h.

Here is the caller graph for this function:

◆ setRange_MaxY()

void dyno::Canvas::setRange_MaxY ( float min,
float max )
inline

Definition at line 124 of file Canvas.h.

Here is the caller graph for this function:

◆ setRange_MinX()

void dyno::Canvas::setRange_MinX ( float min,
float max )
inline

Definition at line 121 of file Canvas.h.

Here is the caller graph for this function:

◆ setRange_MinY()

void dyno::Canvas::setRange_MinY ( float min,
float max )
inline

Definition at line 123 of file Canvas.h.

Here is the caller graph for this function:

◆ setResample()

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

Definition at line 110 of file Canvas.h.

Here is the call graph for this function:

◆ setSpacing()

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

Definition at line 114 of file Canvas.h.

Here is the call graph for this function:

◆ setUseSquard()

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

Definition at line 111 of file Canvas.h.

◆ setVarByStr() [1/6]

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

Definition at line 205 of file Canvas.h.

◆ setVarByStr() [2/6]

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

Definition at line 214 of file Canvas.h.

◆ setVarByStr() [3/6]

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

Definition at line 224 of file Canvas.h.

◆ setVarByStr() [4/6]

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

Definition at line 180 of file Canvas.h.

◆ setVarByStr() [5/6]

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

Definition at line 188 of file Canvas.h.

◆ setVarByStr() [6/6]

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

Definition at line 196 of file Canvas.h.

◆ updateBezierCurve()

void dyno::Canvas::updateBezierCurve ( )
virtual

Reimplemented in dyno::Ramp.

Definition at line 51 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 95 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 143 of file Canvas.h.

Here is the caller graph for this function:

◆ updateResampleLinearLine()

void dyno::Canvas::updateResampleLinearLine ( )

Definition at line 130 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

◆ curveClose

bool dyno::Canvas::curveClose = false

Definition at line 263 of file Canvas.h.

◆ InterpStrings

std::string dyno::Canvas::InterpStrings[2] = { "Linear","Bezier" }

Definition at line 249 of file Canvas.h.

◆ length_EndPoint_Map

std::map<float, EndPoint> dyno::Canvas::length_EndPoint_Map

Definition at line 271 of file Canvas.h.

◆ lockSize

bool dyno::Canvas::lockSize = false

Definition at line 260 of file Canvas.h.

◆ mBezierPoint

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

Definition at line 244 of file Canvas.h.

◆ mCoord

std::vector<Coord2D> dyno::Canvas::mCoord

Definition at line 243 of file Canvas.h.

◆ mFinalCoord

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

Definition at line 245 of file Canvas.h.

◆ mInterpMode

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

Definition at line 242 of file Canvas.h.

◆ mLengthArray

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

Definition at line 247 of file Canvas.h.

◆ mNewMinY

double dyno::Canvas::mNewMinY = 0

Definition at line 257 of file Canvas.h.

◆ mResamplePoint

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

Definition at line 246 of file Canvas.h.

◆ myHandlePoint

std::vector<Coord2D> dyno::Canvas::myHandlePoint

Definition at line 248 of file Canvas.h.

◆ NmaxX

double dyno::Canvas::NmaxX = 1

Definition at line 256 of file Canvas.h.

◆ NmaxY

double dyno::Canvas::NmaxY = 1

Definition at line 258 of file Canvas.h.

◆ NminX

double dyno::Canvas::NminX = 0

Definition at line 255 of file Canvas.h.

◆ Originalcoord

std::vector<OriginalCoord> dyno::Canvas::Originalcoord

Definition at line 250 of file Canvas.h.

◆ OriginalHandlePoint

std::vector<OriginalCoord> dyno::Canvas::OriginalHandlePoint

Definition at line 251 of file Canvas.h.

◆ remapRange

float dyno::Canvas::remapRange[8] = { -3,3,-3,3,-3,3,-3,3 }

Definition at line 253 of file Canvas.h.

◆ resample

bool dyno::Canvas::resample = true

Definition at line 262 of file Canvas.h.

◆ resampleResolution

float dyno::Canvas::resampleResolution = 20

Definition at line 269 of file Canvas.h.

◆ segment

float dyno::Canvas::segment = 10

Definition at line 268 of file Canvas.h.

◆ Spacing

float dyno::Canvas::Spacing = 5

Definition at line 267 of file Canvas.h.

◆ useBezierInterpolation

bool dyno::Canvas::useBezierInterpolation = false

Definition at line 261 of file Canvas.h.

◆ useColseButton

bool dyno::Canvas::useColseButton = true

Definition at line 264 of file Canvas.h.

◆ useSquard

bool dyno::Canvas::useSquard = true

Definition at line 265 of file Canvas.h.

◆ useSquardButton

bool dyno::Canvas::useSquardButton = true

Definition at line 266 of file Canvas.h.


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