本文整理汇总了C++中ParameterData::getReal方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterData::getReal方法的具体用法?C++ ParameterData::getReal怎么用?C++ ParameterData::getReal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterData
的用法示例。
在下文中一共展示了ParameterData::getReal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleCircularArc
int
BrepHandler::extractCircularArc(const DirectoryEntry* de, const ParameterData& params) {
point_t center, start, end;
double offset_z = params.getReal(1);
center[X] = params.getReal(2);
center[Y] = params.getReal(3);
center[Z] = offset_z;
start[X] = params.getReal(4);
start[Y] = params.getReal(5);
start[Z] = offset_z;
end[X] = params.getReal(6);
end[Y] = params.getReal(7);
end[Z] = offset_z;
mat_t xform;
MAT_IDN(xform);
_iges->getTransformation(de->xform(), xform);
// choose the circle/interval representation
// so, calculate the circle params, and then the angle the arc subtends
double dx = start[X] - center[X];
double dy = start[Y] - center[Y];
double radius = sqrt(dx*dx + dy*dy);
point_t tcenter, tstart, tend;
MAT4X3PNT(tcenter, xform, center);
MAT4X3PNT(tstart, xform, start);
MAT4X3PNT(tend, xform, end);
vect_t normal = {0,0,1};
vect_t tnormal;
MAT4X3VEC(tnormal, xform, normal);
return handleCircularArc(radius, tcenter, tnormal, tstart, tend);
}
示例2: debug
int
BrepHandler::extractVertex(const DirectoryEntry* de, int index) {
VertKey k = make_pair(de,index);
VertMap::iterator i = vertices.find(k);
if (i == vertices.end()) {
// XXX: fix this...
ParameterData params;
_iges->getParameter(de->paramData(), params);
int num_verts = params.getInteger(1);
debug("num verts: " << num_verts);
debug("index : " << index);
assert(index <= num_verts);
int i = 3*index-1;
point_t pt;
pt[X] = params.getReal(i);
pt[Y] = params.getReal(i+1);
pt[Z] = params.getReal(i+2);
// XXX: xform matrix application?
vertices[k] = handleVertex(pt);
return vertices[k];
} else {
return i->second;
}
}
示例3: handleLine
int
BrepHandler::extractLine(const DirectoryEntry* de, const ParameterData& params)
{
point_t start, end;
start[X] = params.getReal(1);
start[Y] = params.getReal(2);
start[Z] = params.getReal(3);
end[X] = params.getReal(4);
end[Y] = params.getReal(5);
end[Z] = params.getReal(6);
// probably need to transform this line?
return handleLine(start, end);
}
示例4: handleSurfaceOfRevolution
int
BrepHandler::extractSurfaceOfRevolution(const ParameterData& params) {
Pointer linePtr = params.getPointer(1);
Pointer curvePtr = params.getPointer(2);
double startAngle = params.getReal(3);
double endAngle = params.getReal(4);
// load the line (axis of revolution)
int line = extractLine(linePtr);
// load the curve (generatrix)
int curve = extractCurve(_iges->getDirectoryEntry(curvePtr), false);
return handleSurfaceOfRevolution(line, curve, startAngle, endAngle);
}
示例5: VSET
int
BrepHandler::extractRationalBSplineCurve(const DirectoryEntry* de, const ParameterData& params) {
int k = params.getInteger(1);
int degree = params.getInteger(2);
bool planar = (params.getInteger(3)() == 1) ? true : false;
bool closed = (params.getInteger(4)() == 1) ? true : false;
bool rational = (params.getInteger(5)() == 0) ? true : false;
bool periodic = (params.getInteger(6)() == 1) ? true : false;
int num_control_points = k + 1;
int n = k + 1 - degree;
int num_knots = n + 2 * degree + 1;
double* knots = new double[num_knots];
int i = 7;
for (int _i = 0; _i < num_knots; _i++) {
knots[_i] = params.getReal(i);
i++;
}
double* weights = new double[num_control_points];
for (int _i = 0; _i < num_control_points; _i++) {
weights[_i] = params.getReal(i);
i++;
}
double* ctl_points = new double[num_control_points * 3];
for (int _i = 0; _i < num_control_points; _i++) {
ctl_points[_i*3] = params.getReal(i);
ctl_points[_i*3+1] = params.getReal(i+1);
ctl_points[_i*3+2] = params.getReal(i+2);
i += 3;
}
double umin = params.getReal(i); i++;
double umax = params.getReal(i); i++;
vect_t unit_normal;
if (planar) {
VSET(unit_normal, params.getReal(i), params.getReal(i+1), params.getReal(i+2));
i += 3;
}
int val = handleRationalBSplineCurve(degree,
umin,
umax,
planar,
unit_normal,
closed,
rational,
periodic,
num_knots,
knots,
num_control_points,
weights,
ctl_points);
delete [] knots;
delete [] weights;
delete [] ctl_points;
return val;
}