just a test

Dependencies:   mbed

Fork of scoreLight_Advanced by Alvaro Cassinelli

Revision:
32:52273c3291fe
Parent:
30:d8af03f01cd4
Child:
33:43e8bc451ef0
--- a/classRigidScafold.cpp	Sun Sep 23 10:11:43 2012 +0000
+++ b/classRigidScafold.cpp	Mon Oct 29 14:28:47 2012 +0000
@@ -1,31 +1,39 @@
-#include "classRigidScafold.h"
- 
- RigidScafold::RigidScafold() {
- }
- 
- RigidScafold::~RigidScafold() {
- }
- 
-
- void  RigidScafold::buildCircularScafold(float _radius, vector2Dd _pos, int _numScafoldPoints) {
-    scafold.resize(_numScafoldPoints);
-    float angInc= 2.0 * PI / _numScafoldPoints;
-    float ang=0;
-    for (int i = 0; i < scafold.size(); i++) {
-        scafold[i]= vector2Dd( cos(ang)* _radius, sin(ang)* _radius )   + _pos; // note: I cannot do vector2Dd( cos(ang), sin(ang) ) * _radius because vector2Dd would give (0,0)
-        ang+=angInc;
-    }
-}
-  
- void  RigidScafold::buildLine(float _length, float _angleDeg, vector2Dd _pos, int _numScafoldPoints) {
-   scafold.resize(_numScafoldPoints);
-   vector2Dd auxStep = vector2Dd(_length * cos(_angleDeg/180.0 * PI)/_numScafoldPoints, sin(_length * _angleDeg/180.0 * PI)/_numScafoldPoints ) ;
-    for (int i = 0; i < scafold.size(); i++) {
-        scafold[i]= auxStep * i + _pos;
-    }
-}
-
-  // Other functions to create letters, text, etc. 
-  // ... TO DO ....
-  
+#include "classRigidScafold.h"
+ 
+ RigidScafold::RigidScafold() {
+ }
+ 
+ RigidScafold::~RigidScafold() {
+ }
+ 
+
+ void  RigidScafold::buildCircularScafold(float _radius, vector2Dd _pos, int _numScafoldPoints) {
+    centerScafold=_pos;
+    scafold.resize(_numScafoldPoints);
+    float angInc= 2.0 * PI / _numScafoldPoints;
+    float ang=0;
+    for (int i = 0; i < scafold.size(); i++) {
+        scafold[i]= vector2Dd( cos(ang)* _radius, sin(ang)* _radius )   + centerScafold; 
+        // note: I cannot do vector2Dd( cos(ang), sin(ang) ) * _radius because vector2Dd would give (0,0)
+        ang+=angInc;
+    }
+}
+
+ void  RigidScafold::resizeDimensionScafold(float _factor) {
+    for (int i = 0; i < scafold.size(); i++) {
+        scafold[i] = ( scafold[i]-centerScafold)*_factor+centerScafold; 
+    }
+}
+  
+ void  RigidScafold::buildLine(float _length, float _angleDeg, vector2Dd _pos, int _numScafoldPoints) {
+   scafold.resize(_numScafoldPoints);
+   vector2Dd auxStep = vector2Dd(_length * cos(_angleDeg/180.0 * PI)/_numScafoldPoints, sin(_length * _angleDeg/180.0 * PI)/_numScafoldPoints ) ;
+    for (int i = 0; i < scafold.size(); i++) {
+        scafold[i]= auxStep * i + _pos;
+    }
+}
+
+  // Other functions to create letters, text, etc. 
+  // ... TO DO ....
+  
  
\ No newline at end of file