Importing Spline entity
Moderators: SDS, support, admin
Importing Spline entity
Hello, I've been searching about a topic with this information but I couldn't find it. My doubt is about the Knots data. This is a TList containing single type values represented as pointers. How can I conver this "pointers" into Single values. The normal casting in the example doesn't works.
vFit: Single;
for I := 0 to TsgDXFSpline(Sender).FitCount – 1 do
vFit := Single(TsgDXFSpline(Sender).Knots) + vFit;
I work with C language...
vFit: Single;
for I := 0 to TsgDXFSpline(Sender).FitCount – 1 do
vFit := Single(TsgDXFSpline(Sender).Knots) + vFit;
I work with C language...
Re: Importing Spline entity
int vFit = 0;
TsgDXFSpline *Spln = dynamic_cast<TsgDXFSpline *> (Sender);
if (Spln) {
for (int i = 0; i<iSpln->FitCount; ++i)
vFit += (int) Splin->Knots;
}
Propably It must be like that
Aby
TsgDXFSpline *Spln = dynamic_cast<TsgDXFSpline *> (Sender);
if (Spln) {
for (int i = 0; i<iSpln->FitCount; ++i)
vFit += (int) Splin->Knots;
}
Propably It must be like that
Aby
Re: Importing Spline entity
Thank you aby but I think that I haven't explained the problem correctly. I suppose that I have solved the problem of taking an "int" value from knots array but this is not the corret data type, the correct data type is Single ( or float ). Here it is an example:
Knots values:
0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 3.0, 3.0, 3.0
Correspondent values of array Knots at TsgDXFSpline:
NULL, NULL, NULL, NULL, :3F800000, :40000000, :40400000, :40400000, :40400000, :40400000
How can I convert this pointer values into Single (or float) values?
Knots values:
0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0, 3.0, 3.0, 3.0
Correspondent values of array Knots at TsgDXFSpline:
NULL, NULL, NULL, NULL, :3F800000, :40000000, :40400000, :40400000, :40400000, :40400000
How can I convert this pointer values into Single (or float) values?
Re: Importing Spline entity
Hello Eliseo,
TList here stores Knots, not Pointers to Knots. Please make simple conversion:
vKnot := Single(TsgDXFSpline(Sender).Knots);
TList here stores Knots, not Pointers to Knots. Please make simple conversion:
vKnot := Single(TsgDXFSpline(Sender).Knots);