|
@@ -1,13 +1,7 @@
|
|
|
#include "cdrapp.h"
|
|
|
#include <stdio.h>
|
|
|
|
|
|
-#define ZERO_4PC 0, 0, 0, 0
|
|
|
|
|
|
-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;
|
|
|
double x, y;
|
|
@@ -15,6 +9,9 @@ bool polygon_gravity_dot(corel* cdr){
|
|
|
// IVGShapePtr ActiveShape; // 获取当前选中的图形 函数原型
|
|
|
auto s = cdr->ActiveShape;
|
|
|
|
|
|
+// IVGShapeRangePtr IVGApplication::CreateShapeRange ( );
|
|
|
+ auto srs = cdr->CreateShapeRange();
|
|
|
+
|
|
|
// 获取节点函数原型
|
|
|
// IVGNodePtr IVGNodes::GetItem ( long Index );
|
|
|
// IVGNodePtr IVGNodeRange::GetItem ( long Index );
|
|
@@ -26,14 +23,19 @@ bool polygon_gravity_dot(corel* cdr){
|
|
|
y = n->PositionY;
|
|
|
printf("%f, %f\n", x, y);
|
|
|
|
|
|
- auto sy = MakeEllipse(cdr, x, y, 5);
|
|
|
- sy->Outline->Color->RGBAssign(255, 0, 0);
|
|
|
+ // auto sy = MakeEllipse(cdr, x, y, 5);
|
|
|
+ // sy->Outline->Color->RGBAssign(255, 0, 0);
|
|
|
|
|
|
- auto sj = MakeRectangle(cdr, x, y, 10, 10);
|
|
|
- sj->Outline->Color->RGBAssign(0, 255, 0);
|
|
|
+ // auto sj = MakeRectangle(cdr, x, y, 10, 10);
|
|
|
+ // sj->Outline->Color->RGBAssign(0, 255, 0);
|
|
|
|
|
|
+ auto l = DrawLine(cdr, x, y, s->CenterX, s->CenterY);
|
|
|
+ srs->Add(l);
|
|
|
}
|
|
|
|
|
|
+// HRESULT IVGShapeRange::CreateSelection ( );
|
|
|
+ srs->CreateSelection();
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -69,4 +71,21 @@ IVGShapePtr MakeRectangle(corel* cdr, IVGShapePtr s, double w, double h){
|
|
|
sj->PutCenterX(x);
|
|
|
sj->PutCenterY(y);
|
|
|
return sj;
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// IVGShapePtr IVGLayer::CreateLineSegment ( double StartX, double StartY, double EndX, double EndY );
|
|
|
+// 画一条线,设置轮廓色 M100
|
|
|
+IVGShapePtr DrawLine(corel* cdr, double x1, double y1, double x2, double y2){
|
|
|
+ auto line = cdr->ActiveLayer->CreateLineSegment(x1, y1, x2, y2);
|
|
|
+ line->Outline->Color->CMYKAssign(0, 100, 0, 0);
|
|
|
+ return line;
|
|
|
+}
|
|
|
+
|
|
|
+// IVGShapePtr IVGLayer::FindShape ( _bstr_t Name, enum cdrShapeType Type, long StaticID, VARIANT_BOOL Recursive );
|
|
|
+
|
|
|
+// IVGShapePtr IVGLayer::CreateCurveSegment ( double StartX, double StartY, double EndX, double EndY, double StartingControlPointLength,
|
|
|
+// double StartingControlPointAngle, double EndingControlPointLength, double EndingControlPointAngle );
|
|
|
+
|
|
|
+// IVGShapePtr IVGLayer::CreateCurveSegment2 ( double x1, double y1, double StartingControlPointX, double StartingControlPointY,
|
|
|
+// double EndingControlPointX, double EndingControlPointY, double x2, double y2 );
|