diff options
Diffstat (limited to 'AutoVisual')
-rw-r--r-- | AutoVisual/IGPFamily.pde | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/AutoVisual/IGPFamily.pde b/AutoVisual/IGPFamily.pde index 9ee62cc..ff8d480 100644 --- a/AutoVisual/IGPFamily.pde +++ b/AutoVisual/IGPFamily.pde @@ -2,6 +2,10 @@ class IGPFamily { PVector mid; float diameter; float radius; + Float[] defaultFillColor = {0.0, 0.0, 0.0, 0.0}; + Float[] defaultStrokeColor = {0.66, 0.66, 0.66, 0.4}; + Float[] fillColor; + Float[] strokeColor; ArrayList <PVector> alphaCircleVectors; ArrayList <PVector> alphaCircleVectorsSixteen; ArrayList <PVector> constructionCircleCenters; @@ -50,6 +54,32 @@ class IGPFamily { alphaCircleVectorsSixteen.add(getVectorOnAlphaCircle(337.5)); } + void setFillColor(Float[] fillColor){ + if (fillColor.length==4){ + this.fillColor = fillColor; + } + } + + void setStrokeColor(Float[] strokeColor){ + if (strokeColor.length==4){ + this.strokeColor = strokeColor; + } + } + + void useStrokeColor(){ + if(strokeColor.length!=4 || strokeColor == null){ + strokeColor = defaultStrokeColor; + } + stroke(strokeColor[0], strokeColor[1], strokeColor[2], strokeColor[3]); + } + + void useFillColor(){ + if(fillColor.length!=4 || fillColor == null){ + fillColor = defaultFillColor; + } + fill(fillColor[0], fillColor[1], fillColor[2], fillColor[3]); + } + PVector getVectorOnCircle(PVector mid, float degree){ PVector point = new PVector(mid.x + radius*cos(radians(degree)), mid.y + radius * sin(radians(degree))); return point; @@ -121,9 +151,8 @@ class IGPFamily { } void createDiagonalConstructionLinesOnAlphaCircle(){ - //TODO: use PVectors from ArrayList - createLine(getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(225)); - createLine(getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(315)); + createLine(alphaCircleVectorsSixteen.get(2), alphaCircleVectorsSixteen.get(10)); + createLine(alphaCircleVectorsSixteen.get(6), alphaCircleVectorsSixteen.get(14)); } void createInnerHexagon(){ |