本文整理汇总了C++中ParameterData类的典型用法代码示例。如果您正苦于以下问题:C++ ParameterData类的具体用法?C++ ParameterData怎么用?C++ ParameterData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParameterData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_pair
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;
}
}
示例2: setParameters
/**
* Set parameters. Use all the parameters in the reader.
*/
void SeparatedOutput::setParameters(const ParameterData& pr) {
std::vector<std::string> l = pr.getList();
std::vector<std::string>::const_iterator p;
for (p = l.begin(); p != l.end(); ++p) {
params.push_back(*p+" = "+pr.getString(*p));
}
}
示例3: 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);
}
示例4: debug
void
BrepHandler::extractFace(const DirectoryEntry* de, bool orientWithSurface) {
// spec says the surface can be:
// parametric spline surface
// ruled surface
// surface of revolution
// tabulated cylinder
// rational b-spline surface
// offset surface
// plane surface
// rccyl surface
// rccone surface
// spherical surface
// toroidal surface
debug("########################## E X T R A C T F A C E");
ParameterData params;
_iges->getParameter(de->paramData(), params);
Pointer surfaceDE = params.getPointer(1);
int surf = extractSurface(_iges->getDirectoryEntry(surfaceDE));
int face = handleFace(orientWithSurface, surf);
int numLoops = params.getInteger(2);
bool isOuter = params.getLogical(3) || true; // outer is not set in IGES from Pro/E!
for (int i = 4; (i-4) < numLoops; i++) {
Pointer loopDE = params.getPointer(i);
extractLoop(_iges->getDirectoryEntry(loopDE), isOuter, face);
isOuter = false;
}
}
示例5:
void CD3DTable::setParameters(const ParameterData& p) {
if (p.contains("D")) {
D = p.getValue("D");
}
if (p.contains("H")) {
H = p.getValue("H");
}
}
示例6: 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);
}
示例7: 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);
}
示例8: QVariant
QVariant ParamItemModel::data(const QModelIndex& index, int role) const
{
if (!index.isValid())
{
return QVariant();
}
TreeNode* pNode = static_cast<TreeNode*>(index.internalPointer());
ParameterBaseData* pData = static_cast<ParameterBaseData*>(pNode->getData());
switch (role)
{
case Qt::ToolTipRole:
{
ParameterData* pParameterData = static_cast<ParameterData*>(pData);
Parameter* pParameter = pParameterData->getParameter();
if (pParameter)
{
return pParameter->getDescription();
}
break;
}
case Qt::DisplayRole:
{
if (index.column()==0)
{
return pData->getName();
}
break;
}
case Qt::EditRole:
{
if (index.column() == 1)
{
ParameterData* pParameterData = static_cast<ParameterData*>(pData);
QVariant variant;
variant.setValue(*pParameterData->getParameter());
return variant;
}
break;
}
default:
{
break;
}
}
return QVariant();
}
示例9: switch
void ParamItemModel::setDataNoUndo( const QModelIndex& index,
const QVariant& newData,
int role)
{
TreeNode* pNode = static_cast<TreeNode*>(index.internalPointer());
ParameterBaseData* pData = static_cast<ParameterBaseData*>(pNode->getData());
// Data given by the editor
switch (role)
{
case Qt::EditRole:
{
switch (pData->getType())
{
case ParameterBaseData::GROUP:
case ParameterBaseData::PARAMETER:
{
ParameterData* pParameterData = static_cast<ParameterData*>(pData);
const Parameter& newParameter = newData.value<Parameter>();
pParameterData->getParameter()->setValue(newParameter.getValue());
// Disable stack to avoid new undo commands
QUndoStack* pStack = getUndoStack();
setUndoStack(NULL);
emit dataChanged(index, index);
setUndoStack(pStack);
break;
}
default:
{
break;
}
}
break;
}
}
}
示例10: updateParameterData
void TCASTable::updateParameterData(ParameterData& p) const {
p.setBool("TCAS_HMDilter", HMDFilter);
for (int i = 0; i < 7; i++) {
p.setInternal("TCAS_TAU_"+Fmi(i+2),TAU[i],"s",4);
}
for (int i = 0; i < 7; i++) {
p.setInternal("TCAS_TCOA_"+Fmi(i+2),TCOA[i],"s",4);
}
for (int i = 0; i < 7; i++) {
p.setInternal("TCAS_DMOD_"+Fmi(i+2),DMOD[i],"nmi",4);
}
for (int i = 0; i < 7; i++) {
p.setInternal("TCAS_ZTHR_"+Fmi(i+2),ZTHR[i],"ft",4);
}
for (int i = 0; i < 7; i++) {
p.setInternal("TCAS_HMD_"+Fmi(i+2),HMD[i],"ft",4);
}
}
示例11: setParameters
void TCASTable::setParameters(const ParameterData& p) {
if (p.contains("TCAS_HMDilter")) {
HMDFilter = p.getBool("TCAS_HMDilter");
}
for (int i = 0; i < 7; i++) {
if (p.contains("TCAS_TAU_"+Fmi(i+2))) {
TAU[i] = p.getValue("TCAS_TAU_"+Fmi(i+2));
}
}
for (int i = 0; i < 7; i++) {
if (p.contains("TCAS_TCOA_"+Fmi(i+2))) {
TCOA[i] = p.getValue("TCAS_TCOA_"+Fmi(i+2));
}
}
for (int i = 0; i < 7; i++) {
if (p.contains("TCAS_DMOD_"+Fmi(i+2))) {
DMOD[i] = p.getValue("TCAS_DMOD_"+Fmi(i+2));
}
}
for (int i = 0; i < 7; i++) {
if (p.contains("TCAS_ZTHR_"+Fmi(i+2))) {
ZTHR[i] = p.getValue("TCAS_ZTHR_"+Fmi(i+2));
}
}
for (int i = 0; i < 7; i++) {
if (p.contains("TCAS_HMD_"+Fmi(i+2))) {
HMD[i] = p.getValue("TCAS_HMD_"+Fmi(i+2));
}
}
}
示例12: 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;
}
示例13:
// Set value of property from parameter.
void
PropertyBoolean::set(const ParameterData ¶meter)
{
_val = parameter.asBool();
}
示例14: main
int main(int argc, const char* argv[]) {
DaidalusBatch walker;
int a;
std::string config = "";
std::string output = "";
std::string options = "";
ParameterData params;
int precision = 6;
for (a=1;a < argc && argv[a][0]=='-'; ++a) {
std::string arga = argv[a];
options += arga + " ";
if (walker.processOptions(argv,a)) {
++a;
options += walker.getOptionsString();
} if (arga == "--help" || arga == "-help" || arga == "-h") {
DaidalusBatch::printHelpMsg();
} else if (startsWith(arga,"--conf") || startsWith(arga,"-conf") || arga == "-c") {
config = argv[++a];
arga = argv[a];
options += arga + " ";
} else if (startsWith(arga,"--out") || startsWith(arga,"-out") || arga == "-o") {
output = argv[++a];
arga = argv[a];
} else if (arga == "--verbose" || arga == "-verbose" || arga == "-v") {
walker.verbose = true;
} else if (arga == "--raw" || arga == "-raw" || arga == "-r") {
walker.raw = true;
} else if (arga == "--pvs" || arga == "-pvs") {
walker.format = PVS;
} else if (startsWith(arga,"--proj") || startsWith(arga,"-proj")) {
++a;
walker.prj_t = Util::parse_double(argv[a]);
options += arga+" ";
} else if (startsWith(arga,"-") && arga.find('=') != std::string::npos) {
std::string keyval = arga.substr(arga.find_last_of('-')+1);
params.set(keyval);
} else if (argv[a][0] == '-') {
std::cout << "Invalid option: " << arga << std::endl;
exit(0);
}
}
std::vector<std::string> txtFiles = std::vector<std::string>();
for (;a < argc; ++a) {
std::string arga(argv[a]);
txtFiles.push_back(arga);
}
if (txtFiles.empty()) {
walker.printHelpMsg();
}
std::ofstream fout;
if (output != "") {
fout.open(output.c_str());
walker.out = &fout;
}
Daidalus daa;
if (config != "") {
daa.parameters.loadFromFile(config);
}
if (params.size() > 0) {
daa.parameters.setParameters(params);
}
switch (walker.format) {
case STANDARD:
if (walker.verbose) {
(*walker.out) << "# " << Daidalus::release() << std::endl;
(*walker.out) << "# Options: " << options << std::endl;
(*walker.out) << "#\n" << daa.toString() << "#\n" << std::endl;
}
break;
case PVS:
(*walker.out) << "%%% " << Daidalus::release() << std::endl;
(*walker.out) << "%%% Options: " << options << std::endl;
(*walker.out) << "%%% Parameters:\n"+daa.parameters.toPVS(precision) << std::endl;
break;
default:
break;
}
for (unsigned int i=0; i < txtFiles.size(); ++i) {
std::string filename(txtFiles[i]);
switch (walker.format) {
case STANDARD:
(*walker.out) << "# File: "<< filename << std::endl;
break;
case PVS:
(*walker.out) << "%%% File: " << filename << std::endl;
break;
default:
break;
}
walker.processFile(filename,daa);
}
if (output != "") {
fout.close();
}
}//main
示例15:
// Set value of property from parameter.
void
PropertyFloat::set(const ParameterData ¶meter)
{
_val = parameter.asFloat();
}