/*------------------------------------------------------------------------- * コンストラクタ */ VdcMapper::VdcMapper(const unsigned int width, const unsigned int height) : mDcWidth(width), mDcHeight(height), mVcMaxY(DEFAULT_MAXY), mVcX0(0.0f), mVcY0(0.0f) { if (mDcWidth <= 0 || mDcHeight <= 0) { fprintf(stderr, "%s: width/height must be > 0\n", __FUNCTION__); throw; } setMaxY(DEFAULT_MAXY); initCenter(DEFAULT_MAXY); }
void cCollider::getCoordinates(sf::Sprite& thisSprite) { setMinX(thisSprite.GetPosition().x); setMaxY(thisSprite.GetPosition().y); if (maxY > 763) { setOnGround(true); //rThisSprite.SetY(763); } else { setOnGround(false); } maxX = minX + width; minY = maxY - height; }
Lib_dialog::Lib_dialog(const QString lib_path) : QDialog(NULL), ui(new Ui::Lib_dialog) { ui->setupUi(this); fx.setPath(lib_path); QMenuBar *menuBar = new QMenuBar(this); QAction *action_save= new QAction("save",this); QAction *action_change= new QAction("change",this); QAction *action_load= new QAction("load",this); menuBar->insertAction(NULL,action_save); menuBar->insertAction(NULL,action_change); menuBar->insertAction(NULL,action_load); connect(action_save,SIGNAL( triggered()) ,this,SLOT(save())); connect(action_load,SIGNAL( triggered()),this,SLOT(open())); connect(action_change,SIGNAL( triggered()),this,SLOT(changelist())); connect(ui->widget, SIGNAL(looking(int*,int*)), this, SLOT(looking(int*,int*))); connect(ui->widget, SIGNAL(setXY(int,int)), this, SLOT(setXY(int,int))); connect(ui->widget, SIGNAL(addPoint()), this, SLOT(addPoint())); connect(ui->MaxX,SIGNAL(textChanged ()),this,SLOT(setMaxX())); connect(ui->MinX,SIGNAL(textChanged ()),this,SLOT(setMinX())); connect(ui->MinY,SIGNAL(textChanged ()),this,SLOT(setMinY())); connect(ui->MaxY,SIGNAL(textChanged ()),this,SLOT(setMaxY())); connect(ui->LX,SIGNAL(textChanged ()),this,SLOT(setX())); connect(ui->LY,SIGNAL(textChanged ()),this,SLOT(setY())); connect(ui->gridX,SIGNAL(textChanged ()),this,SLOT(setgridX())); connect(ui->gridY,SIGNAL(textChanged ()),this,SLOT(setgridY())); connect(ui->widget,SIGNAL(drw ()),this,SLOT( draw ())); connect(ui->widget,SIGNAL(del ()),this,SLOT( del ())); connect(ui->widget,SIGNAL(correct ()),this,SLOT( correct ())); connect(ui->widget,SIGNAL(save ()),this,SLOT( save ())); connect(ui->widget,SIGNAL(open ()),this,SLOT( open ())); connect(ui->widget,SIGNAL(changegrid()),this,SLOT( changegrid())); connect(ui->widget,SIGNAL(change(int,int)),this,SLOT(change(int,int))); //------------------------------------------------------------------------------------------- // в lib_path я передам адрес библиотеки(папки с файлами). Сохрани его сам кудато))) // //-------------------------------------------------------------------------------------------- }
void Boundary::refer(const Boundary &boundary) { if (boundary.minX () < minX ()) setMinX (boundary.minX ()); if (boundary.maxX () > maxX ()) setMaxX (boundary.maxX ()); if (boundary.minY () < minY ()) setMinY (boundary.minY ()); if (boundary.maxY () > maxY ()) setMaxY (boundary.maxY ()); if (boundary.minZ () < minZ ()) setMinZ (boundary.minZ ()); if (boundary.maxZ () > maxZ ()) setMaxZ (boundary.maxZ ()); }
void Boundary::refer(const xjPoint &point) { if (point.x () < minX ()) setMinX (point.x ()); if (point.x () > maxX ()) setMaxX (point.x ()); if (point.y () < minY ()) setMinY (point.y ()); if (point.y () > maxY ()) setMaxY (point.y ()); if (point.z () < minZ ()) setMinZ (point.z ()); if (point.z () > maxZ ()) setMaxZ (point.z ()); }
void ChartWidget::addPoint(const Point &p) { int x_pix = convertCoordFromChart(p.x, X) ; int y_pix = convertCoordFromChart(p.y, Y); if(x_pix > width()-edgeOffset ) setMaxX(p.x); if(y_pix > height()-edgeOffset-axisEdgeOffset ) setMaxY(p.y); PointChartInfo pointInfo; pointInfo.selected = false; pointInfo.point = p; points.append(pointInfo); }
void CAABB_f::setMax(float x, float y) { setMaxX(x); setMaxY(y); }