本文整理汇总了C++中resolution函数的典型用法代码示例。如果您正苦于以下问题:C++ resolution函数的具体用法?C++ resolution怎么用?C++ resolution使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resolution函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xofxi
scalar KasmiMassonHill::calcHeight(scalar dist, scalar xi0, scalar xi1) const{
// equal:
if(xi0 == xi1) return zofxi(xi0);
// calc x values at boundaries:
scalar x0 = xofxi(xi0);
scalar x1 = xofxi(xi1);
// if close enough, return mean height:
scalar d0 = mag(x0 - dist);
scalar d1 = mag(x1 - dist);
if(d0 <= resolution() && d1 <= resolution()){
// calc heights
scalar z0 = zofxi(xi0);
scalar z1 = zofxi(xi1);
return d1 / (d0 + d1) * z0 + d0 / (d0 + d1) * z1;
}
// calc middle xi and x there:
scalar xi = 0.5 * (xi0 + xi1);
scalar x = xofxi(xi);
// call again:
if(x <= dist) return calcHeight(dist,xi,xi1);
return calcHeight(dist,xi0,xi);
}
示例2: QPoint
QPoint OutputConfig::position(void) const
{
if( !isActive())
return QPoint();
int index = positionCombo->currentIndex();
if((Relation)positionCombo->itemData(index).toInt() == Absolute)
return QPoint(absolutePosX->value(), absolutePosY->value());
foreach(OutputConfig *config, precedingOutputConfigs)
{
if( config->output()->id()
== positionOutputCombo->itemData( positionOutputCombo->currentIndex()).toUInt())
{
QPoint pos = config->position();
switch( (Relation)positionCombo->itemData(index).toInt())
{
case LeftOf:
return QPoint( pos.x() - resolution().width(), pos.y());
case RightOf:
return QPoint( pos.x() + config->resolution().width(), pos.y());
case Over:
return QPoint( pos.x(), pos.y() - resolution().height());
case Under:
return QPoint( pos.x(), pos.y() + config->resolution().height());
case SameAs:
return pos;
default:
abort();
}
}
}
return QPoint(0, 0);
}
示例3: resolution
void KasmiMassonHill::calcAll(){
// init and fill height list:
heightTable_ = HashTable<scalar>( a_ / resolution() + 1);
for(label i = 0; i < heightTable_.size(); i++){
scalar d = i * resolution();
heightTable_.set(hkey(d), calcHeight(d, 0., a_));
}
}
示例4: fopen
void GeospatialBoundingBox::exportInformationFile() {
FILE *file_ptr = fopen(_format("%s.info",file_name.c_str()).c_str(), "w");
fprintf(file_ptr, "centroid: %f %f %f\n", centroid(0), centroid(1), centroid(2));
fprintf(file_ptr, "resolution: %f %f %f\n",resolution(0), resolution(1), resolution(2));
fprintf(file_ptr, "min_pt: %f %f %f\n", min_pt(0), min_pt(1), min_pt(2));
fprintf(file_ptr, "max_pt: %f %f %f\n", max_pt(0), max_pt(1), max_pt(2));
fprintf(file_ptr, "points: %d\n", number_of_points);
fclose(file_ptr);
return;
}
示例5: main
int main(int argc, char *argv[])
{
BoundingBox bbox(vcg::Point3i(-20, -20, -20), vcg::Point3i(20, 20, 20));
vcg::Point3i resolution(40, 40, 40);
Volume volume;
Walker walker(bbox, resolution);
typedef vcg::tri::MarchingCubes<Mesh, Walker> MarchingCubes;
typedef vcg::tri::ExtendedMarchingCubes<Mesh, Walker> ExtendedMarchingCubes;
// MARCHING CUBES
Mesh mc_mesh;
printf("[MARCHING CUBES] Building mesh...");
MarchingCubes mc(mc_mesh, walker);
walker.BuildMesh<MarchingCubes>(mc_mesh, volume, mc);
vcg::tri::io::ExporterPLY<Mesh>::Save( mc_mesh, "marching_cubes.ply");
printf("OK!\n");
// EXTENDED MARCHING CUBES
Mesh emc_mesh;
printf("[EXTENDED MARCHING CUBES] Building mesh...");
ExtendedMarchingCubes emc(emc_mesh, walker, 30);
walker.BuildMesh<ExtendedMarchingCubes>(emc_mesh, volume, emc);
vcg::tri::io::ExporterPLY<Mesh>::Save( emc_mesh, "extended_marching_cubes.ply");
printf("OK!\n");
};
示例6: defined
void PocoTimestamp::update()
{
#if defined(NIT_FAMILY_WIN32)
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
ULARGE_INTEGER epoch; // UNIX epoch (1970-01-01 00:00:00) expressed in Windows NT FILETIME
epoch.LowPart = 0xD53E8000;
epoch.HighPart = 0x019DB1DE;
ULARGE_INTEGER ts;
ts.LowPart = ft.dwLowDateTime;
ts.HighPart = ft.dwHighDateTime;
ts.QuadPart -= epoch.QuadPart;
_ts = ts.QuadPart/10;
#else
struct timeval tv;
if (gettimeofday(&tv, NULL))
NIT_THROW_FMT(EX_SYSTEM, "cannot get time of day");
_ts = TimeVal(tv.tv_sec)*resolution() + tv.tv_usec;
#endif
}
示例7: resolution
int resolution(char ***addr_square, t_chain *list, int tetriminos)
{
int line;
int column;
char letter;
int i;
if (check_resolved(addr_square, &letter, &i, tetriminos))
return (1);
if (i)
list = list->next;
line = -1;
while ((*addr_square)[++line])
{
column = -1;
while ((*addr_square)[line][++column])
{
if (insert_tetrimino(addr_square, list->tetrimino, line, column))
{
if (resolution(addr_square, list, tetriminos))
return (1);
}
erase_tetrimino(addr_square, letter);
}
}
return (0);
}
示例8: calc_imaginary
static void calc_imaginary(fitinfo *fit)
{
assert(fit->datatype == FIT_IMAGINARY);
/* Generate reflectivity amplitude from the profile */
reflectivity_imag(fit->p.n, fit->p.d, fit->p.rho,
fit->p.mu, fit->beam.lambda, fit->beam.alignment,
fit->nQ, fit->fitQ, fit->fitA);
/* FIXME need to support repeated Q with different resolution. For
the resolution case, this simply means making sure that enough
*/
assert(fit->nQ == fit->dataA.n);
/* Compute the convolution of the reflectivity */
/* FIXME can you simply convolve the real reflectivity? */
if (fit->work != NULL) {
resolution(fit->nQ, fit->fitQ, fit->fitA,
fit->dataA.n, fit->dataA.Q, fit->dataA.dQ, fit->work);
memcpy(fit->fitA, fit->work, sizeof(Real)*fit->dataA.n);
}
/* FIXME sumsq is now based on data Q values rather than
* theory Q values, so we have grounding problems. */
assert(fit->work != NULL);
}
示例9: apply_beam_parameters
static void apply_beam_parameters(fitinfo *fit, Real *cross_section,
fitdata *data)
{
/* Account for back absorption, background and intensity.
* Strictly speaking background and intensity should be
* applied after resolution is calculated, but mathematically
* it is equivalent to apply them before or after. Back absorption,
* which varies with Q, must be applied before resolution.
*/
beam_apply(&fit->beam, fit->nQ, fit->fitQ, cross_section);
/* Compute the convolution of the reflectivity */
if (fit->work != NULL) {
/* FIXME We are not allocating enough storage for multiple measurements
with different resolution. Make sure that we fail in a controlled
way until we have a chance to fix this. */
assert(data->n <= fit->nQ);
resolution(fit->nQ, fit->fitQ, cross_section,
data->n, data->Q, data->dQ, fit->work);
memcpy(cross_section, fit->work, sizeof(Real)*data->n);
} else {
assert(data->n == fit->nQ);
/* FIXME --- with no resolution, need to copy/interpolate raw data
values at data->Q from the computed values at fit->fitQ.
*/
}
/* FIXME sumsq is now based on data Q values rather than
* theory Q values, so we have grounding problems. */
assert(fit->work != NULL);
}
示例10: url
// Copy constructor with all the parameter and copy constructor for constructor with request and mimetype as parameter.
void tst_QMediaResource::copyConstructor()
{
// Initialise all the parameters.
const QUrl url(QString::fromLatin1("http://test.com/test.mp4"));
const QString mimeType(QLatin1String("video/mp4"));
const QString amrCodec(QLatin1String("amr"));
const QString h264Codec(QLatin1String("h264"));
const qint64 dataSize(23600);
int audioBitRate = 1, sampleRate = 2, channelCount = 3, videoBitRate = 4;
QSize resolution(QSize(640, 480));
QString language("eng");
// Create the instance with url and mimetype.
QMediaResource original(url, mimeType);
// Set all the parameters.
original.setAudioCodec(amrCodec);
original.setLanguage(QString("eng"));
original.setVideoCodec(h264Codec);
original.setDataSize(dataSize);
original.setAudioBitRate(audioBitRate);
original.setSampleRate(sampleRate);
original.setChannelCount(channelCount);
original.setVideoBitRate(videoBitRate);
original.setResolution(resolution);
// Copy the instance to new object.
QMediaResource copy(original);
// Verify all the parameters of the copied object.
QCOMPARE(copy.url(), url);
QCOMPARE(copy.mimeType(), mimeType);
QCOMPARE(copy.audioCodec(), amrCodec);
QCOMPARE(copy.language(), language );
QCOMPARE(copy.videoCodec(), h264Codec);
QCOMPARE(copy.dataSize(), dataSize);
QCOMPARE(copy.audioBitRate(), audioBitRate);
QCOMPARE(copy.sampleRate(), sampleRate);
QCOMPARE(copy.channelCount(), channelCount);
QCOMPARE(copy.videoBitRate(), videoBitRate);
QCOMPARE(copy.resolution(), resolution);
// Compare both the objects are equal.
QCOMPARE(original == copy, true);
QCOMPARE(original != copy, false);
// Initialise the request parameter.
QNetworkRequest request1(QUrl(QString::fromLatin1("http://test.com/test.mp4")));
// Constructor with rerquest and mimetype.
QMediaResource original1(request1, mimeType);
// Copy the object and verify if both are eqaul or not.
QMediaResource copy1(original1);
QCOMPARE(copy1.url(), url);
QCOMPARE(copy1.mimeType(), mimeType);
QCOMPARE(copy1.request(), request1);
QCOMPARE(original1 == copy1, true);
}
示例11: painter
void ZebraPaintEngine::drawText ( const QPointF &p, const QString & text, const QFont &font )
{
QTransform transform = painter()->worldTransform();
int xInDots = (int)(transform.dx());
int yInDots = (int)(transform.dy());
int carHeight = (font.pointSize() * resolution()) / 72;
const int minSize = 10;
if(carHeight < minSize) {
carHeight = minSize;
}
int carWidth = qRound((carHeight * 15.0) / 28.0); // fixed width/height ratio for the scalable A0 font
QString rotation = transformRotationCmd();
if(rotation == rotation90Cmd()) {
xInDots -= carHeight;
}
else if(rotation == rotation180Cmd()) {
yInDots -= carHeight;
xInDots -= (carWidth * text.length());
}
else if(rotation == rotation270Cmd()) {
yInDots -= (carWidth * text.length());
}
QString output = QString(m_CmdPrefix + "FO%1,%2" + m_CmdPrefix + "FW%3").arg(xInDots).arg(yInDots).arg(rotation);
output += QString(m_CmdPrefix + "A0,%1,0" + m_CmdPrefix + "FD" + text + m_CmdPrefix + "FS\n").arg(carHeight);
QTextCodec *codec = QTextCodec::codecForName("IBM 850");
m_printBuffer.append(codec->fromUnicode(output));
}
示例12: reader
void VolumeSeriesSource::openSeries() {
if(volumeHandle_)
delete volumeHandle_;
volumeHandle_ = 0;
try {
TextFileReader reader(filename_.get());
if (!reader)
throw tgt::FileNotFoundException("Reading sdat file failed", filename_.get());
std::string type;
std::istringstream args;
std::string format, model;
tgt::ivec3 resolution(0);
tgt::vec3 sliceThickness(1.f);
spreadMin_ = 0.f;
spreadMax_ = 0.f;
files_.clear();
std::string blockfile;
while (reader.getNextLine(type, args, false)) {
if (type == "ObjectFileName:") {
std::string s;
args >> s;
LDEBUG(type << " " << s);
files_.push_back(tgt::FileSystem::dirName(filename_.get()) + "/" + s);
} else if (type == "Resolution:") {
args >> resolution[0];
args >> resolution[1];
args >> resolution[2];
LDEBUG(type << " " << resolution[0] << " x " <<
resolution[1] << " x " << resolution[2]);
} else if (type == "SliceThickness:") {
示例13: move
void move(int keycode, t_init *st)
{
if (keycode == 123)
{
st->x1 += 0.1 / (0.01 * st->zoom);
st->x2 -= 0.1 / (0.01 * st->zoom);
}
if (keycode == 124)
{
st->x1 -= 0.1 / (0.01 * st->zoom);
st->x2 += 0.1 / (0.01 * st->zoom);;
}
if (keycode == 125)
{
st->y1 -= 0.1 / (0.01 * st->zoom);
st->y2 += 0.1 / (0.01 * st->zoom);
}
if (keycode == 126)
{
st->y1 += 0.1 / (0.01 * st->zoom);
st->y2 -= 0.1 / (0.01 * st->zoom);
}
mlx_clear_window(st->mlx, st->win);
resolution(*st);
mlx_put_image_to_window(st->mlx, st->win, st->link,
st->pos_x_image, st->pos_y_image);
}
示例14: split
int Step::createCsi(
QString const &addLine,
QStringList const &csiParts, // the partially assembles model
QPixmap *pixmap,
Meta &meta)
{
qreal modelScale = meta.LPub.assem.modelScale.value();
int sn = stepNumber.number;
// 1 color x y z a b c d e f g h i foo.dat
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
QStringList tokens;
split(addLine,tokens);
QString orient;
if (tokens.size() == 15) {
for (int i = 5; i < 14; i++) {
orient += "_" + tokens[i];
}
}
QString key = QString("%1_%2_%3_%4_%5_%6")
.arg(csiName()+orient)
.arg(sn)
.arg(meta.LPub.page.size.valuePixels(0))
.arg(resolution())
.arg(resolutionType() == DPI ? "DPI" : "DPCM")
.arg(modelScale);
QString fileName = QDir::currentPath() + "/" +
Paths::assemDir + "/" + key + ".png";
QFile csi(fileName);
bool outOfDate = false;
if (csi.exists()) {
QDateTime lastModified = QFileInfo(fileName).lastModified();
QStringList stack = submodelStack();
stack << parent->modelName();
if ( ! isOlder(stack,lastModified)) {
outOfDate = true;
}
}
if ( ! csi.exists() || outOfDate) {
int rc;
// render the partially assembled model
rc = renderer->renderCsi(addLine,csiParts, fileName, meta);
if (rc < 0) {
return rc;
}
}
pixmap->load(fileName);
csiPlacement.size[0] = pixmap->width();
csiPlacement.size[1] = pixmap->height();
return 0;
}
示例15: resolution
void QSFMLCanvas::resizeGL(int width, int height)
{
Vector3 resolution(width,height,32);
setResolution(resolution);
glViewport(0,0,width,height);
}