void R3Matrix:: Translate(const R2Vector& offset) { // Translate matrix XTranslate(offset.X()); YTranslate(offset.Y()); }
void R3Matrix:: Translate(RNScalar offset) { // Translate matrix XTranslate(offset); YTranslate(offset); }
void R3Matrix::Translate(double offset) { // Translate matrix XTranslate(offset); YTranslate(offset); ZTranslate(offset); }
void R4Matrix:: Translate(const R3Vector& offset) { // Translate matrix XTranslate(offset.X()); YTranslate(offset.Y()); ZTranslate(offset.Z()); }
void R3Matrix:: Translate(RNAxis axis, RNScalar offset) { // Translate matrix along axis switch (axis) { case RN_XAXIS: XTranslate(offset); break; case RN_YAXIS: YTranslate(offset); break; default: RNWarning("Matrix translate along undefined axis"); break; } }
void R3Matrix:: Translate(int axis, double offset) { // Translate matrix along axis switch (axis) { case R3_X: XTranslate(offset); break; case R3_Y: YTranslate(offset); break; case R3_Z: ZTranslate(offset); break; default: fprintf(stderr, "Matrix translate along undefined axis"); break; } }
void plotWindow::initPlot(const KNDataFile* mat) { if (mat == 0) { std::cout << "Can't set data\n"; return; } // data = mat; mat->lockRead(); QFileInfo fi(QString::fromStdString(mat->getFileName())); if (fi.isSymLink()) fi = QFileInfo(fi.symLinkTarget()); dataFileInfo = fi; shortFileName = fi.fileName(); matfile->setText(QDir::current().relativeFilePath(mat->getFileName().c_str())); ptlabel->setRange(0, mat->getNCols() - 1); dim->setRange(0, mat->getNDim() - 1); const int xidx = xvar->currentIndex(); std::vector<std::string> parNames; mat->getParNames(parNames); xvarMap.clear(); xvarMap.push_back(XTranslate(XNone, "None")); xvarMap.push_back(XTranslate(XLabel, "Label")); xvarMap.push_back(XTranslate(XMesh, "Mesh")); xvarMap.push_back(XTranslate(XRealMultiplier, "RealMultiplier")); for (size_t i = 0; i < mat->getNPar(); ++i) { if (i < parNames.size()) { xvarMap.push_back(XTranslate((PlotXVariable)(XParameter0 + i), QString::fromStdString(parNames[i]))); } } xvar->clear(); for (size_t i = 0; i < xvarMap.size(); ++i) { xvar->insertItem(static_cast<int>(i), xvarMap.at(i).name); } if ((xidx != -1) && (xidx < xvar->count())) xvar->setCurrentIndex(xidx); const int yidx = yvar->currentIndex(); yvarMap.clear(); yvarMap.push_back(YTranslate(YNone, "None")); yvarMap.push_back(YTranslate(YL2Norm, "L2Norm")); yvarMap.push_back(YTranslate(YAmplitude, "Amplitude")); yvarMap.push_back(YTranslate(YPoincare, "Map")); yvarMap.push_back(YTranslate(YImagMultiplier, "ImagMultiplier")); yvarMap.push_back(YTranslate(YAbsMultiplier, "AbsMultiplier")); yvarMap.push_back(YTranslate(YProfile, "Profile")); for (size_t i = 0; i < mat->getNPar(); ++i) { if (i < parNames.size()) { yvarMap.push_back(YTranslate((PlotYVariable)(YParameter0 + i), QString::fromStdString(parNames[i]))); } } yvar->clear(); for (size_t i = 0; i < yvarMap.size(); ++i) { yvar->insertItem(static_cast<int>(i), yvarMap.at(i).name); } if ((yidx != -1) && (yidx < yvar->count())) yvar->setCurrentIndex(yidx); mat->unlock(); }