|
@@ -2,20 +2,19 @@
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
|
|
|
|
#define ZERO_4PC 0, 0, 0, 0
|
|
#define ZERO_4PC 0, 0, 0, 0
|
|
-bool test(corel* cdr){
|
|
+
|
|
|
|
+IVGShapePtr MakeEllipse(corel* cdr, double x, double y, double r);
|
|
|
|
+IVGShapePtr MakeEllipse(corel* cdr, IVGShapePtr s, double r);
|
|
|
|
+
|
|
|
|
+IVGShapePtr MakeRectangle(corel* cdr, double x, double y, double w, double h);
|
|
|
|
+IVGShapePtr MakeRectangle(corel* cdr, IVGShapePtr s, double w, double h);
|
|
|
|
+bool polygon_gravity_dot(corel* cdr){
|
|
cdr->ActiveDocument->Unit = cdrMillimeter;
|
|
cdr->ActiveDocument->Unit = cdrMillimeter;
|
|
double x, y;
|
|
double x, y;
|
|
|
|
|
|
-
|
|
+
|
|
auto s = cdr->ActiveShape;
|
|
auto s = cdr->ActiveShape;
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -27,16 +26,47 @@ bool test(corel* cdr){
|
|
y = n->PositionY;
|
|
y = n->PositionY;
|
|
printf("%f, %f\n", x, y);
|
|
printf("%f, %f\n", x, y);
|
|
|
|
|
|
- auto sy = cdr->ActiveLayer->CreateEllipse2(x, y, 5, ZERO_4PC);
|
|
+ auto sy = MakeEllipse(cdr, x, y, 5);
|
|
sy->Outline->Color->RGBAssign(255, 0, 0);
|
|
sy->Outline->Color->RGBAssign(255, 0, 0);
|
|
|
|
|
|
- auto sj = cdr->ActiveLayer->CreateRectangle2(x, y, 10, 10, ZERO_4PC);
|
|
+ auto sj = MakeRectangle(cdr, x, y, 10, 10);
|
|
sj->Outline->Color->RGBAssign(0, 255, 0);
|
|
sj->Outline->Color->RGBAssign(0, 255, 0);
|
|
- sj->PutCenterX(x);
|
|
|
|
- sj->PutCenterY(y);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+IVGShapePtr MakeEllipse(corel* cdr, double x, double y, double r){
|
|
|
|
+ return cdr->ActiveLayer->CreateEllipse2(x, y, r, ZERO_4PC);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+IVGShapePtr MakeEllipse(corel* cdr, IVGShapePtr s, double r){
|
|
|
|
+ double x, y;
|
|
|
|
+ x = s->CenterX;
|
|
|
|
+ y = s->CenterY;
|
|
|
|
+ return cdr->ActiveLayer->CreateEllipse2(x, y, r, ZERO_4PC);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+IVGShapePtr MakeRectangle(corel* cdr, double x, double y, double w, double h){
|
|
|
|
+ auto sj = cdr->ActiveLayer->CreateRectangle2(x, y, w, h, ZERO_4PC);
|
|
|
|
+ sj->PutCenterX(x);
|
|
|
|
+ sj->PutCenterY(y);
|
|
|
|
+ return sj;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+IVGShapePtr MakeRectangle(corel* cdr, IVGShapePtr s, double w, double h){
|
|
|
|
+ double x, y;
|
|
|
|
+ x = s->CenterX;
|
|
|
|
+ y = s->CenterY;
|
|
|
|
+ auto sj = cdr->ActiveLayer->CreateRectangle2(x, y, w, h, ZERO_4PC);
|
|
|
|
+ sj->PutCenterX(x);
|
|
|
|
+ sj->PutCenterY(y);
|
|
|
|
+ return sj;
|
|
|
|
+}
|